纠正数据极性,添加曲线,修改曲线刷新率
This commit is contained in:
@@ -102,30 +102,31 @@ PowerSystem::PowerSystem(QWidget *parent) :
|
||||
cmdList.insert(0xea,"加力点火快速阀");
|
||||
|
||||
|
||||
ScopeRPM = new Scope(ui->frame_scope);
|
||||
ScopeTemp = new Scope(ui->frame_scope);
|
||||
ScopeAlt = new Scope(ui->frame_scope);
|
||||
ScopeMa = new Scope(ui->frame_scope);
|
||||
ScopeRPM = new Chart(ui->frame_RPM);
|
||||
ScopeTemp = new Chart(ui->frame_Temp);
|
||||
ScopeAlt = new Chart(ui->frame_Alt);
|
||||
ScopeMa = new Chart(ui->frame_Ma);
|
||||
|
||||
ScopeRPM->hideButton(true);
|
||||
ScopeTemp->hideButton(true);
|
||||
ScopeAlt->hideButton(true);
|
||||
ScopeMa->hideButton(true);
|
||||
ScopeRPM->chart()->axisX()->hide();
|
||||
ScopeTemp->chart()->axisX()->hide();
|
||||
ScopeAlt->chart()->axisX()->hide();
|
||||
ScopeMa->chart()->axisX()->hide();
|
||||
|
||||
ScopeRPM->chartView->chart()->axisX()->hide();
|
||||
ScopeTemp->chartView->chart()->axisX()->hide();
|
||||
ScopeAlt->chartView->chart()->axisX()->hide();
|
||||
ScopeMa->chartView->chart()->axisX()->hide();
|
||||
ScopeRPM->chart()->legend()->setAlignment(Qt::AlignLeft);
|
||||
ScopeTemp->chart()->legend()->setAlignment(Qt::AlignLeft);
|
||||
ScopeAlt->chart()->legend()->setAlignment(Qt::AlignLeft);
|
||||
ScopeMa->chart()->legend()->setAlignment(Qt::AlignLeft);
|
||||
|
||||
|
||||
/*
|
||||
ScopeRPM = new QtCharts::QChart();
|
||||
ScopeTemp = new QtCharts::QChart();
|
||||
ScopeAlt = new QtCharts::QChart();
|
||||
ScopeMa = new QtCharts::QChart();
|
||||
*/
|
||||
|
||||
ScopeRPM->setOperation(false);
|
||||
ScopeTemp->setOperation(false);
|
||||
ScopeAlt->setOperation(false);
|
||||
ScopeMa->setOperation(false);
|
||||
|
||||
ScopeRPM->setRenderHint(QPainter::Antialiasing);
|
||||
ScopeTemp->setRenderHint(QPainter::Antialiasing);
|
||||
ScopeAlt->setRenderHint(QPainter::Antialiasing);
|
||||
ScopeMa->setRenderHint(QPainter::Antialiasing);
|
||||
}
|
||||
|
||||
PowerSystem::~PowerSystem()
|
||||
@@ -135,11 +136,10 @@ PowerSystem::~PowerSystem()
|
||||
|
||||
void PowerSystem::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
|
||||
ScopeRPM->setGeometry(0,0,ui->frame_scope->width(),ui->frame_scope->height()/4);
|
||||
ScopeTemp->setGeometry(0,ui->frame_scope->height()/4,ui->frame_scope->width(),ui->frame_scope->height()/4);
|
||||
ScopeAlt->setGeometry(0,ui->frame_scope->height()/2,ui->frame_scope->width(),ui->frame_scope->height()/4);
|
||||
ScopeMa->setGeometry(0,3*ui->frame_scope->height()/4,ui->frame_scope->width(),ui->frame_scope->height()/4);
|
||||
ScopeRPM->setGeometry(0,0,ui->frame_RPM->width(),ui->frame_RPM->height());
|
||||
ScopeTemp->setGeometry(0,0,ui->frame_Temp->width(),ui->frame_Temp->height());
|
||||
ScopeAlt->setGeometry(0,0,ui->frame_Alt->width(),ui->frame_Alt->height());
|
||||
ScopeMa->setGeometry(0,0,ui->frame_Ma->width(),ui->frame_Ma->height());
|
||||
|
||||
|
||||
}
|
||||
@@ -160,6 +160,7 @@ void PowerSystem::closeEvent(QCloseEvent *event)
|
||||
|
||||
void PowerSystem::contextMenuEvent(QContextMenuEvent *event)
|
||||
{
|
||||
/*
|
||||
QMenu *menu = new QMenu(this);
|
||||
|
||||
QAction *pAction = new QAction("float",this);
|
||||
@@ -170,6 +171,7 @@ void PowerSystem::contextMenuEvent(QContextMenuEvent *event)
|
||||
menu->addAction(pAction);
|
||||
menu->move(cursor().pos());
|
||||
menu->show();
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -313,15 +315,15 @@ void PowerSystem::setTurbineState(mavlink_turbinestate_t *t)
|
||||
|
||||
|
||||
|
||||
ScopeRPM->chartView->setSerieData(tr("物理转速"),t->RPM_mea);
|
||||
ScopeRPM->chartView->setSerieData(tr("期望物理转速"),t->RPM_des);
|
||||
ScopeRPM->setSerieData(tr("物理转速"),t->RPM_mea);
|
||||
ScopeRPM->setSerieData(tr("期望物理转速"),t->RPM_des);
|
||||
|
||||
ScopeTemp->chartView->setSerieData(tr("排气温度T5"),t->T5);
|
||||
ScopeTemp->setSerieData(tr("排气温度T5"),t->T5);
|
||||
|
||||
//从新做一个函数
|
||||
ScopeAlt->chartView->setSerieData(tr("海拔"),10);
|
||||
//ScopeAlt->setSerieData(tr("海拔"),10);
|
||||
|
||||
ScopeMa->chartView->setSerieData(tr("马赫"),t->tas_ap);
|
||||
//ScopeMa->setSerieData(tr("马赫"),t->tas_ap);
|
||||
|
||||
|
||||
|
||||
@@ -334,3 +336,15 @@ void PowerSystem::setCCMState(mavlink_ccmstate_t *t)
|
||||
ui->label_STEMP1->setText(QString::number(t->temp[0] * 0.1,'f',1));
|
||||
ui->label_STEMP2->setText(QString::number(t->temp[1] * 0.1,'f',1));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PowerSystem::setMa(QVariant Ma)
|
||||
{
|
||||
ScopeMa->setSerieData(tr("马赫"),Ma);
|
||||
}
|
||||
|
||||
void PowerSystem::setAlt(QVariant Alt)
|
||||
{
|
||||
ScopeAlt->setSerieData(tr("海拔"),Alt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user