/QMK-Groundstation/trunk/Forms/dlg_Preferences.cpp |
---|
35,6 → 35,13 |
sp_Plotter_Count->setValue(Settings->Data.Plotter_Count); |
sp_Debug_Fast->setValue(Settings->Data.Debug_Fast); |
sp_Debug_Slow->setValue(Settings->Data.Debug_Slow); |
sp_Debug_Off->setValue(Settings->Data.Debug_Off); |
sp_Navi_Fast->setValue(Settings->Data.Navi_Fast); |
sp_Navi_Slow->setValue(Settings->Data.Navi_Slow); |
sp_Navi_Off->setValue(Settings->Data.Navi_Off); |
le_ServerPort->setText(Settings->Server.Port); |
cb_StartServer->setChecked(Settings->Server.StartServer); |
cb_ToGround->setChecked(Settings->Server.ToGround); |
} |
cSettings *dlg_Preferences::get_Settings() |
43,6 → 50,13 |
Settings->Data.Plotter_Count = sp_Plotter_Count->value(); |
Settings->Data.Debug_Fast = sp_Debug_Fast->value(); |
Settings->Data.Debug_Slow = sp_Debug_Slow->value(); |
Settings->Data.Debug_Off = sp_Debug_Off->value(); |
Settings->Data.Navi_Fast = sp_Navi_Fast->value(); |
Settings->Data.Navi_Slow = sp_Navi_Slow->value(); |
Settings->Data.Navi_Off = sp_Navi_Off->value(); |
Settings->Server.Port = le_ServerPort->text(); |
Settings->Server.StartServer = cb_StartServer->isChecked(); |
Settings->Server.ToGround = cb_ToGround->isChecked(); |
return Settings; |
} |
/QMK-Groundstation/trunk/Forms/dlg_Preferences.ui |
---|
6,7 → 6,7 |
<x>0</x> |
<y>0</y> |
<width>402</width> |
<height>296</height> |
<height>298</height> |
</rect> |
</property> |
<property name="windowTitle" > |
170,7 → 170,7 |
<string>Debug-Daten</string> |
</attribute> |
<layout class="QGridLayout" name="gridLayout_3" > |
<item row="0" column="0" > |
<item row="0" column="0" colspan="2" > |
<widget class="QGroupBox" name="groupBox" > |
<property name="title" > |
<string>Debug-Daten intervall</string> |
183,7 → 183,7 |
</property> |
</widget> |
</item> |
<item row="0" column="1" > |
<item row="0" column="3" > |
<widget class="QSpinBox" name="sp_Debug_Slow" > |
<property name="suffix" > |
<string> ms</string> |
202,7 → 202,7 |
</property> |
</widget> |
</item> |
<item row="1" column="0" > |
<item rowspan="2" row="1" column="0" > |
<widget class="QLabel" name="label_2" > |
<property name="text" > |
<string>Intervall schnell :</string> |
209,7 → 209,7 |
</property> |
</widget> |
</item> |
<item row="1" column="1" > |
<item rowspan="2" row="1" column="3" > |
<widget class="QSpinBox" name="sp_Debug_Fast" > |
<property name="suffix" > |
<string> ms</string> |
231,20 → 231,39 |
</property> |
</widget> |
</item> |
<item row="2" column="0" colspan="2" > |
<widget class="QCheckBox" name="checkBox" > |
<property name="enabled" > |
<bool>false</bool> |
</property> |
<item row="3" column="0" > |
<widget class="QLabel" name="label_10" > |
<property name="text" > |
<string>Beim Beenden abschalten</string> |
<string>Intervall offline :</string> |
</property> |
</widget> |
</item> |
<item row="3" column="3" > |
<widget class="QSpinBox" name="sp_Debug_Off" > |
<property name="suffix" > |
<string> ms</string> |
</property> |
<property name="prefix" > |
<string/> |
</property> |
<property name="minimum" > |
<number>10</number> |
</property> |
<property name="maximum" > |
<number>2550</number> |
</property> |
<property name="singleStep" > |
<number>10</number> |
</property> |
<property name="value" > |
<number>1000</number> |
</property> |
</widget> |
</item> |
</layout> |
</widget> |
</item> |
<item row="1" column="0" > |
<item row="1" column="0" colspan="2" > |
<widget class="QGroupBox" name="groupBox_2" > |
<property name="title" > |
<string>Plotter</string> |
276,7 → 295,7 |
</layout> |
</widget> |
</item> |
<item row="2" column="0" > |
<item row="2" column="0" colspan="2" > |
<spacer name="verticalSpacer_4" > |
<property name="orientation" > |
<enum>Qt::Vertical</enum> |
298,6 → 317,9 |
<layout class="QGridLayout" name="gridLayout_11" > |
<item row="0" column="0" > |
<widget class="QGroupBox" name="groupBox_9" > |
<property name="enabled" > |
<bool>false</bool> |
</property> |
<property name="title" > |
<string>Navi-Daten Intervall</string> |
</property> |
310,7 → 332,7 |
</widget> |
</item> |
<item row="0" column="1" > |
<widget class="QSpinBox" name="sp_Debug_Slow_2" > |
<widget class="QSpinBox" name="sp_Navi_Slow" > |
<property name="suffix" > |
<string> ms</string> |
</property> |
336,7 → 358,7 |
</widget> |
</item> |
<item row="1" column="1" > |
<widget class="QSpinBox" name="sp_Debug_Fast_2" > |
<widget class="QSpinBox" name="sp_Navi_Fast" > |
<property name="suffix" > |
<string> ms</string> |
</property> |
357,16 → 379,35 |
</property> |
</widget> |
</item> |
<item row="2" column="0" colspan="2" > |
<widget class="QCheckBox" name="checkBox_5" > |
<property name="enabled" > |
<bool>false</bool> |
</property> |
<item row="2" column="0" > |
<widget class="QLabel" name="label_11" > |
<property name="text" > |
<string>Beim Beenden abschalten</string> |
<string>Intervall offline :</string> |
</property> |
</widget> |
</item> |
<item row="2" column="1" > |
<widget class="QSpinBox" name="sp_Navi_Off" > |
<property name="suffix" > |
<string> ms</string> |
</property> |
<property name="prefix" > |
<string/> |
</property> |
<property name="minimum" > |
<number>10</number> |
</property> |
<property name="maximum" > |
<number>2550</number> |
</property> |
<property name="singleStep" > |
<number>10</number> |
</property> |
<property name="value" > |
<number>250</number> |
</property> |
</widget> |
</item> |
</layout> |
</widget> |
</item> |
470,7 → 511,7 |
</widget> |
</item> |
<item row="0" column="1" > |
<widget class="QLineEdit" name="lineEdit" > |
<widget class="QLineEdit" name="le_ServerPort" > |
<property name="text" > |
<string>10664</string> |
</property> |
477,7 → 518,7 |
</widget> |
</item> |
<item row="1" column="0" colspan="2" > |
<widget class="QCheckBox" name="checkBox_3" > |
<widget class="QCheckBox" name="cb_StartServer" > |
<property name="text" > |
<string>Google Earth Server automatisch starten</string> |
</property> |
493,7 → 534,7 |
</property> |
<layout class="QGridLayout" name="gridLayout_9" > |
<item row="0" column="0" > |
<widget class="QCheckBox" name="checkBox_4" > |
<widget class="QCheckBox" name="cb_ToGround" > |
<property name="text" > |
<string>Höhe bis zum Boden verlängern</string> |
</property> |
/QMK-Groundstation/trunk/Forms/mktool.cpp |
---|
25,6 → 25,7 |
#include <QIcon> |
#include <QToolButton> |
#include <QSpinBox> |
#include <QAction> |
#include "mktool.h" |
#include "dlg_Config.h" |
42,7 → 43,6 |
Settings = new cSettings; |
init_Arrays(); |
init_Icons(); |
init_GUI(); |
init_Objects(); |
57,16 → 57,13 |
// Tab mit Debug-Elementen verbergen |
tab_Main->removeTab(5); |
// tab_Main->removeTab(2); |
// Settings-Tab hinzufügen. |
f_Settings = new wdg_Settings( this ); |
tab_Main->insertTab ( 2, f_Settings, "Parameter"); |
tab_Main->insertTab ( 2, f_Settings, "FC-Settings"); |
tab_Main->widget(2)->setObjectName("Tab_2"); |
// Develop - Nicht gebrauchte sachen abschalten. |
ac_StartServer->setVisible(false); |
box_Flugdaten->hide(); |
box_System->hide(); |
pb_SettingsReset->hide(); |
77,10 → 74,14 |
toolBar->addWidget(lb_Port); |
toolBar->addWidget(le_Port); |
toolBar->addSeparator(); |
// toolBar->addWidget(cb_Hardware); |
lb_Status->setText("Hallo bei QMK-Groundstation...!!!"); |
toolBar->addWidget(rb_SelFC); |
toolBar->addWidget(rb_SelNC); |
toolBar->addWidget(rb_SelMag); |
lb_Status->setText(tr("Hallo bei QMK-Groundstation...!!!")); |
#ifdef _EEEPC_ |
toolBar->hide(); |
lb_Status->hide(); |
94,16 → 95,19 |
showMaximized(); |
} |
// Analoglabels anzeigen |
for (int a = 0; a < MaxAnalog; a++) |
{ |
lb_Analog[a]->setText(Settings->Analog1.Label[a]); |
} |
// Kopie der Tabs anlegen |
for (int b = 0; b < 6; b++) |
{ |
TabWidgets[b] = tab_Main->widget(b); |
} |
// Ausgeblendete Tabs ausblenden |
for (int c = 0; c < 6; c++) |
{ |
if (Settings->GUI.TabViews[c] == false) |
137,7 → 141,7 |
void MKTool::init_Objects() |
{ |
// QTimer-Instanzen |
Ticker = new QTimer(this); |
Ticker = new QTimer(this); |
// Seriell-Port |
serialPort = new ManageSerialPort; |
145,17 → 149,31 |
// QFile-Instanz (Log-Datei) |
CSVFile = new QFile(""); |
// Senden erlauben (Warum auch immer) |
AllowSend = true; |
Server = new cServer(); |
if (Settings->Server.StartServer) |
{ |
ac_StartServer->setChecked(true); |
Server->start_Server(Settings->Server.Port.toInt(), Settings); |
} |
} |
void MKTool::init_Connections() |
{ |
connect(Dec, SIGNAL(clicked()), this, SLOT(slot_Test())); |
// Seriel-Port Empfang |
connect(serialPort, SIGNAL(newDataReceived(const QByteArray &)), this, SLOT(slot_newDataReceived(const QByteArray &))); |
// Serielle Verbundung öffnen / schließen |
connect(ac_ConnectTTY, SIGNAL(triggered()), this, SLOT(slot_OpenPort())); |
// Buttons Settings lesen / schreiben |
connect(f_Settings->pb_Read, SIGNAL(clicked()), this, SLOT(slot_GetParameter())); |
connect(f_Settings->pb_Write, SIGNAL(clicked()), this, SLOT(slot_SetParameter())); |
connect(f_Settings->pb_Read, SIGNAL(clicked()), this, SLOT(slot_GetFCSettings())); |
connect(f_Settings->pb_Write, SIGNAL(clicked()), this, SLOT(slot_SetFCSettings())); |
// LCD auf / ab |
connect(pb_LCDup, SIGNAL(clicked()), this, SLOT(slot_LCD_UP())); |
165,13 → 183,16 |
connect(ac_Config, SIGNAL(triggered()), this, SLOT(slot_ac_Config())); |
connect(ac_Preferences, SIGNAL(triggered()), this, SLOT(slot_ac_Preferences())); |
connect(ac_Motortest, SIGNAL(triggered()), this, SLOT(slot_ac_Motortest())); |
connect(ac_MehrDaten, SIGNAL(triggered()), this, SLOT(slot_ac_MehrDaten())); |
connect(ac_KeineDaten, SIGNAL(triggered()), this, SLOT(slot_ac_KeineDaten())); |
connect(ac_FastDebug, SIGNAL(triggered()), this, SLOT(slot_ac_FastDebug())); |
connect(ac_NoDebug, SIGNAL(triggered()), this, SLOT(slot_ac_NoDebug())); |
connect(ac_FastNavi, SIGNAL(triggered()), this, SLOT(slot_ac_FastNavi())); |
connect(ac_NoNavi, SIGNAL(triggered()), this, SLOT(slot_ac_NoNavi())); |
connect(ac_GetLabels, SIGNAL(triggered()), this, SLOT(slot_ac_GetLabels())); |
// Plotter starten / scrollen |
connect(scroll_plot, SIGNAL(valueChanged(int)), this, SLOT(slot_ScrollPlot(int))); |
connect(ac_StartPlotter, SIGNAL(triggered()), this, SLOT(slot_ac_StartPlotter())); |
connect(ac_StartServer, SIGNAL(triggered()), this, SLOT(slot_ac_StartServer())); |
// Tabs ein & ausblenden |
connect(ac_View0, SIGNAL(triggered()), this, SLOT(slot_ac_View())); |
181,13 → 202,18 |
connect(ac_View4, SIGNAL(triggered()), this, SLOT(slot_ac_View())); |
connect(ac_View5, SIGNAL(triggered()), this, SLOT(slot_ac_View())); |
connect(ac_SelNC, SIGNAL(triggered()), this, SLOT(slot_ac_Hardware())); |
connect(ac_SelFC, SIGNAL(triggered()), this, SLOT(slot_ac_Hardware())); |
connect(ac_SelMag, SIGNAL(triggered()), this, SLOT(slot_ac_Hardware())); |
connect(rb_SelNC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware())); |
connect(rb_SelFC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware())); |
connect(rb_SelMag, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware())); |
// firmeware Updateen / flashen |
connect(pb_Update, SIGNAL(clicked()), this, SLOT(slot_pb_Update())); |
connect(pb_Update, SIGNAL(clicked()), this, SLOT(slot_pb_Update())); |
connect(pb_HexFile, SIGNAL(clicked()), this, SLOT(slot_pb_HexFile())); |
// Serielle Verbundung öffnen / schließen |
connect(ac_ConnectTTY, SIGNAL(triggered()), this, SLOT(slot_OpenPort())); |
// CVS-Record starten / stoppen |
connect(ac_RecordCSV, SIGNAL(triggered()), this, SLOT(slot_RecordCSV())); |
195,7 → 221,7 |
connect(Ticker, SIGNAL(timeout()), SLOT(slot_Ticker())); |
// Seitenwechsel |
connect(tab_Main, SIGNAL(currentChanged(int)), this, SLOT(slot_TabChanged(int))); |
connect(tab_Main, SIGNAL(currentChanged(int)), this, SLOT(slot_TabChanged(int))); |
connect(f_Settings->tab_Par, SIGNAL(currentChanged(int)), this, SLOT(slot_TabChanged(int))); |
// About QMK & About-QT Dialog einfügen |
266,31 → 292,76 |
qwtPlot->replot(); |
} |
void MKTool::init_Icons() |
void MKTool::slot_Test() |
{ |
Icons[0].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledred.png")), QIcon::Normal, QIcon::Off); |
Icons[1].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
Icons[3].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
Icons[4].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledoff.png")), QIcon::Normal, QIcon::Off); |
sRxData RX; |
Icons[5].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/application-exit.png")), QIcon::Normal, QIcon::Off); |
Icons[6].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/media-playback-stop.png")), QIcon::Normal, QIcon::Off); |
Icons[7].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/media-record.png")), QIcon::Normal, QIcon::Off); |
Icons[8].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/network-connect.png")), QIcon::Normal, QIcon::Off); |
Icons[9].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/network-disconnect.png")), QIcon::Normal, QIcon::Off); |
Icons[10].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/utilities-system-monitor.png")), QIcon::Normal, QIcon::Off); |
RX.String = IN->text(); |
RX.Input = IN->text().toLatin1().data(); |
Icons[20].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-up-double.png")), QIcon::Normal, QIcon::Off); |
Icons[21].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-up.png")), QIcon::Normal, QIcon::Off); |
Icons[22].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-down-double.png")), QIcon::Normal, QIcon::Off); |
Icons[23].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-down.png")), QIcon::Normal, QIcon::Off); |
Icons[24].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-left-double.png")), QIcon::Normal, QIcon::Off); |
Icons[25].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-left.png")), QIcon::Normal, QIcon::Off); |
Icons[26].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-right-double.png")), QIcon::Normal, QIcon::Off); |
Icons[27].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-right.png")), QIcon::Normal, QIcon::Off); |
new_RXData(RX); |
} |
void MKTool::slot_ac_Hardware() |
{ |
QAction *Action = (QAction*)sender(); |
if (Action->isChecked() == false) |
{ |
Action->setChecked(true); |
} |
slot_rb_Hardware(); |
// qDebug("Select AC Hardware"); |
} |
void MKTool::slot_rb_Hardware() |
{ |
if ((rb_SelNC->isChecked() == false) && (Mode.ID != ADDRESS_NC)) |
{ |
lb_Status->setText(tr("Schalte um auf NaviCtrl.")); |
TX_Data[0] = 0x1B; |
TX_Data[1] = 0x1B; |
TX_Data[2] = 0x55; |
TX_Data[3] = 0xAA; |
TX_Data[4] = 0x00; |
TX_Data[5] = '\r'; |
send_Data('#', ADDRESS_NC, TX_Data, 6, false); |
usleep(Sleep); |
} |
if (rb_SelFC->isChecked()) |
{ |
lb_Status->setText(tr("Schalte um auf FlightCtrl.")); |
TX_Data[0] = 0; |
send_Data('u', ADDRESS_NC, TX_Data, 1, false); |
} |
else |
if (rb_SelMag->isChecked()) |
{ |
lb_Status->setText(tr("Schalte um auf MK3MAG.")); |
TX_Data[0] = 1; |
send_Data('u', ADDRESS_NC, TX_Data, 1, false); |
} |
else |
if (rb_SelNC->isChecked()) |
{ |
lb_Status->setText(tr("Schalte um auf NaviCtrl.")); |
TX_Data[0] = 0x1B; |
TX_Data[1] = 0x1B; |
TX_Data[2] = 0x55; |
TX_Data[3] = 0xAA; |
TX_Data[4] = 0x00; |
TX_Data[5] = '\r'; |
send_Data('#', ADDRESS_NC, TX_Data, 6, false); |
} |
usleep(Sleep); |
// qDebug("Select RB Hardware"); |
send_Data('v', ADDRESS_ALL, TX_Data, 0, true); |
} |
// Ticker-Event |
/////////////// |
void MKTool::slot_Ticker() |
326,7 → 397,7 |
} |
break; |
case 3 : |
if (ac_MehrDaten->isChecked()) |
if (ac_FastDebug->isChecked()) |
{ |
TX_Data[0] = Settings->Data.Debug_Fast / 10; |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
418,11 → 489,13 |
{ |
if (ac_StartPlotter->isChecked()) |
{ |
lb_Status->setText(tr("Datenplotter gestartet.")); |
ac_StartPlotter->setText("Stop Plotter"); |
pb_StartPlotter->setText("Stop Plotter"); |
} |
else |
{ |
lb_Status->setText(tr("Datenplotter gestopt.")); |
ac_StartPlotter->setText("Start Plotter"); |
pb_StartPlotter->setText("Start Plotter"); |
} |
468,30 → 541,72 |
} |
} |
void MKTool::slot_ac_MehrDaten() // DONE 0.71g |
void MKTool::slot_ac_FastNavi() // DONE NC 0.12i |
{ |
if (!ac_KeineDaten->isChecked()) |
if (!ac_NoNavi->isChecked()) |
{ |
if (ac_MehrDaten->isChecked()) |
if (ac_FastNavi->isChecked()) |
{ |
lb_Status->setText(tr("Fordere schnelle NaviDaten an.")); |
TX_Data[0] = Settings->Data.Navi_Fast / 10; |
} |
else |
{ |
lb_Status->setText(tr("Fordere langsame NaviDaten an.")); |
TX_Data[0] = Settings->Data.Navi_Slow / 10; |
} |
send_Data('o', ADDRESS_NC, TX_Data, 1, false); |
} |
} |
void MKTool::slot_ac_NoNavi() // DONE NC 0.12i |
{ |
if (ac_NoNavi->isChecked()) |
{ |
lb_Status->setText(tr("NaviDaten abstellen.")); |
TX_Data[0] = 0; |
} |
else |
{ |
if (ac_FastNavi->isChecked()) |
{ |
lb_Status->setText(tr("Fordere schnelle NaviDaten an.")); |
TX_Data[0] = Settings->Data.Navi_Fast / 10; |
} |
else |
{ |
lb_Status->setText(tr("Fordere langsame NaviDaten an.")); |
TX_Data[0] = Settings->Data.Navi_Slow / 10; |
} |
} |
send_Data('o', ADDRESS_NC, TX_Data, 1, false); |
} |
void MKTool::slot_ac_FastDebug() // DONE 0.71g |
{ |
if (!ac_NoDebug->isChecked()) |
{ |
if (ac_FastDebug->isChecked()) |
{ |
lb_Status->setText(tr("Fordere schnelle DebugDaten an.")); |
TX_Data[0] = Settings->Data.Debug_Fast / 10; |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
else |
{ |
lb_Status->setText(tr("Fordere langsame DebugDaten an.")); |
TX_Data[0] = Settings->Data.Debug_Slow / 10; |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
} |
void MKTool::slot_ac_KeineDaten() // DONE 0.71g |
void MKTool::slot_ac_NoDebug() // DONE 0.71g |
{ |
if (ac_KeineDaten->isChecked()) |
if (ac_NoDebug->isChecked()) |
{ |
lb_Status->setText(tr("DebugDaten abstellen.")); |
TickerEvent[3] = false; |
TX_Data[0] = 0; |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
else |
{ |
499,17 → 614,18 |
if (Mode.ID == ADDRESS_MK3MAG) |
TickerEvent[3] = true; |
if (ac_MehrDaten->isChecked()) |
if (ac_FastDebug->isChecked()) |
{ |
lb_Status->setText(tr("Fordere schnelle DebugDaten an.")); |
TX_Data[0] = Settings->Data.Debug_Fast / 10; |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
else |
{ |
lb_Status->setText(tr("Fordere langsame DebugDaten an.")); |
TX_Data[0] = Settings->Data.Debug_Slow / 10; |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
} |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
} |
void MKTool::slot_ac_About() |
519,10 → 635,24 |
void MKTool::slot_ac_GetLabels() // DONE 0.71g |
{ |
lb_Status->setText(tr("Analoglabels auslesen.")); |
TX_Data[0] = 0; |
send_Data('a', ADDRESS_ALL, TX_Data, 1, true); |
} |
void MKTool::slot_ac_StartServer() |
{ |
if (ac_StartServer->isChecked()) |
{ |
lb_Status->setText(tr("GoogleEarth-Server gestartet.")); |
Server->start_Server(Settings->Server.Port.toInt(), Settings); |
} |
else |
{ |
lb_Status->setText(tr("GoogleEarth-Server gestopt.")); |
Server->stop_Server(); |
} |
} |
// Daten-Plotter |
///////////////// |
724,32 → 854,20 |
} |
// Settings aus MK lesen / in MK schreiben |
void MKTool::slot_GetParameter() // DONE 0.71g |
void MKTool::slot_GetFCSettings() // DONE 0.71g |
{ |
lb_Status->setText(tr("Lese FlightCtrl-Settings aus.")); |
TX_Data[0] = f_Settings->sb_Set->value(); |
TX_Data[1] = 0; |
send_Data('q', ADDRESS_FC, TX_Data, 1); |
} |
void MKTool::slot_SetParameter() // DONE 0.71g |
void MKTool::slot_SetFCSettings() // DONE 0.71g |
{ |
// store_ParameterSet(sb_Set->value()); |
/* |
char *TX_Data2 = f_Settings->GetFCSettings(); |
lb_Status->setText(tr("Schreibe FlightCtrl-Settings.")); |
TX_Data[0] = sb_Set->value(); |
TX_Data[1] = VERSION_SETTINGS; |
for (int a = 0; a < MaxParameter; a++) |
{ |
TX_Data[a + 2] = ParameterSet[sb_Set->value()][a]; |
} |
// store_ParameterSet(sb_Set->value()); |
*/ |
char *TX_Data2 = f_Settings->SetParameter(); |
send_Data('s', ADDRESS_FC, TX_Data2, MaxParameter + 2, false); |
} |
797,7 → 915,7 |
void MKTool::slot_RecordCSV() // DONE 0.71g |
{ |
if (!CSVFile->isOpen()) |
{ |
{ |
QString Filename = Settings->DIR.Logging + Mode.Hardware + " - " + QDate::currentDate().toString(("yyyy-MM-dd")) + " -- " + QTime::currentTime().toString("hh-mm") + ".csv"; |
CSVFile = new QFile(Filename); |
824,18 → 942,20 |
CSVFile->open(QIODevice::Append | QIODevice::Text); |
} |
pb_Record->setIcon(Icons[6]); |
pb_Record->setIcon(ToolBox::Icon(6)); |
pb_Record->setText("CSV Stop"); |
ac_RecordCSV->setIcon(Icons[6]); |
ac_RecordCSV->setIcon(ToolBox::Icon(6)); |
ac_RecordCSV->setText("CSV Stop"); |
lb_Status->setText(tr("CVS-Record gestartet.")); |
} |
else |
{ |
CSVFile->close(); |
pb_Record->setIcon(Icons[7]); |
pb_Record->setIcon(ToolBox::Icon(7)); |
pb_Record->setText("CSV Aufzeichnen"); |
ac_RecordCSV->setIcon(Icons[7]); |
ac_RecordCSV->setIcon(ToolBox::Icon(7)); |
ac_RecordCSV->setText("CSV Aufzeichnen"); |
lb_Status->setText(tr("CVS-Record gestopt.")); |
} |
} |
895,6 → 1015,30 |
} |
void MKTool::new_NaviData(sRxData RX) |
{ |
Navi.Current.Longitude = ToolBox::Data2Long(RX.Decode, 0, true); |
Navi.Current.Latitude = ToolBox::Data2Long(RX.Decode, 4, true); |
Navi.Current.Altitude = ToolBox::Data2Long(RX.Decode, 8, true); |
Navi.Target.Longitude = ToolBox::Data2Long(RX.Decode, 10, true); |
Navi.Target.Latitude = ToolBox::Data2Long(RX.Decode, 14, true); |
Navi.Target.Altitude = ToolBox::Data2Long(RX.Decode, 18, true); |
sNaviString NaviString; |
NaviString.Longitude = ToolBox::get_Float(Navi.Current.Longitude,10000000); |
NaviString.Latitude = ToolBox::get_Float(Navi.Current.Latitude,10000000); |
NaviString.Altitude = ToolBox::get_Float(Navi.Current.Altitude,1000); |
Server->store_NaviString(NaviString); |
/* |
qDebug(NaviString.Longitude.toLatin1().data()); |
qDebug(NaviString.Latitude.toLatin1().data()); |
qDebug(NaviString.Altitude.toLatin1().data()); |
*/ |
} |
// Seriel-Port Bereich, Befehle senden und Daten empfangen |
////////////////////////////////////////////////////////// |
938,10 → 1082,12 |
int Settings_ID = RX.Decode[0]; |
for (int a = 0; a < MaxParameter; a++) |
{ |
ParameterSet[Settings_ID][a] = RX.Decode[a + 2]; |
FCSettings[a] = RX.Decode[a + 2]; |
} |
//show_ParameterSet(Settings_ID); |
f_Settings->show_ParameterSet(Settings_ID, ParameterSet); |
f_Settings->show_FCSettings(Settings_ID, FCSettings); |
f_Settings->pb_Read->setEnabled(true); |
f_Settings->pb_Write->setEnabled(true); |
} |
else |
{ |
966,6 → 1112,7 |
case 'O' : // NOT DONE 0.12h |
if (ToolBox::Decode64(RX)) |
{ |
new_NaviData(RX); |
} |
break; |
} |
1056,18 → 1203,56 |
"Serielles Protokoll Inkompatibel. \nBitte neue Programmversion installieren,", QMessageBox::Ok); |
} |
if (ac_NoDebug->isChecked()) |
{ |
TX_Data[0] = 0; |
} |
else |
if (ac_FastDebug->isChecked()) |
{ |
TX_Data[0] = Settings->Data.Debug_Fast / 10; |
} |
else |
{ |
TX_Data[0] = Settings->Data.Debug_Slow / 10; |
} |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
// Wenn MK3MAG dann andauernd Daten neu anfragen. |
if (Mode.ID == ADDRESS_MK3MAG) |
{ |
TickerEvent[3] = true; |
rb_SelMag->setChecked(true); |
} |
TX_Data[0] = Settings->Data.Debug_Slow / 10; |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
// Wenn NaviCtrl dann hier. |
if (Mode.ID == ADDRESS_NC) |
{ |
rb_SelNC->setChecked(true); |
if (ac_NoNavi->isChecked()) |
{ |
TX_Data[0] = 0; |
} |
else |
if (ac_FastNavi->isChecked()) |
{ |
TX_Data[0] = Settings->Data.Navi_Fast / 10; |
} |
else |
{ |
TX_Data[0] = Settings->Data.Navi_Slow / 10; |
} |
send_Data('o', ADDRESS_NC, TX_Data, 1, false); |
} |
// Wenn FlightCtrl dann Settings abfragen. |
if (Mode.ID == ADDRESS_FC) |
{ |
rb_SelFC->setChecked(true); |
{ |
TX_Data[0] = 0xff; |
TX_Data[1] = 0; |
1155,18 → 1340,34 |
{ |
if (serialPort->isOpen()) |
{ |
TX_Data[0] = 0; |
TX_Data[1] = 0; |
TX_Data[2] = 0; |
TX_Data[3] = 0; |
send_Data('t', ADDRESS_FC, TX_Data, 4, false); |
TX_Data[0] = Settings->Data.Debug_Off / 10; |
send_Data('d', ADDRESS_ALL, TX_Data, 1, false); |
usleep(Sleep); |
if (Mode.ID == ADDRESS_NC) |
{ |
TX_Data[0] = Settings->Data.Navi_Off / 10; |
send_Data('o', ADDRESS_NC, TX_Data, 1, false); |
usleep(Sleep); |
} |
if (Mode.ID == ADDRESS_NC) |
{ |
TX_Data[0] = 0; |
TX_Data[1] = 0; |
TX_Data[2] = 0; |
TX_Data[3] = 0; |
send_Data('t', ADDRESS_FC, TX_Data, 4, false); |
usleep(Sleep); |
} |
serialPort->close(); |
pb_Open->setText("Verbinden"); |
ac_ConnectTTY->setText("Verbinden"); |
pb_Open->setIcon(Icons[9]); |
ac_ConnectTTY->setIcon(Icons[9]); |
pb_Open->setIcon(ToolBox::Icon(9)); |
ac_ConnectTTY->setIcon(ToolBox::Icon(9)); |
le_Port->setEnabled(true); |
Ticker->stop(); |
} |
else |
1186,6 → 1387,7 |
serialPort->open(); |
if (serialPort->isOpen()) |
{ |
le_Port->setEnabled(false); |
serialPort->receiveData(); |
send_Data('v', ADDRESS_ALL, TX_Data, 0, true); |
1192,8 → 1394,8 |
pb_Open->setText("Trennen"); |
ac_ConnectTTY->setText("Trennen"); |
pb_Open->setIcon(Icons[8]); |
ac_ConnectTTY->setIcon(Icons[8]); |
pb_Open->setIcon(ToolBox::Icon(8)); |
ac_ConnectTTY->setIcon(ToolBox::Icon(8)); |
Ticker->start(2000); |
} |
1205,26 → 1407,42 |
{ |
if (serialPort->isOpen() && AllowSend) |
{ |
QString TX_Data = ToolBox::Encode64(Data, Length); |
QByteArray Temp; |
QString TX_Data; |
TX_Data = QString("#") + (QString('a' + Address)) + QString(CMD) + TX_Data; |
if (CMD != '#') |
{ |
// qDebug("Send data.."); |
TX_Data = ToolBox::Encode64(Data, Length); |
TX_Data = QString("#") + (QString('a' + Address)) + QString(CMD) + TX_Data; |
// qDebug(TX_Data.toLatin1().data()); |
TX_Data = ToolBox::add_CRC(TX_Data) + '\r'; |
TX_Data = ToolBox::add_CRC(TX_Data) + '\r'; |
// qDebug(TX_Data.toLatin1().data()); |
if (Resend) |
if (Resend) |
{ |
LastSend = TX_Data; |
TickerEvent[0] = true; |
} |
Temp = QByteArray(TX_Data.toUtf8()); |
} |
else |
{ |
LastSend = TX_Data; |
TickerEvent[0] = true; |
// qDebug("Send Raw.."); |
for (unsigned int a = 0; a < Length; a++) |
{ |
Temp[a] = Data[a]; |
// qDebug(QString("%1").arg(Temp[a]).toLatin1().data()); |
} |
} |
QByteArray Temp(TX_Data.toUtf8()); |
serialPort->sendData(Temp); |
if (cb_ShowSend->isChecked()) |
if (cb_ShowSend->isChecked() && (CMD != '#')) |
{ |
te_RX->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor); |
te_RX->insertHtml("<span style='color:#8b0000;'>" + TX_Data + "<br /></span>"); |
/QMK-Groundstation/trunk/Forms/mktool.h |
---|
38,6 → 38,7 |
#include "../SerialPort/ManageSerialPort.h" |
#include "../cSettings.h" |
#include "../Classes/cServer.h" |
class QextSerialPort; |
51,19 → 52,23 |
private: |
bool AllowSend; |
// Object für Serielport |
ManageSerialPort *serialPort; |
// Settings-Object |
// Settings-Object (Programmeinstellungen) |
cSettings *Settings; |
// Settings-Widget |
// Settings-Widget (FC-Settings) |
wdg_Settings *f_Settings; |
// HTTp-Server-Object für Google Earth |
cServer *Server; |
// Default-Ticker |
QTimer *Ticker; |
// Die Tabs des Hauptfensters |
// Kopie der Tabs des Hauptfensters |
QWidget *TabWidgets[6]; |
// Analogwert-Beschreibungen |
84,19 → 89,16 |
bool TickerEvent[MaxTickerEvents]; |
bool TickerDiv; |
// Aktuelle und Max-Anzahl der LCD-Seiten |
int LCD_Page; |
int LCD_MAX_Page; |
// Alle Icons |
QIcon Icons[30]; |
// QByteArray allDataReceived; |
// Object für das Datenfile; |
QFile *CSVFile; |
sMode Mode; |
sRxData RxData; |
sNaviData Navi; |
QString RXS; |
QString LastSend; |
104,9 → 106,11 |
// Softwareupdate |
QProcess *Update; |
// Sendedatenbuffer |
char TX_Data[150]; |
int ParameterSet[11][MaxParameter]; |
// FC-Settings |
int FCSettings[MaxParameter]; |
// Programm Initialisieren |
void init_GUI(); |
113,7 → 117,6 |
void init_Objects(); |
void init_Connections(); |
void init_Arrays(); |
void init_Icons(); |
void init_Plot(); |
// Daten-Plotter |
120,6 → 123,8 |
void update_Plot(); |
void config_Plot(); |
void new_NaviData(sRxData RX); |
// Daten Senden, Empfangen und verarbeiten |
void send_Data(char CMD, int Address, char Data[150],unsigned int Length, bool Resend = true); |
void new_RXData(sRxData RX); |
132,12 → 137,21 |
void set_Preferences(); |
private slots: |
void slot_ac_Hardware(); |
void slot_rb_Hardware(); |
void slot_ac_StartServer(); |
void slot_Test(); |
void slot_ac_Config(); |
void slot_ac_Preferences(); |
void slot_ac_StartPlotter(); |
void slot_ac_View(); |
void slot_ac_MehrDaten(); |
void slot_ac_KeineDaten(); |
void slot_ac_FastDebug(); |
void slot_ac_NoDebug(); |
void slot_ac_FastNavi(); |
void slot_ac_NoNavi(); |
void slot_ac_About(); |
void slot_ac_GetLabels(); |
void slot_ac_Motortest(); |
146,13 → 160,14 |
// Default-Ticker |
void slot_Ticker(); |
// LCD-Seite vor / zurück |
void slot_LCD_UP(); |
void slot_LCD_DOWN(); |
void slot_Motortest(int Motor1, int Motor2, int Motor3, int Motor4); |
// Firmeware-Update |
void slot_pb_Update(); |
void slot_UpdateShell(); |
// Seriell-Port Slots |
165,8 → 180,9 |
void slot_ScrollPlot(int Pos); |
void slot_GetParameter(); |
void slot_SetParameter(); |
// FC-Settings lesen / Schreiben |
void slot_GetFCSettings(); |
void slot_SetFCSettings(); |
}; |
#endif |
/QMK-Groundstation/trunk/Forms/mktool.ui |
---|
5,8 → 5,8 |
<rect> |
<x>0</x> |
<y>0</y> |
<width>766</width> |
<height>414</height> |
<width>785</width> |
<height>415</height> |
</rect> |
</property> |
<property name="windowTitle" > |
1030,7 → 1030,7 |
<string>Terminal </string> |
</attribute> |
<layout class="QGridLayout" name="gridLayout_2" > |
<item row="0" column="0" colspan="5" > |
<item row="0" column="0" colspan="8" > |
<widget class="QTextEdit" name="te_RX" > |
<property name="font" > |
<font> |
1047,17 → 1047,17 |
</property> |
</widget> |
</item> |
<item row="1" column="0" > |
<item row="1" column="1" > |
<widget class="QCheckBox" name="cb_ShowData" > |
<property name="text" > |
<string>Datenpackete anzeigen </string> |
<string>Datenpackete </string> |
</property> |
</widget> |
</item> |
<item row="1" column="1" > |
<item row="1" column="2" > |
<widget class="QCheckBox" name="cb_ShowMSG" > |
<property name="text" > |
<string>Meldungen anzeigen </string> |
<string>Meldungen </string> |
</property> |
<property name="checked" > |
<bool>true</bool> |
1064,7 → 1064,7 |
</property> |
</widget> |
</item> |
<item row="1" column="4" > |
<item row="1" column="6" > |
<spacer name="horizontalSpacer_13" > |
<property name="orientation" > |
<enum>Qt::Horizontal</enum> |
1077,7 → 1077,7 |
</property> |
</spacer> |
</item> |
<item row="1" column="3" > |
<item row="1" column="4" > |
<widget class="QCheckBox" name="cb_ShowAlways" > |
<property name="text" > |
<string>auch wenn ausgeblendet </string> |
1084,13 → 1084,27 |
</property> |
</widget> |
</item> |
<item row="1" column="2" > |
<item row="1" column="3" > |
<widget class="QCheckBox" name="cb_ShowSend" > |
<property name="text" > |
<string>gesendete Daten anzeigen</string> |
<string>gesendete Daten </string> |
</property> |
</widget> |
</item> |
<item row="1" column="0" > |
<widget class="QLabel" name="label_2" > |
<property name="text" > |
<string>Anzeigen: </string> |
</property> |
</widget> |
</item> |
<item row="1" column="7" > |
<widget class="QPushButton" name="pb_Clear" > |
<property name="text" > |
<string>Löschen</string> |
</property> |
</widget> |
</item> |
</layout> |
</widget> |
<widget class="QWidget" name="Tab_4" > |
1146,6 → 1160,9 |
<property name="alignment" > |
<set>Qt::AlignCenter</set> |
</property> |
<property name="readOnly" > |
<bool>true</bool> |
</property> |
</widget> |
</item> |
<item row="1" column="0" colspan="3" > |
1173,6 → 1190,9 |
<property name="alignment" > |
<set>Qt::AlignCenter</set> |
</property> |
<property name="readOnly" > |
<bool>false</bool> |
</property> |
</widget> |
</item> |
<item row="2" column="0" colspan="3" > |
1200,6 → 1220,9 |
<property name="alignment" > |
<set>Qt::AlignCenter</set> |
</property> |
<property name="readOnly" > |
<bool>false</bool> |
</property> |
</widget> |
</item> |
<item row="3" column="0" colspan="3" > |
1227,6 → 1250,9 |
<property name="alignment" > |
<set>Qt::AlignCenter</set> |
</property> |
<property name="readOnly" > |
<bool>true</bool> |
</property> |
</widget> |
</item> |
<item row="4" column="0" > |
1644,34 → 1670,71 |
<normaloff>:/Actions/Images/22X22/network-disconnect.png</normaloff>:/Actions/Images/22X22/network-disconnect.png</iconset> |
</property> |
</widget> |
<widget class="QComboBox" name="cb_Hardware" > |
<property name="enabled" > |
<bool>false</bool> |
<widget class="QLineEdit" name="IN" > |
<property name="geometry" > |
<rect> |
<x>0</x> |
<y>270</y> |
<width>751</width> |
<height>31</height> |
</rect> |
</property> |
<property name="text" > |
<string>#cOD{br>Lozm^zgC]===M=============================================================\======>t=====?q>|=E====D============z^</string> |
</property> |
</widget> |
<widget class="QPushButton" name="Dec" > |
<property name="geometry" > |
<rect> |
<x>10</x> |
<y>30</y> |
<width>101</width> |
<height>27</height> |
<x>0</x> |
<y>240</y> |
<width>100</width> |
<height>26</height> |
</rect> |
</property> |
<item> |
<property name="text" > |
<string>FlightCtrl</string> |
</property> |
</item> |
<item> |
<property name="text" > |
<string>NaviCtrl</string> |
</property> |
</item> |
<item> |
<property name="text" > |
<string>MK3Mag</string> |
</property> |
</item> |
<property name="text" > |
<string>Decode</string> |
</property> |
</widget> |
<widget class="QRadioButton" name="rb_SelFC" > |
<property name="geometry" > |
<rect> |
<x>250</x> |
<y>90</y> |
<width>91</width> |
<height>25</height> |
</rect> |
</property> |
<property name="text" > |
<string>FlightCtrl</string> |
</property> |
</widget> |
<widget class="QRadioButton" name="rb_SelNC" > |
<property name="geometry" > |
<rect> |
<x>360</x> |
<y>90</y> |
<width>81</width> |
<height>25</height> |
</rect> |
</property> |
<property name="text" > |
<string>NaviCtrl</string> |
</property> |
</widget> |
<widget class="QRadioButton" name="rb_SelMag" > |
<property name="geometry" > |
<rect> |
<x>460</x> |
<y>90</y> |
<width>81</width> |
<height>25</height> |
</rect> |
</property> |
<property name="text" > |
<string>MK3Mag</string> |
</property> |
</widget> |
</widget> |
</widget> |
</item> |
1682,7 → 1745,7 |
<rect> |
<x>0</x> |
<y>0</y> |
<width>766</width> |
<width>785</width> |
<height>25</height> |
</rect> |
</property> |
1715,8 → 1778,8 |
<addaction name="ac_RecordCSV" /> |
<addaction name="ac_StartPlotter" /> |
<addaction name="separator" /> |
<addaction name="ac_MehrDaten" /> |
<addaction name="ac_KeineDaten" /> |
<addaction name="ac_FastDebug" /> |
<addaction name="ac_NoDebug" /> |
<addaction name="separator" /> |
<addaction name="ac_GetLabels" /> |
</widget> |
1747,9 → 1810,9 |
<property name="title" > |
<string>Hardware</string> |
</property> |
<addaction name="actionFlightCtrl" /> |
<addaction name="actionNaviCtrl" /> |
<addaction name="actionMK3Mag" /> |
<addaction name="ac_SelFC" /> |
<addaction name="ac_SelNC" /> |
<addaction name="ac_SelMag" /> |
</widget> |
<widget class="QMenu" name="menu_Navi_Daten" > |
<property name="title" > |
1756,6 → 1819,9 |
<string>&Navi-Daten</string> |
</property> |
<addaction name="ac_StartServer" /> |
<addaction name="separator" /> |
<addaction name="ac_FastNavi" /> |
<addaction name="ac_NoNavi" /> |
</widget> |
<addaction name="menuProgramm" /> |
<addaction name="menuHardware" /> |
1793,9 → 1859,9 |
</attribute> |
<addaction name="ac_ConnectTTY" /> |
<addaction name="separator" /> |
<addaction name="ac_StartPlotter" /> |
<addaction name="ac_FastDebug" /> |
<addaction name="ac_RecordCSV" /> |
<addaction name="ac_StartPlotter" /> |
<addaction name="ac_MehrDaten" /> |
<addaction name="separator" /> |
<addaction name="ac_Motortest" /> |
<addaction name="separator" /> |
1870,7 → 1936,7 |
<string>Datenfelder wählen</string> |
</property> |
</action> |
<action name="ac_MehrDaten" > |
<action name="ac_FastDebug" > |
<property name="checkable" > |
<bool>true</bool> |
</property> |
1912,7 → 1978,7 |
<bool>false</bool> |
</property> |
<property name="text" > |
<string>Parameter</string> |
<string>FC-Settings</string> |
</property> |
</action> |
<action name="ac_View3" > |
1971,40 → 2037,31 |
<string>Motortest</string> |
</property> |
</action> |
<action name="actionFlightCtrl" > |
<action name="ac_SelFC" > |
<property name="checkable" > |
<bool>true</bool> |
</property> |
<property name="enabled" > |
<bool>false</bool> |
</property> |
<property name="text" > |
<string>FlightCtrl</string> |
</property> |
</action> |
<action name="actionNaviCtrl" > |
<action name="ac_SelNC" > |
<property name="checkable" > |
<bool>true</bool> |
</property> |
<property name="enabled" > |
<bool>false</bool> |
</property> |
<property name="text" > |
<string>NaviCtrl</string> |
</property> |
</action> |
<action name="actionMK3Mag" > |
<action name="ac_SelMag" > |
<property name="checkable" > |
<bool>true</bool> |
</property> |
<property name="enabled" > |
<bool>false</bool> |
</property> |
<property name="text" > |
<string>MK3Mag</string> |
</property> |
</action> |
<action name="ac_KeineDaten" > |
<action name="ac_NoDebug" > |
<property name="checkable" > |
<bool>true</bool> |
</property> |
2024,6 → 2081,26 |
<string>Google Earth Server</string> |
</property> |
</action> |
<action name="ac_FastNavi" > |
<property name="checkable" > |
<bool>true</bool> |
</property> |
<property name="icon" > |
<iconset resource="../MKTool.qrc" > |
<normaloff>:/Actions/Images/22X22/clock.png</normaloff>:/Actions/Images/22X22/clock.png</iconset> |
</property> |
<property name="text" > |
<string>Schnelle Navi-Daten</string> |
</property> |
</action> |
<action name="ac_NoNavi" > |
<property name="checkable" > |
<bool>true</bool> |
</property> |
<property name="text" > |
<string>Navidaten abschalten</string> |
</property> |
</action> |
</widget> |
<customwidgets> |
<customwidget> |
2065,8 → 2142,8 |
<slot>trigger()</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>657</x> |
<y>399</y> |
<x>756</x> |
<y>370</y> |
</hint> |
<hint type="destinationlabel" > |
<x>-1</x> |
2081,8 → 2158,8 |
<slot>trigger()</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>659</x> |
<y>385</y> |
<x>663</x> |
<y>117</y> |
</hint> |
<hint type="destinationlabel" > |
<x>-1</x> |
2097,8 → 2174,8 |
<slot>trigger()</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>249</x> |
<y>385</y> |
<x>253</x> |
<y>117</y> |
</hint> |
<hint type="destinationlabel" > |
<x>-1</x> |
2113,8 → 2190,8 |
<slot>trigger()</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>506</x> |
<y>385</y> |
<x>510</x> |
<y>117</y> |
</hint> |
<hint type="destinationlabel" > |
<x>-1</x> |
2122,5 → 2199,117 |
</hint> |
</hints> |
</connection> |
<connection> |
<sender>rb_SelFC</sender> |
<signal>toggled(bool)</signal> |
<receiver>ac_SelFC</receiver> |
<slot>setChecked(bool)</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>299</x> |
<y>194</y> |
</hint> |
<hint type="destinationlabel" > |
<x>-1</x> |
<y>-1</y> |
</hint> |
</hints> |
</connection> |
<connection> |
<sender>rb_SelMag</sender> |
<signal>toggled(bool)</signal> |
<receiver>ac_SelMag</receiver> |
<slot>setChecked(bool)</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>504</x> |
<y>194</y> |
</hint> |
<hint type="destinationlabel" > |
<x>-1</x> |
<y>-1</y> |
</hint> |
</hints> |
</connection> |
<connection> |
<sender>rb_SelNC</sender> |
<signal>toggled(bool)</signal> |
<receiver>ac_SelNC</receiver> |
<slot>setChecked(bool)</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>404</x> |
<y>194</y> |
</hint> |
<hint type="destinationlabel" > |
<x>-1</x> |
<y>-1</y> |
</hint> |
</hints> |
</connection> |
<connection> |
<sender>ac_SelFC</sender> |
<signal>triggered(bool)</signal> |
<receiver>rb_SelFC</receiver> |
<slot>setChecked(bool)</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>-1</x> |
<y>-1</y> |
</hint> |
<hint type="destinationlabel" > |
<x>299</x> |
<y>194</y> |
</hint> |
</hints> |
</connection> |
<connection> |
<sender>ac_SelMag</sender> |
<signal>triggered(bool)</signal> |
<receiver>rb_SelMag</receiver> |
<slot>setChecked(bool)</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>-1</x> |
<y>-1</y> |
</hint> |
<hint type="destinationlabel" > |
<x>504</x> |
<y>194</y> |
</hint> |
</hints> |
</connection> |
<connection> |
<sender>ac_SelNC</sender> |
<signal>triggered(bool)</signal> |
<receiver>rb_SelNC</receiver> |
<slot>setChecked(bool)</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>-1</x> |
<y>-1</y> |
</hint> |
<hint type="destinationlabel" > |
<x>404</x> |
<y>194</y> |
</hint> |
</hints> |
</connection> |
<connection> |
<sender>pb_Clear</sender> |
<signal>clicked()</signal> |
<receiver>te_RX</receiver> |
<slot>clear()</slot> |
<hints> |
<hint type="sourcelabel" > |
<x>736</x> |
<y>372</y> |
</hint> |
<hint type="destinationlabel" > |
<x>392</x> |
<y>225</y> |
</hint> |
</hints> |
</connection> |
</connections> |
</ui> |
/QMK-Groundstation/trunk/Forms/wdg_Settings.cpp |
---|
20,12 → 20,12 |
#include <QSettings> |
#include "wdg_Settings.h" |
#include "../ToolBox.h" |
wdg_Settings::wdg_Settings(QWidget *parent) : QWidget(parent) |
{ |
setupUi(this); |
init_Icons(); |
connect(pb_Load, SIGNAL(clicked()), this, SLOT(slot_LoadParameter())); |
connect(pb_Save, SIGNAL(clicked()), this, SLOT(slot_SaveParameter())); |
59,50 → 59,26 |
connect(sb_11_3, SIGNAL(valueChanged(int)), this, SLOT(slot_ValuetoLED17(int))); |
} |
void wdg_Settings::init_Icons() |
{ |
Icons[0].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledred.png")), QIcon::Normal, QIcon::Off); |
Icons[1].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
Icons[3].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledyellow.png")), QIcon::Normal, QIcon::Off); |
Icons[4].addPixmap(QPixmap(QString::fromUtf8(":/LED/Images/16X16/ledoff.png")), QIcon::Normal, QIcon::Off); |
Icons[5].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/application-exit.png")), QIcon::Normal, QIcon::Off); |
Icons[6].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/media-playback-stop.png")), QIcon::Normal, QIcon::Off); |
Icons[7].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/media-record.png")), QIcon::Normal, QIcon::Off); |
Icons[8].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/network-connect.png")), QIcon::Normal, QIcon::Off); |
Icons[9].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/network-disconnect.png")), QIcon::Normal, QIcon::Off); |
Icons[10].addPixmap(QPixmap(QString::fromUtf8(":/Actions/Images/22X22/utilities-system-monitor.png")), QIcon::Normal, QIcon::Off); |
Icons[20].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-up-double.png")), QIcon::Normal, QIcon::Off); |
Icons[21].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-up.png")), QIcon::Normal, QIcon::Off); |
Icons[22].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-down-double.png")), QIcon::Normal, QIcon::Off); |
Icons[23].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-down.png")), QIcon::Normal, QIcon::Off); |
Icons[24].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-left-double.png")), QIcon::Normal, QIcon::Off); |
Icons[25].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-left.png")), QIcon::Normal, QIcon::Off); |
Icons[26].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-right-double.png")), QIcon::Normal, QIcon::Off); |
Icons[27].addPixmap(QPixmap(QString::fromUtf8(":/Arrows/Images/32X32/arrow-right.png")), QIcon::Normal, QIcon::Off); |
} |
void wdg_Settings::set_LED(QToolButton *ToolButton, bool On) |
{ |
if (ToolButton->text() == QString("0") && On) |
{ |
ToolButton->setIcon(Icons[0]); |
ToolButton->setIcon(ToolBox::Icon(0)); |
ToolButton->setText("1"); |
} |
else if (ToolButton->text() == QString("1") && !On) |
{ |
ToolButton->setIcon(Icons[4]); |
ToolButton->setIcon(ToolBox::Icon(4)); |
ToolButton->setText("0"); |
} |
else if (ToolButton->text() == QString("00") && On) |
{ |
ToolButton->setIcon(Icons[0]); |
ToolButton->setIcon(ToolBox::Icon(0)); |
ToolButton->setText("11"); |
} |
else if (ToolButton->text() == QString("11") && !On) |
{ |
ToolButton->setIcon(Icons[4]); |
ToolButton->setIcon(ToolBox::Icon(4)); |
ToolButton->setText("00"); |
} |
} |
256,12 → 232,12 |
{ |
if (tb_9_6->text() == QString("0")) |
{ |
tb_9_6->setIcon(Icons[20]); |
tb_9_6->setIcon(ToolBox::Icon(20)); |
tb_9_6->setText("1"); |
} |
else |
{ |
tb_9_6->setIcon(Icons[21]); |
tb_9_6->setIcon(ToolBox::Icon(21)); |
tb_9_6->setText("0"); |
} |
} |
270,12 → 246,12 |
{ |
if (tb_9_7->text() == QString("0")) |
{ |
tb_9_7->setIcon(Icons[22]); |
tb_9_7->setIcon(ToolBox::Icon(22)); |
tb_9_7->setText("1"); |
} |
else |
{ |
tb_9_7->setIcon(Icons[23]); |
tb_9_7->setIcon(ToolBox::Icon(23)); |
tb_9_7->setText("0"); |
} |
} |
284,12 → 260,12 |
{ |
if (tb_9_8->text() == QString("0")) |
{ |
tb_9_8->setIcon(Icons[24]); |
tb_9_8->setIcon(ToolBox::Icon(24)); |
tb_9_8->setText("1"); |
} |
else |
{ |
tb_9_8->setIcon(Icons[25]); |
tb_9_8->setIcon(ToolBox::Icon(25)); |
tb_9_8->setText("0"); |
} |
} |
298,12 → 274,12 |
{ |
if (tb_9_9->text() == QString("0")) |
{ |
tb_9_9->setIcon(Icons[26]); |
tb_9_9->setIcon(ToolBox::Icon(26)); |
tb_9_9->setText("1"); |
} |
else |
{ |
tb_9_9->setIcon(Icons[27]); |
tb_9_9->setIcon(ToolBox::Icon(27)); |
tb_9_9->setText("0"); |
} |
} |
423,20 → 399,21 |
Setting.endGroup(); |
Setting.beginGroup("NaviCtrl"); |
ParameterSet[Set][P_NAV_GPS_MODE] = Setting.value("GPS_ModeControl", 253).toInt(); |
ParameterSet[Set][P_NAV_GPS_GAIN] = Setting.value("GPS_Gain", 100).toInt(); |
ParameterSet[Set][P_NAV_GPS_P] = Setting.value("GPS_P", 90).toInt(); |
ParameterSet[Set][P_NAV_GPS_I] = Setting.value("GPS_I", 90).toInt(); |
ParameterSet[Set][P_NAV_GPS_D] = Setting.value("GPS_D", 90).toInt(); |
ParameterSet[Set][P_NAV_GPS_ACC] = Setting.value("GPS_Acc", 0).toInt(); |
ParameterSet[Set][P_NAV_GPS_MIN] = Setting.value("GPS_MinSat", 6).toInt(); |
ParameterSet[Set][P_NAV_STICK_THRE] = Setting.value("GPS_StickThreshold", 8).toInt(); |
ParameterSet[Set][P_NAV_WIND_CORR] = Setting.value("GPS_WindCorrection", 90).toInt(); |
ParameterSet[Set][P_NAV_SPEED_COMP] = Setting.value("GPS_SpeedCompensation", 30).toInt(); |
ParameterSet[Set][P_NAV_RADIUS] = Setting.value("GPS_MaxRadius", 100).toInt(); |
ParameterSet[Set][P_NAV_GPS_MODE] = Setting.value("GPS_ModeControl", 253).toInt(); |
ParameterSet[Set][P_NAV_GPS_GAIN] = Setting.value("GPS_Gain", 100).toInt(); |
ParameterSet[Set][P_NAV_GPS_P] = Setting.value("GPS_P", 90).toInt(); |
ParameterSet[Set][P_NAV_GPS_I] = Setting.value("GPS_I", 90).toInt(); |
ParameterSet[Set][P_NAV_GPS_D] = Setting.value("GPS_D", 90).toInt(); |
ParameterSet[Set][P_NAV_GPS_ACC] = Setting.value("GPS_Acc", 0).toInt(); |
ParameterSet[Set][P_NAV_GPS_MIN] = Setting.value("GPS_MinSat", 6).toInt(); |
ParameterSet[Set][P_NAV_STICK_THRE] = Setting.value("GPS_StickThreshold", 8).toInt(); |
ParameterSet[Set][P_NAV_WIND_CORR] = Setting.value("GPS_WindCorrection", 90).toInt(); |
ParameterSet[Set][P_NAV_SPEED_COMP] = Setting.value("GPS_SpeedCompensation", 30).toInt(); |
ParameterSet[Set][P_NAV_RADIUS] = Setting.value("GPS_MaxRadius", 100).toInt(); |
ParameterSet[Set][P_NAV_ANGLE_LIMIT] = Setting.value("GPS_AngleLimit", 60).toInt(); |
Setting.endGroup(); |
show_ParameterSet(Set, ParameterSet); |
show_FCSettings(Set, ParameterSet[Set]); |
} |
} |
716,11 → 693,12 |
Setting.setValue("GPS_WindCorrection", ParameterSet[Set][P_NAV_WIND_CORR]); |
Setting.setValue("GPS_SpeedCompensation", ParameterSet[Set][P_NAV_SPEED_COMP]); |
Setting.setValue("GPS_MaxRadius", ParameterSet[Set][P_NAV_RADIUS]); |
Setting.setValue("GPS_AngleLimit", ParameterSet[Set][P_NAV_ANGLE_LIMIT]); |
Setting.endGroup(); |
} |
} |
char *wdg_Settings::SetParameter() // DONE 0.71g |
char *wdg_Settings::GetFCSettings() // DONE 0.71g |
{ |
store_ParameterSet(sb_Set->value()); |
745,24 → 723,24 |
{ |
Set = Set; |
if (Settings[Wert] <= 250) |
if (Wert <= 250) |
{ |
Combo->setItemText(4, QString("%1").arg(Settings[Wert])); |
Combo->setItemText(4, QString("%1").arg(Wert)); |
Combo->setCurrentIndex(4); |
} |
else |
{ |
Combo->setCurrentIndex(Settings[Wert] - 251); |
Combo->setCurrentIndex(Wert - 251); |
} |
return Combo; |
} |
void wdg_Settings::show_ParameterSet(int Set, int ParamSet[11][MaxParameter]) // DONE 0.71h |
void wdg_Settings::show_FCSettings(int Set, int FCSettings[MaxParameter]) // DONE 0.71h |
{ |
memcpy(Settings, ParamSet[Set], sizeof(ParamSet[Set])); |
memcpy(ParameterSet, ParamSet, sizeof(ParamSet)); |
memcpy(Settings, FCSettings, sizeof(FCSettings)); |
// memcpy(ParameterSet, ParamSet, sizeof(ParamSet)); |
memcpy(ParameterSet[Set], ParamSet[Set], sizeof(ParamSet[Set])); |
memcpy(ParameterSet[Set], FCSettings, sizeof(FCSettings)); |
sb_Set->setValue(Set); |
769,169 → 747,169 |
char Name[12]; |
for (int a = 0; a < 12; a++) |
{ |
Name[a] = ParameterSet[Set][P_NAME+a]; |
Name[a] = FCSettings[P_NAME+a]; |
} |
le_SetName->setText(QString(Name)); |
// Seite 1 |
{ |
cb_1_1->setChecked(ParameterSet[Set][P_GLOBAL_CONF] & 0x01); |
cb_1_2->setChecked(ParameterSet[Set][P_GLOBAL_CONF] & 0x02); |
cb_1_3->setChecked(ParameterSet[Set][P_GLOBAL_CONF] & 0x04); |
cb_1_4->setChecked(ParameterSet[Set][P_GLOBAL_CONF] & 0x08); |
cb_1_5->setChecked(ParameterSet[Set][P_GLOBAL_CONF] & 0x10); |
cb_1_6->setChecked(ParameterSet[Set][P_GLOBAL_CONF] & 0x20); |
cb_1_7->setChecked(ParameterSet[Set][P_GLOBAL_CONF] & 0x40); |
cb_1_8->setChecked(ParameterSet[Set][P_GLOBAL_CONF] & 0x80); |
cb_1_1->setChecked(FCSettings[P_GLOBAL_CONF] & 0x01); |
cb_1_2->setChecked(FCSettings[P_GLOBAL_CONF] & 0x02); |
cb_1_3->setChecked(FCSettings[P_GLOBAL_CONF] & 0x04); |
cb_1_4->setChecked(FCSettings[P_GLOBAL_CONF] & 0x08); |
cb_1_5->setChecked(FCSettings[P_GLOBAL_CONF] & 0x10); |
cb_1_6->setChecked(FCSettings[P_GLOBAL_CONF] & 0x20); |
cb_1_7->setChecked(FCSettings[P_GLOBAL_CONF] & 0x40); |
cb_1_8->setChecked(FCSettings[P_GLOBAL_CONF] & 0x80); |
} |
// Seite 2 |
{ |
sb_2_1->setValue(ParameterSet[Set][P_KANAL_NICK]); |
sb_2_2->setValue(ParameterSet[Set][P_KANAL_ROLL]); |
sb_2_3->setValue(ParameterSet[Set][P_KANAL_GAS]); |
sb_2_4->setValue(ParameterSet[Set][P_KANAL_GIER]); |
sb_2_5->setValue(ParameterSet[Set][P_KANAL_POTI1]); |
sb_2_6->setValue(ParameterSet[Set][P_KANAL_POTI2]); |
sb_2_7->setValue(ParameterSet[Set][P_KANAL_POTI3]); |
sb_2_8->setValue(ParameterSet[Set][P_KANAL_POTI4]); |
sb_2_1->setValue(FCSettings[P_KANAL_NICK]); |
sb_2_2->setValue(FCSettings[P_KANAL_ROLL]); |
sb_2_3->setValue(FCSettings[P_KANAL_GAS]); |
sb_2_4->setValue(FCSettings[P_KANAL_GIER]); |
sb_2_5->setValue(FCSettings[P_KANAL_POTI1]); |
sb_2_6->setValue(FCSettings[P_KANAL_POTI2]); |
sb_2_7->setValue(FCSettings[P_KANAL_POTI3]); |
sb_2_8->setValue(FCSettings[P_KANAL_POTI4]); |
} |
// Seite 3 |
{ |
sb_3_1->setValue(ParameterSet[Set][P_STICK_P]); |
sb_3_2->setValue(ParameterSet[Set][P_STICK_D]); |
cb_3_3 = setCombo(cb_3_3, Set, P_GIER_P); |
cb_3_4 = setCombo(cb_3_4, Set, P_EXTERNAL); |
sb_3_1->setValue(FCSettings[P_STICK_P]); |
sb_3_2->setValue(FCSettings[P_STICK_D]); |
cb_3_3 = setCombo(cb_3_3, Set, FCSettings[P_GIER_P]); |
cb_3_4 = setCombo(cb_3_4, Set, FCSettings[P_EXTERNAL]); |
} |
// Seite 4 |
{ |
cb_4_1 = setCombo(cb_4_1, Set, P_MAXHOEHE); |
sb_4_2->setValue(ParameterSet[Set][P_MIN_GAS]); |
cb_4_3 = setCombo(cb_4_3, Set, P_HOEHE_P); |
cb_4_4 = setCombo(cb_4_4, Set, P_DRUCK_D); |
cb_4_5 = setCombo(cb_4_5, Set, P_HOEHE_ACC); |
sb_4_6->setValue(ParameterSet[Set][P_HOEHE_GAIN]); |
cb_4_7->setChecked(ParameterSet[Set][P_LOOP_CONFIG] & 0x10); |
cb_4_1 = setCombo(cb_4_1, Set, FCSettings[P_MAXHOEHE]); |
sb_4_2->setValue(FCSettings[P_MIN_GAS]); |
cb_4_3 = setCombo(cb_4_3, Set, FCSettings[P_HOEHE_P]); |
cb_4_4 = setCombo(cb_4_4, Set, FCSettings[P_DRUCK_D]); |
cb_4_5 = setCombo(cb_4_5, Set, FCSettings[P_HOEHE_ACC]); |
sb_4_6->setValue(FCSettings[P_HOEHE_GAIN]); |
cb_4_7->setChecked(FCSettings[P_LOOP_CONFIG] & 0x10); |
} |
// Seite 5 |
{ |
cb_5_1 = setCombo(cb_5_1, Set, P_GYRO_P); |
cb_5_2 = setCombo(cb_5_2, Set, P_GYRO_I); |
cb_5_3 = setCombo(cb_5_3, Set, P_DYNAMIC_STAB); |
sb_5_4->setValue(ParameterSet[Set][P_GYRO_ACC_FAKTOR]); |
sb_5_5->setValue(ParameterSet[Set][P_GYRO_ACC_ABGL]); |
cb_5_6 = setCombo(cb_5_6, Set, P_FAKTOR_I); |
sb_5_7->setValue(ParameterSet[Set][P_DRIFT_KOMP]); |
cb_5_1 = setCombo(cb_5_1, Set, FCSettings[P_GYRO_P]); |
cb_5_2 = setCombo(cb_5_2, Set, FCSettings[P_GYRO_I]); |
cb_5_3 = setCombo(cb_5_3, Set, FCSettings[P_DYNAMIC_STAB]); |
sb_5_4->setValue(FCSettings[P_GYRO_ACC_FAKTOR]); |
sb_5_5->setValue(FCSettings[P_GYRO_ACC_ABGL]); |
cb_5_6 = setCombo(cb_5_6, Set, FCSettings[P_FAKTOR_I]); |
sb_5_7->setValue(FCSettings[P_DRIFT_KOMP]); |
} |
// Seite 6 |
{ |
cb_6_1 = setCombo(cb_6_1, Set, P_SERVO_NICK_CONT); |
sb_6_2->setValue(ParameterSet[Set][P_SERVO_NICK_COMP]); |
sb_6_3->setValue(ParameterSet[Set][P_SERVO_NICK_MIN]); |
sb_6_4->setValue(ParameterSet[Set][P_SERVO_NICK_MAX]); |
sb_6_5->setValue(ParameterSet[Set][P_SERVO_NICK_REFR]); |
cb_6_6->setChecked(ParameterSet[Set][P_SERVO_NICK_COMPI]); |
cb_6_1 = setCombo(cb_6_1, Set, FCSettings[P_SERVO_NICK_CONT]); |
sb_6_2->setValue(FCSettings[P_SERVO_NICK_COMP]); |
sb_6_3->setValue(FCSettings[P_SERVO_NICK_MIN]); |
sb_6_4->setValue(FCSettings[P_SERVO_NICK_MAX]); |
sb_6_5->setValue(FCSettings[P_SERVO_NICK_REFR]); |
cb_6_6->setChecked(FCSettings[P_SERVO_NICK_COMPI]); |
} |
// Seite 7 |
{ |
sb_7_1->setValue(ParameterSet[Set][P_GAS_MIN]); |
sb_7_2->setValue(ParameterSet[Set][P_GAS_MAX]); |
cb_7_3 = setCombo(cb_7_3, Set, P_KOMPASS_WIRKUNG); |
sb_7_4->setValue(ParameterSet[Set][P_UNTERSPANNUNG]); |
sb_7_5->setValue(ParameterSet[Set][P_NOTGASZEIT]); |
sb_7_6->setValue(ParameterSet[Set][P_NOTGAS]); |
sb_7_1->setValue(FCSettings[P_GAS_MIN]); |
sb_7_2->setValue(FCSettings[P_GAS_MAX]); |
cb_7_3 = setCombo(cb_7_3, Set, FCSettings[P_KOMPASS_WIRKUNG]); |
sb_7_4->setValue(FCSettings[P_UNTERSPANNUNG]); |
sb_7_5->setValue(FCSettings[P_NOTGASZEIT]); |
sb_7_6->setValue(FCSettings[P_NOTGAS]); |
} |
// Seite 8 |
{ |
cb_8_1 = setCombo(cb_8_1, Set, P_ACHS_KOPPLUNG); |
cb_8_2 = setCombo(cb_8_2, Set, P_ACHS_GKOPPLUNG); |
cb_8_1 = setCombo(cb_8_1, Set, FCSettings[P_ACHS_KOPPLUNG]); |
cb_8_2 = setCombo(cb_8_2, Set, FCSettings[P_ACHS_GKOPPLUNG]); |
} |
// Seite 9 |
{ |
if (ParameterSet[Set][P_LOOP_CONFIG] & 0x01) |
if (FCSettings[P_LOOP_CONFIG] & 0x01) |
{ |
tb_9_6->setIcon(Icons[20]); |
tb_9_6->setIcon(ToolBox::Icon(20)); |
tb_9_6->setText("1"); |
} |
else |
{ |
tb_9_6->setIcon(Icons[21]); |
tb_9_6->setIcon(ToolBox::Icon(21)); |
tb_9_6->setText("0"); |
} |
if (ParameterSet[Set][P_LOOP_CONFIG] & 0x02) |
if (FCSettings[P_LOOP_CONFIG] & 0x02) |
{ |
tb_9_7->setIcon(Icons[22]); |
tb_9_7->setIcon(ToolBox::Icon(22)); |
tb_9_7->setText("1"); |
} |
else |
{ |
tb_9_7->setIcon(Icons[23]); |
tb_9_7->setIcon(ToolBox::Icon(23)); |
tb_9_7->setText("0"); |
} |
if (ParameterSet[Set][P_LOOP_CONFIG] & 0x04) |
if (FCSettings[P_LOOP_CONFIG] & 0x04) |
{ |
tb_9_8->setIcon(Icons[24]); |
tb_9_8->setIcon(ToolBox::Icon(24)); |
tb_9_8->setText("1"); |
} |
else |
{ |
tb_9_8->setIcon(Icons[25]); |
tb_9_8->setIcon(ToolBox::Icon(25)); |
tb_9_8->setText("0"); |
} |
if (ParameterSet[Set][P_LOOP_CONFIG] & 0x08) |
if (FCSettings[P_LOOP_CONFIG] & 0x08) |
{ |
tb_9_9->setIcon(Icons[26]); |
tb_9_9->setIcon(ToolBox::Icon(26)); |
tb_9_9->setText("1"); |
} |
else |
{ |
tb_9_9->setIcon(Icons[27]); |
tb_9_9->setIcon(ToolBox::Icon(27)); |
tb_9_9->setText("0"); |
} |
cb_9_1 = setCombo(cb_9_1, Set, P_LOOP_GAS_LIMIT); |
sb_9_2->setValue(ParameterSet[Set][P_LOOP_THRESHOLD]); |
sb_9_3->setValue(ParameterSet[Set][P_WINKEL_NICK]); |
sb_9_4->setValue(ParameterSet[Set][P_LOOP_HYSTERESE]); |
sb_9_5->setValue(ParameterSet[Set][P_WINKEL_ROLL]); |
cb_9_1 = setCombo(cb_9_1, Set, FCSettings[P_LOOP_GAS_LIMIT]); |
sb_9_2->setValue(FCSettings[P_LOOP_THRESHOLD]); |
sb_9_3->setValue(FCSettings[P_WINKEL_NICK]); |
sb_9_4->setValue(FCSettings[P_LOOP_HYSTERESE]); |
sb_9_5->setValue(FCSettings[P_WINKEL_ROLL]); |
} |
// Seite 10 |
{ |
cb_10_1 = setCombo(cb_10_1, Set, P_USER_1); |
cb_10_2 = setCombo(cb_10_2, Set, P_USER_2); |
cb_10_3 = setCombo(cb_10_3, Set, P_USER_3); |
cb_10_4 = setCombo(cb_10_4, Set, P_USER_4); |
cb_10_5 = setCombo(cb_10_5, Set, P_USER_5); |
cb_10_6 = setCombo(cb_10_6, Set, P_USER_6); |
cb_10_7 = setCombo(cb_10_7, Set, P_USER_7); |
cb_10_8 = setCombo(cb_10_8, Set, P_USER_8); |
cb_10_1 = setCombo(cb_10_1, Set, FCSettings[P_USER_1]); |
cb_10_2 = setCombo(cb_10_2, Set, FCSettings[P_USER_2]); |
cb_10_3 = setCombo(cb_10_3, Set, FCSettings[P_USER_3]); |
cb_10_4 = setCombo(cb_10_4, Set, FCSettings[P_USER_4]); |
cb_10_5 = setCombo(cb_10_5, Set, FCSettings[P_USER_5]); |
cb_10_6 = setCombo(cb_10_6, Set, FCSettings[P_USER_6]); |
cb_10_7 = setCombo(cb_10_7, Set, FCSettings[P_USER_7]); |
cb_10_8 = setCombo(cb_10_8, Set, FCSettings[P_USER_8]); |
} |
// Seite 11 |
{ |
sb_11_1->setValue(ParameterSet[Set][P_J16_BITMASK]); |
cb_11_2 = setCombo(cb_11_2, Set, P_J16_TIMING); |
sb_11_3->setValue(ParameterSet[Set][P_J17_BITMASK]); |
cb_11_4 = setCombo(cb_11_4, Set, P_J17_TIMING); |
sb_11_1->setValue(FCSettings[P_J16_BITMASK]); |
cb_11_2 = setCombo(cb_11_2, Set, FCSettings[P_J16_TIMING]); |
sb_11_3->setValue(FCSettings[P_J17_BITMASK]); |
cb_11_4 = setCombo(cb_11_4, Set, FCSettings[P_J17_TIMING]); |
} |
// Seite 12 |
{ |
cb_12_1 = setCombo(cb_12_1, Set, P_NAV_GPS_MODE); |
cb_12_2 = setCombo(cb_12_2, Set, P_NAV_GPS_GAIN); |
sb_12_3->setValue(ParameterSet[Set][P_NAV_STICK_THRE]); |
sb_12_4->setValue(ParameterSet[Set][P_NAV_GPS_MIN]); |
cb_12_5 = setCombo(cb_12_5, Set, P_NAV_GPS_P); |
cb_12_6 = setCombo(cb_12_6, Set, P_NAV_GPS_I); |
cb_12_7 = setCombo(cb_12_7, Set, P_NAV_GPS_D); |
cb_12_8 = setCombo(cb_12_8, Set, P_NAV_GPS_ACC); |
cb_12_1 = setCombo(cb_12_1, Set, FCSettings[P_NAV_GPS_MODE]); |
cb_12_2 = setCombo(cb_12_2, Set, FCSettings[P_NAV_GPS_GAIN]); |
sb_12_3->setValue(FCSettings[P_NAV_STICK_THRE]); |
sb_12_4->setValue(FCSettings[P_NAV_GPS_MIN]); |
cb_12_5 = setCombo(cb_12_5, Set, FCSettings[P_NAV_GPS_P]); |
cb_12_6 = setCombo(cb_12_6, Set, FCSettings[P_NAV_GPS_I]); |
cb_12_7 = setCombo(cb_12_7, Set, FCSettings[P_NAV_GPS_D]); |
cb_12_8 = setCombo(cb_12_8, Set, FCSettings[P_NAV_GPS_ACC]); |
} |
// Seite 13 |
{ |
cb_13_1 = setCombo(cb_13_1, Set, P_NAV_WIND_CORR); |
cb_13_2 = setCombo(cb_13_2, Set, P_NAV_SPEED_COMP); |
cb_13_3 = setCombo(cb_13_3, Set, P_NAV_RADIUS); |
cb_13_4 = setCombo(cb_13_4, Set, P_NAV_ANGLE_LIMIT); |
cb_13_1 = setCombo(cb_13_1, Set, FCSettings[P_NAV_WIND_CORR]); |
cb_13_2 = setCombo(cb_13_2, Set, FCSettings[P_NAV_SPEED_COMP]); |
cb_13_3 = setCombo(cb_13_3, Set, FCSettings[P_NAV_RADIUS]); |
cb_13_4 = setCombo(cb_13_4, Set, FCSettings[P_NAV_ANGLE_LIMIT]); |
} |
} |
/QMK-Groundstation/trunk/Forms/wdg_Settings.h |
---|
35,17 → 35,13 |
explicit wdg_Settings(QWidget *parent = 0); |
virtual ~wdg_Settings(); |
void show_ParameterSet(int Set, int Settings[11][MaxParameter]); |
char *SetParameter(); |
void show_FCSettings(int Set, int FCSettings[MaxParameter]); |
char *GetFCSettings(); |
private: |
// Alle Icons |
QIcon Icons[30]; |
int Settings[MaxParameter]; |
int ParameterSet[11][MaxParameter]; |
void init_Icons(); |
void set_LED(QToolButton *ToolButton, bool On = false); |
QComboBox *setCombo(QComboBox *Combo, int Set, int Wert); |
/QMK-Groundstation/trunk/Forms/wdg_Settings.ui |
---|
1056,9 → 1056,10 |
</style></head><body style=" font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;"> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Hier kann der Höhenregler parametriert werden.</span></p> |
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p> |
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Setpoint:</span> Gibt die maximale Höhe an. Normalerweise wird hier ein Poti als Kanal der Funke eingetragen. Kleine Werte ermöglichen nur niedrige Maximalhöhen.<span style=" font-weight:600;"> </span></p> |
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Soll-Höhe:</span> Gibt die maximale Höhe an. Normalerweise wird hier ein Poti als Kanal der Funke eingetragen. Kleine Werte ermöglichen nur niedrige Maximalhöhen.<span style=" font-weight:600;"> </span></p> |
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Fluganfänger sollten das Feature nutzen, hier evtl. 0 eintragen und den Höhenregler aktivieren (siehe oben). Dann kann es nicht passieren, dass der MikroKopter zu hoch steigt. Bei Nutzung des Höhenreglers als Schalter ist hier auch das entsprechende Poti einzutragen, um den Kanal der Funke damit festzulegen. </p> |
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Min Gas:</span> unter diesen Wert wird das Gas nicht gestellt, wenn die Höhe überschritten wurde. </p> |
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">3-Fach-Schalter: </span><span style=" text-decoration: underline;">Höhenschalter</span> kann auf 3-Poligen Schalter gelegt werden --&gt; z.B. mit dem GPS-Schalter kombiniert<br />Bei Mittelstellung ist die Höhenregelung dann aus</p> |
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">P-Anteil:</span> Abhängigkeit von Rücknahme von Gas bei Höhe über. Je höher dieser Wert, desto kleiner ist der Flugbereich oberhalb der Maximalhöhe. </p> |
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Luftdruck-D:</span> Dämpft das Schwingverhalten des Höhenreglers. Geringste Luftdruckänderungen haben damit grosse Wirkung auf Gas. </p> |
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Z-ACC:</span> Dämpft das Schwingverhalten mittels des Beschleunigungssensors. </p> |
1393,6 → 1394,12 |
</item> |
<item row="3" column="1" > |
<widget class="QCheckBox" name="cb_4_7" > |
<property name="font" > |
<font> |
<weight>75</weight> |
<bold>true</bold> |
</font> |
</property> |
<property name="text" > |
<string>3fach Schalter </string> |
</property> |
4522,7 → 4529,7 |
</font> |
</property> |
<property name="text" > |
<string>GPS max Radius:</string> |
<string>GPS-Maxradius:</string> |
</property> |
</widget> |
</item> |
4657,13 → 4664,12 |
</style></head><body style=" font-family:'Sans Serif'; font-size:11pt; font-weight:400; font-style:normal;"> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; text-decoration: underline;">Einstellungen für das Navi-Ctrl (Seite 2).</span></p> |
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Speed Compensation:</span></p> |
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">only for AID mode.</p> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"><span style=" text-decoration:none;">GPS-Wind-Correction: </span><span style=" font-weight:400; text-decoration:none;">soll den MK bei Coming-Home direkter zurückfliegen und die Drift durch Wind kompensieren</span></p> |
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">GPS Winkelbegrenzung:</span></p> |
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600; text-decoration: underline;"></p> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Begrenzung des Maximalen Neigungswinkel.</p></body></html></string> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Speed Compensation: </span>Greift bei AID unterstützend ein, wenn man einen neuen Punkt anfliegt Wenn zuviel Geschwindigkeit aufgebaut wird, bremst das den MK</p> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /><span style=" font-weight:600;">GPS-Maxradius: </span>Soll eine virtuelle Grenze bilden, die mit GPS nicht überschritten wird.<br />Wenn der MK ausserhalb des Kreises einloggen soll, nimmt er als neue Position einen Punkt auf dem Kreisrand.<br />Man kann den Radius auch auf ein Poti legen. Wegpunkte und Soll-Positionen werden damit auch auf einen Kreis von max. 512m Durchmesser begrenzt.</p> |
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> |
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">GPS Winkelbegrenzung: </span>Damit lässt sich die maximale Neigung der GPS-Regelung begrenzen. <br />Ein Wert von 60 entspricht ca.35°</p></body></html></string> |
</property> |
</widget> |
</item> |