- Timestamp:
- Sep 9, 2021, 5:06:34 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/ui_com.cpp
r442 r443 320 320 // for(int i=0;i<offset;i++) printf("%x ",send_buffer[i]); 321 321 // printf("\n"); 322 Send(send_buffer, offset,resume_period);322 //Send(send_buffer, offset,resume_period); 323 323 } 324 324 … … 393 393 if(ptr->actual_size>=ptr->final_size) {//par securité on test aussi le cas ou supérieur 394 394 Printf("ready to send\n"); 395 SendNRT(ptr->buf, ptr->actual_size,ptr->period); 395 396 //clean 396 397 ptr->actual_size=0; -
trunk/tools/FlairGCS/src/ConnectionLayout.cpp
r436 r443 48 48 } 49 49 case DATA_BIG_ENDIAN: { 50 // for(int i=0;i<size;i++) fprintf(stderr,"%x ",buf[i]);51 // fprintf(stderr,"\n");52 50 uint16_t period; 53 51 memcpy(&period, &buf[1], sizeof(uint16_t)); 54 52 period = qFromBigEndian(period); 55 drawDatas(&buf[3], size - 3, period, true);53 drawDatas(&buf[3], size - 3, period, 1,true); 56 54 break; 57 55 } 58 56 case DATA_LITTLE_ENDIAN: { 59 // for(int i=0;i<size;i++) fprintf(stderr,"%x ",buf[i]);60 // fprintf(stderr,"\n");61 57 uint16_t period; 62 58 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); 65 69 break; 66 70 } … … 111 115 QString ConnectionLayout::getName() { return name; } 112 116 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 } 117 void 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 } 118 123 } 119 124 -
trunk/tools/FlairGCS/src/ConnectionLayout.h
r436 r443 27 27 28 28 private: 29 void drawDatas(char *buf, int buf_size, uint16_t period, 29 void drawDatas(char *buf, int buf_size, uint16_t period,uint16_t nb_buffering, 30 30 bool big_endian = false); 31 31 QString name; -
trunk/tools/FlairGCS/src/DataPlot1D.cpp
r437 r443 76 76 } 77 77 78 void DataPlot1D::BufEvent(char **buf, int *buf_size, uint16_t period, 78 void DataPlot1D::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 79 79 bool big_endian) { 80 80 setEnabled(IsEnabled()); 81 if (IsEnabled() == false || RefreshRate_ms() != period) 82 return; 81 if (IsEnabled() == false || RefreshRate_ms() != period) return; 83 82 double *datas = (double *)malloc(datas_type.count() * sizeof(double)); 84 83 … … 89 88 memcpy((void *)&data_raw, *buf, sizeof(uint32_t)); 90 89 *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); 93 91 datas[i] = *data; 94 92 } else if (datas_type.at(i) == "int8_t") { … … 101 99 memcpy((void *)&data, *buf, sizeof(data)); 102 100 *buf += sizeof(data); 103 if (big_endian == true) 104 data = qFromBigEndian(data); 101 if (big_endian == true) data = qFromBigEndian(data); 105 102 datas[i] = data; 106 103 } 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()); 109 105 } 110 106 } -
trunk/tools/FlairGCS/src/DataPlot1D.h
r437 r443 21 21 void XmlEvent(QDomElement *dom); 22 22 bool eventFilter(QObject *, QEvent *); 23 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);23 void BufEvent(char **buf, int *buf_size, uint16_t period, uint16_t nb_buffering,bool big_endian); 24 24 bool mouseEvent(QMouseEvent *event); 25 25 QList<QString> datas_type; -
trunk/tools/FlairGCS/src/DataPlot2D.cpp
r437 r443 251 251 } 252 252 253 void DataPlot2D::BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian) {253 void DataPlot2D::BufEvent(char **buf, int *buf_size, uint16_t period, uint16_t nb_buffering,bool big_endian) { 254 254 255 255 if (IsEnabled() == false || RefreshRate_ms() != period) -
trunk/tools/FlairGCS/src/DataPlot2D.h
r437 r443 46 46 void setYAxisScale(float ymin, float ymax); 47 47 void setXAxisScale(float xmin, float xmax); 48 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);48 void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, bool big_endian); 49 49 void showCurve(QwtPlotItem *item, bool on); 50 50 -
trunk/tools/FlairGCS/src/DataRemote.h
r437 r443 21 21 bool IsEnabled(void); 22 22 int ReceiveSize(void); 23 virtual void BufEvent(char **buf, int *buf_size, uint16_t period, 24 bool big_endian) = 0; 23 virtual void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, bool big_endian) = 0; 25 24 void appendmenu(QMenu *menu); 26 25 QAction *execmenu(QWidget *parent, QMenu *menu, QPoint point); -
trunk/tools/FlairGCS/src/Map.cpp
r437 r443 287 287 } 288 288 289 void Map::BufEvent(char **buf, int *buf_size, uint16_t period, 289 void Map::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 290 290 bool big_endian) { 291 291 if (IsEnabled() == false || RefreshRate_ms() != period) -
trunk/tools/FlairGCS/src/Map.h
r437 r443 57 57 void Reset(void); 58 58 void XmlEvent(QDomElement *dom); 59 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);59 void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, bool big_endian); 60 60 61 61 void RemovePoints(void); -
trunk/tools/FlairGCS/src/Picture.cpp
r437 r443 45 45 Picture::~Picture() { delete layout; } 46 46 47 void Picture::BufEvent(char **buf, int *buf_size, uint16_t period, 47 void Picture::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 48 48 bool big_endian) { 49 49 if (big_endian) -
trunk/tools/FlairGCS/src/Picture.h
r437 r443 37 37 38 38 bool eventFilter(QObject *, QEvent *); 39 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);39 void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, bool big_endian); 40 40 void XmlEvent(QDomElement *dom); 41 41 }; -
trunk/tools/FlairGCS/src/RangeFinderPlot.cpp
r437 r443 148 148 } 149 149 150 void RangeFinderPlot::BufEvent(char **buf, int *buf_size, uint16_t period, 150 void RangeFinderPlot::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 151 151 bool big_endian) { 152 152 plot->setEnabled(IsEnabled()); -
trunk/tools/FlairGCS/src/RangeFinderPlot.h
r437 r443 44 44 45 45 bool eventFilter(QObject *, QEvent *); 46 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);46 void BufEvent(char **buf, int *buf_size, uint16_t period, uint16_t nb_buffering,bool big_endian); 47 47 }; 48 48 -
trunk/tools/FlairGCS/src/UdtSocket.cpp
r399 r443 225 225 case DATA_BIG_ENDIAN: 226 226 case DATA_LITTLE_ENDIAN: 227 emit dataReady(buf, size ); 227 case MULTIPLE_DATA_BIG_ENDIAN: 228 case MULTIPLE_DATA_LITTLE_ENDIAN: 229 emit dataReady(buf, size); 228 230 break; 229 231 case CLOSING_CONNECTION: -
trunk/tools/FlairGCS/src/UsSensorPlot.cpp
r437 r443 184 184 } 185 185 186 void UsSensorPlot::BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian) {186 void UsSensorPlot::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,bool big_endian) { 187 187 plot->setEnabled(IsEnabled()); 188 188 if (IsEnabled() == false || RefreshRate_ms() != period) -
trunk/tools/FlairGCS/src/UsSensorPlot.h
r437 r443 57 57 void setYAxisScale(float ymin, float ymax); 58 58 void setXAxisScale(float xmin, float xmax); 59 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);59 void BufEvent(char **buf, int *buf_size, uint16_t period, uint16_t nb_buffering,bool big_endian); 60 60 void plotMeasure(int index); 61 61
Note:
See TracChangeset
for help on using the changeset viewer.