From 573e5a14e810de5e9e5a12863aa5f4398ef777fd Mon Sep 17 00:00:00 2001 From: joern274 Date: Sat, 13 Jul 2024 09:18:40 +0200 Subject: [PATCH] Uncheck compile flag if compiler did not produce desired result --- plugins/logic_evaluator/src/logic_evaluator_dialog.cpp | 8 +++++++- plugins/logic_evaluator/src/plugin_logic_evaluator.cpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/logic_evaluator/src/logic_evaluator_dialog.cpp b/plugins/logic_evaluator/src/logic_evaluator_dialog.cpp index d485e56e90e..fc666950ca7 100644 --- a/plugins/logic_evaluator/src/logic_evaluator_dialog.cpp +++ b/plugins/logic_evaluator/src/logic_evaluator_dialog.cpp @@ -129,7 +129,7 @@ namespace hal { ngates->setAlignment(Qt::AlignHCenter); labLayout->addWidget(ngates,0,0); mCheckCompiled = new QCheckBox("Run compiled logic", bbox); - mCheckCompiled->setChecked(!skipCompile); + mCheckCompiled->setChecked(mSharedLib.handle!=nullptr); mCheckIndicate = new QCheckBox("Show in graphic view", bbox); labLayout->addWidget(mCheckCompiled,2,0); labLayout->addWidget(mCheckIndicate,3,0); @@ -152,7 +152,11 @@ namespace hal { void LogicEvaluatorDialog::handleCompiledStateChanged(int state) { if (state==Qt::Checked && !mSharedLib.handle) + { compile(); + if (!mSharedLib.handle) + mCheckCompiled->setChecked(false); + } } void LogicEvaluatorDialog::handleIndicateStateChanged(int state) @@ -314,6 +318,8 @@ namespace hal { return false; } + log_info("logic_evaluator", "Temporary shared library '{}' successfully build and loaded.", mSharedLib.fnSharedLib.toStdString()); + return true; } diff --git a/plugins/logic_evaluator/src/plugin_logic_evaluator.cpp b/plugins/logic_evaluator/src/plugin_logic_evaluator.cpp index 28b460c65d2..8b16cd89732 100644 --- a/plugins/logic_evaluator/src/plugin_logic_evaluator.cpp +++ b/plugins/logic_evaluator/src/plugin_logic_evaluator.cpp @@ -46,6 +46,7 @@ namespace hal void LogicEvaluatorPlugin::on_load() { qRegisterMetaType(); + LogManager::get_instance()->add_channel("logic_evaluator", {LogManager::create_stdout_sink(), LogManager::create_file_sink(), LogManager::create_gui_sink()}, "info"); } void LogicEvaluatorPlugin::on_unload()