Changeset 269 in flair-src for trunk/tools


Ignore:
Timestamp:
Oct 4, 2018, 1:53:11 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

flairgcs:
speed up processing time when receiving datas from uav
triger watchdog while receiving datas from uav
(avoids connection lost in uav)

Location:
trunk/tools/FlairGCS/src
Files:
40 edited

Legend:

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

    r15 r269  
    4646void CheckBox::Reset(void) { checkbox->setChecked(checkbox_value); }
    4747
    48 void CheckBox::LoadEvent(QDomElement dom) {
     48void CheckBox::LoadEvent(QDomElement *dom) {
    4949  if (checkbox->isEnabled() == true) {
    50     if (dom.attribute("value") == QString("1")) {
     50    if (dom->attribute("value") == QString("1")) {
    5151      checkbox->setChecked(true);
    5252    } else {
  • trunk/tools/FlairGCS/src/CheckBox.h

    r15 r269  
    2323  void SetUptodate(void);
    2424  void Reset(void);
    25   void LoadEvent(QDomElement dom);
     25  void LoadEvent(QDomElement *dom);
    2626
    2727  void ui_to_var(void);
  • trunk/tools/FlairGCS/src/ComboBox.cpp

    r15 r269  
    2828ComboBox::~ComboBox() { delete combobox; }
    2929
    30 void ComboBox::XmlEvent(QDomElement dom) {
    31   if (dom.attribute("item") != "") {
    32     QString item = dom.attribute("item");
     30void ComboBox::XmlEvent(QDomElement *dom) {
     31  if (dom->attribute("item") != "") {
     32    QString item = dom->attribute("item");
    3333    combobox->addItem(item);
    3434    combobox->setCurrentIndex(combobox_value);
     
    5050void ComboBox::Reset(void) { combobox->setCurrentIndex(combobox_value); }
    5151
    52 void ComboBox::LoadEvent(QDomElement dom) {
     52void ComboBox::LoadEvent(QDomElement *dom) {
    5353  if (combobox->isEnabled() == true) {
    54     combobox->setCurrentIndex((dom.attribute("value")).toInt());
     54    combobox->setCurrentIndex((dom->attribute("value")).toInt());
    5555  }
    5656}
  • trunk/tools/FlairGCS/src/ComboBox.h

    r15 r269  
    2121  QComboBox *combobox;
    2222  int combobox_value;
    23   void XmlEvent(QDomElement dom);
     23  void XmlEvent(QDomElement *dom);
    2424  void SetUptodate(void);
    2525  void Reset(void);
    26   void LoadEvent(QDomElement dom);
     26  void LoadEvent(QDomElement *dom);
    2727
    2828  void ui_to_var(void);
  • trunk/tools/FlairGCS/src/ConnectionLayout.cpp

    r260 r269  
    3838    }
    3939
    40     ParseXml(doc.firstChildElement("root").firstChildElement());
     40    QDomElement dom=doc.firstChildElement("root").firstChildElement();
     41    ParseXml(&dom);
    4142    break;
    4243  }
     
    8384}
    8485
    85 void ConnectionLayout::LoadXml(QDomDocument to_parse) {
    86   QDomElement tmp = to_parse.firstChildElement("root");
     86void ConnectionLayout::LoadXml(QDomDocument *to_parse) {
     87  QDomElement tmp = to_parse->firstChildElement("root");
    8788  while (tmp.attribute("name") != name && !tmp.isNull())
    88     tmp = to_parse.nextSiblingElement("root");
     89    tmp = to_parse->nextSiblingElement("root");
    8990
    9091  if (!tmp.isNull()) {
    91     XmlWidget::LoadXml(tmp);
     92    XmlWidget::LoadXml(&tmp);
    9293  } else {
    9394    fprintf(stderr,"%s not found in xml file \n", name.toLocal8Bit().constData());
  • trunk/tools/FlairGCS/src/ConnectionLayout.h

    r260 r269  
    2020  void addDataRemote(DataRemote *data);
    2121  void removeDataRemote(DataRemote *data);
    22   void LoadXml(QDomDocument to_parse);
     22  void LoadXml(QDomDocument *to_parse);
    2323  QString getName();
    2424  static QString getDocRootName(char* buf, int size);
  • trunk/tools/FlairGCS/src/DataPlot1D.cpp

    r244 r269  
    2424}
    2525
    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");
     26void 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");
    3333    addCurve(QPen(QColor(r, g, b, 255)), name);
    3434    datas_type.append(type);
  • trunk/tools/FlairGCS/src/DataPlot1D.h

    r17 r269  
    1919
    2020private:
    21   void XmlEvent(QDomElement dom);
     21  void XmlEvent(QDomElement *dom);
    2222  bool eventFilter(QObject *, QEvent *);
    2323  void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
  • trunk/tools/FlairGCS/src/DataPlot2D.cpp

    r244 r269  
    104104}
    105105
    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");
     106void 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");
    113113    addCurve(QPen(QColor(r, g, b, 255)), name, type);
    114114  } else {
  • trunk/tools/FlairGCS/src/DataPlot2D.h

    r15 r269  
    3131private:
    3232  QwtPlot *plot;
    33   void XmlEvent(QDomElement dom);
     33  void XmlEvent(QDomElement *dom);
    3434  void alignScales(void);
    3535  void plot_data(double data_x, double data_y, int index);
  • trunk/tools/FlairGCS/src/DataRemote.cpp

    r234 r269  
    8888int DataRemote::ReceiveSize(void) { return receivesize; }
    8989
    90 void DataRemote::XmlSetup(QDomElement dom) {
    91   refresh_rate = dom.attribute("period").toInt() / 1000.;
    92   if (dom.attribute("enabled") == "1")
     90void DataRemote::XmlSetup(QDomElement *dom) {
     91  refresh_rate = dom->attribute("period").toInt() / 1000.;
     92  if (dom->attribute("enabled") == "1")
    9393    auto_refresh = true;
    9494  else
  • trunk/tools/FlairGCS/src/DataRemote.h

    r222 r269  
    3232  int receivesize;
    3333
    34   void XmlSetup(QDomElement dom);
     34  void XmlSetup(QDomElement *dom);
    3535
    3636private:
  • trunk/tools/FlairGCS/src/DoubleSpinBox.cpp

    r257 r269  
    105105}
    106106
    107 void DoubleSpinBox::LoadEvent(QDomElement dom) {
     107void DoubleSpinBox::LoadEvent(QDomElement *dom) {
    108108  if (doublespinbox->isEnabled() == true) {
    109     doublespinbox->setValue((dom.attribute("value")).toDouble());
     109    doublespinbox->setValue((dom->attribute("value")).toDouble());
    110110  }
    111111}
  • trunk/tools/FlairGCS/src/DoubleSpinBox.h

    r15 r269  
    2525  void SetUptodate(void);
    2626  void Reset(void);
    27   void LoadEvent(QDomElement dom);
     27  void LoadEvent(QDomElement *dom);
    2828  void ui_to_var(void);
    2929  void ui_to_xml(void);
  • trunk/tools/FlairGCS/src/Label.cpp

    r15 r269  
    2222Label::~Label() {}
    2323
    24 void Label::XmlEvent(QDomElement dom) {
    25   label->setText(dom.attribute("value"));
     24void Label::XmlEvent(QDomElement *dom) {
     25  label->setText(dom->attribute("value"));
    2626}
  • trunk/tools/FlairGCS/src/Label.h

    r15 r269  
    1717
    1818private:
    19   void XmlEvent(QDomElement dom);
     19  void XmlEvent(QDomElement *dom);
    2020  QLabel *label;
    2121};
  • trunk/tools/FlairGCS/src/Layout.cpp

    r244 r269  
    6969QGridLayout *Layout::getQGridLayout() { return qgridlayout; }
    7070
    71 void Layout::XmlEvent(QDomElement dom) {
     71void Layout::XmlEvent(QDomElement *dom) {
    7272  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();
    7878
    7979  // initially rowCount()=1 and columnCount()=1 but count()=0 !
     
    103103
    104104  if (type == "TabWidget") {
    105     int position = dom.attribute("position").toInt();
     105    int position = dom->attribute("position").toInt();
    106106    widget =
    107107        new TabWidget(this, row, col, name, (QTabWidget::TabPosition)position);
     
    114114  }
    115115  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();
    121121    widget = new SpinBox(this, row, col, name, suffix, value, min, max, step);
    122122  }
    123123  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();
    130130    widget = new DoubleSpinBox(this, row, col, name, suffix, value, min, max,
    131131                               step, decimals);
     
    133133  if (type == "Vector3DSpinBox") {
    134134    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();
    142142    widget = new Vector3DSpinBox(this, row, col, name, value, min, max, step,
    143143                                 decimals);
    144144  }
    145145  if (type == "CheckBox") {
    146     int value = dom.attribute("value").toInt();
     146    int value = dom->attribute("value").toInt();
    147147    widget = new CheckBox(this, row, col, name, value);
    148148  }
    149149  if (type == "ComboBox") {
    150     int value = dom.attribute("value").toInt();
     150    int value = dom->attribute("value").toInt();
    151151    widget = new ComboBox(this, row, col, name, value);
    152152  }
     
    155155  }
    156156  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();
    161161    if (enabled == 1) {
    162162      widget = new DataPlot1D(this, row, col, name, ymin, ymax, true, period);
     
    166166  }
    167167  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();
    176176    if (enabled == 1) {
    177177      widget = new DataPlot2D(this, row, col, name, x_name, y_name, xmin, xmax,
     
    183183  }
    184184  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();
    192192    if (enabled == 1) {
    193193      widget = new UsSensorPlot(this, row, col, name, y_name,
     
    199199  }
    200200  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();
    214214    bool invert_axis_bool;
    215215    if (invert_axis == 0) {
     
    231231  }
    232232  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();
    237237    if (enabled == 1) {
    238238      widget = new Picture(this, row, col, name, width, height, true, period);
     
    242242  }
    243243  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();
    246246    int i = 0;
    247247    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();
    252252      QtMobility::QGeoCoordinate coordinate =
    253253          QtMobility::QGeoCoordinate(latitude, longitude, alt);
     
    272272    QStringList items;
    273273    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));
    276276      items.append(item);
    277277      count++;
  • trunk/tools/FlairGCS/src/Layout.h

    r15 r269  
    2323private:
    2424  void Constructor(QString name);
    25   void XmlEvent(QDomElement dom);
     25  void XmlEvent(QDomElement *dom);
    2626  QGridLayout *qgridlayout;
    2727};
  • trunk/tools/FlairGCS/src/ListWidget.cpp

    r88 r269  
    5151}
    5252
    53 void ListWidget::XmlEvent(QDomElement dom) {
     53void ListWidget::XmlEvent(QDomElement *dom) {
    5454  isUpToDate = false;
    55   if (dom.attribute("item") != "") {
    56     QString item = dom.attribute("item");
     55  if (dom->attribute("item") != "") {
     56    QString item = dom->attribute("item");
    5757    QListWidgetItem *widget_item = new QListWidgetItem(item);
    5858    // new item, so the text is red
     
    6060    listwidget->addItem(widget_item);
    6161  }
    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();
    6464    RemoveItemFromXml(row_to_del);
    6565    QListWidgetItem *item_to_del = listwidget->takeItem(row_to_del);
     
    106106}
    107107
    108 void ListWidget::LoadEvent(QDomElement dom) {
     108void ListWidget::LoadEvent(QDomElement *dom) {
    109109  //function not tested
    110110  std::cout << "FlairGCS LoadEvent" << std::endl;
     
    114114    QStringList items;
    115115    int count = 0;
    116     while (dom.hasAttribute("item" + QString::number(count))) {
     116    while (dom->hasAttribute("item" + QString::number(count))) {
    117117      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)));
    119119      count++;
    120120    }
  • trunk/tools/FlairGCS/src/ListWidget.h

    r88 r269  
    7272   * \param[in]  dom   The dom containing the xml file.
    7373   */
    74   void XmlEvent(QDomElement dom);
     74  void XmlEvent(QDomElement *dom);
    7575  /**
    7676   * \brief      Reset the widget, load the internal parameters.
     
    8383   * \param[in]  dom   The dom containing the xml file.
    8484   */
    85   void LoadEvent(QDomElement dom);
     85  void LoadEvent(QDomElement *dom);
    8686  /**
    8787   * \brief      Save the user interface variables state in the internal members.
  • trunk/tools/FlairGCS/src/Manager.cpp

    r260 r269  
    319319                "," + QString::number(errorColumn) + ")");
    320320      } else {
    321         connections.at(i).layout->LoadXml(doc);
     321        connections.at(i).layout->LoadXml(&doc);
    322322      }
    323323      delete file;
  • trunk/tools/FlairGCS/src/Map.cpp

    r244 r269  
    272272}
    273273
    274 void Map::XmlEvent(QDomElement dom) {
    275   if (dom.attribute("point") != "") {
     274void Map::XmlEvent(QDomElement *dom) {
     275  if (dom->attribute("point") != "") {
    276276    receivesize += 3 * sizeof(double);
    277277    if (mapWidget->isEnabled()) {
    278278      Landmark *landmark = new Landmark(geoMap, QGeoCoordinate(0, 0, 0),
    279                                         dom.attribute("point"), "cross");
     279                                        dom->attribute("point"), "cross");
    280280      landmark->setColor(Qt::black);
    281281      points.append(landmark);
    282       mapWidget->AddPoint(dom.attribute("point"));
     282      mapWidget->AddPoint(dom->attribute("point"));
    283283    }
    284284  } else {
  • trunk/tools/FlairGCS/src/Map.h

    r67 r269  
    5656  void SetUptodate(void);
    5757  void Reset(void);
    58   void XmlEvent(QDomElement dom);
     58  void XmlEvent(QDomElement *dom);
    5959  void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
    6060
  • trunk/tools/FlairGCS/src/Picture.cpp

    r244 r269  
    9797}
    9898
    99 void Picture::XmlEvent(QDomElement dom) { XmlSetup(dom); }
     99void Picture::XmlEvent(QDomElement *dom) { XmlSetup(dom); }
  • trunk/tools/FlairGCS/src/Picture.h

    r15 r269  
    3838  bool eventFilter(QObject *, QEvent *);
    3939  void BufEvent(char **buf, int *buf_size, uint16_t period, bool big_endian);
    40   void XmlEvent(QDomElement dom);
     40  void XmlEvent(QDomElement *dom);
    4141};
    4242
  • trunk/tools/FlairGCS/src/RangeFinderPlot.cpp

    r244 r269  
    9797RangeFinderPlot::~RangeFinderPlot() { delete plot; }
    9898
    99 void RangeFinderPlot::XmlEvent(QDomElement dom) { XmlSetup(dom); }
     99void RangeFinderPlot::XmlEvent(QDomElement *dom) { XmlSetup(dom); }
    100100
    101101bool RangeFinderPlot::eventFilter(QObject *o, QEvent *e) {
  • trunk/tools/FlairGCS/src/RangeFinderPlot.h

    r15 r269  
    3434  void SetTriangle(uint32_t id, float length);
    3535  QwtPlot *plot;
    36   void XmlEvent(QDomElement dom);
     36  void XmlEvent(QDomElement *dom);
    3737  void alignScales(void);
    3838  float xmin_orig, xmax_orig, ymin_orig, ymax_orig;
  • trunk/tools/FlairGCS/src/SpinBox.cpp

    r15 r269  
    4040void SpinBox::Reset(void) { spinbox->setValue(spinbox_value); }
    4141
    42 void SpinBox::LoadEvent(QDomElement dom) {
     42void SpinBox::LoadEvent(QDomElement *dom) {
    4343  if (spinbox->isEnabled() == true) {
    44     spinbox->setValue((dom.attribute("value")).toInt());
     44    spinbox->setValue((dom->attribute("value")).toInt());
    4545  }
    4646}
  • trunk/tools/FlairGCS/src/SpinBox.h

    r15 r269  
    2424  void SetUptodate(void);
    2525  void Reset(void);
    26   void LoadEvent(QDomElement dom);
     26  void LoadEvent(QDomElement *dom);
    2727
    2828  void ui_to_var(void);
  • trunk/tools/FlairGCS/src/TabWidget.cpp

    r15 r269  
    2828TabWidget::~TabWidget() {}
    2929
    30 void TabWidget::XmlEvent(QDomElement dom) {
    31   QString type = dom.tagName();
    32   QString name = dom.attribute("name");
    33   int position = dom.attribute("position").toInt();
     30void TabWidget::XmlEvent(QDomElement *dom) {
     31  QString type = dom->tagName();
     32  QString name = dom->attribute("name");
     33  int position = dom->attribute("position").toInt();
    3434
    3535  if (type == "Tab") {
  • trunk/tools/FlairGCS/src/TabWidget.h

    r15 r269  
    2222private:
    2323  QTabWidget *tab;
    24   void XmlEvent(QDomElement dom);
     24  void XmlEvent(QDomElement *dom);
    2525};
    2626
  • trunk/tools/FlairGCS/src/TextEdit.cpp

    r15 r269  
    2929TextEdit::~TextEdit() {}
    3030
    31 void TextEdit::XmlEvent(QDomElement dom) {
    32   text->append(dom.attribute("value"));
     31void TextEdit::XmlEvent(QDomElement *dom) {
     32  text->append(dom->attribute("value"));
    3333}
  • trunk/tools/FlairGCS/src/TextEdit.h

    r15 r269  
    2222  QPushButton *clear;
    2323  QTextEdit *text;
    24   void XmlEvent(QDomElement dom);
     24  void XmlEvent(QDomElement *dom);
    2525};
    2626
  • trunk/tools/FlairGCS/src/UdtSocket.cpp

    r258 r269  
    6666// disconnection of ground station
    6767void UdtSocket::heartbeat(void) {
     68  //printf("h %s %i.%i\n",name.toLocal8Bit().constData(),QTime::currentTime().second(),QTime::currentTime().msec());
    6869  char data = WATCHDOG_HEADER;
    6970  quint64 sent=write(&data, 1,HEARTBEAT_TIMER,true);
     
    161162    } else if(readfds==socket && num==1 && rv==1) {
    162163      int size;
     164      QTime initTime;
     165      initTime.start();
    163166      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       
    164175        size=UDT::recvmsg(socket, buf, buf_size);
    165176     
  • trunk/tools/FlairGCS/src/UsSensorPlot.cpp

    r259 r269  
    131131}
    132132
    133 void UsSensorPlot::XmlEvent(QDomElement dom) {
     133void UsSensorPlot::XmlEvent(QDomElement *dom) {
    134134  XmlSetup(dom);
    135135}
  • trunk/tools/FlairGCS/src/UsSensorPlot.h

    r259 r269  
    3131private:
    3232  QwtPlot *plot;
    33   void XmlEvent(QDomElement dom);
     33  void XmlEvent(QDomElement *dom);
    3434  void alignScales(void);
    3535  float xmin_orig, xmax_orig, ymin_orig, ymax_orig;
  • trunk/tools/FlairGCS/src/Vector3DSpinBox.cpp

    r199 r269  
    146146}
    147147
    148 void Vector3DSpinBox::LoadEvent(QDomElement dom) {
     148void Vector3DSpinBox::LoadEvent(QDomElement *dom) {
    149149  if (doublespinbox[0].isEnabled()) {
    150     doublespinbox[0].setValue((dom.attribute("value_x")).toDouble());
     150    doublespinbox[0].setValue((dom->attribute("value_x")).toDouble());
    151151  }
    152152  if (doublespinbox[1].isEnabled()) {
    153     doublespinbox[1].setValue((dom.attribute("value_y")).toDouble());
     153    doublespinbox[1].setValue((dom->attribute("value_y")).toDouble());
    154154  }
    155155  if (doublespinbox[2].isEnabled()) {
    156     doublespinbox[2].setValue((dom.attribute("value_z")).toDouble());
     156    doublespinbox[2].setValue((dom->attribute("value_z")).toDouble());
    157157  }
    158158}
  • trunk/tools/FlairGCS/src/Vector3DSpinBox.h

    r15 r269  
    3232  void SetValues(QString value[3]);
    3333  void Reset(void);
    34   void LoadEvent(QDomElement dom);
     34  void LoadEvent(QDomElement *dom);
    3535  void ui_to_var(void);
    3636  void ui_to_xml(void);
  • trunk/tools/FlairGCS/src/XmlWidget.cpp

    r244 r269  
    8888}
    8989
    90 void XmlWidget::ParseXml(QDomElement to_parse) {
    91 
    92   if (to_parse.isNull())
     90void XmlWidget::ParseXml(QDomElement *to_parse) {
     91
     92  if (to_parse->isNull())
    9393    return;
    9494
    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");
    9797
    9898  // fprintf(stderr,"parse %s
     
    108108    // si on a une balise IsEnabled, on ne traite que ca
    109109    if (match->visible_widget != NULL) {
    110       if (to_parse.attribute("IsEnabled") == "0") {
     110      if (to_parse->attribute("IsEnabled") == "0") {
    111111        match->visible_widget->setEnabled(false);
    112112        return;
    113113      }
    114       if (to_parse.attribute("IsEnabled") == "1") {
     114      if (to_parse->attribute("IsEnabled") == "1") {
    115115        match->visible_widget->setEnabled(true);
    116116        return;
     
    119119
    120120    // 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") {
    122122      // fprintf(stderr,"delete flag\n");
    123123      if (match->isContainer == true && match->childs->count() != 0) {
     
    131131    }
    132132
    133     if (to_parse.firstChild().isNull() == true &&
     133    if (to_parse->firstChild().isNull() == true &&
    134134        match->isExpandable == false) {
    135135      QString new_name;
     
    148148      }
    149149      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);
    152152
    153153      XmlEvent(to_parse);
     
    155155      // return -1;//ou retourner le xml a renvoyer pour chager de nom
    156156    } else {
    157       if (to_parse.firstChild().toElement().isNull()) {
     157      if (to_parse->firstChild().toElement().isNull()) {
    158158        match->XmlEvent(to_parse);
    159159        return;
    160160      } 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
     168void XmlWidget::LoadXml(QDomElement *to_parse) {
     169  if (to_parse->isNull())
    169170    return;
    170171
    171172  LoadEvent(to_parse);
    172173
    173   QDomElement elem = to_parse.firstChild().toElement();
     174  QDomElement elem = to_parse->firstChild().toElement();
    174175
    175176  while (!elem.isNull()) {
     
    184185    if (match != NULL) {
    185186      // fprintf(stderr,"match\n");
    186       match->LoadXml(elem);
     187      match->LoadXml(&elem);
    187188    }
    188189    elem = elem.nextSibling().toElement();
  • trunk/tools/FlairGCS/src/XmlWidget.h

    r67 r269  
    2121  ~XmlWidget();
    2222  QDomDocument XmlDoc(void);
    23   void ParseXml(QDomElement to_parse);
     23  void ParseXml(QDomElement *to_parse);
    2424  void GetFullXml(QDomElement *doc);
    2525  void GetUpdateXml(QDomElement *doc);
    2626  void ResetAllChilds(void);
    2727  virtual bool IsUptodate(void) { return true; };
    28   void LoadXml(QDomElement to_parse);
     28  void LoadXml(QDomElement *to_parse);
    2929  void RenamedFrom(QString old_name);
    3030  QString Name(void);
     
    5151  void SetIsContainer(bool status);
    5252  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){};
    5555  QDomElement *AddXmlChild(QString type);
    5656  void RemoveXmlChild(QDomElement *element);
Note: See TracChangeset for help on using the changeset viewer.