fix build issue.

This commit is contained in:
pandx 2025-04-02 10:13:03 +08:00
parent e952ec06a5
commit b03cf0c257
6 changed files with 24 additions and 49 deletions

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"files.associations": {
"memory": "cpp"
}
}

View File

@ -10,22 +10,7 @@
class CardBase { class CardBase {
public: public:
CardBase() {} CardBase() {}
~CardBase() {} virtual ~CardBase() {}
// void FromJson(const Json::Value &cfg) {
// version_ = cfg["version"].asInt();
// slot_ = cfg["slot"].asInt();
// card_type_ = static_cast<CardType>(cfg["type"].asInt());
// }
// Json::Value ToJson() {
// Json::Value ch;
// ch[NAME(version)] = version_;
// ch[NAME(slot)] = slot_;
// ch[NAME(type)] = card_type_;
// return ch;
// }
// protected:
int version_; int version_;
int slot_; // 从1~15 int slot_; // 从1~15
CardType card_type_; CardType card_type_;
@ -34,7 +19,7 @@ class CardBase {
class VariableBase { class VariableBase {
public: public:
VariableBase() {} VariableBase() {}
~VariableBase() {} virtual ~VariableBase() {}
int id_; int id_;
VibChannelType type_; VibChannelType type_;

View File

@ -10,7 +10,7 @@
#include "vibrationdata.h" #include "vibrationdata.h"
#include "config_mgr.h" #include "config_mgr.h"
Radial_vibration::Radial_vibration(int slot_no_, int channel_, bool active, QWidget *parent) Radial::Radial(int slot_no_, int channel_, bool active, QWidget *parent)
: QWidget(parent) : QWidget(parent)
, ui(new Ui::Radial_vibration) { , ui(new Ui::Radial_vibration) {
ui->setupUi(this); ui->setupUi(this);
@ -28,15 +28,15 @@ Radial_vibration::Radial_vibration(int slot_no_, int channel_, bool active, QWid
Init(); Init();
} }
Radial_vibration::~Radial_vibration() { Radial::~Radial() {
delete ui; delete ui;
} }
void Radial_vibration::on_pushButton_cancel_clicked() { void Radial::on_pushButton_cancel_clicked() {
this->close(); this->close();
} }
void Radial_vibration::on_checkBox_1x_ampl_toggled(bool checked) { void Radial::on_checkBox_1x_ampl_toggled(bool checked) {
if (checked) { if (checked) {
ui->comboBox_1x_value_range->setEnabled(true); ui->comboBox_1x_value_range->setEnabled(true);
ui->doubleSpinBox_1x_ampl_clamp->setEnabled(true); ui->doubleSpinBox_1x_ampl_clamp->setEnabled(true);
@ -48,7 +48,7 @@ void Radial_vibration::on_checkBox_1x_ampl_toggled(bool checked) {
ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(false); ui->doubleSpinBox_1x_phase_lag_clamp->setEnabled(false);
} }
void Radial_vibration::on_checkBox_2x_ampl_toggled(bool checked) { void Radial::on_checkBox_2x_ampl_toggled(bool checked) {
if (checked) { if (checked) {
ui->comboBox_2x_value_range->setEnabled(true); ui->comboBox_2x_value_range->setEnabled(true);
ui->doubleSpinBox_2x_ampl_clamp->setEnabled(true); ui->doubleSpinBox_2x_ampl_clamp->setEnabled(true);
@ -60,7 +60,7 @@ void Radial_vibration::on_checkBox_2x_ampl_toggled(bool checked) {
ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(false); ui->doubleSpinBox_2x_phase_lag_clamp->setEnabled(false);
} }
void Radial_vibration::on_checkBox_not_1x_ampl_toggled(bool checked) { void Radial::on_checkBox_not_1x_ampl_toggled(bool checked) {
if (checked) { if (checked) {
ui->comboBox_not_1x_ampl->setEnabled(true); ui->comboBox_not_1x_ampl->setEnabled(true);
ui->doubleSpinBox_not_1x_ampl_clamp->setEnabled(true); ui->doubleSpinBox_not_1x_ampl_clamp->setEnabled(true);
@ -70,7 +70,7 @@ void Radial_vibration::on_checkBox_not_1x_ampl_toggled(bool checked) {
ui->doubleSpinBox_not_1x_ampl_clamp->setEnabled(false); ui->doubleSpinBox_not_1x_ampl_clamp->setEnabled(false);
} }
void Radial_vibration::on_checkBox_smax_ampl_toggled(bool checked) { void Radial::on_checkBox_smax_ampl_toggled(bool checked) {
if (checked) { if (checked) {
ui->comboBox_smax_range->setEnabled(true); ui->comboBox_smax_range->setEnabled(true);
ui->doubleSpinBox_smax_clamp->setEnabled(true); ui->doubleSpinBox_smax_clamp->setEnabled(true);
@ -80,7 +80,7 @@ void Radial_vibration::on_checkBox_smax_ampl_toggled(bool checked) {
ui->doubleSpinBox_smax_clamp->setEnabled(false); ui->doubleSpinBox_smax_clamp->setEnabled(false);
} }
void Radial_vibration::Init() { void Radial::Init() {
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no); std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
if (base_ptr == nullptr) { if (base_ptr == nullptr) {
qCritical() << "[Velocity::Init] should not be here"; qCritical() << "[Velocity::Init] should not be here";
@ -139,7 +139,7 @@ void Radial_vibration::Init() {
ui->spinBox_comparision_percentage->setValue(variable_ptr->recorder_out_.percentage); ui->spinBox_comparision_percentage->setValue(variable_ptr->recorder_out_.percentage);
} }
void Radial_vibration::on_pushButton_confirm_clicked() { void Radial::on_pushButton_confirm_clicked() {
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no); std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
if (base_ptr == nullptr) { if (base_ptr == nullptr) {
qCritical() << "[Acceleration::Init] should not be here"; qCritical() << "[Acceleration::Init] should not be here";
@ -245,6 +245,6 @@ void Radial_vibration::on_pushButton_confirm_clicked() {
} }
void Radial_vibration::on_pushButton_set_default_clicked() { void Radial::on_pushButton_set_default_clicked() {
} }

View File

@ -7,12 +7,12 @@ namespace Ui {
class Radial_vibration; class Radial_vibration;
} }
class Radial_vibration : public QWidget { class Radial : public QWidget {
Q_OBJECT Q_OBJECT
public: public:
explicit Radial_vibration(int slot_no_, int channel_, bool active, QWidget *parent = nullptr); explicit Radial(int slot_no_, int channel_, bool active, QWidget *parent = nullptr);
~Radial_vibration(); ~Radial();
int slot_no; int slot_no;
int channel; int channel;
private slots: private slots:

View File

@ -231,7 +231,7 @@ void Seismic_monitor::on_pushButton_config_1_clicked() {
acceleration->setWindowModality(Qt::ApplicationModal); acceleration->setWindowModality(Qt::ApplicationModal);
acceleration->show(); acceleration->show();
} else if (ui->comboBox_chan_type_1->currentIndex() == kVibRadial) { } else if (ui->comboBox_chan_type_1->currentIndex() == kVibRadial) {
Radial_vibration *radial_vibration = new Radial_vibration(slot_no, channel, ui->checkBox_enable_1->isChecked()); Radial *radial_vibration = new Radial(slot_no, channel, ui->checkBox_enable_1->isChecked());
radial_vibration->setWindowModality(Qt::ApplicationModal); radial_vibration->setWindowModality(Qt::ApplicationModal);
radial_vibration->show(); radial_vibration->show();
} else if (ui->comboBox_chan_type_1->currentIndex() == kVibVelocity) { } else if (ui->comboBox_chan_type_1->currentIndex() == kVibVelocity) {
@ -248,7 +248,7 @@ void Seismic_monitor::on_pushButton_config_2_clicked() {
acceleration->setWindowModality(Qt::ApplicationModal); acceleration->setWindowModality(Qt::ApplicationModal);
acceleration->show(); acceleration->show();
} else if (ui->comboBox_chan_type_2->currentIndex() == kVibRadial) { } else if (ui->comboBox_chan_type_2->currentIndex() == kVibRadial) {
Radial_vibration *radial_vibration = new Radial_vibration(slot_no, channel, ui->checkBox_enable_2->isChecked()); Radial *radial_vibration = new Radial(slot_no, channel, ui->checkBox_enable_2->isChecked());
radial_vibration->setWindowModality(Qt::ApplicationModal); radial_vibration->setWindowModality(Qt::ApplicationModal);
radial_vibration->show(); radial_vibration->show();
} else if (ui->comboBox_chan_type_2->currentIndex() == kVibVelocity) { } else if (ui->comboBox_chan_type_2->currentIndex() == kVibVelocity) {
@ -265,7 +265,7 @@ void Seismic_monitor::on_pushButton_config_3_clicked() {
acceleration->setWindowModality(Qt::ApplicationModal); acceleration->setWindowModality(Qt::ApplicationModal);
acceleration->show(); acceleration->show();
} else if (ui->comboBox_chan_type_3->currentIndex() == kVibRadial) { } else if (ui->comboBox_chan_type_3->currentIndex() == kVibRadial) {
Radial_vibration *radial_vibration = new Radial_vibration(slot_no, channel, ui->checkBox_enable_3->isChecked()); Radial *radial_vibration = new Radial(slot_no, channel, ui->checkBox_enable_3->isChecked());
radial_vibration->setWindowModality(Qt::ApplicationModal); radial_vibration->setWindowModality(Qt::ApplicationModal);
radial_vibration->show(); radial_vibration->show();
} else if (ui->comboBox_chan_type_3->currentIndex() == kVibVelocity) { } else if (ui->comboBox_chan_type_3->currentIndex() == kVibVelocity) {
@ -282,7 +282,7 @@ void Seismic_monitor::on_pushButton_config_4_clicked() {
acceleration->setWindowModality(Qt::ApplicationModal); acceleration->setWindowModality(Qt::ApplicationModal);
acceleration->show(); acceleration->show();
} else if (ui->comboBox_chan_type_4->currentIndex() == kVibRadial) { } else if (ui->comboBox_chan_type_4->currentIndex() == kVibRadial) {
Radial_vibration *radial_vibration = new Radial_vibration(slot_no, channel, ui->checkBox_enable_4->isChecked()); Radial *radial_vibration = new Radial(slot_no, channel, ui->checkBox_enable_4->isChecked());
radial_vibration->setWindowModality(Qt::ApplicationModal); radial_vibration->setWindowModality(Qt::ApplicationModal);
radial_vibration->show(); radial_vibration->show();
} else if (ui->comboBox_chan_type_4->currentIndex() == kVibVelocity) { } else if (ui->comboBox_chan_type_4->currentIndex() == kVibVelocity) {

View File

@ -8,24 +8,9 @@
class VibrationData : public CardBase { class VibrationData : public CardBase {
public: public:
VibrationData(); VibrationData();
// void FromJson(const Json::Value &cfg) {
// version_ = cfg["version"].asInt();
// slot_ = cfg["slot"].asInt();
// card_type_ = static_cast<CardType>(cfg["type"].asInt());
// }
// Json::Value ToJson() {
// Json::Value ch;
// ch[NAME(version)] = version_;
// ch[NAME(slot)] = slot_;
// ch[NAME(type)] = card_type_;
// return ch;
// }
std::shared_ptr<VariableBase> GetChannelPtr(int cid); std::shared_ptr<VariableBase> GetChannelPtr(int cid);
void RemoveChannel(int cid); void RemoveChannel(int cid);
// private:
SeismicMonitor base_config_[CHANNEL_COUNT]; SeismicMonitor base_config_[CHANNEL_COUNT];
// AllFilter filter_[CHANNEL_COUNT];
std::vector<std::shared_ptr<VariableBase>> variables_; std::vector<std::shared_ptr<VariableBase>> variables_;
}; };