add codes.

This commit is contained in:
pandx 2025-04-02 10:27:10 +08:00
parent b03cf0c257
commit 64bd8799fb
6 changed files with 7 additions and 24 deletions

View File

@ -170,12 +170,12 @@ void Acceleration::Init() {
} }
std::shared_ptr<VibrationData> ptr = std::dynamic_pointer_cast<VibrationData>(base_ptr); std::shared_ptr<VibrationData> ptr = std::dynamic_pointer_cast<VibrationData>(base_ptr);
if (ptr->base_config_[channel - 1].channel_type != kVibAcc) { if (ptr->base_config_[channel - 1].channel_type != kVibAcc) {
qDebug() << " channel type changes"; qDebug() << "[Acceleration::Init] channel type changes";
return; return;
} }
std::shared_ptr<VariableBase> variable_base = ptr->GetChannelPtr(channel); std::shared_ptr<VariableBase> variable_base = ptr->GetChannelPtr(channel);
if (variable_base == nullptr) { if (variable_base == nullptr) {
qDebug() << "no channel ptr"; qDebug() << "[Acceleration::Init] no channel ptr";
return; return;
} }
std::shared_ptr<AccVelVariable> variable_ptr = std::dynamic_pointer_cast<AccVelVariable>(variable_base); std::shared_ptr<AccVelVariable> variable_ptr = std::dynamic_pointer_cast<AccVelVariable>(variable_base);

View File

@ -31,12 +31,6 @@ class Acceleration : public QWidget {
private: private:
Ui::Acceleration *ui; Ui::Acceleration *ui;
// Filter filter[3];
// Dealy delay;
// Variables variables[4];
// Alert_Variables alert_variables;
// void readJsonFile(const QString &filePath);
void Init(); void Init();
}; };

View File

@ -83,17 +83,17 @@ void Radial::on_checkBox_smax_ampl_toggled(bool checked) {
void Radial::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() << "[Radial::Init] should not be here";
return; return;
} }
std::shared_ptr<VibrationData> ptr = std::dynamic_pointer_cast<VibrationData>(base_ptr); std::shared_ptr<VibrationData> ptr = std::dynamic_pointer_cast<VibrationData>(base_ptr);
if (ptr->base_config_[channel - 1].channel_type != kVibRadial) { if (ptr->base_config_[channel - 1].channel_type != kVibRadial) {
qDebug() << " channel type changes"; qDebug() << "[Radial::Init] channel type changes";
return; return;
} }
std::shared_ptr<VariableBase> variable_base = ptr->GetChannelPtr(channel); std::shared_ptr<VariableBase> variable_base = ptr->GetChannelPtr(channel);
if (variable_base == nullptr) { if (variable_base == nullptr) {
qDebug() << "no channel ptr"; qDebug() << "[Radial::Init] no channel ptr";
return; return;
} }
std::shared_ptr<RadialVariable> variable_ptr = std::dynamic_pointer_cast<RadialVariable>(variable_base); std::shared_ptr<RadialVariable> variable_ptr = std::dynamic_pointer_cast<RadialVariable>(variable_base);

View File

@ -28,11 +28,6 @@ class Radial : public QWidget {
private: private:
Ui::Radial_vibration *ui; Ui::Radial_vibration *ui;
// Filter filter[3];
// Dealy delay;
// Variables variables[6];
// Alert_Variables alert_variables;
// void readJsonFile(const QString &filePath);
void Init(); void Init();
}; };

View File

@ -126,12 +126,12 @@ void Velocity::Init() {
} }
std::shared_ptr<VibrationData> ptr = std::dynamic_pointer_cast<VibrationData>(base_ptr); std::shared_ptr<VibrationData> ptr = std::dynamic_pointer_cast<VibrationData>(base_ptr);
if (ptr->base_config_[channel - 1].channel_type != kVibVelocity) { if (ptr->base_config_[channel - 1].channel_type != kVibVelocity) {
qDebug() << " channel type changes"; qDebug() << "[Velocity::Init] channel type changes";
return; return;
} }
std::shared_ptr<VariableBase> variable_base = ptr->GetChannelPtr(channel); std::shared_ptr<VariableBase> variable_base = ptr->GetChannelPtr(channel);
if (variable_base == nullptr) { if (variable_base == nullptr) {
qDebug() << "no channel ptr"; qDebug() << "[Velocity::Init] no channel ptr";
return; return;
} }
std::shared_ptr<AccVelVariable> variable_ptr = std::dynamic_pointer_cast<AccVelVariable>(variable_base); std::shared_ptr<AccVelVariable> variable_ptr = std::dynamic_pointer_cast<AccVelVariable>(variable_base);

View File

@ -28,12 +28,6 @@ class Velocity : public QWidget {
private: private:
Ui::Velocity *ui; Ui::Velocity *ui;
// Filter filter[3];
// Dealy delay;
// Variables variables[4];
// Alert_Variables alert_variables;
// void readJsonFile(const QString &filePath);
void Init(); void Init();
}; };