add codes.
This commit is contained in:
parent
eaed2efaa5
commit
4a0e1a44c5
@ -168,23 +168,36 @@ void Acceleration::on_checkBox_2x_ampl_toggled(bool checked) {
|
||||
|
||||
void Acceleration::Init() {
|
||||
std::shared_ptr<CardBase> base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot_no);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (filter[i].checked) {
|
||||
if (filter[i].type == "band_pass") {
|
||||
ui->checkBox_band_pass->setChecked(filter[i].checked);
|
||||
ui->spinBox_band_pass_low->setValue(filter[i].low);
|
||||
ui->spinBox_band_pass_high->setValue(filter[i].high);
|
||||
} else if (filter[i].type == "low_pass") {
|
||||
ui->checkBox_low_pass->setChecked(filter[i].checked);
|
||||
ui->spinBox_low_pass_low->setValue(filter[i].low);
|
||||
ui->spinBox_low_pass_high->setValue(filter[i].high);
|
||||
} else if (filter[i].type == "high_pass") {
|
||||
ui->checkBox_high_pass->setChecked(filter[i].checked);
|
||||
ui->spinBox_high_pass_low->setValue(filter[i].low);
|
||||
ui->spinBox_high_pass_high->setValue(filter[i].high);
|
||||
}
|
||||
if (base_ptr == nullptr) {
|
||||
qCritical() << "[Acceleration::Init] should not be here";
|
||||
return;
|
||||
}
|
||||
std::shared_ptr<VibrationData> ptr = std::dynamic_pointer_cast<VibrationData>(base_ptr);
|
||||
if (ptr->base_config_[channel - 1].channel_type != kVibAcc) {
|
||||
// user change the channel type
|
||||
return;
|
||||
}
|
||||
ui->checkBox_low_pass->setChecked(ptr->filter_[channel - 1].filter[0].checked);
|
||||
ui->spinBox_low_pass_low->setValue(ptr->filter_[channel - 1].filter[0].low);
|
||||
ui->spinBox_low_pass_high->setValue(ptr->filter_[channel - 1].filter[0].high);
|
||||
ui->checkBox_high_pass->setChecked(ptr->filter_[channel - 1].filter[1].checked);
|
||||
ui->spinBox_high_pass_low->setValue(ptr->filter_[channel - 1].filter[1].low);
|
||||
ui->spinBox_high_pass_high->setValue(ptr->filter_[channel - 1].filter[1].high);
|
||||
ui->checkBox_band_pass->setChecked(ptr->filter_[channel - 1].filter[2].checked);
|
||||
ui->spinBox_band_pass_low->setValue(ptr->filter_[channel - 1].filter[2].low);
|
||||
ui->spinBox_band_pass_high->setValue(ptr->filter_[channel - 1].filter[2].high);
|
||||
// std::shared_ptr<VariableBase> variable_base = ptr->GetChannelPtr(channel);
|
||||
std::shared_ptr<AccVelVariable> variable_ptr = std::dynamic_pointer_cast<AccVelVariable>(ptr->GetChannelPtr(channel));
|
||||
ui->comboBox_direct_value_range->setCurrentIndex(variables[i].full_sacle_range);
|
||||
ui->doubleSpinBox_direct_clamp->setValue(variables[i].clamp_value);
|
||||
ui->label_bias_voltage->setText(QString::number(variables[i].bias_voltage));
|
||||
ui->doubleSpinBox_bias_volt_clamp->setValue(variables[i].clamp_value);
|
||||
ui->comboBox_1x_value_range->setCurrentIndex(variables[i].full_sacle_range);
|
||||
ui->doubleSpinBox_1x_ampl_clamp->setValue(variables[i].clamp_value);
|
||||
ui->doubleSpinBox_1x_phase_lag_clamp->setValue(variables[i].clamp_value);
|
||||
ui->comboBox_2x_value_range->setCurrentIndex(variables[i].full_sacle_range);
|
||||
ui->doubleSpinBox_2x_ampl_clamp->setValue(variables[i].clamp_value);
|
||||
ui->doubleSpinBox_2x_phase_lag_clamp->setValue(variables[i].clamp_value);
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (variables[i].type == "direct") {
|
||||
ui->comboBox_direct_value_range->setCurrentIndex(variables[i].full_sacle_range);
|
||||
|
Loading…
x
Reference in New Issue
Block a user