Skip to content

Commit

Permalink
remove P1P-P1S warning
Browse files Browse the repository at this point in the history
(cherry picked from commit 1d8cdf0)
  • Loading branch information
SoftFever committed Dec 30, 2023
1 parent b4633dc commit 5a14fa2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
21 changes: 6 additions & 15 deletions src/slic3r/GUI/DeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1378,9 +1378,13 @@ void MachineObject::parse_status(int flag)
}

if (!is_support_p1s_plus) {
is_support_p1s_plus = ((flag >> 27) & 0x1) != 0;
}
auto supported_plus = ((flag >> 27) & 0x1) != 0;
auto installed_plus = ((flag >> 26) & 0x1) != 0;

if (installed_plus && supported_plus) {
is_support_p1s_plus = true;
}
}

sdcard_state = MachineObject::SdcardState((flag >> 8) & 0x11);

Expand Down Expand Up @@ -4064,12 +4068,6 @@ int MachineObject::parse_json(std::string payload)
} else if (jj["command"].get<std::string>() == "gcode_line") {
//ack of gcode_line
BOOST_LOG_TRIVIAL(debug) << "parse_json, ack of gcode_line = " << j.dump(4);
if (m_agent && is_studio_cmd(sequence_id)) {
json t;
t["dev_id"] = this->dev_id;
t["signal"] = this->wifi_signal;
m_agent->track_event("ack_cmd_gcode_line", t.dump());
}
} else if (jj["command"].get<std::string>() == "project_prepare") {
//ack of project file
BOOST_LOG_TRIVIAL(info) << "parse_json, ack of project_prepare = " << j.dump(4);
Expand All @@ -4082,13 +4080,6 @@ int MachineObject::parse_json(std::string payload)
} else if (jj["command"].get<std::string>() == "project_file") {
//ack of project file
BOOST_LOG_TRIVIAL(debug) << "parse_json, ack of project_file = " << j.dump(4);

if (m_agent && is_studio_cmd(sequence_id)) {
json t;
t["dev_id"] = this->dev_id;
t["signal"] = this->wifi_signal;
m_agent->track_event("ack_cmd_project_file", t.dump());
}
std::string result;
if (jj.contains("result")) {
result = jj["result"].get<std::string>();
Expand Down
9 changes: 7 additions & 2 deletions src/slic3r/GUI/SelectMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2347,14 +2347,19 @@ bool SelectMachineDialog::is_same_printer_model()
const auto source_model = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
const auto target_model = obj_->printer_type;
// Orca: ignore P1P -> P1S
if (source_model != target_model && !(preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle) == "C12") && !(target_model == "C11" && source_model == "C12")) {
if (source_model != target_model) {
if ((source_model == "C12" && target_model == "C11") || (source_model == "C11" && target_model == "C12") ||
(obj_->is_support_p1s_plus && (source_model == "C12"))) {
return true;
}

BOOST_LOG_TRIVIAL(info) << "printer_model: source = " << source_model;
BOOST_LOG_TRIVIAL(info) << "printer_model: target = " << target_model;
return false;
}

if (obj_->is_support_p1s_plus) {
BOOST_LOG_TRIVIAL(info) << "printer_model: source = " << preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
BOOST_LOG_TRIVIAL(info) << "printer_model: source = " << source_model;
BOOST_LOG_TRIVIAL(info) << "printer_model: target = " << obj_->printer_type << " (plus)";
return false;
}
Expand Down

0 comments on commit 5a14fa2

Please sign in to comment.