Added errors description

This commit is contained in:
2023-04-28 18:54:49 +03:00
parent b361b6b2fe
commit d729454f8a
3 changed files with 91 additions and 9 deletions
+6 -4
View File
@@ -360,7 +360,7 @@ public:
last_alarm = alarm;
}
void on_check_completed(bool success, size_t failed_index, int error) override {
void on_check_completed(bool success, size_t failed_index, size_t error) override {
btnCheckProgram->set_background_color(success ? colGreen : colRed);
if (success) {
btnRunProgram->set_enabled(true);
@@ -369,19 +369,21 @@ public:
btnRunProgram->set_enabled(false);
std::stringstream ss;
auto i = pgm.instruction_at(failed_index);
ss << "Program check failed at line " << i.line << " (" << i.command << "). Error: " << error;
ss << "Program check failed at line " << i.line << " (" << i.command << "). Error: " << error << ", "
<< grbl::error_to_string(error);
new MessageDialog(this, MessageDialog::Type::Warning, "Check result", ss.str());
}
}
void on_run_completed(bool success, size_t failed_index, int error) override {
void on_run_completed(bool success, size_t failed_index, size_t error) override {
btnRunProgram->set_background_color(success ? colGreen : colRed);
if (success) {
new MessageDialog(this, MessageDialog::Type::Information, "Run result", "Program executed successfully");
} else {
std::stringstream ss;
auto i = pgm.instruction_at(failed_index);
ss << "Program execution failed at line " << i.line << " (" << i.command << "). Error: " << error;
ss << "Program execution failed at line " << i.line << " (" << i.command << "). Error: " << error << ", "
<< grbl::error_to_string(error);
new MessageDialog(this, MessageDialog::Type::Warning, "Run result", ss.str());
}
}