Ignore:
Timestamp:
Sep 9, 2021, 5:06:34 PM (3 years ago)
Author:
Sanahuja Guillaume
Message:

update buffering (gcs part)

File:
1 edited

Legend:

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

    r436 r443  
    4848  }
    4949  case DATA_BIG_ENDIAN: {
    50     // for(int i=0;i<size;i++) fprintf(stderr,"%x ",buf[i]);
    51     // fprintf(stderr,"\n");
    5250    uint16_t period;
    5351    memcpy(&period, &buf[1], sizeof(uint16_t));
    5452    period = qFromBigEndian(period);
    55     drawDatas(&buf[3], size - 3, period, true);
     53    drawDatas(&buf[3], size - 3, period, 1,true);
    5654    break;
    5755  }
    5856  case DATA_LITTLE_ENDIAN: {
    59     // for(int i=0;i<size;i++) fprintf(stderr,"%x ",buf[i]);
    60     // fprintf(stderr,"\n");
    6157    uint16_t period;
    6258    memcpy(&period, &buf[1], sizeof(uint16_t));
    63     // fprintf(stderr,"recu %i period %i\n",size,period);
    64     drawDatas(&buf[3], size - 3, period);
     59    drawDatas(&buf[3], size - 3, period,1);
     60    break;
     61  }
     62  case MULTIPLE_DATA_LITTLE_ENDIAN: {
     63    uint16_t period;
     64    uint16_t nb_buffering;
     65    memcpy(&period, buf+sizeof(char), sizeof(uint16_t));
     66    memcpy(&nb_buffering,buf+sizeof(char)+sizeof(uint16_t), sizeof(uint16_t));
     67    fprintf(stderr,"recu %i, period %i, nb_buff %i\n",size,period,nb_buffering);
     68    drawDatas(buf+sizeof(char)+sizeof(uint16_t)+sizeof(uint16_t), size - sizeof(char)+sizeof(uint16_t)+sizeof(uint16_t), period, nb_buffering);
    6569    break;
    6670  }
     
    111115QString ConnectionLayout::getName() { return name; }
    112116
    113 void ConnectionLayout::drawDatas(char *buf, int buf_size, uint16_t period,
    114                                  bool big_endian) {
    115   for (int i = 0; i < dataremotes.count(); i++) {
    116     dataremotes.at(i)->BufEvent(&buf, &buf_size, period, big_endian);
    117   }
     117void ConnectionLayout::drawDatas(char *buf, int buf_size, uint16_t period,uint16_t nb_buffering, bool big_endian) {
     118    for (int i = 0; i < nb_buffering; i++) {
     119        for (int j = 0; j < dataremotes.count(); j++) {
     120            dataremotes.at(j)->BufEvent(&buf, &buf_size, period, nb_buffering, big_endian);
     121        }
     122    }
    118123}
    119124
Note: See TracChangeset for help on using the changeset viewer.