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,10 → 923,12 |
} |
} |
else |
{ if (l_Data[z].length() > 1) |
{ |
qDebug("Ohne Ende"); |
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."); |