773 lines
20 KiB
C++
773 lines
20 KiB
C++
#include "Diagram.h"
|
|
#include "ui_Diagram.h"
|
|
|
|
Diagram::Diagram(QWidget *parent) :
|
|
ToolsWidget(parent),
|
|
ui(new Ui::Diagram)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
|
|
QFile file(":/qss/Diagram.qss");
|
|
file.open(QFile::ReadOnly);
|
|
QTextStream filetext(&file);
|
|
QString stylesheet = filetext.readAll();
|
|
this->setStyleSheet(stylesheet);
|
|
file.close();
|
|
int w = 60;
|
|
int h = 25;
|
|
|
|
attChart = new Chart(ui->frame_Attitude);
|
|
gyroChart = new Chart(ui->frame_Gyro);
|
|
accChart = new Chart(ui->frame_Accelerate);
|
|
|
|
attChart->setGeometry(0,0,ui->frame_Attitude->width(),ui->frame_Attitude->height());
|
|
gyroChart->setGeometry(0,0,ui->frame_Gyro->width(),ui->frame_Gyro->height());
|
|
accChart->setGeometry(0,0,ui->frame_Accelerate->width(),ui->frame_Accelerate->height());
|
|
|
|
|
|
attChart->chart()->legend()->setAlignment(Qt::AlignRight);
|
|
gyroChart->chart()->legend()->setAlignment(Qt::AlignRight);
|
|
accChart->chart()->legend()->setAlignment(Qt::AlignRight);
|
|
|
|
attChart->setOperation(false);
|
|
gyroChart->setOperation(false);
|
|
accChart->setOperation(false);
|
|
|
|
attChart->setRenderHint(QPainter::Antialiasing);
|
|
gyroChart->setRenderHint(QPainter::Antialiasing);
|
|
accChart->setRenderHint(QPainter::Antialiasing);
|
|
|
|
//ui->label->setFixedSize(w,h);
|
|
|
|
|
|
|
|
attChart->setRubberBand(QChartView::RectangleRubberBand);
|
|
gyroChart->setRubberBand(QChartView::RectangleRubberBand);
|
|
accChart->setRubberBand(QChartView::RectangleRubberBand);
|
|
|
|
//=======================================================
|
|
connect(ui->checkBox_ins_ax,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_acc_stateChanged);
|
|
|
|
connect(ui->checkBox_ins_ay,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_acc_stateChanged);
|
|
|
|
connect(ui->checkBox_ins_az,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_acc_stateChanged);
|
|
//=======================================================
|
|
connect(ui->checkBox_ins_p,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
|
|
connect(ui->checkBox_ins_q,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
|
|
connect(ui->checkBox_ins_r,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
//=======================================================
|
|
connect(ui->checkBox_ins_rol,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_att_stateChanged);
|
|
|
|
connect(ui->checkBox_ins_pit,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_att_stateChanged);
|
|
|
|
|
|
//=======================================================
|
|
connect(ui->checkBox_sbg_ax,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_acc_stateChanged);
|
|
|
|
connect(ui->checkBox_sbg_ay,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_acc_stateChanged);
|
|
|
|
connect(ui->checkBox_sbg_az,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_acc_stateChanged);
|
|
//=======================================================
|
|
connect(ui->checkBox_sbg_p,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
|
|
connect(ui->checkBox_sbg_q,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
|
|
connect(ui->checkBox_sbg_r,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
//=======================================================
|
|
connect(ui->checkBox_sbg_rol,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_att_stateChanged);
|
|
|
|
connect(ui->checkBox_sbg_pit,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_att_stateChanged);
|
|
|
|
|
|
//=======================================================
|
|
connect(ui->checkBox_use_p,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
|
|
connect(ui->checkBox_use_q,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
|
|
connect(ui->checkBox_use_r,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_gyro_stateChanged);
|
|
//=======================================================
|
|
connect(ui->checkBox_use_rol,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_att_stateChanged);
|
|
|
|
connect(ui->checkBox_use_pit,&QCheckBox::stateChanged,
|
|
this,&Diagram::on_checkBox_att_stateChanged);
|
|
|
|
|
|
|
|
update();
|
|
|
|
}
|
|
|
|
Diagram::~Diagram()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void Diagram::resizeEvent(QResizeEvent *event)
|
|
{
|
|
|
|
attChart->setGeometry(0,0,ui->frame_Attitude->width(),ui->frame_Attitude->height());
|
|
gyroChart->setGeometry(0,0,ui->frame_Gyro->width(),ui->frame_Gyro->height());
|
|
accChart->setGeometry(0,0,ui->frame_Accelerate->width(),ui->frame_Accelerate->height());
|
|
|
|
}
|
|
|
|
void Diagram::setBaseState(uint32_t pos,QVariant measure,QVariant target)
|
|
{
|
|
switch (pos) {
|
|
case 1:
|
|
ui->label_measure_atteck->setText(measure.toString());
|
|
if(qAbs(measure.toFloat()) >= 20)
|
|
{
|
|
setColor(ui->label_measure_atteck,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_measure_atteck,state::inital);
|
|
}
|
|
break;
|
|
case 2:
|
|
ui->label_measure_slide->setText(measure.toString());
|
|
if(qAbs(measure.toFloat()) >= 20)
|
|
{
|
|
setColor(ui->label_measure_slide,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_measure_slide,state::inital);
|
|
}
|
|
break;
|
|
case 3:
|
|
ui->label_measure_roll->setText(measure.toString());
|
|
ui->label_target_roll->setText(target.toString());
|
|
|
|
if(qAbs(measure.toFloat()) >= 45)
|
|
{
|
|
setColor(ui->label_measure_roll,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_measure_roll,state::inital);
|
|
}
|
|
|
|
|
|
break;
|
|
case 4:
|
|
ui->label_measure_pitch->setText(measure.toString());
|
|
ui->label_target_pitch->setText(target.toString());
|
|
|
|
if(qAbs(measure.toFloat()) >= 25)
|
|
{
|
|
setColor(ui->label_measure_pitch,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_measure_pitch,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 5:
|
|
ui->label_measure_heading->setText(measure.toString());
|
|
ui->label_target_heading->setText(target.toString());
|
|
break;
|
|
case 6:
|
|
ui->label_measure_altitude->setText(measure.toString());
|
|
ui->label_target_altitude->setText(target.toString());
|
|
break;
|
|
case 7:
|
|
ui->label_measure_tas->setText(measure.toString());
|
|
ui->label_target_tas->setText(target.toString());
|
|
|
|
if(qAbs(measure.toFloat()) <= 100)
|
|
{
|
|
setColor(ui->label_measure_tas,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_measure_tas,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 8:
|
|
ui->label_measure_cas->setText(measure.toString());
|
|
//ui->label_target_cas->setText(target.toString());
|
|
|
|
if(qAbs(measure.toFloat()) <= 90)
|
|
{
|
|
setColor(ui->label_measure_cas,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_measure_cas,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 9:
|
|
ui->label_measure_gs->setText(measure.toString());
|
|
if(measure.toFloat() <= 100)
|
|
{
|
|
setColor(ui->label_measure_gs,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_measure_gs,state::inital);
|
|
}
|
|
break;
|
|
case 10:
|
|
ui->label_measure_ma->setText(measure.toString());
|
|
//ui->label_target_cas->setText(target.toString());
|
|
break;
|
|
case 11:
|
|
ui->label_measure_vrate->setText(measure.toString());
|
|
//ui->label_target_cas->setText(target.toString());
|
|
|
|
if(measure.toFloat() <= -50)
|
|
{
|
|
setColor(ui->label_measure_vrate,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_measure_vrate,state::inital);
|
|
}
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Diagram::setServo(uint32_t pos,QVariant measure,QVariant target)
|
|
{
|
|
switch (pos) {
|
|
case 1:
|
|
ui->label_measure_LA->setText(measure.toString());
|
|
ui->label_target_LA->setText(target.toString());
|
|
break;
|
|
case 2:
|
|
ui->label_measure_RA->setText(measure.toString());
|
|
ui->label_target_RA->setText(target.toString());
|
|
break;
|
|
case 3:
|
|
ui->label_measure_LE->setText(measure.toString());
|
|
ui->label_target_LE->setText(target.toString());
|
|
break;
|
|
case 4:
|
|
ui->labeL_measure_RE->setText(measure.toString());
|
|
ui->label_target_RE->setText(target.toString());
|
|
break;
|
|
case 5:
|
|
ui->label_measure_RUD->setText(measure.toString());
|
|
ui->label_target_RUD->setText(target.toString());
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Diagram::setEngine(uint32_t pos,QVariant value)
|
|
{
|
|
switch (pos) {
|
|
case 1:
|
|
|
|
if(value.toInt() >= 100)
|
|
{
|
|
ui->label_throttle->setRange(0,value.toInt());
|
|
}
|
|
|
|
ui->label_throttle->setValue(value.toInt());
|
|
break;
|
|
case 2:
|
|
ui->label_rpm->setText(value.toString());
|
|
|
|
if(value.toFloat() >= 46100)
|
|
{
|
|
setColor(ui->label_rpm,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_rpm,state::inital);
|
|
}
|
|
break;
|
|
case 3:
|
|
ui->label_FuelPressure->setText(value.toString());
|
|
|
|
if((value.toFloat() <= 10)||(value.toFloat() >= 80))
|
|
{
|
|
setColor(ui->label_FuelPressure,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_FuelPressure,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 4:
|
|
ui->label_Innage->setText(value.toString());
|
|
|
|
if(value.toFloat() <= 9)
|
|
{
|
|
setColor(ui->label_Innage,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_Innage,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 5:
|
|
ui->label_temp_up->setText(value.toString());
|
|
|
|
if(value.toFloat() >= 130)
|
|
{
|
|
setColor(ui->label_temp_up,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_temp_up,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 6:
|
|
ui->label_temp_right->setText(value.toString());
|
|
|
|
if(value.toFloat() >= 130)
|
|
{
|
|
setColor(ui->label_temp_right,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_temp_right,state::inital);
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
}
|
|
|
|
void Diagram::setBattery(uint32_t pos,QVariant value)
|
|
{
|
|
switch (pos) {
|
|
case 1:
|
|
ui->label_28V_V->setText(value.toString());
|
|
|
|
if(qAbs(value.toFloat()) <= 23)
|
|
{
|
|
setColor(ui->label_28V_percent,state::failure);
|
|
setColor(ui->label_28V_V,state::failure);
|
|
}
|
|
else if(qAbs(value.toFloat()) <= 25)
|
|
{
|
|
setColor(ui->label_28V_percent,state::warning);
|
|
setColor(ui->label_28V_V,state::warning);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_28V_percent,state::inital);
|
|
setColor(ui->label_28V_V,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 2:
|
|
ui->label_28V_A->setText(value.toString());
|
|
|
|
if(qAbs(value.toFloat()) >= 10)
|
|
{
|
|
setColor(ui->label_28V_A,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_28V_A,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 3:
|
|
ui->label_28V_percent->setText(value.toString());
|
|
break;
|
|
case 4:
|
|
ui->label_28V_Temp->setText(value.toString());
|
|
|
|
if(value.toFloat() <= 0)
|
|
{
|
|
setColor(ui->label_28V_Temp,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_28V_Temp,state::inital);
|
|
}
|
|
|
|
break;
|
|
|
|
case 5:
|
|
ui->label_56V_V->setText(value.toString());
|
|
|
|
if(qAbs(value.toFloat()) <= 46)
|
|
{
|
|
setColor(ui->label_56V_percent,state::failure);
|
|
setColor(ui->label_56V_V,state::failure);
|
|
}
|
|
else if(qAbs(value.toFloat()) <= 50)
|
|
{
|
|
setColor(ui->label_56V_percent,state::warning);
|
|
setColor(ui->label_56V_V,state::warning);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_56V_percent,state::inital);
|
|
setColor(ui->label_56V_V,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 6:
|
|
ui->label_56V_A->setText(value.toString());
|
|
|
|
if(qAbs(value.toFloat()) >= 10)
|
|
{
|
|
setColor(ui->label_56V_A,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_56V_A,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 7:
|
|
ui->label_56V_percent->setText(value.toString());
|
|
break;
|
|
case 8:
|
|
ui->label_56V_Temp->setText(value.toString());
|
|
|
|
if(value.toFloat() <= 0)
|
|
{
|
|
setColor(ui->label_56V_Temp,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_56V_Temp,state::inital);
|
|
}
|
|
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
void Diagram::setDlink(uint32_t pos,QVariant value)
|
|
{
|
|
switch (pos) {
|
|
case 1:
|
|
ui->label_RSSI->setText(value.toString());
|
|
|
|
if(qAbs(value.toFloat()) <= 50)
|
|
{
|
|
setColor(ui->label_RSSI,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_RSSI,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 2:
|
|
ui->label_RSS->setText(value.toString());
|
|
|
|
if(qAbs(value.toFloat()) <= 500)
|
|
{
|
|
setColor(ui->label_RSS,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_RSS,state::inital);
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
}
|
|
|
|
void Diagram::setTime(uint32_t pos,QTime Value)
|
|
{
|
|
switch (pos) {
|
|
case 3:
|
|
ui->label_StartUpTime->setText(Value.toString("HH:mm:ss"));
|
|
break;
|
|
case 4:
|
|
ui->label_FilghtTime->setText(Value.toString("HH:mm:ss"));
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
void Diagram::setTargetPoint(int Value)
|
|
{
|
|
ui->label_TargetPoint->setText(QString::number(Value,'f',0));
|
|
}
|
|
|
|
void Diagram::setNavigation(uint32_t pos,QVariant value)
|
|
{
|
|
switch (pos) {
|
|
case 1:
|
|
ui->label_Fix->setText(value.toString());
|
|
|
|
if(value.toString() == tr("未定位"))
|
|
{
|
|
setColor(ui->label_Fix,state::failure);
|
|
}
|
|
else if(value.toString() == tr("2D"))
|
|
{
|
|
setColor(ui->label_Fix,state::warning);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_Fix,state::inital);
|
|
}
|
|
|
|
|
|
break;
|
|
case 2:
|
|
ui->label_SVN->setText(value.toString());
|
|
break;
|
|
case 3:
|
|
ui->label_Source->setText(value.toString());
|
|
break;
|
|
case 4:
|
|
//ui->label_TargetPoint->setText(value.toString());
|
|
break;
|
|
case 5:
|
|
ui->label_xtrack->setText(value.toString());
|
|
|
|
|
|
if(qAbs(value.toFloat()) >= 10000)
|
|
{
|
|
setColor(ui->label_xtrack,state::failure);
|
|
}
|
|
else
|
|
{
|
|
setColor(ui->label_xtrack,state::inital);
|
|
}
|
|
|
|
break;
|
|
case 6:
|
|
ui->label_dist->setText(value.toString());
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Diagram::setControlState(uint32_t pos,QVariant value)
|
|
{
|
|
switch (pos) {
|
|
case 1:
|
|
//ui->label_ControlMode->setText(value.toString());
|
|
break;
|
|
case 2:
|
|
ui->label_FlightMode->setText(value.toString());
|
|
break;
|
|
case 3:
|
|
//ui->label_VMode->setText(value.toString());
|
|
break;
|
|
case 4:
|
|
//ui->label_HMode->setText(value.toString());
|
|
break;
|
|
}
|
|
}
|
|
|
|
void Diagram::setAttitude(uint8_t source,
|
|
float ax,float ay,float az,
|
|
float p,float q,float r,
|
|
float rol,float pit,float yaw)
|
|
{
|
|
switch (source) {
|
|
case 1:
|
|
{
|
|
if(ui->checkBox_ins_ax->isChecked())
|
|
{
|
|
accChart->setSerieData(tr("ins ax"),ax);
|
|
}
|
|
|
|
if(ui->checkBox_ins_ay->isChecked())
|
|
{
|
|
accChart->setSerieData(tr("ins ay"),ay);
|
|
}
|
|
|
|
if(ui->checkBox_ins_az->isChecked())
|
|
{
|
|
accChart->setSerieData(tr("ins az"),az);
|
|
}
|
|
|
|
|
|
if(ui->checkBox_ins_p->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("ins p"),p);
|
|
}
|
|
|
|
if(ui->checkBox_ins_q->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("ins q"),q);
|
|
}
|
|
|
|
if(ui->checkBox_ins_r->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("ins r"),r);
|
|
}
|
|
|
|
|
|
if(ui->checkBox_ins_rol->isChecked())
|
|
{
|
|
attChart->setSerieData(tr("ins rol"),rol);
|
|
}
|
|
|
|
if(ui->checkBox_ins_pit->isChecked())
|
|
{
|
|
attChart->setSerieData(tr("ins pit"),pit);
|
|
}
|
|
|
|
}break;
|
|
case 2:
|
|
{
|
|
if(ui->checkBox_sbg_ax->isChecked())
|
|
{
|
|
accChart->setSerieData(tr("sbg ax"),ax);
|
|
}
|
|
|
|
if(ui->checkBox_sbg_ay->isChecked())
|
|
{
|
|
accChart->setSerieData(tr("sbg ay"),ay);
|
|
}
|
|
|
|
if(ui->checkBox_sbg_az->isChecked())
|
|
{
|
|
accChart->setSerieData(tr("sbg az"),az);
|
|
}
|
|
|
|
|
|
if(ui->checkBox_sbg_p->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("sbg p"),p);
|
|
}
|
|
|
|
if(ui->checkBox_sbg_q->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("sbg q"),q);
|
|
}
|
|
|
|
if(ui->checkBox_sbg_r->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("sbg r"),r);
|
|
}
|
|
|
|
|
|
if(ui->checkBox_sbg_rol->isChecked())
|
|
{
|
|
attChart->setSerieData(tr("sbg rol"),rol);
|
|
}
|
|
|
|
if(ui->checkBox_sbg_pit->isChecked())
|
|
{
|
|
attChart->setSerieData(tr("sbg pit"),pit);
|
|
}
|
|
|
|
}break;
|
|
case 3:
|
|
{
|
|
if(ui->checkBox_use_p->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("use p"),p);
|
|
}
|
|
|
|
if(ui->checkBox_use_q->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("use q"),q);
|
|
}
|
|
|
|
if(ui->checkBox_use_r->isChecked())
|
|
{
|
|
gyroChart->setSerieData(tr("use r"),r);
|
|
}
|
|
|
|
|
|
if(ui->checkBox_use_rol->isChecked())
|
|
{
|
|
attChart->setSerieData(tr("use rol"),rol);
|
|
}
|
|
|
|
if(ui->checkBox_use_pit->isChecked())
|
|
{
|
|
attChart->setSerieData(tr("use pit"),pit);
|
|
}
|
|
|
|
}break;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Diagram::on_checkBox_att_stateChanged(int arg1)
|
|
{
|
|
QCheckBox *chk = qobject_cast<QCheckBox *>(sender());
|
|
if(chk)
|
|
{
|
|
if(arg1 == Qt::Checked)
|
|
{
|
|
attChart->addSeries(chk->text());
|
|
}
|
|
else if(arg1 == Qt::Unchecked)
|
|
{
|
|
attChart->removeSerie(chk->text());
|
|
}
|
|
update();
|
|
}
|
|
}
|
|
|
|
void Diagram::on_checkBox_gyro_stateChanged(int arg1)
|
|
{
|
|
QCheckBox *chk = qobject_cast<QCheckBox *>(sender());
|
|
if(chk)
|
|
{
|
|
if(arg1 == Qt::Checked)
|
|
{
|
|
gyroChart->addSeries(chk->text());
|
|
}
|
|
else if(arg1 == Qt::Unchecked)
|
|
{
|
|
gyroChart->removeSerie(chk->text());
|
|
}
|
|
update();
|
|
}
|
|
}
|
|
|
|
void Diagram::on_checkBox_acc_stateChanged(int arg1)
|
|
{
|
|
QCheckBox *chk = qobject_cast<QCheckBox *>(sender());
|
|
if(chk)
|
|
{
|
|
if(arg1 == Qt::Checked)
|
|
{
|
|
accChart->addSeries(chk->text());
|
|
}
|
|
else if(arg1 == Qt::Unchecked)
|
|
{
|
|
accChart->removeSerie(chk->text());
|
|
}
|
|
update();
|
|
}
|
|
}
|
|
|
|
|