FIX: disable printing while ams setting up
jira: [STUDIO-9813] Change-Id: Ic5ff3f96ab86da317744d5fbe0b068e3ba77666b
This commit is contained in:
parent
2a551af40a
commit
26609a130a
|
@ -907,15 +907,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;
|
||||
|
@ -4340,6 +4337,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);
|
||||
|
@ -6268,7 +6275,7 @@ bool MachineObject::is_nozzle_data_invalid()
|
|||
return false;
|
||||
}
|
||||
|
||||
int MachineObject::get_flag_bits(std::string str, int start, int count)
|
||||
int MachineObject::get_flag_bits(std::string str, int start, int count) const
|
||||
{
|
||||
try {
|
||||
unsigned long long decimal_value = std::stoull(str, nullptr, 16);
|
||||
|
@ -6280,7 +6287,7 @@ int MachineObject::get_flag_bits(std::string str, int start, int count)
|
|||
}
|
||||
}
|
||||
|
||||
int MachineObject::get_flag_bits(int num, int start, int count, int base)
|
||||
int MachineObject::get_flag_bits(int num, int start, int count, int base) const
|
||||
{
|
||||
try {
|
||||
unsigned long long mask = (1ULL << count) - 1;
|
||||
|
|
|
@ -671,6 +671,10 @@ 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;
|
||||
|
@ -1249,8 +1253,8 @@ public:
|
|||
bool check_enable_np(const json& print) const;
|
||||
void parse_new_info(json print);
|
||||
bool is_nozzle_data_invalid();
|
||||
int get_flag_bits(std::string str, int start, int count = 1);
|
||||
int get_flag_bits(int num, int start, int count = 1, int base = 10);
|
||||
int get_flag_bits(std::string str, int start, int count = 1) const;
|
||||
int get_flag_bits(int num, int start, int count = 1, int base = 10) const;
|
||||
|
||||
/* Device Filament Check */
|
||||
struct FilamentData
|
||||
|
|
|
@ -3462,14 +3462,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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue