完成状态界面,航点改颜色
This commit is contained in:
+71
-23
@@ -169,13 +169,13 @@ void StatusUI::setMode(uint32_t pos,QVariant value1,QVariant value2)
|
||||
|
||||
|
||||
|
||||
void StatusUI::setState(uint32_t pos,QVariant real,QVariant tar)
|
||||
void StatusUI::setState(uint32_t pos, QVariant value1, QVariant value2)
|
||||
{
|
||||
switch (pos) {
|
||||
case 1:
|
||||
ui->label_1_Atteck->setText(real.toString());
|
||||
ui->label_1_Atteck->setText(value1.toString());
|
||||
|
||||
if(qAbs(real.toFloat()) >= 45)
|
||||
if(qAbs(value1.toFloat()) >= 40)
|
||||
{
|
||||
setColor(ui->label_1_Atteck,state::failure);
|
||||
}
|
||||
@@ -186,9 +186,9 @@ void StatusUI::setState(uint32_t pos,QVariant real,QVariant tar)
|
||||
|
||||
break;
|
||||
case 2:
|
||||
ui->label_1_Slide->setText(real.toString());
|
||||
ui->label_1_Slide->setText(value1.toString());
|
||||
|
||||
if(qAbs(real.toFloat()) >= 40)
|
||||
if(qAbs(value1.toFloat()) >= 40)
|
||||
{
|
||||
setColor(ui->label_1_Slide,state::failure);
|
||||
}
|
||||
@@ -199,41 +199,89 @@ void StatusUI::setState(uint32_t pos,QVariant real,QVariant tar)
|
||||
|
||||
break;
|
||||
case 3:
|
||||
ui->label_1_rol->setText(real.toString());
|
||||
ui->label_2_rol->setText(tar.toString());
|
||||
ui->label_1_rol->setText(value1.toString());
|
||||
ui->label_2_rol->setText(value2.toString());
|
||||
|
||||
if(qAbs(value1.toFloat()) >= 60)
|
||||
{
|
||||
setColor(ui->label_1_rol,state::failure);
|
||||
}
|
||||
else
|
||||
{
|
||||
setColor(ui->label_1_rol,state::inital);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case 4:
|
||||
ui->label_1_pit->setText(real.toString());
|
||||
ui->label_2_pit->setText(tar.toString());
|
||||
ui->label_1_pit->setText(value1.toString());
|
||||
ui->label_2_pit->setText(value2.toString());
|
||||
|
||||
if(qAbs(value1.toFloat()) >= 40)
|
||||
{
|
||||
setColor(ui->label_1_pit,state::failure);
|
||||
}
|
||||
else
|
||||
{
|
||||
setColor(ui->label_1_pit,state::inital);
|
||||
}
|
||||
|
||||
break;
|
||||
case 5:
|
||||
ui->label_1_heading->setText(real.toString());
|
||||
ui->label_2_heading->setText(tar.toString());
|
||||
ui->label_1_heading->setText(value1.toString());
|
||||
ui->label_2_heading->setText(value2.toString());
|
||||
|
||||
break;
|
||||
case 6:
|
||||
ui->label_1_alt->setText(real.toString());
|
||||
ui->label_2_alt->setText(tar.toString());
|
||||
ui->label_1_alt->setText(value1.toString());
|
||||
ui->label_2_alt->setText(value2.toString());
|
||||
break;
|
||||
case 7:
|
||||
ui->label_1_cas->setText(real.toString());
|
||||
ui->label_1_cas->setText(value1.toString());
|
||||
|
||||
break;
|
||||
case 8:
|
||||
ui->label_1_tas->setText(real.toString());
|
||||
ui->label_2_tas->setText(tar.toString());
|
||||
ui->label_1_tas->setText(value1.toString());
|
||||
ui->label_2_tas->setText(value2.toString());
|
||||
|
||||
if(value1.toFloat() <= 90)
|
||||
{
|
||||
setColor(ui->label_1_tas,state::failure);
|
||||
}
|
||||
else
|
||||
{
|
||||
setColor(ui->label_1_tas,state::inital);
|
||||
}
|
||||
|
||||
break;
|
||||
case 9:
|
||||
ui->label_1_gs->setText(real.toString());
|
||||
ui->label_1_gs->setText(value1.toString());
|
||||
|
||||
if(value1.toFloat() <= 90)
|
||||
{
|
||||
setColor(ui->label_1_gs,state::failure);
|
||||
}
|
||||
else
|
||||
{
|
||||
setColor(ui->label_1_gs,state::inital);
|
||||
}
|
||||
|
||||
break;
|
||||
case 10:
|
||||
ui->label_1_ma->setText(real.toString());
|
||||
ui->label_1_ma->setText(value1.toString());
|
||||
|
||||
break;
|
||||
case 11:
|
||||
ui->label_1_rate->setText(real.toString());
|
||||
ui->label_1_rate->setText(value1.toString());
|
||||
|
||||
if(value1.toFloat() <= -70)
|
||||
{
|
||||
setColor(ui->label_1_rate,state::failure);
|
||||
}
|
||||
else
|
||||
{
|
||||
setColor(ui->label_1_rate,state::inital);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -288,7 +336,7 @@ void StatusUI::setEngine(uint32_t pos,QVariant value1,QVariant value2)
|
||||
|
||||
ui->label_1_FuelLevel->setText(value1.toString());
|
||||
|
||||
if(qAbs(value1.toFloat()) <= 10)
|
||||
if(qAbs(value1.toFloat()) <= 9)
|
||||
{
|
||||
setColor(ui->label_1_FuelLevel,state::failure);
|
||||
}
|
||||
@@ -300,7 +348,7 @@ void StatusUI::setEngine(uint32_t pos,QVariant value1,QVariant value2)
|
||||
|
||||
ui->label_2_FuelLevel->setText(value2.toString());
|
||||
|
||||
if(qAbs(value2.toFloat()) <= 10)
|
||||
if(qAbs(value2.toFloat()) <= 9)
|
||||
{
|
||||
setColor(ui->label_2_FuelLevel,state::failure);
|
||||
}
|
||||
@@ -424,7 +472,7 @@ void StatusUI::setDlink(uint32_t pos,QVariant value1,QVariant value2)
|
||||
|
||||
ui->label_ssp->setText(value1.toString());
|
||||
|
||||
if(qAbs(value1.toFloat()) <= 500)
|
||||
if(qAbs(value1.toFloat()) <= 50)
|
||||
{
|
||||
setColor(ui->label_ssp,state::failure);
|
||||
}
|
||||
@@ -437,7 +485,7 @@ void StatusUI::setDlink(uint32_t pos,QVariant value1,QVariant value2)
|
||||
|
||||
ui->label_ssr->setText(value2.toString());
|
||||
|
||||
if(qAbs(value2.toFloat()) <= 50)
|
||||
if(qAbs(value2.toFloat()) <= 500)
|
||||
{
|
||||
setColor(ui->label_ssr,state::failure);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user