FIX: Calibration adaptation encryption
jira: none Change-Id: Ie42da224ca02261b0c32262be895c215878b7921
This commit is contained in:
parent
b9f898d8d8
commit
7498d6e5f8
|
@ -201,9 +201,8 @@ void HistoryWindow::update(MachineObject* obj)
|
|||
{
|
||||
if (!obj) return;
|
||||
|
||||
if (obj->cali_version != history_version) {
|
||||
if (obj->cali_version != obj->last_cali_version) {
|
||||
if (obj->has_get_pa_calib_tab) {
|
||||
history_version = obj->cali_version;
|
||||
reqeust_history_result(obj);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ protected:
|
|||
bool& m_show_history_dialog;
|
||||
std::vector<PACalibResult> m_calib_results_history;
|
||||
MachineObject* curr_obj { nullptr };
|
||||
int history_version = -1;
|
||||
};
|
||||
|
||||
class EditCalibrationHistoryDialog : public DPIDialog
|
||||
|
|
|
@ -4655,15 +4655,24 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
}
|
||||
}
|
||||
else if (jj["command"].get<std::string>() == "extrusion_cali_get") {
|
||||
std::string str = jj.dump();
|
||||
BOOST_LOG_TRIVIAL(info) << "extrusion_cali_get: " << str;
|
||||
reset_pa_cali_history_result();
|
||||
bool is_succeed = true;
|
||||
if (jj.contains("result") && jj.contains("reason")) {
|
||||
if (jj["result"].get<std::string>() == "fail") {
|
||||
if (jj.contains("err_code")) {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
}
|
||||
is_succeed = false;
|
||||
}
|
||||
}
|
||||
|
||||
reset_pa_cali_history_result();
|
||||
if (is_succeed) {
|
||||
last_cali_version = cali_version;
|
||||
has_get_pa_calib_tab = true;
|
||||
}
|
||||
|
||||
if (jj.contains("nozzle_diameter")) {
|
||||
if (jj["nozzle_diameter"].is_number_float()) {
|
||||
|
@ -4682,11 +4691,6 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
|
||||
if (jj.contains("filaments") && jj["filaments"].is_array()) {
|
||||
try {
|
||||
#ifdef CALI_DEBUG
|
||||
std::string str = jj.dump();
|
||||
BOOST_LOG_TRIVIAL(info) << "extrusion_cali_get: " << str;
|
||||
#endif
|
||||
|
||||
for (auto it = jj["filaments"].begin(); it != jj["filaments"].end(); it++) {
|
||||
PACalibResult pa_calib_result;
|
||||
pa_calib_result.filament_id = (*it)["filament_id"].get<std::string>();
|
||||
|
@ -4725,23 +4729,25 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
// notify cali history to update
|
||||
}
|
||||
else if (jj["command"].get<std::string>() == "extrusion_cali_get_result") {
|
||||
std::string str = jj.dump();
|
||||
BOOST_LOG_TRIVIAL(info) << "extrusion_cali_get_result: " << str;
|
||||
reset_pa_cali_result();
|
||||
bool is_succeed = true;
|
||||
if (jj.contains("result") && jj.contains("reason")) {
|
||||
if (jj["result"].get<std::string>() == "fail") {
|
||||
if (jj.contains("err_code")) {
|
||||
auto err_code = jj["err_code"].get<int>();
|
||||
print_error = err_code;
|
||||
is_succeed = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reset_pa_cali_result();
|
||||
if (is_succeed)
|
||||
get_pa_calib_result = true;
|
||||
|
||||
if (jj.contains("filaments") && jj["filaments"].is_array()) {
|
||||
try {
|
||||
#ifdef CALI_DEBUG
|
||||
std::string str = jj.dump();
|
||||
BOOST_LOG_TRIVIAL(info) << "extrusion_cali_get_result: " << str;
|
||||
#endif
|
||||
|
||||
for (auto it = jj["filaments"].begin(); it != jj["filaments"].end(); it++) {
|
||||
PACalibResult pa_calib_result;
|
||||
pa_calib_result.tray_id = (*it)["tray_id"].get<int>();
|
||||
|
|
|
@ -624,6 +624,7 @@ public:
|
|||
bool is_support_layer_num { false };
|
||||
bool nozzle_blob_detection_enabled{ false };
|
||||
|
||||
int last_cali_version = -1;
|
||||
int cali_version = -1;
|
||||
float cali_selected_nozzle_dia { 0.0 };
|
||||
// 1: record when start calibration in preset page
|
||||
|
|
|
@ -310,11 +310,13 @@ void MonitorPanel::select_machine(std::string machine_sn)
|
|||
set_default();
|
||||
update_all();
|
||||
|
||||
m_status_info_panel->last_cali_version.reset();
|
||||
|
||||
MachineObject *obj_ = dev->get_selected_machine();
|
||||
if (obj_)
|
||||
if (obj_) {
|
||||
obj_->last_cali_version = -1;
|
||||
obj_->reset_pa_cali_history_result();
|
||||
obj_->reset_pa_cali_result();
|
||||
GUI::wxGetApp().sidebar().load_ams_list(obj_->dev_id, obj_);
|
||||
}
|
||||
|
||||
Layout();
|
||||
}
|
||||
|
|
|
@ -2573,7 +2573,7 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
}
|
||||
if (m_filament_setting_dlg) { m_filament_setting_dlg->obj = obj; }
|
||||
|
||||
if (obj && (!last_cali_version.has_value() || last_cali_version != obj->cali_version)) {
|
||||
if (obj && (obj->last_cali_version != obj->cali_version)) {
|
||||
last_cali_version = obj->cali_version;
|
||||
CalibUtils::emit_get_PA_calib_info(obj->nozzle_diameter, "");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue