Merge branch 'self_dev_screen' of http://218.94.94.190:3000/zhangsheng/TSI_Config into self_dev_screen
This commit is contained in:
commit
d64e70bf07
@ -587,6 +587,7 @@ void ConfigMgr::Save(QString & file_path) {
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
@ -519,6 +519,7 @@ typedef struct SingleRelayS_{
|
||||
logic_expression = "";
|
||||
active = false;
|
||||
vote = false;
|
||||
count_vote = 0;
|
||||
}
|
||||
} SingleRelayS;
|
||||
|
||||
@ -534,6 +535,7 @@ typedef struct SingleRelayNOK_{
|
||||
logic_expression = "";
|
||||
active = false;
|
||||
vote = false;
|
||||
count_vote = 0;
|
||||
}
|
||||
} SingleRelayNOK;
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ SingleRelay::SingleRelay(int slot,CardType cardtype,QWidget *parent)
|
||||
vote_current_index = ui->comboBox_vote_group->currentIndex();
|
||||
Init();
|
||||
onComboBoxIndexChanged(current_index);
|
||||
|
||||
on_comboBox_vote_group_currentIndexChanged(current_index);
|
||||
}
|
||||
|
||||
SingleRelay::~SingleRelay() {
|
||||
@ -149,8 +149,16 @@ void SingleRelay::Init(){
|
||||
if(!relay_data->single_relay[current_index].logic_expression.isEmpty()){
|
||||
setExpressionToTreeView(treeView_relay, relay_data->single_relay[current_index].logic_expression);
|
||||
}
|
||||
if(!relay_data->single_relay[current_index].logic[vote_current_index].isEmpty()){
|
||||
setExpressionToTreeView(treeView_relay, relay_data->single_relay[current_index].logic[vote_current_index]);
|
||||
}
|
||||
qDebug() << "relay_data->single_relay[current_index].active" << relay_data->single_relay[current_index].active;
|
||||
ui->checkBox_active->setChecked(relay_data->single_relay[current_index].active);
|
||||
ui->comboBox_group->setCurrentIndex(relay_data->single_relay[current_index].group - 1);
|
||||
ui->lineEdit_vote_count->setText(QString::number(relay_data->single_relay[current_index].count_vote));
|
||||
ui->checkBox_vote->setChecked(relay_data->single_relay[current_index].vote);
|
||||
on_checkBox_vote_clicked(relay_data->single_relay[current_index].vote);
|
||||
|
||||
}
|
||||
void SingleRelay::on_pushButton_cancel_clicked() {
|
||||
this->close();
|
||||
@ -274,13 +282,15 @@ void SingleRelay::on_pushButton_confirm_clicked()
|
||||
QString("错误位置:%1\n错误描述:%2").arg(result.errorPos).arg(result.errorMsg));
|
||||
return;
|
||||
}
|
||||
if(ui->checkBox_vote->checkState()){
|
||||
if(ui->checkBox_vote->isChecked()){
|
||||
relay_data->single_relay[current_index].logic[ui->comboBox_vote_group->currentIndex()] = finalExpr;
|
||||
relay_data->single_relay[current_index].count_vote = ui->lineEdit_vote_count->text().toInt();
|
||||
}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();
|
||||
qDebug() << "逻辑表达式:" << finalExpr ;
|
||||
this->close();
|
||||
}
|
||||
@ -304,9 +314,9 @@ void SingleRelay::onComboBoxIndexChanged(int index){
|
||||
return;
|
||||
}
|
||||
qDebug() << "finalExpr" << finalExpr;
|
||||
if(ui->checkBox_vote->checkState()){
|
||||
relay_data->single_relay[current_index].logic[ui->comboBox_vote_group->currentIndex()] = finalExpr;
|
||||
if(relay_data->single_relay[index].logic[ui->comboBox_vote_group->currentIndex()] != "")
|
||||
if(ui->checkBox_vote->isChecked()){
|
||||
relay_data->single_relay[current_index].logic[vote_current_index] = finalExpr;
|
||||
if(relay_data->single_relay[index].logic[0] != "")
|
||||
setExpressionToTreeView(treeView_relay, relay_data->single_relay[index].logic[ui->comboBox_vote_group->currentIndex()]);
|
||||
else
|
||||
model_Relay->clear();
|
||||
@ -317,11 +327,13 @@ void SingleRelay::onComboBoxIndexChanged(int index){
|
||||
else
|
||||
model_Relay->clear();
|
||||
}
|
||||
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();
|
||||
current_index = index;
|
||||
qDebug() << "active" << relay_data->single_relay[index].active;
|
||||
ui->checkBox_active->setChecked(relay_data->single_relay[index].active);
|
||||
ui->lineEdit_vote_count->setText(QString::number(relay_data->single_relay[index].count_vote));
|
||||
|
||||
}
|
||||
ExprNode* SingleRelay::parseExpression(const QString& expr, int& pos) {
|
||||
@ -522,7 +534,7 @@ void SingleRelay::on_comboBox_vote_group_currentIndexChanged(int index)
|
||||
QString("错误位置:%1\n错误描述:%2").arg(result.errorPos).arg(result.errorMsg));
|
||||
return;
|
||||
}
|
||||
qDebug() << "finalExpr" << finalExpr;
|
||||
qDebug() << "finalExpr" << finalExpr << index;
|
||||
relay_data->single_relay[current_index].logic[vote_current_index] = finalExpr;
|
||||
if(relay_data->single_relay[current_index].logic[index] != "")
|
||||
setExpressionToTreeView(treeView_relay, relay_data->single_relay[current_index].logic[index]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user