曳光管状态显示修正
This commit is contained in:
@@ -19,13 +19,12 @@ ServoSystem::ServoSystem(QWidget *parent) :
|
||||
file.close();
|
||||
|
||||
//========
|
||||
setColor(ui->checkBox_onBoard,state::success);
|
||||
setColor(ui->checkBox_28v,state::success);
|
||||
setColor(ui->checkBox_56v,state::success);
|
||||
setColor(ui->checkBox_AirSpeed,state::success);
|
||||
setColor(ui->checkBox_500W,state::failure);
|
||||
|
||||
//setColor(ui->label_LE_SBIT,state::failure);
|
||||
setColor(ui->checkBox_onBoard,state::inital);
|
||||
setColor(ui->checkBox_28v,state::inital);
|
||||
setColor(ui->checkBox_56v,state::inital);
|
||||
setColor(ui->checkBox_AirSpeed,state::inital);
|
||||
setColor(ui->checkBox_500W,state::inital);
|
||||
setColor(ui->checkBox_Tracer,state::inital);
|
||||
|
||||
|
||||
setCheckState(6,state::failure);
|
||||
@@ -296,13 +295,13 @@ void ServoSystem::setCheckState(uint32_t pos,QVariant value)
|
||||
setColor(ui->checkBox_56v,(value.toBool())?(state::success):(state::failure));
|
||||
break;
|
||||
case 4:
|
||||
setColor(ui->checkBox_AirSpeed,(value.toBool())?(state::success):(state::failure));
|
||||
setColor(ui->checkBox_AirSpeed,(value.toBool())?(state::success):(state::inital));
|
||||
break;
|
||||
case 5:
|
||||
setColor(ui->checkBox_500W,(value.toBool())?(state::success):(state::failure));
|
||||
setColor(ui->checkBox_500W,(value.toBool())?(state::success):(state::inital));
|
||||
break;
|
||||
case 6:
|
||||
//setColor(ui->checkBox_5525D,(value.toBool())?(state::success):(state::failure));
|
||||
//setColor(ui->checkBox_Tracer,(value.toBool())?(state::success):(state::failure));
|
||||
break;
|
||||
case 7:
|
||||
//setColor(ui->checkBox_5803A,(value.toBool())?(state::success):(state::failure));
|
||||
@@ -380,6 +379,11 @@ void ServoSystem::setServoState(mavlink_servo_output_raw_t *t)
|
||||
|
||||
}
|
||||
|
||||
void ServoSystem::setCCMState(mavlink_ccmstate_t *t)
|
||||
{
|
||||
//判断echo_seq,是否一直在增加
|
||||
|
||||
}
|
||||
|
||||
void ServoSystem::setAPversion(QString ver)
|
||||
{
|
||||
@@ -537,6 +541,29 @@ void ServoSystem::commandAccepted(bool flag,uint16_t command,uint8_t result)
|
||||
m_command = 0;
|
||||
m_confirm = 0;
|
||||
|
||||
if(isWaitPitotAck == true)
|
||||
{
|
||||
if(result == MAV_RESULT_ACCEPTED)//已经正确执行
|
||||
{
|
||||
isWaitPitotAck = false;
|
||||
setColor(ui->checkBox_AirSpeed,state::success);
|
||||
}
|
||||
else if(result == MAV_RESULT_ACCEPTED)//已经正确执行
|
||||
{
|
||||
isWaitPitotAck = false;
|
||||
setColor(ui->checkBox_AirSpeed,state::success);
|
||||
}
|
||||
}
|
||||
|
||||
if(isWaitTracerAck == true)
|
||||
{
|
||||
if(result == MAV_RESULT_ACCEPTED)//已经正确执行
|
||||
{
|
||||
isWaitTracerAck = false;
|
||||
setColor(ui->checkBox_Tracer,state::success);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(string.size() > 0)
|
||||
@@ -657,11 +684,16 @@ void ServoSystem::on_pushButton_SendCommand_clicked()
|
||||
|
||||
if(cmdType == 0)
|
||||
{
|
||||
emit showMessage(tr("发送指令 ") + QString::number(m_command) + " " + m_name,5000);
|
||||
emit cmd_long(m_param1,m_param2,m_param3,m_param4,m_param5,m_param6,m_param7,m_command,m_confirm);
|
||||
|
||||
if(m_name == ui->pushButton_AirHeatOn->text())
|
||||
|
||||
QString name = m_name.split(' ',QString::SkipEmptyParts).last();
|
||||
|
||||
//qDebug() << m_name << name;
|
||||
|
||||
if(name == ui->pushButton_AirHeatOn->text())
|
||||
{
|
||||
isWaitPitotAck = true;
|
||||
|
||||
if((tim)&&(tim->isActive()))
|
||||
{
|
||||
tim->stop();
|
||||
@@ -670,8 +702,9 @@ void ServoSystem::on_pushButton_SendCommand_clicked()
|
||||
heatCount = 0;
|
||||
tim->start();
|
||||
}
|
||||
else if(m_name == ui->pushButton_HeatOff->text())
|
||||
else if(name == ui->pushButton_HeatOff->text())
|
||||
{
|
||||
setColor(ui->checkBox_AirSpeed,state::inital);
|
||||
if((tim)&&(tim->isActive()))
|
||||
{
|
||||
tim->stop();
|
||||
@@ -679,6 +712,14 @@ void ServoSystem::on_pushButton_SendCommand_clicked()
|
||||
ui->label_heatTime->setText(tr("time: %1 s").arg(heatCount));
|
||||
}
|
||||
}
|
||||
else if(name == ui->pushButton_tracer->text())
|
||||
{
|
||||
isWaitTracerAck = true;
|
||||
//qDebug() << "wait for tracer";
|
||||
}
|
||||
|
||||
emit showMessage(tr("发送指令 ") + QString::number(m_command) + " " + m_name,5000);
|
||||
emit cmd_long(m_param1,m_param2,m_param3,m_param4,m_param5,m_param6,m_param7,m_command,m_confirm);
|
||||
|
||||
}
|
||||
else if(cmdType == 1)
|
||||
@@ -1143,6 +1184,8 @@ void ServoSystem::on_pushButton_AirHeatOn_clicked()
|
||||
|
||||
if(rst == QMessageBox::AcceptRole)
|
||||
{
|
||||
|
||||
|
||||
on_commandClicked(ui->pushButton_AirHeatOn->text(),
|
||||
1,1,0,0,0,0,0,20005,0);
|
||||
|
||||
@@ -1237,6 +1280,8 @@ void ServoSystem::on_pushButton_500W_Close_clicked()
|
||||
|
||||
void ServoSystem::on_pushButton_tracer_clicked()
|
||||
{
|
||||
|
||||
|
||||
on_commandClicked(tr("设定 %1").arg(ui->pushButton_tracer->text()),
|
||||
0,0,0,0,0,0,0,20013,0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user