Changeset 269 in flair-src for trunk/tools/FlairGCS/src
- Timestamp:
- Oct 4, 2018, 1:53:11 PM (6 years ago)
- Location:
- trunk/tools/FlairGCS/src
- Files:
-
- 40 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/FlairGCS/src/CheckBox.cpp
r15 r269 46 46 void CheckBox::Reset(void) { checkbox->setChecked(checkbox_value); } 47 47 48 void CheckBox::LoadEvent(QDomElement dom) {48 void CheckBox::LoadEvent(QDomElement *dom) { 49 49 if (checkbox->isEnabled() == true) { 50 if (dom .attribute("value") == QString("1")) {50 if (dom->attribute("value") == QString("1")) { 51 51 checkbox->setChecked(true); 52 52 } else { -
trunk/tools/FlairGCS/src/CheckBox.h
r15 r269 23 23 void SetUptodate(void); 24 24 void Reset(void); 25 void LoadEvent(QDomElement dom);25 void LoadEvent(QDomElement *dom); 26 26 27 27 void ui_to_var(void); -
trunk/tools/FlairGCS/src/ComboBox.cpp
r15 r269 28 28 ComboBox::~ComboBox() { delete combobox; } 29 29 30 void ComboBox::XmlEvent(QDomElement dom) {31 if (dom .attribute("item") != "") {32 QString item = dom .attribute("item");30 void ComboBox::XmlEvent(QDomElement *dom) { 31 if (dom->attribute("item") != "") { 32 QString item = dom->attribute("item"); 33 33 combobox->addItem(item); 34 34 combobox->setCurrentIndex(combobox_value); … … 50 50 void ComboBox::Reset(void) { combobox->setCurrentIndex(combobox_value); } 51 51 52 void ComboBox::LoadEvent(QDomElement dom) {52 void ComboBox::LoadEvent(QDomElement *dom) { 53 53 if (combobox->isEnabled() == true) { 54 combobox->setCurrentIndex((dom .attribute("value")).toInt());54 combobox->setCurrentIndex((dom->attribute("value")).toInt()); 55 55 } 56 56 } -
trunk/tools/FlairGCS/src/ComboBox.h
r15 r269 21 21 QComboBox *combobox; 22 22 int combobox_value; 23 void XmlEvent(QDomElement dom);23 void XmlEvent(QDomElement *dom); 24 24 void SetUptodate(void); 25 25 void Reset(void); 26 void LoadEvent(QDomElement dom);26 void LoadEvent(QDomElement *dom); 27 27 28 28 void ui_to_var(void); -
trunk/tools/FlairGCS/src/ConnectionLayout.cpp
r260 r269 38 38 } 39 39 40 ParseXml(doc.firstChildElement("root").firstChildElement()); 40 QDomElement dom=doc.firstChildElement("root").firstChildElement(); 41 ParseXml(&dom); 41 42 break; 42 43 } … … 83 84 } 84 85 85 void ConnectionLayout::LoadXml(QDomDocument to_parse) {86 QDomElement tmp = to_parse .firstChildElement("root");86 void ConnectionLayout::LoadXml(QDomDocument *to_parse) { 87 QDomElement tmp = to_parse->firstChildElement("root"); 87 88 while (tmp.attribute("name") != name && !tmp.isNull()) 88 tmp = to_parse .nextSiblingElement("root");89 tmp = to_parse->nextSiblingElement("root"); 89 90 90 91 if (!tmp.isNull()) { 91 XmlWidget::LoadXml( tmp);92 XmlWidget::LoadXml(&tmp); 92 93 } else { 93 94 fprintf(stderr,"%s not found in xml file \n", name.toLocal8Bit().constData()); -
trunk/tools/FlairGCS/src/ConnectionLayout.h
r260 r269 20 20 void addDataRemote(DataRemote *data); 21 21 void removeDataRemote(DataRemote *data); 22 void LoadXml(QDomDocument to_parse);22 void LoadXml(QDomDocument *to_parse); 23 23 QString getName(); 24 24 static QString getDocRootName(char* buf, int size); -
trunk/tools/FlairGCS/src/DataPlot1D.cpp
r244 r269 24 24 } 25 25 26 void DataPlot1D::XmlEvent(QDomElement dom) {27 if (dom .attribute("curve") != "") {28 QString type = dom .attribute("type");29 int r = dom .attribute("r").toInt();30 int g = dom .attribute("g").toInt();31 int b = dom .attribute("b").toInt();32 QString name = dom .attribute("curve");26 void DataPlot1D::XmlEvent(QDomElement *dom) { 27 if (dom->attribute("curve") != "") { 28 QString type = dom->attribute("type"); 29 int r = dom->attribute("r").toInt(); 30 int g = dom->attribute("g").toInt(); 31 int b = dom->attribute("b").toInt(); 32 QString name = dom->attribute("curve"); 33 33 addCurve(QPen(QColor(r, g, b, 255)), name); 34 34 datas_type.append(type); -
trunk/tools/FlairGCS/src/DataPlot1D.h
r17 r269 19 19 20 20 private: 21 void XmlEvent(QDomElement dom);21 void XmlEvent(QDomElement *dom); 22 22 bool eventFilter(QObject *, QEvent *); 23 23 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian); -
trunk/tools/FlairGCS/src/DataPlot2D.cpp
r244 r269 104 104 } 105 105 106 void DataPlot2D::XmlEvent(QDomElement dom) {107 if (dom .attribute("curve") != "") {108 QString type = dom .attribute("type");109 int r = dom .attribute("r").toInt();110 int g = dom .attribute("g").toInt();111 int b = dom .attribute("b").toInt();112 QString name = dom .attribute("curve");106 void DataPlot2D::XmlEvent(QDomElement *dom) { 107 if (dom->attribute("curve") != "") { 108 QString type = dom->attribute("type"); 109 int r = dom->attribute("r").toInt(); 110 int g = dom->attribute("g").toInt(); 111 int b = dom->attribute("b").toInt(); 112 QString name = dom->attribute("curve"); 113 113 addCurve(QPen(QColor(r, g, b, 255)), name, type); 114 114 } else { -
trunk/tools/FlairGCS/src/DataPlot2D.h
r15 r269 31 31 private: 32 32 QwtPlot *plot; 33 void XmlEvent(QDomElement dom);33 void XmlEvent(QDomElement *dom); 34 34 void alignScales(void); 35 35 void plot_data(double data_x, double data_y, int index); -
trunk/tools/FlairGCS/src/DataRemote.cpp
r234 r269 88 88 int DataRemote::ReceiveSize(void) { return receivesize; } 89 89 90 void DataRemote::XmlSetup(QDomElement dom) {91 refresh_rate = dom .attribute("period").toInt() / 1000.;92 if (dom .attribute("enabled") == "1")90 void DataRemote::XmlSetup(QDomElement *dom) { 91 refresh_rate = dom->attribute("period").toInt() / 1000.; 92 if (dom->attribute("enabled") == "1") 93 93 auto_refresh = true; 94 94 else -
trunk/tools/FlairGCS/src/DataRemote.h
r222 r269 32 32 int receivesize; 33 33 34 void XmlSetup(QDomElement dom);34 void XmlSetup(QDomElement *dom); 35 35 36 36 private: -
trunk/tools/FlairGCS/src/DoubleSpinBox.cpp
r257 r269 105 105 } 106 106 107 void DoubleSpinBox::LoadEvent(QDomElement dom) {107 void DoubleSpinBox::LoadEvent(QDomElement *dom) { 108 108 if (doublespinbox->isEnabled() == true) { 109 doublespinbox->setValue((dom .attribute("value")).toDouble());109 doublespinbox->setValue((dom->attribute("value")).toDouble()); 110 110 } 111 111 } -
trunk/tools/FlairGCS/src/DoubleSpinBox.h
r15 r269 25 25 void SetUptodate(void); 26 26 void Reset(void); 27 void LoadEvent(QDomElement dom);27 void LoadEvent(QDomElement *dom); 28 28 void ui_to_var(void); 29 29 void ui_to_xml(void); -
trunk/tools/FlairGCS/src/Label.cpp
r15 r269 22 22 Label::~Label() {} 23 23 24 void Label::XmlEvent(QDomElement dom) {25 label->setText(dom .attribute("value"));24 void Label::XmlEvent(QDomElement *dom) { 25 label->setText(dom->attribute("value")); 26 26 } -
trunk/tools/FlairGCS/src/Label.h
r15 r269 17 17 18 18 private: 19 void XmlEvent(QDomElement dom);19 void XmlEvent(QDomElement *dom); 20 20 QLabel *label; 21 21 }; -
trunk/tools/FlairGCS/src/Layout.cpp
r244 r269 69 69 QGridLayout *Layout::getQGridLayout() { return qgridlayout; } 70 70 71 void Layout::XmlEvent(QDomElement dom) {71 void Layout::XmlEvent(QDomElement *dom) { 72 72 XmlWidget *widget = NULL; 73 QString type = dom .tagName();74 QString name = dom .attribute("name");75 QString old_name = dom .attribute("old_name");76 int row = dom .attribute("row").toInt();77 int col = dom .attribute("col").toInt();73 QString type = dom->tagName(); 74 QString name = dom->attribute("name"); 75 QString old_name = dom->attribute("old_name"); 76 int row = dom->attribute("row").toInt(); 77 int col = dom->attribute("col").toInt(); 78 78 79 79 // initially rowCount()=1 and columnCount()=1 but count()=0 ! … … 103 103 104 104 if (type == "TabWidget") { 105 int position = dom .attribute("position").toInt();105 int position = dom->attribute("position").toInt(); 106 106 widget = 107 107 new TabWidget(this, row, col, name, (QTabWidget::TabPosition)position); … … 114 114 } 115 115 if (type == "SpinBox") { 116 int value = dom .attribute("value").toInt();117 QString suffix = dom .attribute("suffix");118 int min = dom .attribute("min").toInt();119 int max = dom .attribute("max").toInt();120 int step = dom .attribute("step").toInt();116 int value = dom->attribute("value").toInt(); 117 QString suffix = dom->attribute("suffix"); 118 int min = dom->attribute("min").toInt(); 119 int max = dom->attribute("max").toInt(); 120 int step = dom->attribute("step").toInt(); 121 121 widget = new SpinBox(this, row, col, name, suffix, value, min, max, step); 122 122 } 123 123 if (type == "DoubleSpinBox") { 124 QString value = dom .attribute("value");125 QString suffix = dom .attribute("suffix");126 double min = dom .attribute("min").toDouble();127 double max = dom .attribute("max").toDouble();128 double step = dom .attribute("step").toDouble();129 int decimals = dom .attribute("decimals").toInt();124 QString value = dom->attribute("value"); 125 QString suffix = dom->attribute("suffix"); 126 double min = dom->attribute("min").toDouble(); 127 double max = dom->attribute("max").toDouble(); 128 double step = dom->attribute("step").toDouble(); 129 int decimals = dom->attribute("decimals").toInt(); 130 130 widget = new DoubleSpinBox(this, row, col, name, suffix, value, min, max, 131 131 step, decimals); … … 133 133 if (type == "Vector3DSpinBox") { 134 134 QString value[3]; 135 value[0] = dom .attribute("value_x");136 value[1] = dom .attribute("value_y");137 value[2] = dom .attribute("value_z");138 double min = dom .attribute("min").toDouble();139 double max = dom .attribute("max").toDouble();140 double step = dom .attribute("step").toDouble();141 int decimals = dom .attribute("decimals").toInt();135 value[0] = dom->attribute("value_x"); 136 value[1] = dom->attribute("value_y"); 137 value[2] = dom->attribute("value_z"); 138 double min = dom->attribute("min").toDouble(); 139 double max = dom->attribute("max").toDouble(); 140 double step = dom->attribute("step").toDouble(); 141 int decimals = dom->attribute("decimals").toInt(); 142 142 widget = new Vector3DSpinBox(this, row, col, name, value, min, max, step, 143 143 decimals); 144 144 } 145 145 if (type == "CheckBox") { 146 int value = dom .attribute("value").toInt();146 int value = dom->attribute("value").toInt(); 147 147 widget = new CheckBox(this, row, col, name, value); 148 148 } 149 149 if (type == "ComboBox") { 150 int value = dom .attribute("value").toInt();150 int value = dom->attribute("value").toInt(); 151 151 widget = new ComboBox(this, row, col, name, value); 152 152 } … … 155 155 } 156 156 if (type == "DataPlot1D") { 157 float ymin = dom .attribute("min").toFloat();158 float ymax = dom .attribute("max").toFloat();159 int enabled = dom .attribute("enabled").toInt();160 int period = dom .attribute("period").toInt();157 float ymin = dom->attribute("min").toFloat(); 158 float ymax = dom->attribute("max").toFloat(); 159 int enabled = dom->attribute("enabled").toInt(); 160 int period = dom->attribute("period").toInt(); 161 161 if (enabled == 1) { 162 162 widget = new DataPlot1D(this, row, col, name, ymin, ymax, true, period); … … 166 166 } 167 167 if (type == "DataPlot2D") { 168 float xmin = dom .attribute("xmin").toFloat();169 float xmax = dom .attribute("xmax").toFloat();170 float ymin = dom .attribute("ymin").toFloat();171 float ymax = dom .attribute("ymax").toFloat();172 QString x_name = dom .attribute("x_name");173 QString y_name = dom .attribute("y_name");174 int enabled = dom .attribute("enabled").toInt();175 int period = dom .attribute("period").toInt();168 float xmin = dom->attribute("xmin").toFloat(); 169 float xmax = dom->attribute("xmax").toFloat(); 170 float ymin = dom->attribute("ymin").toFloat(); 171 float ymax = dom->attribute("ymax").toFloat(); 172 QString x_name = dom->attribute("x_name"); 173 QString y_name = dom->attribute("y_name"); 174 int enabled = dom->attribute("enabled").toInt(); 175 int period = dom->attribute("period").toInt(); 176 176 if (enabled == 1) { 177 177 widget = new DataPlot2D(this, row, col, name, x_name, y_name, xmin, xmax, … … 183 183 } 184 184 if (type == "UsSensorPlot") { 185 float ymin = dom .attribute("ymin").toFloat();186 float ymax = dom .attribute("ymax").toFloat();187 QString y_name = dom .attribute("y_name");188 int enabled = dom .attribute("enabled").toInt();189 int period = dom .attribute("period").toInt();190 QString type = dom .attribute("type");191 int samples = dom .attribute("samples").toInt();185 float ymin = dom->attribute("ymin").toFloat(); 186 float ymax = dom->attribute("ymax").toFloat(); 187 QString y_name = dom->attribute("y_name"); 188 int enabled = dom->attribute("enabled").toInt(); 189 int period = dom->attribute("period").toInt(); 190 QString type = dom->attribute("type"); 191 int samples = dom->attribute("samples").toInt(); 192 192 if (enabled == 1) { 193 193 widget = new UsSensorPlot(this, row, col, name, y_name, … … 199 199 } 200 200 if (type == "RangeFinderPlot") { 201 float xmin = dom .attribute("xmin").toFloat();202 float xmax = dom .attribute("xmax").toFloat();203 float ymin = dom .attribute("ymin").toFloat();204 float ymax = dom .attribute("ymax").toFloat();205 QString x_name = dom .attribute("x_name");206 QString y_name = dom .attribute("y_name");207 QString data_type = dom .attribute("type");208 float start_angle = dom .attribute("start_angle").toFloat();209 float end_angle = dom .attribute("end_angle").toFloat();210 uint32_t nb_samples = dom .attribute("nb_samples").toUInt();211 int enabled = dom .attribute("enabled").toInt();212 int period = dom .attribute("period").toInt();213 int invert_axis = dom .attribute("invert_axis").toInt();201 float xmin = dom->attribute("xmin").toFloat(); 202 float xmax = dom->attribute("xmax").toFloat(); 203 float ymin = dom->attribute("ymin").toFloat(); 204 float ymax = dom->attribute("ymax").toFloat(); 205 QString x_name = dom->attribute("x_name"); 206 QString y_name = dom->attribute("y_name"); 207 QString data_type = dom->attribute("type"); 208 float start_angle = dom->attribute("start_angle").toFloat(); 209 float end_angle = dom->attribute("end_angle").toFloat(); 210 uint32_t nb_samples = dom->attribute("nb_samples").toUInt(); 211 int enabled = dom->attribute("enabled").toInt(); 212 int period = dom->attribute("period").toInt(); 213 int invert_axis = dom->attribute("invert_axis").toInt(); 214 214 bool invert_axis_bool; 215 215 if (invert_axis == 0) { … … 231 231 } 232 232 if (type == "Picture") { 233 int width = dom .attribute("width").toInt();234 int height = dom .attribute("height").toInt();235 int enabled = dom .attribute("enabled").toInt();236 int period = dom .attribute("period").toInt();233 int width = dom->attribute("width").toInt(); 234 int height = dom->attribute("height").toInt(); 235 int enabled = dom->attribute("enabled").toInt(); 236 int period = dom->attribute("period").toInt(); 237 237 if (enabled == 1) { 238 238 widget = new Picture(this, row, col, name, width, height, true, period); … … 242 242 } 243 243 if (type == "Map") { 244 int period = dom .attribute("period").toInt();245 int enabled = dom .attribute("enabled").toInt();244 int period = dom->attribute("period").toInt(); 245 int enabled = dom->attribute("enabled").toInt(); 246 246 int i = 0; 247 247 QList<QtMobility::QGeoCoordinate> coordinates; 248 while (dom .hasAttribute("lat" + QString::number(i))) {249 double latitude = dom .attribute("lat" + QString::number(i)).toDouble();250 double longitude = dom .attribute("long" + QString::number(i)).toDouble();251 double alt = dom .attribute("alt" + QString::number(i)).toDouble();248 while (dom->hasAttribute("lat" + QString::number(i))) { 249 double latitude = dom->attribute("lat" + QString::number(i)).toDouble(); 250 double longitude = dom->attribute("long" + QString::number(i)).toDouble(); 251 double alt = dom->attribute("alt" + QString::number(i)).toDouble(); 252 252 QtMobility::QGeoCoordinate coordinate = 253 253 QtMobility::QGeoCoordinate(latitude, longitude, alt); … … 272 272 QStringList items; 273 273 int count = 0; 274 while (dom .hasAttribute("item" + QString::number(count))) {275 QString item = dom .attribute("item" + QString::number(count));274 while (dom->hasAttribute("item" + QString::number(count))) { 275 QString item = dom->attribute("item" + QString::number(count)); 276 276 items.append(item); 277 277 count++; -
trunk/tools/FlairGCS/src/Layout.h
r15 r269 23 23 private: 24 24 void Constructor(QString name); 25 void XmlEvent(QDomElement dom);25 void XmlEvent(QDomElement *dom); 26 26 QGridLayout *qgridlayout; 27 27 }; -
trunk/tools/FlairGCS/src/ListWidget.cpp
r88 r269 51 51 } 52 52 53 void ListWidget::XmlEvent(QDomElement dom) {53 void ListWidget::XmlEvent(QDomElement *dom) { 54 54 isUpToDate = false; 55 if (dom .attribute("item") != "") {56 QString item = dom .attribute("item");55 if (dom->attribute("item") != "") { 56 QString item = dom->attribute("item"); 57 57 QListWidgetItem *widget_item = new QListWidgetItem(item); 58 58 // new item, so the text is red … … 60 60 listwidget->addItem(widget_item); 61 61 } 62 if (dom .attribute("delete") != "") {63 int row_to_del = dom .attribute("delete").toInt();62 if (dom->attribute("delete") != "") { 63 int row_to_del = dom->attribute("delete").toInt(); 64 64 RemoveItemFromXml(row_to_del); 65 65 QListWidgetItem *item_to_del = listwidget->takeItem(row_to_del); … … 106 106 } 107 107 108 void ListWidget::LoadEvent(QDomElement dom) {108 void ListWidget::LoadEvent(QDomElement *dom) { 109 109 //function not tested 110 110 std::cout << "FlairGCS LoadEvent" << std::endl; … … 114 114 QStringList items; 115 115 int count = 0; 116 while (dom .hasAttribute("item" + QString::number(count))) {116 while (dom->hasAttribute("item" + QString::number(count))) { 117 117 std::cout << "FlairGCS LoadEvent boucle" << std::endl; 118 listwidget->addItem(dom .attribute("item" + QString::number(count)));118 listwidget->addItem(dom->attribute("item" + QString::number(count))); 119 119 count++; 120 120 } -
trunk/tools/FlairGCS/src/ListWidget.h
r88 r269 72 72 * \param[in] dom The dom containing the xml file. 73 73 */ 74 void XmlEvent(QDomElement dom);74 void XmlEvent(QDomElement *dom); 75 75 /** 76 76 * \brief Reset the widget, load the internal parameters. … … 83 83 * \param[in] dom The dom containing the xml file. 84 84 */ 85 void LoadEvent(QDomElement dom);85 void LoadEvent(QDomElement *dom); 86 86 /** 87 87 * \brief Save the user interface variables state in the internal members. -
trunk/tools/FlairGCS/src/Manager.cpp
r260 r269 319 319 "," + QString::number(errorColumn) + ")"); 320 320 } else { 321 connections.at(i).layout->LoadXml( doc);321 connections.at(i).layout->LoadXml(&doc); 322 322 } 323 323 delete file; -
trunk/tools/FlairGCS/src/Map.cpp
r244 r269 272 272 } 273 273 274 void Map::XmlEvent(QDomElement dom) {275 if (dom .attribute("point") != "") {274 void Map::XmlEvent(QDomElement *dom) { 275 if (dom->attribute("point") != "") { 276 276 receivesize += 3 * sizeof(double); 277 277 if (mapWidget->isEnabled()) { 278 278 Landmark *landmark = new Landmark(geoMap, QGeoCoordinate(0, 0, 0), 279 dom .attribute("point"), "cross");279 dom->attribute("point"), "cross"); 280 280 landmark->setColor(Qt::black); 281 281 points.append(landmark); 282 mapWidget->AddPoint(dom .attribute("point"));282 mapWidget->AddPoint(dom->attribute("point")); 283 283 } 284 284 } else { -
trunk/tools/FlairGCS/src/Map.h
r67 r269 56 56 void SetUptodate(void); 57 57 void Reset(void); 58 void XmlEvent(QDomElement dom);58 void XmlEvent(QDomElement *dom); 59 59 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian); 60 60 -
trunk/tools/FlairGCS/src/Picture.cpp
r244 r269 97 97 } 98 98 99 void Picture::XmlEvent(QDomElement dom) { XmlSetup(dom); }99 void Picture::XmlEvent(QDomElement *dom) { XmlSetup(dom); } -
trunk/tools/FlairGCS/src/Picture.h
r15 r269 38 38 bool eventFilter(QObject *, QEvent *); 39 39 void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian); 40 void XmlEvent(QDomElement dom);40 void XmlEvent(QDomElement *dom); 41 41 }; 42 42 -
trunk/tools/FlairGCS/src/RangeFinderPlot.cpp
r244 r269 97 97 RangeFinderPlot::~RangeFinderPlot() { delete plot; } 98 98 99 void RangeFinderPlot::XmlEvent(QDomElement dom) { XmlSetup(dom); }99 void RangeFinderPlot::XmlEvent(QDomElement *dom) { XmlSetup(dom); } 100 100 101 101 bool RangeFinderPlot::eventFilter(QObject *o, QEvent *e) { -
trunk/tools/FlairGCS/src/RangeFinderPlot.h
r15 r269 34 34 void SetTriangle(uint32_t id, float length); 35 35 QwtPlot *plot; 36 void XmlEvent(QDomElement dom);36 void XmlEvent(QDomElement *dom); 37 37 void alignScales(void); 38 38 float xmin_orig, xmax_orig, ymin_orig, ymax_orig; -
trunk/tools/FlairGCS/src/SpinBox.cpp
r15 r269 40 40 void SpinBox::Reset(void) { spinbox->setValue(spinbox_value); } 41 41 42 void SpinBox::LoadEvent(QDomElement dom) {42 void SpinBox::LoadEvent(QDomElement *dom) { 43 43 if (spinbox->isEnabled() == true) { 44 spinbox->setValue((dom .attribute("value")).toInt());44 spinbox->setValue((dom->attribute("value")).toInt()); 45 45 } 46 46 } -
trunk/tools/FlairGCS/src/SpinBox.h
r15 r269 24 24 void SetUptodate(void); 25 25 void Reset(void); 26 void LoadEvent(QDomElement dom);26 void LoadEvent(QDomElement *dom); 27 27 28 28 void ui_to_var(void); -
trunk/tools/FlairGCS/src/TabWidget.cpp
r15 r269 28 28 TabWidget::~TabWidget() {} 29 29 30 void TabWidget::XmlEvent(QDomElement dom) {31 QString type = dom .tagName();32 QString name = dom .attribute("name");33 int position = dom .attribute("position").toInt();30 void TabWidget::XmlEvent(QDomElement *dom) { 31 QString type = dom->tagName(); 32 QString name = dom->attribute("name"); 33 int position = dom->attribute("position").toInt(); 34 34 35 35 if (type == "Tab") { -
trunk/tools/FlairGCS/src/TabWidget.h
r15 r269 22 22 private: 23 23 QTabWidget *tab; 24 void XmlEvent(QDomElement dom);24 void XmlEvent(QDomElement *dom); 25 25 }; 26 26 -
trunk/tools/FlairGCS/src/TextEdit.cpp
r15 r269 29 29 TextEdit::~TextEdit() {} 30 30 31 void TextEdit::XmlEvent(QDomElement dom) {32 text->append(dom .attribute("value"));31 void TextEdit::XmlEvent(QDomElement *dom) { 32 text->append(dom->attribute("value")); 33 33 } -
trunk/tools/FlairGCS/src/TextEdit.h
r15 r269 22 22 QPushButton *clear; 23 23 QTextEdit *text; 24 void XmlEvent(QDomElement dom);24 void XmlEvent(QDomElement *dom); 25 25 }; 26 26 -
trunk/tools/FlairGCS/src/UdtSocket.cpp
r258 r269 66 66 // disconnection of ground station 67 67 void UdtSocket::heartbeat(void) { 68 //printf("h %s %i.%i\n",name.toLocal8Bit().constData(),QTime::currentTime().second(),QTime::currentTime().msec()); 68 69 char data = WATCHDOG_HEADER; 69 70 quint64 sent=write(&data, 1,HEARTBEAT_TIMER,true); … … 161 162 } else if(readfds==socket && num==1 && rv==1) { 162 163 int size; 164 QTime initTime; 165 initTime.start(); 163 166 do { 167 //we are in "infinite" loop, so let the heartbeat run if needed 168 if(initTime.elapsed()>HEARTBEAT_TIMER) { 169 initTime.start(); 170 //do not use error check of heartbeat() method: (otherwise, closes com too early) 171 char data = WATCHDOG_HEADER; 172 UDT::sendmsg(socket, &data, 1, HEARTBEAT_TIMER, true); 173 } 174 164 175 size=UDT::recvmsg(socket, buf, buf_size); 165 176 -
trunk/tools/FlairGCS/src/UsSensorPlot.cpp
r259 r269 131 131 } 132 132 133 void UsSensorPlot::XmlEvent(QDomElement dom) {133 void UsSensorPlot::XmlEvent(QDomElement *dom) { 134 134 XmlSetup(dom); 135 135 } -
trunk/tools/FlairGCS/src/UsSensorPlot.h
r259 r269 31 31 private: 32 32 QwtPlot *plot; 33 void XmlEvent(QDomElement dom);33 void XmlEvent(QDomElement *dom); 34 34 void alignScales(void); 35 35 float xmin_orig, xmax_orig, ymin_orig, ymax_orig; -
trunk/tools/FlairGCS/src/Vector3DSpinBox.cpp
r199 r269 146 146 } 147 147 148 void Vector3DSpinBox::LoadEvent(QDomElement dom) {148 void Vector3DSpinBox::LoadEvent(QDomElement *dom) { 149 149 if (doublespinbox[0].isEnabled()) { 150 doublespinbox[0].setValue((dom .attribute("value_x")).toDouble());150 doublespinbox[0].setValue((dom->attribute("value_x")).toDouble()); 151 151 } 152 152 if (doublespinbox[1].isEnabled()) { 153 doublespinbox[1].setValue((dom .attribute("value_y")).toDouble());153 doublespinbox[1].setValue((dom->attribute("value_y")).toDouble()); 154 154 } 155 155 if (doublespinbox[2].isEnabled()) { 156 doublespinbox[2].setValue((dom .attribute("value_z")).toDouble());156 doublespinbox[2].setValue((dom->attribute("value_z")).toDouble()); 157 157 } 158 158 } -
trunk/tools/FlairGCS/src/Vector3DSpinBox.h
r15 r269 32 32 void SetValues(QString value[3]); 33 33 void Reset(void); 34 void LoadEvent(QDomElement dom);34 void LoadEvent(QDomElement *dom); 35 35 void ui_to_var(void); 36 36 void ui_to_xml(void); -
trunk/tools/FlairGCS/src/XmlWidget.cpp
r244 r269 88 88 } 89 89 90 void XmlWidget::ParseXml(QDomElement to_parse) {91 92 if (to_parse .isNull())90 void XmlWidget::ParseXml(QDomElement *to_parse) { 91 92 if (to_parse->isNull()) 93 93 return; 94 94 95 QString type = to_parse .tagName();96 QString name = to_parse .attribute("name");95 QString type = to_parse->tagName(); 96 QString name = to_parse->attribute("name"); 97 97 98 98 // fprintf(stderr,"parse %s … … 108 108 // si on a une balise IsEnabled, on ne traite que ca 109 109 if (match->visible_widget != NULL) { 110 if (to_parse .attribute("IsEnabled") == "0") {110 if (to_parse->attribute("IsEnabled") == "0") { 111 111 match->visible_widget->setEnabled(false); 112 112 return; 113 113 } 114 if (to_parse .attribute("IsEnabled") == "1") {114 if (to_parse->attribute("IsEnabled") == "1") { 115 115 match->visible_widget->setEnabled(true); 116 116 return; … … 119 119 120 120 // si on a une balise delete, on ne traite que ca 121 if (to_parse .attribute("Delete") == "1") {121 if (to_parse->attribute("Delete") == "1") { 122 122 // fprintf(stderr,"delete flag\n"); 123 123 if (match->isContainer == true && match->childs->count() != 0) { … … 131 131 } 132 132 133 if (to_parse .firstChild().isNull() == true &&133 if (to_parse->firstChild().isNull() == true && 134 134 match->isExpandable == false) { 135 135 QString new_name; … … 148 148 } 149 149 fprintf(stderr,"new_name %s\n", new_name.toLocal8Bit().constData()); 150 to_parse .setAttribute("name", new_name);151 to_parse .setAttribute("old_name", name);150 to_parse->setAttribute("name", new_name); 151 to_parse->setAttribute("old_name", name); 152 152 153 153 XmlEvent(to_parse); … … 155 155 // return -1;//ou retourner le xml a renvoyer pour chager de nom 156 156 } else { 157 if (to_parse .firstChild().toElement().isNull()) {157 if (to_parse->firstChild().toElement().isNull()) { 158 158 match->XmlEvent(to_parse); 159 159 return; 160 160 } else { 161 match->ParseXml(to_parse.firstChild().toElement()); 162 } 163 } 164 } 165 } 166 167 void XmlWidget::LoadXml(QDomElement to_parse) { 168 if (to_parse.isNull()) 161 QDomElement dom=to_parse->firstChild().toElement(); 162 match->ParseXml(&dom); 163 } 164 } 165 } 166 } 167 168 void XmlWidget::LoadXml(QDomElement *to_parse) { 169 if (to_parse->isNull()) 169 170 return; 170 171 171 172 LoadEvent(to_parse); 172 173 173 QDomElement elem = to_parse .firstChild().toElement();174 QDomElement elem = to_parse->firstChild().toElement(); 174 175 175 176 while (!elem.isNull()) { … … 184 185 if (match != NULL) { 185 186 // fprintf(stderr,"match\n"); 186 match->LoadXml( elem);187 match->LoadXml(&elem); 187 188 } 188 189 elem = elem.nextSibling().toElement(); -
trunk/tools/FlairGCS/src/XmlWidget.h
r67 r269 21 21 ~XmlWidget(); 22 22 QDomDocument XmlDoc(void); 23 void ParseXml(QDomElement to_parse);23 void ParseXml(QDomElement *to_parse); 24 24 void GetFullXml(QDomElement *doc); 25 25 void GetUpdateXml(QDomElement *doc); 26 26 void ResetAllChilds(void); 27 27 virtual bool IsUptodate(void) { return true; }; 28 void LoadXml(QDomElement to_parse);28 void LoadXml(QDomElement *to_parse); 29 29 void RenamedFrom(QString old_name); 30 30 QString Name(void); … … 51 51 void SetIsContainer(bool status); 52 52 void SetIsExpandable(bool status); 53 virtual void XmlEvent(QDomElement dom){};54 virtual void LoadEvent(QDomElement dom){};53 virtual void XmlEvent(QDomElement *dom){}; 54 virtual void LoadEvent(QDomElement *dom){}; 55 55 QDomElement *AddXmlChild(QString type); 56 56 void RemoveXmlChild(QDomElement *element);
Note:
See TracChangeset
for help on using the changeset viewer.