ENH: show calibration result failed info
Change-Id: I07b8d2d5065ea7e77084d6eae8988e5ab7008172
This commit is contained in:
parent
619cb8eeff
commit
3c29f34e73
|
@ -3838,9 +3838,27 @@ int MachineObject::parse_json(std::string payload)
|
||||||
}
|
}
|
||||||
catch(...) {
|
catch(...) {
|
||||||
}
|
}
|
||||||
} else if (jj["command"].get<std::string>() == "extrusion_cali") {
|
} else if (jj["command"].get<std::string>() == "extrusion_cali" || jj["command"].get<std::string>() == "flowrate_cali") {
|
||||||
if (jj.contains("result") && jj["result"].get<std::string>() == "success") {
|
if (jj.contains("result")) {
|
||||||
// enter extrusion cali
|
if (jj["result"].get<std::string>() == "success") {
|
||||||
|
;
|
||||||
|
}
|
||||||
|
else if (jj["result"].get<std::string>() == "fail") {
|
||||||
|
std::string cali_mode = jj["command"].get<std::string>();
|
||||||
|
std::string reason = jj["reason"].get<std::string>();
|
||||||
|
GUI::wxGetApp().CallAfter([cali_mode, reason] {
|
||||||
|
wxString info = "";
|
||||||
|
if (reason == "invalid nozzle_diameter") {
|
||||||
|
info = _L("Invalid nozzle diameter");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
info = reason;
|
||||||
|
}
|
||||||
|
GUI::MessageDialog msg_dlg(nullptr, info, _L("Calibration error"), wxICON_WARNING | wxOK);
|
||||||
|
msg_dlg.ShowModal();
|
||||||
|
BOOST_LOG_TRIVIAL(trace) << cali_mode << " result fail, reason = " << reason;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (jj["command"].get<std::string>() == "extrusion_cali_set") {
|
} else if (jj["command"].get<std::string>() == "extrusion_cali_set") {
|
||||||
#ifdef CALI_DEBUG
|
#ifdef CALI_DEBUG
|
||||||
|
|
Loading…
Reference in New Issue