Browse Source

Started populating the Combobox in HIL sim with the available Links

QGC4.4
Mariano Lizarraga 15 years ago
parent
commit
91f2d433c9
  1. 15
      src/ui/slugshilsim.cc
  2. 9
      src/ui/slugshilsim.h
  3. 12
      src/ui/slugshilsim.ui

15
src/ui/slugshilsim.cc

@ -1,14 +1,29 @@ @@ -1,14 +1,29 @@
#include "slugshilsim.h"
#include "ui_slugshilsim.h"
#include "LinkManager.h"
SlugsHilSim::SlugsHilSim(QWidget *parent) :
QWidget(parent),
ui(new Ui::SlugsHilSim)
{
ui->setupUi(this);
linkAdded();
}
SlugsHilSim::~SlugsHilSim()
{
delete ui;
}
void SlugsHilSim::linkAdded(void){
ui->cb_mavlinkLinks->clear();
QList<LinkInterface *> linkList = LinkManager::instance()->getLinks() ;
for (int i = 0; i< linkList.size(); i++){
ui->cb_mavlinkLinks->addItem((linkList.takeFirst())->getName());
}
}

9
src/ui/slugshilsim.h

@ -2,9 +2,11 @@ @@ -2,9 +2,11 @@
#define SLUGSHILSIM_H
#include <QWidget>
#include <QHostAddress>
#include <QUdpSocket>
#include "LinkInterface.h"
namespace Ui {
class SlugsHilSim;
}
@ -19,6 +21,11 @@ public: @@ -19,6 +21,11 @@ public:
protected:
LinkInterface* hilLink;
QHostAddress* simulinkIp;
QUdpSocket* txSocket;
QUdpSocket* rxSocket;
slots:
private:
Ui::SlugsHilSim *ui;

12
src/ui/slugshilsim.ui

@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_3">
<widget class="QLineEdit" name="ed_ipAdress">
<property name="minimumSize">
<size>
<width>60</width>
@ -99,7 +99,7 @@ @@ -99,7 +99,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit">
<widget class="QLineEdit" name="ed_rxPort">
<property name="minimumSize">
<size>
<width>60</width>
@ -132,7 +132,7 @@ @@ -132,7 +132,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_2">
<widget class="QLineEdit" name="ed_TxPort">
<property name="minimumSize">
<size>
<width>60</width>
@ -179,12 +179,12 @@ @@ -179,12 +179,12 @@
<enum>Qt::RightToLeft</enum>
</property>
<property name="text">
<string>Slugs HIL Sim Serial Port</string>
<string>Slugs HIL Sim Serial Link</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox"/>
<widget class="QComboBox" name="cb_mavlinkLinks"/>
</item>
</layout>
</item>
@ -204,7 +204,7 @@ @@ -204,7 +204,7 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<widget class="QPushButton" name="bt_startHil">
<property name="text">
<string>Set in HIL Mode</string>
</property>

Loading…
Cancel
Save