添加伺服系统
This commit is contained in:
@@ -6,7 +6,9 @@ PowerSystem::PowerSystem(QWidget *parent) :
|
||||
ui(new Ui::PowerSystem)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
par = parent;
|
||||
m_parent = parent;
|
||||
|
||||
setWindowTitle(tr("PowerSyste"));
|
||||
|
||||
//load qss
|
||||
QFile file(":/qss/PowerSystem.qss");
|
||||
@@ -92,6 +94,27 @@ PowerSystem::PowerSystem(QWidget *parent) :
|
||||
ui->comboBox_rate->setCurrentIndex(-1);
|
||||
|
||||
|
||||
ui->comboBox_TestPoint->addItem("核心机主燃油泵",0);
|
||||
ui->comboBox_TestPoint->addItem("加力主燃油泵",1);
|
||||
ui->comboBox_TestPoint->addItem("加力点火燃油泵",2);
|
||||
ui->comboBox_TestPoint->addItem("尾喷口舵机",3);
|
||||
ui->comboBox_TestPoint->addItem("点火器",4);
|
||||
ui->comboBox_TestPoint->addItem("启动控制器1",5);
|
||||
ui->comboBox_TestPoint->addItem("启动控制器2",6);
|
||||
ui->comboBox_TestPoint->addItem("核心机点火油阀",7);
|
||||
ui->comboBox_TestPoint->addItem("核心机优先油阀",8);
|
||||
ui->comboBox_TestPoint->addItem("核心机轻吹油阀",9);
|
||||
ui->comboBox_TestPoint->addItem("核心机启动气阀",10);
|
||||
ui->comboBox_TestPoint->addItem("核心机主油阀",11);
|
||||
ui->comboBox_TestPoint->addItem("加力主油阀",12);
|
||||
ui->comboBox_TestPoint->addItem("加力轻吹阀",13);
|
||||
ui->comboBox_TestPoint->addItem("加力点火快速阀",14);
|
||||
ui->comboBox_TestPoint->addItem("手动转速控制",15);
|
||||
ui->comboBox_TestPoint->setCurrentIndex(-1);
|
||||
|
||||
ui->comboBox_TestValue->show();
|
||||
ui->comboBox_TestValue->setCurrentIndex(-1);
|
||||
|
||||
}
|
||||
|
||||
PowerSystem::~PowerSystem()
|
||||
@@ -99,11 +122,7 @@ PowerSystem::~PowerSystem()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void PowerSystem::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
setFloat();
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
|
||||
void PowerSystem::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
@@ -113,6 +132,11 @@ void PowerSystem::mousePressEvent(QMouseEvent *event)
|
||||
}
|
||||
}
|
||||
|
||||
void PowerSystem::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
setFloat();
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
void PowerSystem::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
@@ -141,7 +165,7 @@ void PowerSystem::setFloat(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setParent(par);
|
||||
this->setParent(m_parent);
|
||||
this->move(0,0);
|
||||
}
|
||||
this->show();
|
||||
@@ -264,5 +288,81 @@ void PowerSystem::setTurbineState(mavlink_turbinestate_t *t)
|
||||
|
||||
}
|
||||
|
||||
void PowerSystem::on_comboBox_TestPoint_currentIndexChanged(int index)
|
||||
{
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 15:
|
||||
ui->label_TestValue->show();
|
||||
ui->label_TestValue->setText("转速");
|
||||
|
||||
ui->comboBox_TestValue->show();
|
||||
ui->comboBox_TestValue->clear();
|
||||
ui->comboBox_TestValue->addItem("10000",10000);
|
||||
ui->comboBox_TestValue->addItem("15000",15000);
|
||||
ui->comboBox_TestValue->addItem("20000",20000);
|
||||
ui->comboBox_TestValue->addItem("25000",25000);
|
||||
ui->comboBox_TestValue->addItem("30000",30000);
|
||||
ui->comboBox_TestValue->addItem("35000",35000);
|
||||
ui->comboBox_TestValue->addItem("40000",40000);
|
||||
ui->comboBox_TestValue->addItem("45000",45000);
|
||||
ui->comboBox_TestValue->setEditable(true);
|
||||
ui->comboBox_TestValue->setCurrentIndex(0);
|
||||
|
||||
break;
|
||||
case 3:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
ui->label_TestValue->show();
|
||||
ui->label_TestValue->setText("电平");
|
||||
|
||||
ui->comboBox_TestValue->show();
|
||||
ui->comboBox_TestValue->clear();
|
||||
ui->comboBox_TestValue->addItem("低电平",0);
|
||||
ui->comboBox_TestValue->addItem("高电平",1);
|
||||
ui->comboBox_TestValue->setEditable(true);
|
||||
ui->comboBox_TestValue->setCurrentIndex(1);
|
||||
|
||||
break;
|
||||
case 4:
|
||||
ui->label_TestValue->hide();
|
||||
ui->comboBox_TestValue->hide();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void PowerSystem::on_pushButton_SendTest_clicked()
|
||||
{
|
||||
float testPoint = 0;
|
||||
float testValue = 0;
|
||||
|
||||
if(!ui->comboBox_TestValue->isHidden())//显示
|
||||
{
|
||||
testPoint = ui->comboBox_TestPoint->currentData(Qt::UserRole).toFloat();
|
||||
testValue = ui->comboBox_TestValue->currentData(Qt::UserRole).toFloat();
|
||||
}
|
||||
else
|
||||
{
|
||||
testPoint = ui->comboBox_TestPoint->currentData(Qt::UserRole).toFloat();
|
||||
}
|
||||
|
||||
qDebug() << "send test:" << testPoint << testValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user