FIX: disable send print while the ams is during setting up
jira: [STUDIO-9813] Change-Id: I55dcca9aab4a9923636c1cf7a0a27bc7e4b9586d
This commit is contained in:
parent
086e977d89
commit
5b800d0342
|
@ -903,6 +903,20 @@ bool MachineObject::is_support_amx_ext_mix_mapping() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* the API is developing by AP, not completed now*/
|
||||||
|
bool MachineObject::is_ams_on_settingup() const
|
||||||
|
{
|
||||||
|
for (const auto& ext : m_extder_data.extders)
|
||||||
|
{
|
||||||
|
if (ext.ams_stat != 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static float calc_color_distance(wxColour c1, wxColour c2)
|
static float calc_color_distance(wxColour c1, wxColour c2)
|
||||||
{
|
{
|
||||||
float lab[2][3];
|
float lab[2][3];
|
||||||
|
@ -4338,6 +4352,8 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
||||||
|
|
||||||
/*AMS without initialization*/
|
/*AMS without initialization*/
|
||||||
if (nozzle_id == 0xE) {
|
if (nozzle_id == 0xE) {
|
||||||
|
ams_id_set.erase(ams_id);
|
||||||
|
amsList.erase(ams_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -695,6 +695,8 @@ public:
|
||||||
bool is_ams_need_update;
|
bool is_ams_need_update;
|
||||||
|
|
||||||
inline bool is_ams_unload() { return m_tray_tar.compare("255") == 0; }
|
inline bool is_ams_unload() { return m_tray_tar.compare("255") == 0; }
|
||||||
|
[[nodiscard]] bool is_ams_on_settingup() const;
|
||||||
|
|
||||||
Ams* get_curr_Ams();
|
Ams* get_curr_Ams();
|
||||||
AmsTray* get_curr_tray();
|
AmsTray* get_curr_tray();
|
||||||
AmsTray *get_ams_tray(std::string ams_id, std::string tray_id);
|
AmsTray *get_ams_tray(std::string ams_id, std::string tray_id);
|
||||||
|
|
|
@ -1737,6 +1737,10 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||||
update_print_status_msg(msg_text, true, true);
|
update_print_status_msg(msg_text, true, true);
|
||||||
Enable_Send_Button(false);
|
Enable_Send_Button(false);
|
||||||
Enable_Refresh_Button(true);
|
Enable_Refresh_Button(true);
|
||||||
|
} else if (status == PrintDialogStatus::PrintStatusAmsOnSettingup) {
|
||||||
|
update_print_status_msg(_L("AMS is setting up. Please try again later."), false, false);
|
||||||
|
Enable_Send_Button(false);
|
||||||
|
Enable_Refresh_Button(true);
|
||||||
} else if (status == PrintDialogStatus::PrintStatusDisableAms) {
|
} else if (status == PrintDialogStatus::PrintStatusDisableAms) {
|
||||||
update_print_status_msg(wxEmptyString, false, false);
|
update_print_status_msg(wxEmptyString, false, false);
|
||||||
Enable_Send_Button(true);
|
Enable_Send_Button(true);
|
||||||
|
@ -1750,7 +1754,7 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||||
update_print_status_msg(msg_text, true, false);
|
update_print_status_msg(msg_text, true, false);
|
||||||
Enable_Send_Button(false);
|
Enable_Send_Button(false);
|
||||||
Enable_Refresh_Button(true);
|
Enable_Refresh_Button(true);
|
||||||
} else if (status == PrintDialogStatus::PrintStatusAmsMappingSuccess){
|
} else if (status == PrintDialogStatus::PrintStatusAmsMappingSuccess){
|
||||||
wxString msg_text = _L("Filaments to AMS slots mappings have been established. You can click a filament above to change its mapping AMS slot");
|
wxString msg_text = _L("Filaments to AMS slots mappings have been established. You can click a filament above to change its mapping AMS slot");
|
||||||
update_print_status_msg(msg_text, false, false);
|
update_print_status_msg(msg_text, false, false);
|
||||||
Enable_Send_Button(true);
|
Enable_Send_Button(true);
|
||||||
|
@ -3362,6 +3366,12 @@ void SelectMachineDialog::update_show_status()
|
||||||
}
|
}
|
||||||
|
|
||||||
// check ams and vt_slot mix use status
|
// check ams and vt_slot mix use status
|
||||||
|
if (obj_->is_ams_on_settingup())
|
||||||
|
{
|
||||||
|
show_status(PrintDialogStatus::PrintStatusAmsOnSettingup);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct ExtruderStatus
|
struct ExtruderStatus
|
||||||
{
|
{
|
||||||
bool has_ams{false};
|
bool has_ams{false};
|
||||||
|
|
|
@ -73,6 +73,7 @@ enum PrintDialogStatus {
|
||||||
PrintStatusInSystemPrinting,
|
PrintStatusInSystemPrinting,
|
||||||
PrintStatusInPrinting,
|
PrintStatusInPrinting,
|
||||||
PrintStatusDisableAms,
|
PrintStatusDisableAms,
|
||||||
|
PrintStatusAmsOnSettingup,
|
||||||
PrintStatusAmsMappingSuccess,
|
PrintStatusAmsMappingSuccess,
|
||||||
PrintStatusAmsMappingInvalid,
|
PrintStatusAmsMappingInvalid,
|
||||||
PrintStatusAmsMappingU0Invalid,
|
PrintStatusAmsMappingU0Invalid,
|
||||||
|
|
Loading…
Reference in New Issue