11,10 → 11,14 |
* read mixer values from FlightCtrl |
*/ |
void Handler::read_mixer() { |
TX_Data[0] = 0; |
com->send_cmd('n', ADDRESS_FC, TX_Data, 1, true); |
char tx_data[1] = {0}; |
//com->log("read motor mixer"); |
com->sendCmd('n', ADDRESS_FC, tx_data, 1, true); |
} |
|
void Handler::get_motor_config() { |
} |
|
void Handler::receive_data(sRxData RX) { |
//extract hardware ID from received Data |
int hardwareID = RX.input[1] - 'a'; |
31,7 → 35,7 |
|
if (RX.decode[0] == VERSION_MIXER) |
{ |
f_MotorMixer->set_MotorConfig(RX); |
//f_MotorMixer->set_MotorConfig(RX); |
} |
} |
break; |
43,7 → 47,7 |
|
if (RX.decode[0] == 1) |
{ |
lb_Status->setText(tr("MotorMixer-Daten in FC geschrieben.")); |
//lb_Status->setText(tr("MotorMixer-Daten in FC geschrieben.")); |
} |
} |
break; |
52,7 → 56,7 |
case 'P' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
f_Settings->pb_K1->setValue(Parser::dataToInt(RX.decode, 2,true)); |
/*f_Settings->pb_K1->setValue(Parser::dataToInt(RX.decode, 2,true)); |
f_Settings->pb_K2->setValue(Parser::dataToInt(RX.decode, 4,true)); |
f_Settings->pb_K3->setValue(Parser::dataToInt(RX.decode, 6,true)); |
f_Settings->pb_K4->setValue(Parser::dataToInt(RX.decode, 8,true)); |
59,7 → 63,7 |
f_Settings->pb_K5->setValue(Parser::dataToInt(RX.decode, 10 ,true)); |
f_Settings->pb_K6->setValue(Parser::dataToInt(RX.decode, 12,true)); |
f_Settings->pb_K7->setValue(Parser::dataToInt(RX.decode, 14,true)); |
f_Settings->pb_K8->setValue(Parser::dataToInt(RX.decode, 16,true)); |
f_Settings->pb_K8->setValue(Parser::dataToInt(RX.decode, 16,true));*/ |
} |
break; |
// Settings lesen |
66,22 → 70,22 |
case 'Q' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
o_Connection->stop_ReSend(); |
com->stopReSend(); |
|
if (RX.decode[1] == VERSION_SETTINGS) |
{ |
int Settings_ID = RX.decode[0]; |
for (int a = 0; a < MaxParameter; a++) |
/*for (int a = 0; a < MaxParameter; a++) |
{ |
FCSettings[a] = RX.decode[a + 2]; |
} |
f_Settings->show_FCSettings(Settings_ID, FCSettings); |
f_Settings->pb_Read->setEnabled(true); |
f_Settings->pb_Write->setEnabled(true); |
f_Settings->pb_Write->setEnabled(true);*/ |
} |
else |
{ |
f_Settings->pb_Read->setDisabled(true); |
/*f_Settings->pb_Read->setDisabled(true); |
f_Settings->pb_Write->setDisabled(true); |
|
QString name = QString("Versionen inkompatibel.\n") + |
91,13 → 95,14 |
QString(RX.decode[1]) + |
QString("\nParameterbearbeitung nicht moeglich."); |
QMessageBox::warning(this, QA_NAME, |
name, QMessageBox::Ok); |
name, QMessageBox::Ok);*/ |
} |
} |
break; |
// Settings geschrieben |
// Settings written |
case 'S' : // DONE 0.71g |
o_Connection->stop_ReSend(); |
com->stopReSend(); |
//TODO: QMessagebox("settings written successful") ? |
break; |
} |
|
108,7 → 113,7 |
case 'O' : // NOT DONE 0.12h |
if (Parser::decode64(RX)) |
{ |
new_NaviData(RX); |
//new_NaviData(RX); |
} |
break; |
} |
121,9 → 126,9 |
case 'L' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
o_Connection->stop_ReSend(); |
com->stopReSend(); |
|
int LCD[150]; |
/*int LCD[150]; |
memcpy(LCD,RX.decode, sizeof(RX.decode)); |
|
f_LCD->show_Data(LCD); |
130,6 → 135,7 |
|
LCD_Page = RX.decode[0]; |
LCD_MAX_Page = RX.decode[1]; |
*/ |
} |
break; |
// Analoglabels |
136,11 → 142,12 |
case 'A' : // DONE 0.71g |
if (Parser::decode64(RX)) |
{ |
o_Connection->stop_ReSend(); |
com->stopReSend(); |
|
int Position = RX.decode[0]; |
if (Position != 31) |
{ |
/* |
Settings->Analog1.Label[Position] = ToolBox::dataToQString(RX.decode,1,17).trimmed(); |
if (Settings->Analog1.Label[Position] == "") |
{ |
148,10 → 155,11 |
} |
Position ++; |
TX_Data[0] = Position; |
o_Connection->send_Cmd('a', ADDRESS_ALL, TX_Data, 1, true); |
o_Connection->send_Cmd('a', ADDRESS_ALL, TX_Data, 1, true);*/ |
} |
if (Position == 31) |
{ |
/* |
for (int a = 0; a < MaxAnalog; a++) |
{ |
lb_Analog[a]->setText(Settings->Analog1.Label[a]); |
158,7 → 166,7 |
} |
Settings->Analog1.Version = QString(Mode.Version); |
Settings->write_Settings_AnalogLabels(HardwareID); |
config_Plot(); |
config_Plot();*/ |
} |
} |
break; |
168,9 → 176,9 |
{ |
for (int i = 0; i < MaxAnalog; i++) |
{ |
AnalogData[i] = Parser::dataToInt(RX.decode, (i * 2) + 2); |
//AnalogData[i] = Parser::dataToInt(RX.decode, (i * 2) + 2); |
} |
show_DebugData(); |
//show_DebugData(); |
} |
break; |
// Version |
177,8 → 185,8 |
case 'V' : // DONE 0.71h |
if (Parser::decode64(RX)) |
{ |
o_Connection->stop_ReSend(); |
|
com->stopReSend(); |
/* |
Mode.ID = HardwareID; |
Mode.VERSION_MAJOR = RX.decode[0]; |
Mode.VERSION_MINOR = RX.decode[1]; |
283,7 → 291,7 |
{ |
lb_Analog[a]->setText(Settings->Analog1.Label[a]); |
} |
config_Plot(); |
config_Plot();*/ |
} |
break; |
} |