Changeset 455 in flair-src for trunk/tools
- Timestamp:
- Oct 4, 2021, 10:03:51 AM (3 years ago)
- Location:
- trunk/tools/FlairGCS/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/DataRemote.cpp
r444 r455 16 16 receivesize = 0; 17 17 refresh_rate = (double)period / 1000.; 18 this->nb_buffering=nb_buffering; 18 19 //flair programs without nb buffering have nb_buffering=0, set it to 1 for compatibility 20 if(nb_buffering==0) { 21 this->nb_buffering=1; 22 nbBufferingCompatible=false; 23 } else { 24 this->nb_buffering=nb_buffering; 25 nbBufferingCompatible=true; 26 } 27 19 28 20 29 connectionLayout()->addDataRemote(this); … … 37 46 setRefreshRate->setEnabled(auto_refresh); 38 47 39 menu->addSeparator(); 40 setNbBuffering = menu->addAction(QString("set nb buffering (%1)").arg(nb_buffering)); 48 //flair programs without nb buffering have nb_buffering=0 49 if(nbBufferingCompatible) { 50 menu->addSeparator(); 51 setNbBuffering = menu->addAction(QString("set nb buffering (%1)").arg(nb_buffering)); 52 } 41 53 42 54 /* menu->addSeparator(); … … 52 64 53 65 action = menu->exec(point); 54 66 if(action==NULL) return action;//setNbBuffering can also be null if in compatibility mode 67 55 68 if (action == SetAutoRefresh) { 56 69 SendPeriod(RefreshRate_ms(), SetAutoRefresh->isChecked()); … … 113 126 void DataRemote::XmlSetup(QDomElement *dom) { 114 127 refresh_rate = dom->attribute("period").toUShort() / 1000.; 115 nb_buffering = dom->attribute("nb_buf").toUShort(); 128 if(nbBufferingCompatible) nb_buffering = dom->attribute("nb_buf").toUShort(); 129 116 130 if (dom->attribute("enabled") == "1") 117 131 auto_refresh = true; -
trunk/tools/FlairGCS/src/DataRemote.h
r444 r455 38 38 uint16_t nb_buffering; 39 39 QAction *SetAutoRefresh, *setRefreshRate,*setNbBuffering; 40 bool nbBufferingCompatible; 40 41 //QAction **log;//todo implement this feature (log directly in gcs, in case of uav program crash) 41 42 }; -
trunk/tools/FlairGCS/src/Layout.cpp
r437 r455 160 160 uint16_t period = dom->attribute("period").toUShort(); 161 161 uint16_t nb_buffering = dom->attribute("nb_buf").toUShort(); 162 if(period==0) period=100; 162 163 if (enabled == 1) { 163 164 widget = new DataPlot1D(this, row, col, name, ymin, ymax, true, period,nb_buffering); 164 165 } else { 165 widget = new DataPlot1D(this, row, col, name, ymin, ymax, false, 100,nb_buffering);166 widget = new DataPlot1D(this, row, col, name, ymin, ymax, false, period,nb_buffering); 166 167 } 167 168 } … … 176 177 uint16_t period = dom->attribute("period").toUShort(); 177 178 uint16_t nb_buffering = dom->attribute("nb_buf").toUShort(); 179 if(period==0) period=100; 178 180 if (enabled == 1) { 179 181 widget = new DataPlot2D(this, row, col, name, x_name, y_name, xmin, xmax, … … 181 183 } else { 182 184 widget = new DataPlot2D(this, row, col, name, x_name, y_name, xmin, xmax, 183 ymin, ymax, false, 100,nb_buffering);185 ymin, ymax, false, period,nb_buffering); 184 186 } 185 187 } … … 192 194 QString type = dom->attribute("type"); 193 195 int samples = dom->attribute("samples").toInt(); 196 if(period==0) period=100; 194 197 if (enabled == 1) { 195 198 widget = new UsSensorPlot(this, row, col, name, y_name, … … 197 200 } else { 198 201 widget = new UsSensorPlot(this, row, col, name, y_name, 199 ymin, ymax, samples,type,false, 100);202 ymin, ymax, samples,type,false, period); 200 203 } 201 204 } … … 220 223 invert_axis_bool = true; 221 224 } 225 if(period==0) period=100; 222 226 if (enabled == 1) { 223 227 widget = … … 229 233 new RangeFinderPlot(this, row, col, name, x_name, y_name, xmin, xmax, 230 234 ymin, ymax, start_angle, end_angle, nb_samples, 231 data_type, invert_axis, false, 100);235 data_type, invert_axis, false, period); 232 236 } 233 237 } … … 237 241 int enabled = dom->attribute("enabled").toInt(); 238 242 uint16_t period = dom->attribute("period").toUShort(); 243 if(period==0) period=100; 239 244 if (enabled == 1) { 240 245 widget = new Picture(this, row, col, name, width, height, true, period); … … 257 262 i++; 258 263 } 259 264 if(period==0) period=100; 260 265 if (enabled == 1) { 261 266 widget = new Map(this, row, col, name, coordinates, true, period);
Note:
See TracChangeset
for help on using the changeset viewer.