Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 715 → Rev 750

/QMK-Groundstation/trunk/QMK-Communicator/Dialogs/dlg_Main.cpp
57,6 → 57,14
resize(o_Settings->GUI.Size);
move(o_Settings->GUI.Point);
 
f_Terminal->resize(o_Settings->TERMINAL.Size);
f_Terminal->move(o_Settings->TERMINAL.Point);
 
f_Terminal->cb_Data->setChecked(o_Settings->DATA.Data);
f_Terminal->cb_Info->setChecked(o_Settings->DATA.Info);
f_Terminal->cb_Send->setChecked(o_Settings->DATA.Send);
f_Terminal->cb_TCP->setChecked(o_Settings->DATA.TCP);
 
if (o_Settings->GUI.isMax)
{
showMaximized();
96,6 → 104,8
// Password für IP-Verbindung.
le_Password->setText(o_Settings->CLIENT.TCP_Password);
 
btn_Debug->setVisible(false);
btn_ConnectServer->setVisible(false);
}
 
// Signale mit Slots verbinden
114,6 → 124,12
connect(btn_Terminal, SIGNAL(clicked()), this, SLOT(slot_btn_Terminal()));
connect(btn_ConnectServer, SIGNAL(clicked()), this, SLOT(slot_btn_ConnectServer()));
 
connect(btn_Debug, SIGNAL(clicked()), this, SLOT(slot_btn_Debug()));
 
connect(rb_NC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
connect(rb_FC, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
connect(rb_MK3MAG, SIGNAL(clicked()), this, SLOT(slot_rb_Hardware()));
 
// About QMK-Kernel & About-QT Dialog einfügen
connect(ac_About, SIGNAL(triggered()), this, SLOT(slot_ac_About()));
connect(ac_Server, SIGNAL(triggered()), this, SLOT(slot_ac_Server()));
151,7 → 167,7
////////////////////////////
void dlg_Main::parse_Input_Data(QString t_Data)
{
unsigned char OutData[150];
unsigned char OutData[180];
char *InData = t_Data.toLatin1().data();
 
if (HandlerMK::Decode_64(InData, t_Data.length(), OutData) != 0)
338,7 → 354,7
}
}
 
// IP-Input-Daten verarbeiten.
// IP-Output-Daten verarbeiten. (Live-Data)
void dlg_Main::parse_TCP_Output_Data(QString t_Data)
{
QStringList Data;
372,11 → 388,11
QString s_MD5PW;
QByteArray a_MD5PW;
 
a_MD5PW = QCryptographicHash::hash(QString("madlen").toAscii(),QCryptographicHash::Md5);
a_MD5PW = QCryptographicHash::hash(QString(QByteArray::fromBase64(Base64Hash.toLatin1()) + o_Settings->LIVEDATA.Password).toAscii(),QCryptographicHash::Md5);
 
s_MD5PW = QString(a_MD5PW.toHex().data());
 
o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 104, "keyoz@c64-power.net;" + s_MD5PW));
o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 104, o_Settings->LIVEDATA.User + ";" + s_MD5PW));
}
break;
}
505,8 → 521,8
{
Con_Output = Con_Server[0];
 
s_Output.Main = "127.0.0.1";//Server[0];
s_Output.Sub = "64410";//Server[1];
s_Output.Main = o_Settings->LIVEDATA.Server;//Server[0];
s_Output.Sub = o_Settings->LIVEDATA.Port;//Server[1];
 
o_Output = new Input_TCP();
o_Output->Init();
533,11 → 549,41
}
}
 
void dlg_Main::slot_btn_Debug()
{
if (o_Output->IsOpen())
{
o_Output->send_Data("#cO=M======wWMrSCuD==A===============================================A=GM======[M=====@==@|p==O=CM=========kN");
}
}
 
void dlg_Main::slot_rb_Hardware()
{
// if ((rb_NC->isChecked() == false) && (VersionInfo.ID != ADDRESS_NC))
// {
// o_Input->send_Data(HandlerMK::get_SelectNC());
// }
 
if (rb_FC->isChecked())
{
o_Input->send_Data(HandlerMK::get_SelectFC());
}
else
if (rb_MK3MAG->isChecked())
{
o_Input->send_Data(HandlerMK::get_SelectMK3MAG());
}
else
if (rb_NC->isChecked())
{
o_Input->send_Data(HandlerMK::get_SelectNC());
}
 
o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
}
 
void dlg_Main::slot_Output_Disconnected(int Error)
{
// cb_Server->setEnabled(true);
// le_Password->setEnabled(true);
 
disconnect(o_Output, SIGNAL(sig_NewData(QString)), 0, 0);
if (o_Output->Mode() == TCP)
{
580,10 → 626,6
void dlg_Main::slot_Output_Connected()
{
connect(o_Output, SIGNAL(sig_NewData(QString)), this, SLOT(slot_Output_Data(QString)));
 
// o_Output->send_Data(HandlerIP::make_Frame(ID_COMMUNICATOR, 101, QA_NAME + " " + QA_VERSION));
// o_Input->send_Data(HandlerMK::make_Frame('v', 0, c_Data, 0).toLatin1().data(), DATA_VERSION);
// btn_Connect->setText(tr("Trennen"));
}
 
void dlg_Main::slot_Output_Data(QString t_Data)
593,7 → 635,7
}
else if (o_Output->Mode() == TCP)
{
show_Terminal(6, t_Data);
show_Terminal(6, "IP:" + t_Data);
parse_TCP_Output_Data(t_Data);
}
}
854,9 → 896,11
ID = ID;
 
// QString t_Data = QString(TCP_Socket->readLine(TCP_Socket->bytesAvailable())).remove(QChar('\n'));
QString t_Data = s_Buffer + QString(Socket->readAll());
QString t_Data = s_Buffer + QString(Socket->readAll()).remove(QChar('\n'));
s_Buffer = "";
 
t_Data = t_Data.replace('\r', "\r\n");
 
QStringList l_Data = t_Data.split('\n');
 
for (int z = 0; z < l_Data.count(); z++)
879,9 → 923,11
}
}
else
{
qDebug("Ohne Ende");
s_Buffer = s_Buffer + l_Data[z];
{ if (l_Data[z].length() > 1)
{
qDebug(QString("Ohne Ende: " + l_Data[z]).toLatin1().data());
s_Buffer = s_Buffer + l_Data[z];
}
}
 
}
941,6 → 987,10
o_Settings->GUI.Size = size();
o_Settings->GUI.Point = pos();
 
// o_Settings->GUI.isMax = isMaximized();
o_Settings->TERMINAL.Size = f_Terminal->size();
o_Settings->TERMINAL.Point = f_Terminal->pos();
 
o_Settings->CLIENT.TTY_MAX = cb_Device->count();
o_Settings->CLIENT.TTY_ID = cb_Device->currentIndex();
 
963,6 → 1013,11
}
}
 
o_Settings->DATA.Data = f_Terminal->cb_Data->isChecked();
o_Settings->DATA.Info = f_Terminal->cb_Info->isChecked();
o_Settings->DATA.Send = f_Terminal->cb_Send->isChecked();
o_Settings->DATA.TCP = f_Terminal->cb_TCP->isChecked();
 
o_Settings->write_Settings();
 
// qDebug("Ende.");
/QMK-Groundstation/trunk/QMK-Communicator/Dialogs/dlg_Main.h
130,7 → 130,10
 
void slot_btn_Terminal();
void slot_btn_ConnectServer();
void slot_btn_Debug();
 
void slot_rb_Hardware();
 
// Einkommende Datenpackete.
void slot_Input_Data(QString t_Data);
void slot_Input_Disconnected(int Error);
/QMK-Groundstation/trunk/QMK-Communicator/Dialogs/dlg_Main.ui
6,7 → 6,7
<rect>
<x>0</x>
<y>0</y>
<width>447</width>
<width>519</width>
<height>372</height>
</rect>
</property>
139,9 → 139,6
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QRadioButton" name="rb_FC">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>FlightCtrl</string>
</property>
149,9 → 146,6
</item>
<item row="0" column="1">
<widget class="QRadioButton" name="rb_NC">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>NaviCtrl</string>
</property>
159,9 → 153,6
</item>
<item row="0" column="2">
<widget class="QRadioButton" name="rb_MK3MAG">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>MK3MAG</string>
</property>
281,6 → 272,18
</item>
<item row="0" column="1" rowspan="2">
<widget class="QGroupBox" name="groupBox_3">
<property name="minimumSize">
<size>
<width>150</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string>Clients</string>
</property>
420,6 → 423,13
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QPushButton" name="btn_Debug">
<property name="text">
<string>Debug-Button</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
430,7 → 440,7
<rect>
<x>0</x>
<y>0</y>
<width>447</width>
<width>519</width>
<height>21</height>
</rect>
</property>
438,14 → 448,10
<property name="title">
<string>Programm</string>
</property>
<addaction name="ac_Server"/>
<addaction name="separator"/>
<addaction name="ac_Quit"/>
</widget>
<widget class="QMenu" name="menu_Preferences">
<property name="title">
<string>Einstellungen</string>
</property>
<addaction name="ac_Server"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>Hilfe</string>
453,7 → 459,6
<addaction name="ac_About"/>
</widget>
<addaction name="menu_Program"/>
<addaction name="menu_Preferences"/>
<addaction name="menu_Help"/>
</widget>
<action name="ac_Quit">
480,7 → 485,7
<normaloff>:/Icon/Global/Images/Icons/QMK-Communicator.png</normaloff>:/Icon/Global/Images/Icons/QMK-Communicator.png</iconset>
</property>
<property name="text">
<string>Server</string>
<string>Einstellungen</string>
</property>
</action>
</widget>
/QMK-Groundstation/trunk/QMK-Communicator/Dialogs/dlg_Preferences.cpp
30,6 → 30,11
le_TCP_Port->setText(QString("%1").arg(o_Settings->SERVER.TCP_PORT));
le_UDP_Port->setText(QString("%1").arg(o_Settings->SERVER.UDP_PORT));
le_Password->setText(o_Settings->SERVER.Password);
 
le_LiveServer->setText(o_Settings->LIVEDATA.Server);
le_LivePort->setText(o_Settings->LIVEDATA.Port);
le_LiveUser->setText(o_Settings->LIVEDATA.User);
le_LivePassword->setText(o_Settings->LIVEDATA.Password);
}
 
cSettings *dlg_Preferences::get_Settings()
38,5 → 43,10
o_Settings->SERVER.TCP_PORT = le_TCP_Port->text().toInt();
o_Settings->SERVER.UDP_PORT = le_UDP_Port->text().toInt();
 
o_Settings->LIVEDATA.Server = le_LiveServer->text();
o_Settings->LIVEDATA.Port = le_LivePort->text();
o_Settings->LIVEDATA.User = le_LiveUser->text();
o_Settings->LIVEDATA.Password = le_LivePassword->text();
 
return o_Settings;
}
/QMK-Groundstation/trunk/QMK-Communicator/Dialogs/dlg_Preferences.ui
6,98 → 6,202
<rect>
<x>0</x>
<y>0</y>
<width>251</width>
<height>160</height>
<width>400</width>
<height>192</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>400</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Server-Einstellungen</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string/>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Communicator</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>TCP</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="le_TCP_Port"/>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>UDP</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="le_UDP_Port">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="le_Password">
<property name="text">
<string>qwertz</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="4" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Live-Daten senden</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Server:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="le_LiveServer">
<property name="text">
<string>127.0.0.1</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Login:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="le_LiveUser">
<property name="text">
<string>KeyOz</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="le_LivePassword">
<property name="text">
<string>qwertz</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="le_LivePort">
<property name="text">
<string>64410</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>TCP</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLineEdit" name="le_TCP_Port"/>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>UDP</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_2">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Port:</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="le_UDP_Port">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLineEdit" name="le_Password">
<property name="text">
<string>qwertz</string>
</property>
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
</widget>
</item>
</layout>
</widget>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<item row="1" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
109,6 → 213,17
</item>
</layout>
</widget>
<tabstops>
<tabstop>checkBox</tabstop>
<tabstop>le_TCP_Port</tabstop>
<tabstop>le_Password</tabstop>
<tabstop>le_LiveServer</tabstop>
<tabstop>le_LiveUser</tabstop>
<tabstop>le_LivePassword</tabstop>
<tabstop>buttonBox</tabstop>
<tabstop>checkBox_2</tabstop>
<tabstop>le_UDP_Port</tabstop>
</tabstops>
<resources/>
<connections>
<connection>