mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -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()
|
||||
{
|
||||
AppConfig* config = Slic3r::GUI::wxGetApp().app_config;
|
||||
if (config) {
|
||||
if (config->get("check_ams_version") == "0")
|
||||
return false;
|
||||
}
|
||||
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;
|
||||
}
|
||||
if (printer_type == "BL-P001" || printer_type == "BL-P002") {
|
||||
AppConfig* config = Slic3r::GUI::wxGetApp().app_config;
|
||||
if (config) {
|
||||
if (config->get("check_ams_version") == "0")
|
||||
return 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)) {
|
||||
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++) {
|
||||
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 result = true;
|
||||
|
||||
if (module == "ota") {
|
||||
if (version.compare("00.01.04.03") < 0)
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue