71,6 → 71,7 |
void dlg_MotorMixer::set_Objects(Handler *handler, cSettings *t_Settings) |
{ |
this->handler = handler; |
this->data = handler->data; |
o_Settings = t_Settings; |
} |
|
101,85 → 102,97 |
// Motordaten aus GUI übernehmen |
void dlg_MotorMixer::get_MotorData() |
{ |
//FIXME: add Function in handler to send data |
sMotorData motorData; |
|
char * mixerName = le_NAME->text().toAscii().data(); |
motorData.mixer_name = string(mixerName); |
|
//TODO: use an array in Form |
int motor[16][4] = { |
sb_GAS_1->value(), sb_NICK_1->value(), sb_ROLL_1->value(), sb_GIER_1->value(), |
sb_GAS_2->value(), sb_NICK_2->value(), sb_ROLL_2->value(), sb_GIER_2->value(), |
sb_GAS_3->value(), sb_NICK_3->value(), sb_ROLL_3->value(), sb_GIER_3->value(), |
sb_GAS_4->value(), sb_NICK_4->value(), sb_ROLL_4->value(), sb_GIER_4->value(), |
sb_GAS_5->value(), sb_NICK_5->value(), sb_ROLL_5->value(), sb_GIER_5->value(), |
sb_GAS_6->value(), sb_NICK_6->value(), sb_ROLL_6->value(), sb_GIER_6->value(), |
sb_GAS_7->value(), sb_NICK_7->value(), sb_ROLL_7->value(), sb_GIER_7->value(), |
sb_GAS_8->value(), sb_NICK_8->value(), sb_ROLL_8->value(), sb_GIER_8->value(), |
sb_GAS_9->value(), sb_NICK_9->value(), sb_ROLL_9->value(), sb_GIER_9->value(), |
sb_GAS_10->value(), sb_NICK_10->value(), sb_ROLL_10->value(), sb_GIER_10->value(), |
sb_GAS_11->value(), sb_NICK_11->value(), sb_ROLL_11->value(), sb_GIER_11->value(), |
sb_GAS_12->value(), sb_NICK_12->value(), sb_ROLL_12->value(), sb_GIER_12->value() |
int gas[MAX_MOTORS] = { |
sb_GAS_1->value(), sb_GAS_2->value(), sb_GAS_3->value(), sb_GAS_4->value(), |
sb_GAS_5->value(), sb_GAS_6->value(), sb_GAS_7->value(), sb_GAS_8->value(), |
sb_GAS_9->value(), sb_GAS_10->value(), sb_GAS_11->value(), sb_GAS_12->value() |
}; |
int nick[MAX_MOTORS] = { |
sb_NICK_1->value(), sb_NICK_2->value(), sb_NICK_3->value(), sb_NICK_4->value(), |
sb_NICK_5->value(), sb_NICK_6->value(), sb_NICK_7->value(), sb_NICK_8->value(), |
sb_NICK_9->value(), sb_NICK_10->value(), sb_NICK_11->value(), sb_NICK_12->value() |
}; |
int roll[MAX_MOTORS] = { |
sb_ROLL_1->value(), sb_ROLL_2->value(), sb_ROLL_3->value(), sb_ROLL_4->value(), |
sb_ROLL_5->value(), sb_ROLL_6->value(), sb_ROLL_7->value(), sb_ROLL_8->value(), |
sb_ROLL_9->value(), sb_ROLL_10->value(), sb_ROLL_11->value(), sb_ROLL_12->value() |
}; |
int yaw[MAX_MOTORS] = { |
sb_GIER_1->value(), sb_GIER_2->value(), sb_GIER_3->value(), sb_GIER_4->value(), |
sb_GIER_5->value(), sb_GIER_6->value(), sb_GIER_7->value(), sb_GIER_8->value(), |
sb_GIER_9->value(), sb_GIER_10->value(), sb_GIER_11->value(), sb_GIER_12->value() |
}; |
for (int i = 0; i < MAX_MOTORS; i++) { |
motorData.mixer_gas[i] = gas[i]; |
motorData.mixer_nick[i] = nick[i]; |
motorData.mixer_roll[i] = roll[i]; |
motorData.mixer_yaw[i] = yaw[i]; |
} |
//FIXME: add Function in handler to send data |
} |
|
// Motordaten anzeigen |
void dlg_MotorMixer::set_MotorData() |
{ |
//FIXME: create special struct for mixer - KopterData |
/* |
le_NAME->setText(MixerName); |
sMotorData motorData = handler->data->motor; |
le_NAME->setText(motorData.mixer_name.c_str()); |
|
sb_GAS_1->setValue(Motor[0][0]); |
sb_GAS_2->setValue(Motor[1][0]); |
sb_GAS_3->setValue(Motor[2][0]); |
sb_GAS_4->setValue(Motor[3][0]); |
sb_GAS_5->setValue(Motor[4][0]); |
sb_GAS_6->setValue(Motor[5][0]); |
sb_GAS_7->setValue(Motor[6][0]); |
sb_GAS_8->setValue(Motor[7][0]); |
sb_GAS_9->setValue(Motor[8][0]); |
sb_GAS_10->setValue(Motor[9][0]); |
sb_GAS_11->setValue(Motor[10][0]); |
sb_GAS_12->setValue(Motor[11][0]); |
sb_GAS_1->setValue(motorData.mixer_gas[0]); |
sb_GAS_2->setValue(motorData.mixer_gas[1]); |
sb_GAS_3->setValue(motorData.mixer_gas[2]); |
sb_GAS_4->setValue(motorData.mixer_gas[3]); |
sb_GAS_5->setValue(motorData.mixer_gas[4]); |
sb_GAS_6->setValue(motorData.mixer_gas[5]); |
sb_GAS_7->setValue(motorData.mixer_gas[6]); |
sb_GAS_8->setValue(motorData.mixer_gas[7]); |
sb_GAS_9->setValue(motorData.mixer_gas[8]); |
sb_GAS_10->setValue(motorData.mixer_gas[9]); |
sb_GAS_11->setValue(motorData.mixer_gas[10]); |
sb_GAS_12->setValue(motorData.mixer_gas[11]); |
|
sb_NICK_1->setValue(Motor[0][1]); |
sb_NICK_2->setValue(Motor[1][1]); |
sb_NICK_3->setValue(Motor[2][1]); |
sb_NICK_4->setValue(Motor[3][1]); |
sb_NICK_5->setValue(Motor[4][1]); |
sb_NICK_6->setValue(Motor[5][1]); |
sb_NICK_7->setValue(Motor[6][1]); |
sb_NICK_8->setValue(Motor[7][1]); |
sb_NICK_9->setValue(Motor[8][1]); |
sb_NICK_10->setValue(Motor[9][1]); |
sb_NICK_11->setValue(Motor[10][1]); |
sb_NICK_12->setValue(Motor[11][1]); |
sb_NICK_1->setValue(motorData.mixer_nick[0]); |
sb_NICK_2->setValue(motorData.mixer_nick[1]); |
sb_NICK_3->setValue(motorData.mixer_nick[2]); |
sb_NICK_4->setValue(motorData.mixer_nick[3]); |
sb_NICK_5->setValue(motorData.mixer_nick[4]); |
sb_NICK_6->setValue(motorData.mixer_nick[5]); |
sb_NICK_7->setValue(motorData.mixer_nick[6]); |
sb_NICK_8->setValue(motorData.mixer_nick[7]); |
sb_NICK_9->setValue(motorData.mixer_nick[8]); |
sb_NICK_10->setValue(motorData.mixer_nick[9]); |
sb_NICK_11->setValue(motorData.mixer_nick[10]); |
sb_NICK_12->setValue(motorData.mixer_nick[11]); |
|
sb_ROLL_1->setValue(Motor[0][2]); |
sb_ROLL_2->setValue(Motor[1][2]); |
sb_ROLL_3->setValue(Motor[2][2]); |
sb_ROLL_4->setValue(Motor[3][2]); |
sb_ROLL_5->setValue(Motor[4][2]); |
sb_ROLL_6->setValue(Motor[5][2]); |
sb_ROLL_7->setValue(Motor[6][2]); |
sb_ROLL_8->setValue(Motor[7][2]); |
sb_ROLL_9->setValue(Motor[8][2]); |
sb_ROLL_10->setValue(Motor[9][2]); |
sb_ROLL_11->setValue(Motor[10][2]); |
sb_ROLL_12->setValue(Motor[11][2]); |
sb_ROLL_1->setValue(motorData.mixer_roll[0]); |
sb_ROLL_2->setValue(motorData.mixer_roll[1]); |
sb_ROLL_3->setValue(motorData.mixer_roll[2]); |
sb_ROLL_4->setValue(motorData.mixer_roll[3]); |
sb_ROLL_5->setValue(motorData.mixer_roll[4]); |
sb_ROLL_6->setValue(motorData.mixer_roll[5]); |
sb_ROLL_7->setValue(motorData.mixer_roll[6]); |
sb_ROLL_8->setValue(motorData.mixer_roll[7]); |
sb_ROLL_9->setValue(motorData.mixer_roll[8]); |
sb_ROLL_10->setValue(motorData.mixer_roll[9]); |
sb_ROLL_11->setValue(motorData.mixer_roll[10]); |
sb_ROLL_12->setValue(motorData.mixer_roll[11]); |
|
sb_GIER_1->setValue(Motor[0][3]); |
sb_GIER_2->setValue(Motor[1][3]); |
sb_GIER_3->setValue(Motor[2][3]); |
sb_GIER_4->setValue(Motor[3][3]); |
sb_GIER_5->setValue(Motor[4][3]); |
sb_GIER_6->setValue(Motor[5][3]); |
sb_GIER_7->setValue(Motor[6][3]); |
sb_GIER_8->setValue(Motor[7][3]); |
sb_GIER_9->setValue(Motor[8][3]); |
sb_GIER_10->setValue(Motor[9][3]); |
sb_GIER_11->setValue(Motor[10][3]); |
sb_GIER_12->setValue(Motor[11][3]); |
*/ |
sb_GIER_1->setValue(motorData.mixer_yaw[0]); |
sb_GIER_2->setValue(motorData.mixer_yaw[1]); |
sb_GIER_3->setValue(motorData.mixer_yaw[2]); |
sb_GIER_4->setValue(motorData.mixer_yaw[3]); |
sb_GIER_5->setValue(motorData.mixer_yaw[4]); |
sb_GIER_6->setValue(motorData.mixer_yaw[5]); |
sb_GIER_7->setValue(motorData.mixer_yaw[6]); |
sb_GIER_8->setValue(motorData.mixer_yaw[7]); |
sb_GIER_9->setValue(motorData.mixer_yaw[8]); |
sb_GIER_10->setValue(motorData.mixer_yaw[9]); |
sb_GIER_11->setValue(motorData.mixer_yaw[10]); |
sb_GIER_12->setValue(motorData.mixer_yaw[11]); |
} |
|
// Prüfen auf vollstaändigkeit |
187,14 → 200,20 |
{ |
Wert = Wert; |
|
int NICK = sb_NICK_1->value() + sb_NICK_2->value() + sb_NICK_3->value() + sb_NICK_4->value() + sb_NICK_5->value() + sb_NICK_6->value() + |
sb_NICK_7->value() + sb_NICK_8->value() + sb_NICK_9->value() + sb_NICK_10->value() + sb_NICK_11->value() + sb_NICK_12->value(); |
int NICK = sb_NICK_1->value() + sb_NICK_2->value() + sb_NICK_3->value() + |
sb_NICK_4->value() + sb_NICK_5->value() + sb_NICK_6->value() + |
sb_NICK_7->value() + sb_NICK_8->value() + sb_NICK_9->value() + |
sb_NICK_10->value() + sb_NICK_11->value() + sb_NICK_12->value(); |
|
int ROLL = sb_ROLL_1->value() + sb_ROLL_2->value() + sb_ROLL_3->value() + sb_ROLL_4->value() + sb_ROLL_5->value() + sb_ROLL_6->value() + |
sb_ROLL_7->value() + sb_ROLL_8->value() + sb_ROLL_9->value() + sb_ROLL_10->value() + sb_ROLL_11->value() + sb_ROLL_12->value(); |
int ROLL = sb_ROLL_1->value() + sb_ROLL_2->value() + sb_ROLL_3->value() + |
sb_ROLL_4->value() + sb_ROLL_5->value() + sb_ROLL_6->value() + |
sb_ROLL_7->value() + sb_ROLL_8->value() + sb_ROLL_9->value() + |
sb_ROLL_10->value() + sb_ROLL_11->value() + sb_ROLL_12->value(); |
|
int GIER = sb_GIER_1->value() + sb_GIER_2->value() + sb_GIER_3->value() + sb_GIER_4->value() + sb_GIER_5->value() + sb_GIER_6->value() + |
sb_GIER_7->value() + sb_GIER_8->value() + sb_GIER_9->value() + sb_GIER_10->value() + sb_GIER_11->value() + sb_GIER_12->value(); |
int GIER = sb_GIER_1->value() + sb_GIER_2->value() + sb_GIER_3->value() + |
sb_GIER_4->value() + sb_GIER_5->value() + sb_GIER_6->value() + |
sb_GIER_7->value() + sb_GIER_8->value() + sb_GIER_9->value() + |
sb_GIER_10->value() + sb_GIER_11->value() + sb_GIER_12->value(); |
|
if (NICK == 0) |
{ |
287,17 → 306,14 |
QSettings Setting(Filename, QSettings::IniFormat); |
|
Setting.beginGroup("Info"); |
//FIXME: Add mixer-struct in kopter.h for kopterdata |
// MixerName = Setting.value("Name", QString("--noname--")).toString(); |
// MixerVersion = Setting.value("Version", 0).toInt(); |
data->motor.mixer_name = Setting.value("Name", QString("--noname--")).toString().toAscii().data(); |
data->motor.mixer_version = Setting.value("Version", 0).toInt(); |
Setting.endGroup(); |
|
//FIXME: Add mixer-struct in kopter.h for kopterdata |
/* |
Setting.beginGroup("Gas"); |
for (int z = 0; z < MAXMOTOR; z++) |
{ |
Motor[z][0] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt(); |
data->motor.mixer_gas[z] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt(); |
} |
Setting.endGroup(); |
|
304,7 → 320,7 |
Setting.beginGroup("Nick"); |
for (int z = 0; z < MAXMOTOR; z++) |
{ |
Motor[z][1] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt(); |
data->motor.mixer_nick[z] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt(); |
} |
Setting.endGroup(); |
|
311,7 → 327,7 |
Setting.beginGroup("Roll"); |
for (int z = 0; z < MAXMOTOR; z++) |
{ |
Motor[z][2] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt(); |
data->motor.mixer_roll[z] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt(); |
} |
Setting.endGroup(); |
|
318,14 → 334,14 |
Setting.beginGroup("Yaw"); |
for (int z = 0; z < MAXMOTOR; z++) |
{ |
Motor[z][3] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt(); |
data->motor.mixer_yaw[z] = Setting.value(QString("Motor%1").arg(z+1), 0).toInt(); |
} |
Setting.endGroup(); |
if (MixerVersion == VERSION_MIXER) |
|
if (data->motor.mixer_version == VERSION_MIXER) |
{ |
set_MotorData(); |
} |
*/ |
} |
} |
|
345,16 → 361,14 |
QSettings Setting(Filename, QSettings::IniFormat); |
|
Setting.beginGroup("Info"); |
//FIXME: Add mixer-struct in kopter.h for kopterdata - doppelter Code!!! |
/* |
Setting.setValue("Name", MixerName); |
Setting.setValue("Version", VERSION_MIXER); |
Setting.setValue("Name", data->motor.mixer_name.c_str()); |
Setting.setValue("Version", data->motor.mixer_version); |
Setting.endGroup(); |
|
Setting.beginGroup("Gas"); |
for (int z = 0; z < MAXMOTOR; z++) |
{ |
Setting.setValue(QString("Motor%1").arg(z+1), Motor[z][0]); |
Setting.setValue(QString("Motor%1").arg(z+1), data->motor.mixer_gas[z]); |
} |
Setting.endGroup(); |
|
361,7 → 375,7 |
Setting.beginGroup("Nick"); |
for (int z = 0; z < MAXMOTOR; z++) |
{ |
Setting.setValue(QString("Motor%1").arg(z+1), Motor[z][1]); |
Setting.setValue(QString("Motor%1").arg(z+1), data->motor.mixer_nick[z]); |
} |
Setting.endGroup(); |
|
368,7 → 382,7 |
Setting.beginGroup("Roll"); |
for (int z = 0; z < MAXMOTOR; z++) |
{ |
Setting.setValue(QString("Motor%1").arg(z+1), Motor[z][2]); |
Setting.setValue(QString("Motor%1").arg(z+1), data->motor.mixer_roll[z]); |
} |
Setting.endGroup(); |
|
375,9 → 389,8 |
Setting.beginGroup("Yaw"); |
for (int z = 0; z < MAXMOTOR; z++) |
{ |
Setting.setValue(QString("Motor%1").arg(z+1), Motor[z][3]); |
Setting.setValue(QString("Motor%1").arg(z+1), data->motor.mixer_yaw[z]); |
} |
Setting.endGroup(); |
*/ |
} |
} |