Changeset 443 in flair-src for trunk/tools/FlairGCS/src/DataPlot1D.cpp


Ignore:
Timestamp:
09/09/21 17:06:34 (5 months ago)
Author:
Sanahuja Guillaume
Message:

update buffering (gcs part)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/FlairGCS/src/DataPlot1D.cpp

    r437 r443  
    7676}
    7777
    78 void DataPlot1D::BufEvent(char **buf, int *buf_size, uint16_t period,
     78void DataPlot1D::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,
    7979                          bool big_endian) {
    8080  setEnabled(IsEnabled());
    81   if (IsEnabled() == false || RefreshRate_ms() != period)
    82     return;
     81  if (IsEnabled() == false || RefreshRate_ms() != period) return;
    8382  double *datas = (double *)malloc(datas_type.count() * sizeof(double));
    8483
     
    8988      memcpy((void *)&data_raw, *buf, sizeof(uint32_t));
    9089      *buf += sizeof(uint32_t);
    91       if (big_endian == true)
    92         data_raw = qFromBigEndian(data_raw);
     90      if (big_endian == true) data_raw = qFromBigEndian(data_raw);
    9391      datas[i] = *data;
    9492    } else if (datas_type.at(i) == "int8_t") {
     
    10199      memcpy((void *)&data, *buf, sizeof(data));
    102100      *buf += sizeof(data);
    103       if (big_endian == true)
    104         data = qFromBigEndian(data);
     101      if (big_endian == true) data = qFromBigEndian(data);
    105102      datas[i] = data;
    106103    } else {
    107       fprintf(stderr,"DataPlot1D::BufEvent unknown type %s\n",
    108              datas_type.at(i).toLocal8Bit().constData());
     104      fprintf(stderr,"DataPlot1D::BufEvent unknown type %s\n",datas_type.at(i).toLocal8Bit().constData());
    109105    }
    110106  }
Note: See TracChangeset for help on using the changeset viewer.