mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-15 12:45:54 +08:00
ENH: modify to new upgrade protocol
Change-Id: I8d431ec3c5e9c81e7a7438c6b1db9febf01d4706 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
d54461413f
commit
801b15966a
@ -336,6 +336,9 @@ void MachineInfoPanel::update_version_text(MachineObject* obj)
|
|||||||
} else {
|
} else {
|
||||||
// update version text
|
// update version text
|
||||||
auto it = obj->module_vers.find("ota");
|
auto it = obj->module_vers.find("ota");
|
||||||
|
|
||||||
|
// old protocol
|
||||||
|
if (obj->new_ver_list.empty() && !obj->m_new_ver_list_exist) {
|
||||||
if (obj->upgrade_new_version
|
if (obj->upgrade_new_version
|
||||||
&& !obj->ota_new_version_number.empty()) {
|
&& !obj->ota_new_version_number.empty()) {
|
||||||
if (it != obj->module_vers.end()) {
|
if (it != obj->module_vers.end()) {
|
||||||
@ -357,6 +360,24 @@ void MachineInfoPanel::update_version_text(MachineObject* obj)
|
|||||||
}
|
}
|
||||||
m_ota_new_version_img->Hide();
|
m_ota_new_version_img->Hide();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
auto ota_it = obj->new_ver_list.find("ota");
|
||||||
|
if (ota_it == obj->new_ver_list.end()) {
|
||||||
|
wxString ver_text = wxString::Format("%s(%s)", it->second.sw_ver, _L("Latest version"));
|
||||||
|
m_staticText_ver_val->SetLabelText(ver_text);
|
||||||
|
m_ota_new_version_img->Hide();
|
||||||
|
} else {
|
||||||
|
if (ota_it->second.sw_new_ver != ota_it->second.sw_ver) {
|
||||||
|
m_ota_new_version_img->Show();
|
||||||
|
wxString ver_text = wxString::Format("%s->%s", ota_it->second.sw_ver, ota_it->second.sw_new_ver);
|
||||||
|
m_staticText_ver_val->SetLabelText(ver_text);
|
||||||
|
} else {
|
||||||
|
m_ota_new_version_img->Hide();
|
||||||
|
wxString ver_text = wxString::Format("%s(%s)", it->second.sw_ver, _L("Latest version"));
|
||||||
|
m_staticText_ver_val->SetLabelText(ver_text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user