IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 1, 2022, 10:01:56 AM (4 years ago)
Author:
eugene
Message:

enable subset for string-type vectors; allow "set a = b" for string-type vectors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/subset.c

    r35109 r42311  
    8181    }
    8282  }
     83  if ((ivec->type == OPIHI_STR) && (tvec->type == OPIHI_FLT)) {
     84    opihi_flt *vt = tvec[0].elements.Flt;
     85    for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) {
     86      if (!*vt) continue;
     87      ovec[0].elements.Str[Npts] = strcreate (ivec[0].elements.Str[i]);
     88      Npts++;
     89    }
     90  }
     91  if ((ivec->type == OPIHI_STR) && (tvec->type == OPIHI_INT)) {
     92    opihi_int *vt = tvec[0].elements.Int;
     93    for (Npts = i = 0; i < tvec[0].Nelements; i++, vt++) {
     94      if (!*vt) continue;
     95      ovec[0].elements.Str[Npts] = strcreate (ivec[0].elements.Str[i]);
     96      Npts++;
     97    }
     98  }
    8399
    84100  // free up unused memory
Note: See TracChangeset for help on using the changeset viewer.