mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
ENH: check ams support only on X1 printer
Change-Id: I830ad6c5f4f7c16edda4d880737548fda0697667
This commit is contained in:
parent
e56c266edc
commit
4b0d63ba8e
1 changed files with 25 additions and 19 deletions
|
@ -501,36 +501,42 @@ bool MachineObject::is_U0_firmware()
|
||||||
|
|
||||||
bool MachineObject::is_support_ams_mapping()
|
bool MachineObject::is_support_ams_mapping()
|
||||||
{
|
{
|
||||||
AppConfig* config = Slic3r::GUI::wxGetApp().app_config;
|
if (printer_type == "BL-P001" || printer_type == "BL-P002") {
|
||||||
if (config) {
|
AppConfig* config = Slic3r::GUI::wxGetApp().app_config;
|
||||||
if (config->get("check_ams_version") == "0")
|
if (config) {
|
||||||
return false;
|
if (config->get("check_ams_version") == "0")
|
||||||
}
|
return true;
|
||||||
bool need_upgrade = false;
|
|
||||||
if (has_ams()) {
|
|
||||||
// compare ota version and ams version
|
|
||||||
auto ota_ver_it = module_vers.find("ota");
|
|
||||||
if (ota_ver_it != module_vers.end()) {
|
|
||||||
if (!MachineObject::is_support_ams_mapping_version("ota", ota_ver_it->second.sw_ver)) {
|
|
||||||
need_upgrade = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for (int i = 0; i < 4; i++) {
|
bool need_upgrade = false;
|
||||||
std::string ams_id = (boost::format("ams/%1%") % i).str();
|
if (has_ams()) {
|
||||||
auto ams_ver_it = module_vers.find(ams_id);
|
// compare ota version and ams version
|
||||||
if (ams_ver_it != module_vers.end()) {
|
auto ota_ver_it = module_vers.find("ota");
|
||||||
if (!MachineObject::is_support_ams_mapping_version("ams", ams_ver_it->second.sw_ver)) {
|
if (ota_ver_it != module_vers.end()) {
|
||||||
|
if (!MachineObject::is_support_ams_mapping_version("ota", ota_ver_it->second.sw_ver)) {
|
||||||
need_upgrade = true;
|
need_upgrade = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
std::string ams_id = (boost::format("ams/%1%") % i).str();
|
||||||
|
auto ams_ver_it = module_vers.find(ams_id);
|
||||||
|
if (ams_ver_it != module_vers.end()) {
|
||||||
|
if (!MachineObject::is_support_ams_mapping_version("ams", ams_ver_it->second.sw_ver)) {
|
||||||
|
need_upgrade = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return !need_upgrade;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
return !need_upgrade;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MachineObject::is_support_ams_mapping_version(std::string module, std::string version)
|
bool MachineObject::is_support_ams_mapping_version(std::string module, std::string version)
|
||||||
{
|
{
|
||||||
bool result = true;
|
bool result = true;
|
||||||
|
|
||||||
if (module == "ota") {
|
if (module == "ota") {
|
||||||
if (version.compare("00.01.04.03") < 0)
|
if (version.compare("00.01.04.03") < 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue