diff --git a/config_mgr.cpp b/config_mgr.cpp index 09c1942..cc1b72e 100644 --- a/config_mgr.cpp +++ b/config_mgr.cpp @@ -584,20 +584,22 @@ void ConfigMgr::Save(QString & file_path) { for(int var = 0 ; var < 10;++var){ if(ptr->single_relay[ch].logic[var] != ""){ array_logic.append(ptr->single_relay[ch].logic[var]); + channel_item.insert("active", ptr->single_relay[ch].active); + channel_item.insert("group",ptr->single_relay[ch].group); + channel_item.insert("logic_vote", array_logic); + channel_item.insert("vote",ptr->single_relay[ch].vote); } } - channel_item.insert("logic_vote", array_logic); - channel_item.insert("vote",ptr->single_relay[ch].vote); }else{ if(ptr->single_relay[ch].logic_expression != ""){ qDebug() << "ch" << ch << ptr->single_relay[ch].logic_expression; channel_item.insert("logic_expression", ptr->single_relay[ch].logic_expression); channel_item.insert("vote",ptr->single_relay[ch].vote); - + channel_item.insert("active", ptr->single_relay[ch].active); + channel_item.insert("group",ptr->single_relay[ch].group); } } - channel_item.insert("active", ptr->single_relay[ch].active); - channel_item.insert("group",ptr->single_relay[ch].group); + }else if(card_type_[i] == kCardRelaySingleNOK){ std::shared_ptr base_ptr = ConfigMgr::Instance()->GetSlotPtr(slot); if (base_ptr == nullptr) { diff --git a/singlerelay.cpp b/singlerelay.cpp index b6c30f1..bcd2fbb 100644 --- a/singlerelay.cpp +++ b/singlerelay.cpp @@ -288,6 +288,7 @@ void SingleRelay::on_pushButton_confirm_clicked() }else{ relay_data->single_relay[current_index].logic_expression = finalExpr; } + relay_data->single_relay[current_index].active = ui->checkBox_active->isChecked(); relay_data->single_relay[current_index].vote = ui->checkBox_vote->isChecked(); relay_data->single_relay[current_index].group = ui->comboBox_group->currentIndex() + 1; relay_data->single_relay[current_index].count_vote = ui->lineEdit_vote_count->text().toInt();