FIX: wrong update info about AMS1
jira: [STUDIO-9089] Change-Id: I7ce5b1069abddd8aaa187ade03d0271b0b16dc9e
This commit is contained in:
parent
920736cf4e
commit
032b34eded
|
@ -3198,6 +3198,8 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
ver_info.product_name = wxString::FromUTF8((*it).value("product_name", json()).get<string>());
|
||||
if ((*it).contains("sw_ver"))
|
||||
ver_info.sw_ver = (*it)["sw_ver"].get<std::string>();
|
||||
if ((*it).contains("sw_new_ver"))
|
||||
ver_info.sw_new_ver = (*it)["sw_new_ver"].get<std::string>();
|
||||
if ((*it).contains("sn"))
|
||||
ver_info.sn = (*it)["sn"].get<std::string>();
|
||||
if ((*it).contains("hw_ver"))
|
||||
|
@ -3926,7 +3928,7 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
|||
upgrade_progress = jj["upgrade_state"]["progress"].get<std::string>();
|
||||
} if (jj["upgrade_state"].contains("new_version_state"))
|
||||
upgrade_new_version = jj["upgrade_state"]["new_version_state"].get<int>() == 1 ? true : false;
|
||||
if (jj["upgrade_state"].contains("ams_new_version_number"))
|
||||
if (!check_enable_np(jj) && jj["upgrade_state"].contains("ams_new_version_number"))/* is not used in new np, by AP*/
|
||||
ams_new_version_number = jj["upgrade_state"]["ams_new_version_number"].get<std::string>();
|
||||
if (jj["upgrade_state"].contains("ota_new_version_number"))
|
||||
ota_new_version_number = jj["upgrade_state"]["ota_new_version_number"].get<std::string>();
|
||||
|
@ -5658,17 +5660,26 @@ AmsTray MachineObject::parse_vt_tray(json vtray)
|
|||
return vt_tray;
|
||||
}
|
||||
|
||||
bool MachineObject::check_enable_np(json print) const
|
||||
{
|
||||
if (print.contains("cfg") && print.contains("fun") && print.contains("aux") && print.contains("stat"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void MachineObject::parse_new_info(json print)
|
||||
{
|
||||
if (print.contains("cfg") && print.contains("fun") && print.contains("aux") && print.contains("stat")) {
|
||||
is_enable_np = true;
|
||||
BOOST_LOG_TRIVIAL(info) << "using new print data for parsing";
|
||||
}
|
||||
else {
|
||||
is_enable_np = false;
|
||||
is_enable_np = check_enable_np(print);
|
||||
if (!is_enable_np)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << "using new print data for parsing";
|
||||
|
||||
/*cfg*/
|
||||
std::string cfg = print["cfg"].get<std::string>();
|
||||
|
||||
|
|
|
@ -1203,6 +1203,7 @@ public:
|
|||
AmsTray parse_vt_tray(json vtray);
|
||||
|
||||
/*for parse new info*/
|
||||
bool check_enable_np(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);
|
||||
|
|
Loading…
Reference in New Issue