41修改,基础班,发布
This commit is contained in:
+29
-41
@@ -76,6 +76,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
this,SLOT(onTabIndexChanged(int)));
|
||||
|
||||
|
||||
qDebug() << "menuBar init";
|
||||
//---------------
|
||||
//设置
|
||||
setting = new Setting(this);
|
||||
@@ -91,10 +92,10 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
//状态
|
||||
|
||||
statusui = new StatusUI(this);
|
||||
statusui->hide();
|
||||
//statusui = new StatusUI(this);
|
||||
//statusui->hide();
|
||||
|
||||
healthui = new HealthUI(this);
|
||||
//healthui = new HealthUI(this);
|
||||
//指令
|
||||
commandUI = new CommandUI(this);
|
||||
|
||||
@@ -320,7 +321,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
map,SLOT(WPSetCurrent(int)),Qt::DirectConnection);
|
||||
|
||||
//==== showmessage=====
|
||||
connect(toolsui->command,SIGNAL(showMessage(QString,int)),this,SLOT(showMessage(QString,int)));
|
||||
//connect(toolsui->command,SIGNAL(showMessage(QString,int)),this,SLOT(showMessage(QString,int)));
|
||||
connect(commandUI,SIGNAL(showMessage(QString,int)),this,SLOT(showMessage(QString,int)));
|
||||
connect(copk,SIGNAL(showMessage(QString,int)),this,SLOT(showMessage(QString,int)));
|
||||
connect(dlink,SIGNAL(showMessage(QString,int)),this,SLOT(showMessage(QString,int)));
|
||||
@@ -390,7 +391,7 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
|
||||
|
||||
map->setGeometry(0,menuBarUI->height(),
|
||||
this->width()- copk->width() - statusui->width(),this->height() - menuBarUI->height());
|
||||
this->width()- copk->width(),this->height() - menuBarUI->height());
|
||||
|
||||
if(MainIndex == 2)//renwu
|
||||
{
|
||||
@@ -400,24 +401,17 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
|
||||
//if(MainIndex == 5)//renwu
|
||||
{
|
||||
/*
|
||||
if(statusui->isHidden())
|
||||
map->setGeometry(0,menuBarUI->height(),
|
||||
this->width()- copk->width(),this->height() - menuBarUI->height());
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
copk->setGeometry(this->width() - copk->width(),menuBarUI->height(),
|
||||
copk->width(),copk->height());
|
||||
|
||||
healthui->setGeometry(this->width() - copk->width(),menuBarUI->height() + copk->height(),
|
||||
copk->width(),healthui->height());
|
||||
|
||||
|
||||
statusui->setGeometry(map->width(),
|
||||
menuBarUI->height(),
|
||||
copk->width() *1.5,
|
||||
this->height() - menuBarUI->height());
|
||||
|
||||
|
||||
missionUI->setGeometry(this->width() - copk->width(),menuBarUI->height(),
|
||||
copk->width(),this->height() - menuBarUI->height());
|
||||
@@ -425,8 +419,8 @@ void MainWindow::resizeEvent(QResizeEvent *event)
|
||||
|
||||
|
||||
|
||||
commandUI->setGeometry(this->width() - copk->width(),menuBarUI->height() + copk->height() + healthui->height(),
|
||||
copk->width(),this->height() - menuBarUI->height() - copk->height() - healthui->height());
|
||||
commandUI->setGeometry(this->width() - copk->width(),menuBarUI->height() + copk->height(),
|
||||
copk->width(),this->height() - menuBarUI->height() - copk->height());
|
||||
|
||||
|
||||
toolsui->setGeometry(0,menuBarUI->height(),
|
||||
@@ -628,14 +622,14 @@ void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
|
||||
copk->show();
|
||||
commandUI->show();
|
||||
//statusui->show();
|
||||
healthui->show();
|
||||
//healthui->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
copk->hide();
|
||||
commandUI->hide();
|
||||
//statusui->hide();
|
||||
healthui->hide();
|
||||
//healthui->hide();
|
||||
}
|
||||
|
||||
|
||||
@@ -646,24 +640,16 @@ void MainWindow::onTabIndexChanged(const int &index)//界面选择管理
|
||||
|
||||
if(index == 5)
|
||||
{
|
||||
if(statusui->isHidden())
|
||||
{
|
||||
|
||||
copk->show();
|
||||
commandUI->show();
|
||||
statusui->show();
|
||||
healthui->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
copk->show();
|
||||
commandUI->show();
|
||||
statusui->hide();
|
||||
healthui->show();
|
||||
}
|
||||
//statusui->hide();
|
||||
//healthui->show();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
statusui->hide();
|
||||
//statusui->hide();
|
||||
}
|
||||
|
||||
|
||||
@@ -689,7 +675,8 @@ void MainWindow::setCommunicationLostState(bool flag)
|
||||
|
||||
isCommunicationLost = flag;
|
||||
|
||||
healthui->setState(6,(dlink->mavlinknode->isCommunicationLost)?(HealthUI::state::failure):(HealthUI::state::success));//DLINK
|
||||
|
||||
//healthui->setState(6,(dlink->mavlinknode->isCommunicationLost)?(HealthUI::state::failure):(HealthUI::state::success));//DLINK
|
||||
|
||||
if(flag == true)//通讯丢失
|
||||
{
|
||||
@@ -698,7 +685,7 @@ void MainWindow::setCommunicationLostState(bool flag)
|
||||
showMessage(tr("Communication Lost"),3000);
|
||||
tts->say(tr("Communication Lost"));
|
||||
}
|
||||
|
||||
/*
|
||||
healthui->setState(1,HealthUI::state::failure);
|
||||
healthui->setState(2,HealthUI::state::failure);
|
||||
healthui->setState(4,HealthUI::state::failure);
|
||||
@@ -719,7 +706,7 @@ void MainWindow::setCommunicationLostState(bool flag)
|
||||
healthui->setState(25,HealthUI::state::failure);
|
||||
|
||||
healthui->setState(30,HealthUI::state::failure);
|
||||
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -972,7 +959,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
dlink->mavlinknode->vehicle.attitude.yaw * 57.3);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
if(MainIndex == 3)//飞行界面
|
||||
{
|
||||
//刷新时间1Hz
|
||||
@@ -988,7 +975,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
showMessage(message);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1017,7 +1004,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
舵机指令
|
||||
自检 2004
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
//设置舵机显示
|
||||
|
||||
@@ -1097,6 +1084,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
//dlink->mavlinknode->vehicle.servo_output_raw.servo5_raw
|
||||
uint16_t servoHealt = dlink->mavlinknode->vehicle.servo_output_raw.servo10_raw;
|
||||
|
||||
*/
|
||||
/*
|
||||
sbus = feedback (ra)
|
||||
sbus = feedback (re)
|
||||
@@ -1110,7 +1098,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
//舵机反馈是有符号16b/
|
||||
|
||||
//qDebug() << getBit(health,16);
|
||||
|
||||
/*
|
||||
healthui->setState(11,getBit(health,16)?(getBit(servoHealt,3)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//LA
|
||||
healthui->setState(12,getBit(health,13)?(getBit(servoHealt,0)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//RA
|
||||
healthui->setState(13,getBit(health,17)?(getBit(servoHealt,4)?(HealthUI::state::success):(HealthUI::state::warning)):(HealthUI::state::failure));//LE
|
||||
@@ -1413,7 +1401,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
toolsui->diagram->setGPS2(7,gpsFix2);
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1424,7 +1412,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
|
||||
|
||||
void MainWindow::TotalDistance(double value)
|
||||
{
|
||||
/*
|
||||
|
||||
if(MainIndex == 2)//任务界面
|
||||
{
|
||||
QString message;
|
||||
@@ -1436,6 +1424,6 @@ void MainWindow::TotalDistance(double value)
|
||||
showMessage(message);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user