diff --git a/keyphase.cpp b/keyphase.cpp index 72b9366..097dc6d 100644 --- a/keyphase.cpp +++ b/keyphase.cpp @@ -130,15 +130,19 @@ void KeyPhase::Init() { return; } std::shared_ptr keyphase_data = std::dynamic_pointer_cast(base_ptr); - for (int i = 0; i < CHANNEL_COUNT; i++) { + for (int i = 0; i < CHANNEL_COUNT_SPEED; i++) { if (i + 1 == 1) { ui->checkBox_enable_1->setChecked(keyphase_data->variables_[i].active); ui->doubleSpinBox_high_1->setValue(keyphase_data->variables_[i].normal_voltage_high); ui->doubleSpinBox_low_1->setValue(keyphase_data->variables_[i].normal_voltage_low); if (keyphase_data->variables_[i].automatic_threshold) { ui->radioButton_automatic_threshold_1->setChecked(true); + ui->doubleSpinBox_threshold_1->setEnabled(false); + ui->doubleSpinBox_hysteresis_1->setEnabled(false); } else { ui->radioButton_manual_threshold_1->setChecked(true); + ui->doubleSpinBox_threshold_1->setEnabled(true); + ui->doubleSpinBox_hysteresis_1->setEnabled(true); } ui->doubleSpinBox_threshold_1->setValue(keyphase_data->variables_[i].threshold); ui->doubleSpinBox_hysteresis_1->setValue(keyphase_data->variables_[i].hysteresis); @@ -149,8 +153,12 @@ void KeyPhase::Init() { ui->doubleSpinBox_low_2->setValue(keyphase_data->variables_[i].normal_voltage_low); if (keyphase_data->variables_[i].automatic_threshold) { ui->radioButton_automatic_threshold_2->setChecked(true); + ui->doubleSpinBox_threshold_2->setEnabled(false); + ui->doubleSpinBox_hysteresis_2->setEnabled(false); } else { ui->radioButton_manual_threshold_2->setChecked(true); + ui->doubleSpinBox_threshold_2->setEnabled(true); + ui->doubleSpinBox_hysteresis_2->setEnabled(true); } ui->doubleSpinBox_threshold_2->setValue(keyphase_data->variables_[i].threshold); ui->doubleSpinBox_hysteresis_2->setValue(keyphase_data->variables_[i].hysteresis); @@ -161,8 +169,12 @@ void KeyPhase::Init() { ui->doubleSpinBox_low_3->setValue(keyphase_data->variables_[i].normal_voltage_low); if (keyphase_data->variables_[i].automatic_threshold) { ui->radioButton_automatic_threshold_3->setChecked(true); + ui->doubleSpinBox_threshold_3->setEnabled(false); + ui->doubleSpinBox_hysteresis_3->setEnabled(false); } else { ui->radioButton_manual_threshold_3->setChecked(true); + ui->doubleSpinBox_threshold_3->setEnabled(true); + ui->doubleSpinBox_hysteresis_3->setEnabled(true); } ui->doubleSpinBox_threshold_3->setValue(keyphase_data->variables_[i].threshold); ui->doubleSpinBox_hysteresis_3->setValue(keyphase_data->variables_[i].hysteresis); @@ -173,8 +185,12 @@ void KeyPhase::Init() { ui->doubleSpinBox_low_4->setValue(keyphase_data->variables_[i].normal_voltage_low); if (keyphase_data->variables_[i].automatic_threshold) { ui->radioButton_automatic_threshold_4->setChecked(true); + ui->doubleSpinBox_threshold_4->setEnabled(false); + ui->doubleSpinBox_hysteresis_4->setEnabled(false); } else { ui->radioButton_manual_threshold_4->setChecked(true); + ui->doubleSpinBox_threshold_4->setEnabled(true); + ui->doubleSpinBox_hysteresis_4->setEnabled(true); } ui->doubleSpinBox_threshold_4->setValue(keyphase_data->variables_[i].threshold); ui->doubleSpinBox_hysteresis_4->setValue(keyphase_data->variables_[i].hysteresis); diff --git a/keyphase.ui b/keyphase.ui index c0990b7..7ff29bc 100644 --- a/keyphase.ui +++ b/keyphase.ui @@ -6,8 +6,8 @@ 0 0 - 791 - 605 + 824 + 510 @@ -101,7 +101,7 @@ - 1 + 0 @@ -440,6 +440,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -779,6 +792,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -794,7 +820,7 @@ - 10 + 0 220 77 75 @@ -829,7 +855,7 @@ - 1 + 0 @@ -1168,6 +1194,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -1507,6 +1546,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/seismic_monitor.ui b/seismic_monitor.ui index 479dc0f..bbfad46 100644 --- a/seismic_monitor.ui +++ b/seismic_monitor.ui @@ -6,8 +6,8 @@ 0 0 - 975 - 697 + 928 + 610 @@ -111,7 +111,7 @@ - 1 + 0 @@ -1067,8 +1067,8 @@ - 30 - 120 + 20 + 110 93 28 @@ -2267,8 +2267,8 @@ - 50 - 130 + 20 + 100 93 28 diff --git a/singlerelay.cpp b/singlerelay.cpp index 1cea32a..3ef8f54 100644 --- a/singlerelay.cpp +++ b/singlerelay.cpp @@ -112,6 +112,8 @@ void SingleRelay::Init(){ std::shared_ptr ptr = std::dynamic_pointer_cast(cardbase_ptr); for (int var = 0; var < CHANNEL_COUNT; ++var) { std::shared_ptr variable_base = ptr->GetChannelPtr(var + 1); + if(variable_base == nullptr) + continue; QString item_data,item_str; if(variable_base->alert_high.enable){ item_str = QString("%1 (槽位 %2 通道 %3 警报高)").arg(ptr->base_config_[var].point_name).arg(ptr->base_config_[var].chan_id.mid(1,2)).arg(ptr->base_config_[var].chan_id.mid(4,2)); @@ -462,7 +464,6 @@ void SingleRelay::slotDeleteItem() if(curIndex.isValid()){ model_Relay->removeRow(curIndex.row(),curIndex.parent()); } - } void SingleRelay::on_treeView_Relay_customContextMenuRequested(const QPoint &pos) { diff --git a/tachometer.ui b/tachometer.ui index 0e240e4..0ac1d8a 100644 --- a/tachometer.ui +++ b/tachometer.ui @@ -6,8 +6,8 @@ 0 0 - 947 - 716 + 835 + 623