完成KB3所有界面
This commit is contained in:
+59
-32
@@ -370,7 +370,7 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
copk->width(),copk->height());
|
||||
|
||||
healthui->setGeometry(this->width() - copk->width(),menuBarUI->height() + copk->height(),
|
||||
copk->width(),280);
|
||||
copk->width(),210);
|
||||
|
||||
|
||||
statusui->setGeometry(map->width(),
|
||||
@@ -681,9 +681,6 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
|
||||
static quint64 lastTime = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
|
||||
|
||||
|
||||
static qint64 frq_time = 0;
|
||||
if((QDateTime::currentMSecsSinceEpoch() - frq_time) <= 200)
|
||||
{
|
||||
@@ -741,7 +738,6 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
copk->setGPS(gps_str);
|
||||
|
||||
|
||||
|
||||
QString arm_str;
|
||||
arm_str.clear();
|
||||
|
||||
@@ -928,11 +924,22 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
|
||||
|
||||
toolsui->powersystem->setTurbineState(&dlink->mavlinknode->vehicle.turbinstate);
|
||||
|
||||
toolsui->powersystem->setCCMState(&dlink->mavlinknode->vehicle.ccmstate);
|
||||
toolsui->servosystem->setBUMState(&dlink->mavlinknode->vehicle.bmustate);
|
||||
toolsui->servosystem->setServoState(&dlink->mavlinknode->vehicle.servo_output_raw);
|
||||
|
||||
|
||||
bool v28_Low = false,v56_Low = false;
|
||||
v28_Low = ((dlink->mavlinknode->vehicle.bmustate.BAT1_remain_perc * 0.1) < 10)?(1):(0);
|
||||
v56_Low = ((dlink->mavlinknode->vehicle.bmustate.BAT2_remain_perc * 0.1) < 10)?(1):(0);
|
||||
|
||||
toolsui->servosystem->setCheckState(1,v28_Low || v56_Low);
|
||||
toolsui->servosystem->setCheckState(2,v28_Low);
|
||||
toolsui->servosystem->setCheckState(3,v56_Low);
|
||||
toolsui->servosystem->setCheckState(4,0);
|
||||
toolsui->servosystem->setCheckState(5,0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -954,25 +961,24 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
//qDebug() << dlink->mavlinknode->isCommunicationLost;
|
||||
healthui->setState(6,(dlink->mavlinknode->isCommunicationLost)?(1):(0));//DLINK
|
||||
|
||||
healthui->setState(7,getBit(health,13));//AIR
|
||||
healthui->setState(8,getBit(health,14));//record
|
||||
healthui->setState(9,getBit(health,15));//FP
|
||||
healthui->setState(10,getBit(health,11)?(getBit(health,5)?(0):(2)):(1));//FL
|
||||
healthui->setState(11,getBit(health,16));//LA
|
||||
healthui->setState(12,getBit(health,17));//RA
|
||||
healthui->setState(13,getBit(health,18));//LE
|
||||
healthui->setState(14,getBit(health,19));//RE
|
||||
healthui->setState(15,getBit(health,20));//RU
|
||||
healthui->setState(7,getBit(health,13)?(0):(1));//AIR
|
||||
healthui->setState(9,getBit(health,15)?(0):(1));//FP
|
||||
healthui->setState(10,getBit(health,11)?(0):(1));//FL
|
||||
|
||||
healthui->setState(16,getBit(health,21));//LP
|
||||
healthui->setState(17,getBit(health,22));//RP
|
||||
healthui->setState(11,getBit(health,16)?(0):(1));//LA
|
||||
healthui->setState(12,getBit(health,17)?(0):(1));//RA
|
||||
healthui->setState(13,getBit(health,18)?(0):(1));//LE
|
||||
healthui->setState(14,getBit(health,19)?(0):(1));//RE
|
||||
healthui->setState(15,getBit(health,20)?(0):(1));//RU
|
||||
|
||||
healthui->setState(18,getBit(health,23));//SIM
|
||||
healthui->setState(16,getBit(health,21)?(0):(1));//LT
|
||||
healthui->setState(17,getBit(health,22)?(0):(1));//RT
|
||||
|
||||
healthui->setState(21,getBit(health,25));//OPEN U
|
||||
healthui->setState(22,getBit(health,26));//TROW U
|
||||
healthui->setState(23,getBit(health,27));//ENG 1
|
||||
healthui->setState(24,getBit(health,28));//ENG 2
|
||||
|
||||
healthui->setState(21,getBit(health,25)?(0):(1));//OPEN U
|
||||
healthui->setState(22,getBit(health,26)?(0):(1));//TROW U
|
||||
healthui->setState(23,getBit(health,27)?(0):(1));//ENG 1
|
||||
healthui->setState(24,getBit(health,28)?(0):(1));//ENG 2
|
||||
|
||||
healthui->setState(25,getBit(health,(dlink->mavlinknode->vehicle.gps_raw_int.satellites_visible > 7)?(0):(1)));//GPS
|
||||
healthui->setValueState(25,QString::number(dlink->mavlinknode->vehicle.gps_raw_int.satellites_visible) + tr("颗星"));//GPS
|
||||
@@ -981,17 +987,38 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
healthui->setValueState(26,getBit(health,12)?(tr("连接内置惯导")):(tr("连接SBG")));//sel
|
||||
|
||||
|
||||
statusui->setState(1,QString::number(dlink->mavlinknode->vehicle.airspeed_autocal.ratio,'f',1),2);
|
||||
|
||||
statusui->setState(1,1,2);
|
||||
statusui->setState(2,QString::number(dlink->mavlinknode->vehicle.attitude.pitch * 57.3,'f',1),2);
|
||||
statusui->setState(3,QString::number(dlink->mavlinknode->vehicle.attitude.roll * 57.3,'f',1),2);
|
||||
statusui->setState(4,QString::number(dlink->mavlinknode->vehicle.attitude.yaw * 57.3,'f',1),2);
|
||||
statusui->setState(5,QString::number(dlink->mavlinknode->vehicle.nav_controller_output.xtrack_error,'f',1),2);
|
||||
statusui->setState(6,QString::number(dlink->mavlinknode->vehicle.gps_raw_int.alt,'f',1),2);
|
||||
statusui->setState(7,QString::number(dlink->mavlinknode->vehicle.vfr_hud.airspeed,'f',1),2);
|
||||
statusui->setState(8,QString::number(dlink->mavlinknode->vehicle.vfr_hud.airspeed,'f',1),2);
|
||||
statusui->setState(9,QString::number(dlink->mavlinknode->vehicle.vfr_hud.airspeed/340.0,'f',1),2);
|
||||
statusui->setState(10,QString::number(dlink->mavlinknode->vehicle.vfr_hud.climb,'f',1),2);
|
||||
statusui->setState(2,QString::number(dlink->mavlinknode->vehicle.attitude.pitch * 57.3,'f',1),
|
||||
QString::number(dlink->mavlinknode->vehicle.nav_controller_output.nav_pitch * 57.3,'f',1));
|
||||
|
||||
statusui->setState(3,QString::number(dlink->mavlinknode->vehicle.attitude.roll * 57.3,'f',1),
|
||||
QString::number(dlink->mavlinknode->vehicle.nav_controller_output.nav_roll * 57.3,'f',1));
|
||||
|
||||
statusui->setState(4,QString::number(dlink->mavlinknode->vehicle.attitude.yaw * 57.3,'f',1),
|
||||
QString::number(dlink->mavlinknode->vehicle.nav_controller_output.nav_bearing,'f',1));
|
||||
|
||||
statusui->setState(5,QString::number(dlink->mavlinknode->vehicle.nav_controller_output.xtrack_error,'f',1),
|
||||
QString::number(dlink->mavlinknode->vehicle.nav_controller_output.xtrack_error,'f',1));
|
||||
|
||||
statusui->setState(6,QString::number(dlink->mavlinknode->vehicle.gps_raw_int.alt * 10e-4,'f',1),
|
||||
QString::number(dlink->mavlinknode->vehicle.gps_raw_int.alt * 10e-4
|
||||
+dlink->mavlinknode->vehicle.nav_controller_output.alt_error * 10e-4,'f',1));
|
||||
|
||||
statusui->setState(7,QString::number(dlink->mavlinknode->vehicle.vfr_hud.airspeed,'f',1),
|
||||
QString::number(dlink->mavlinknode->vehicle.vfr_hud.airspeed
|
||||
+dlink->mavlinknode->vehicle.nav_controller_output.aspd_error,'f',1));
|
||||
|
||||
statusui->setState(8,QString::number(dlink->mavlinknode->vehicle.vfr_hud.airspeed,'f',1),
|
||||
QString::number(dlink->mavlinknode->vehicle.vfr_hud.airspeed
|
||||
+dlink->mavlinknode->vehicle.nav_controller_output.aspd_error,'f',1));
|
||||
|
||||
statusui->setState(9,QString::number(dlink->mavlinknode->vehicle.vfr_hud.airspeed/340.0,'f',1),
|
||||
QString::number((dlink->mavlinknode->vehicle.vfr_hud.airspeed
|
||||
+dlink->mavlinknode->vehicle.nav_controller_output.aspd_error)/340.0,'f',1));
|
||||
|
||||
statusui->setState(10,QString::number(dlink->mavlinknode->vehicle.global_position_int.vz * 10e-3,'f',1),
|
||||
QString::number(dlink->mavlinknode->vehicle.global_position_int.vz * 10e-3,'f',1));
|
||||
|
||||
statusui->setServo(1,dlink->mavlinknode->vehicle.servo_output_raw.servo13_raw,
|
||||
dlink->mavlinknode->vehicle.servo_output_raw.servo3_raw);
|
||||
|
||||
Reference in New Issue
Block a user