FIX: disable printing while ams setting up

jira: [STUDIO-9813]
Change-Id: Ic5ff3f96ab86da317744d5fbe0b068e3ba77666b
(cherry picked from commit 26609a130afbab4088cc7bea261266fa6da1def5)
This commit is contained in:
xin.zhang 2025-03-05 12:29:20 +08:00 committed by Noisyfox
parent 7cf1621747
commit 5807353e24
3 changed files with 18 additions and 9 deletions

View file

@ -917,15 +917,12 @@ bool MachineObject::is_support_amx_ext_mix_mapping() {
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)
int setting_up_stat = this->get_flag_bits(ams_cali_stat, 0, 8);
if (setting_up_stat == 0x01 || setting_up_stat == 0x02 || setting_up_stat == 0x03 || setting_up_stat == 0x04)
{
if (ext.ams_stat != 0)
{
return true;
}
return true;
}
return false;
@ -4285,6 +4282,16 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
tray_exist_bits = stol(jj["ams"]["tray_exist_bits"].get<std::string>(), nullptr, 16);
}
if (jj["ams"].contains("cali_id"))
{
ams_cali_id = jj["ams"]["cali_id"].get<int>();
}
if (jj["ams"].contains("cali_stat"))
{
ams_cali_stat = jj["ams"]["cali_stat"].get<int>();
}
if (!key_field_only) {
if (jj["ams"].contains("tray_read_done_bits")) {
tray_read_done_bits = stol(jj["ams"]["tray_read_done_bits"].get<std::string>(), nullptr, 16);

View file

@ -674,6 +674,11 @@ public:
/* ams properties */
std::map<std::string, Ams*> amsList; // key: ams[id], start with 0
int ams_cali_id = 0;
int ams_cali_stat = 0;
//AmsTray vt_tray; // virtual tray
long ams_exist_bits = 0;
long tray_exist_bits = 0;
long tray_is_bbl_bits = 0;

View file

@ -3449,14 +3449,11 @@ void SelectMachineDialog::update_show_status()
}
}
// check ams and vt_slot mix use status
#if 0 /*AP is supporting, send the print job and let the device check it*/
if (obj_->is_ams_on_settingup())
{
show_status(PrintDialogStatus::PrintStatusAmsOnSettingup);
return;
}
#endif
struct ExtruderStatus
{