Changeset 444 in flair-src for trunk/tools/FlairGCS/src
- Timestamp:
- Sep 10, 2021, 2:37:55 PM (3 years ago)
- Location:
- trunk/tools/FlairGCS/src
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/ConnectionLayout.cpp
r443 r444 60 60 break; 61 61 } 62 case MULTIPLE_DATA_BIG_ENDIAN: { 63 uint16_t period; 64 uint16_t nb_buffering; 65 memcpy(&period, buf+sizeof(char), sizeof(uint16_t)); 66 period = qFromBigEndian(period); 67 memcpy(&nb_buffering,buf+sizeof(char)+sizeof(uint16_t), sizeof(uint16_t)); 68 nb_buffering = qFromBigEndian(nb_buffering); 69 //fprintf(stderr,"recu %i, period %i, nb_buff %i\n",size,period,nb_buffering); 70 drawDatas(buf+sizeof(char)+sizeof(uint16_t)+sizeof(uint16_t), size - sizeof(char)+sizeof(uint16_t)+sizeof(uint16_t), period, nb_buffering,true); 71 break; 72 } 62 73 case MULTIPLE_DATA_LITTLE_ENDIAN: { 63 74 uint16_t period; … … 65 76 memcpy(&period, buf+sizeof(char), sizeof(uint16_t)); 66 77 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);78 //fprintf(stderr,"recu %i, period %i, nb_buff %i\n",size,period,nb_buffering); 68 79 drawDatas(buf+sizeof(char)+sizeof(uint16_t)+sizeof(uint16_t), size - sizeof(char)+sizeof(uint16_t)+sizeof(uint16_t), period, nb_buffering); 69 80 break; … … 118 129 for (int i = 0; i < nb_buffering; i++) { 119 130 for (int j = 0; j < dataremotes.count(); j++) { 120 dataremotes.at(j)->BufEvent(&buf, &buf_size, period, nb_buffering, 131 dataremotes.at(j)->BufEvent(&buf, &buf_size, period, nb_buffering,big_endian); 121 132 } 122 133 } -
trunk/tools/FlairGCS/src/DataPlot1D.cpp
r443 r444 76 76 } 77 77 78 void DataPlot1D::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 79 bool big_endian) { 78 void DataPlot1D::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,bool big_endian) { 80 79 setEnabled(IsEnabled()); 81 if (IsEnabled() == false || RefreshRate_ms() != period ) return;80 if (IsEnabled() == false || RefreshRate_ms() != period || NbBuffering()!=nb_buffering) return; 82 81 double *datas = (double *)malloc(datas_type.count() * sizeof(double)); 83 82 -
trunk/tools/FlairGCS/src/DataPlot1D.h
r443 r444 21 21 void XmlEvent(QDomElement *dom); 22 22 bool eventFilter(QObject *, QEvent *); 23 void BufEvent(char **buf, int *buf_size, uint16_t period, 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
r443 r444 251 251 } 252 252 253 void DataPlot2D::BufEvent(char **buf, int *buf_size, uint16_t period, 253 void DataPlot2D::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,bool big_endian) { 254 254 255 if (IsEnabled() == false || RefreshRate_ms() != period) 256 return; 255 if (IsEnabled() == false || RefreshRate_ms() != period || NbBuffering()!=nb_buffering) return; 257 256 258 257 for (int i = 0; i < datas->count(); i++) { -
trunk/tools/FlairGCS/src/DataPlot2D.h
r443 r444 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,uint16_t nb_buffering, 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.cpp
r437 r444 87 87 } 88 88 89 uint16_t DataRemote::NbBuffering(void) { 90 return nb_buffering; 91 } 92 89 93 bool DataRemote::IsEnabled(void) { return auto_refresh; } 90 94 … … 107 111 } 108 112 109 int DataRemote::ReceiveSize(void) { return receivesize; }110 111 113 void DataRemote::XmlSetup(QDomElement *dom) { 112 114 refresh_rate = dom->attribute("period").toUShort() / 1000.; -
trunk/tools/FlairGCS/src/DataRemote.h
r443 r444 18 18 uint16_t period, uint16_t nb_buffering=1); 19 19 ~DataRemote(); 20 virtual void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,bool big_endian) = 0; 21 22 protected: 23 int receivesize; 24 double refresh_rate; // en s 25 26 void XmlSetup(QDomElement *dom); 20 27 uint16_t RefreshRate_ms(void); 28 uint16_t NbBuffering(void); 21 29 bool IsEnabled(void); 22 int ReceiveSize(void);23 virtual void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, bool big_endian) = 0;24 30 void appendmenu(QMenu *menu); 25 31 QAction *execmenu(QWidget *parent, QMenu *menu, QPoint point); 26 27 protected:28 bool auto_refresh;29 bool is_logging;30 double refresh_rate; // en s31 int receivesize;32 uint16_t nb_buffering;33 34 void XmlSetup(QDomElement *dom);35 32 36 33 private: 37 34 void SendPeriod(uint16_t period, bool auto_refresh); 38 35 void SendNbBuffering(uint16_t nb_buffering); 36 bool is_logging; 37 bool auto_refresh; 38 uint16_t nb_buffering; 39 39 QAction *SetAutoRefresh, *setRefreshRate,*setNbBuffering; 40 40 //QAction **log;//todo implement this feature (log directly in gcs, in case of uav program crash) -
trunk/tools/FlairGCS/src/Map.cpp
r443 r444 287 287 } 288 288 289 void Map::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 290 bool big_endian) { 291 if (IsEnabled() == false || RefreshRate_ms() != period) 292 return; 289 void Map::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,bool big_endian) { 290 if (IsEnabled() == false || RefreshRate_ms() != period || NbBuffering()!=nb_buffering) return; 293 291 294 292 for (int i = 0; i < points.count(); i++) { -
trunk/tools/FlairGCS/src/Map.h
r443 r444 57 57 void Reset(void); 58 58 void XmlEvent(QDomElement *dom); 59 void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 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
r443 r444 45 45 Picture::~Picture() { delete layout; } 46 46 47 void Picture::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 48 bool big_endian) { 47 void Picture::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,bool big_endian) { 49 48 if (big_endian) 50 49 fprintf(stderr,"Picture::BufEvent, big endian not handled\n"); 51 50 52 if (IsEnabled() == false || RefreshRate_ms() != period) 53 return; 51 if (IsEnabled() == false || RefreshRate_ms() != period || NbBuffering()!=nb_buffering) return; 54 52 55 53 if ((*buf_size) >= im_width * im_height) { … … 89 87 90 88 a = menu->addAction("get frame"); 91 a->setEnabled(! auto_refresh);89 a->setEnabled(!IsEnabled()); 92 90 93 91 appendmenu(menu); -
trunk/tools/FlairGCS/src/Picture.h
r443 r444 37 37 38 38 bool eventFilter(QObject *, QEvent *); 39 void BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 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
r443 r444 148 148 } 149 149 150 void RangeFinderPlot::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering, 151 bool big_endian) { 150 void RangeFinderPlot::BufEvent(char **buf, int *buf_size, uint16_t period,uint16_t nb_buffering,bool big_endian) { 152 151 plot->setEnabled(IsEnabled()); 153 if (IsEnabled() == false || RefreshRate_ms() != period) 154 return; 152 if (IsEnabled() == false || RefreshRate_ms() != period || NbBuffering()!=nb_buffering) return; 155 153 156 154 for (uint32_t i = 0; i < nb_samples; i++) { -
trunk/tools/FlairGCS/src/RangeFinderPlot.h
r443 r444 44 44 45 45 bool eventFilter(QObject *, QEvent *); 46 void BufEvent(char **buf, int *buf_size, uint16_t period, 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/UsSensorPlot.cpp
r443 r444 186 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 if (IsEnabled() == false || RefreshRate_ms() != period) 189 return; 188 if (IsEnabled() == false || RefreshRate_ms() != period || NbBuffering()!=nb_buffering) return; 190 189 191 190 measure_t measure; -
trunk/tools/FlairGCS/src/UsSensorPlot.h
r443 r444 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, 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.