mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
NEW:added missing method for github branch
Change-Id: I6dba035deb036a5610d3659a6abebbe9ae768bdc
This commit is contained in:
parent
316636d36c
commit
b461d8f9d5
5 changed files with 83 additions and 21 deletions
|
@ -22,31 +22,34 @@
|
|||
"bed_temperature_limit": 100,
|
||||
"model_id": "C11",
|
||||
"printer_type": "C11",
|
||||
"ftp_folder" : "sdcard/",
|
||||
"compatible_machine": [ "BL-P001", "BL-P002"],
|
||||
"ftp_folder": "sdcard/",
|
||||
"printer_thumbnail_image": "printer_thumbnail_p1p"
|
||||
},
|
||||
{
|
||||
|
||||
"display_name": "Bambu Lab X1",
|
||||
"func": {
|
||||
"FUNC_VIRTUAL_TYAY" : true,
|
||||
"FUNC_VIRTUAL_TYAY": true,
|
||||
"FUNC_EXTRUSION_CALI": false,
|
||||
"FUNC_LOCAL_TUNNEL": false
|
||||
},
|
||||
"model_id": "BL-P002",
|
||||
"camera_resolution":["720p","1080p"],
|
||||
"compatible_machine": [ "BL-P001", "C11"],
|
||||
"camera_resolution": [ "720p", "1080p" ],
|
||||
"printer_type": "3DPrinter-X1",
|
||||
"printer_thumbnail_image": "printer_thumbnail"
|
||||
},
|
||||
{
|
||||
"display_name": "Bambu Lab X1 Carbon",
|
||||
"func": {
|
||||
"FUNC_VIRTUAL_TYAY" : true,
|
||||
"FUNC_VIRTUAL_TYAY": true,
|
||||
"FUNC_EXTRUSION_CALI": false,
|
||||
"FUNC_LOCAL_TUNNEL": false
|
||||
},
|
||||
"model_id": "BL-P001",
|
||||
"camera_resolution":["720p","1080p"],
|
||||
"compatible_machine": [ "BL-P002", "C11"],
|
||||
"camera_resolution": [ "720p", "1080p" ],
|
||||
"printer_type": "3DPrinter-X1-Carbon",
|
||||
"printer_thumbnail_image": "printer_thumbnail"
|
||||
}
|
||||
|
|
|
@ -2362,6 +2362,11 @@ void MachineObject::set_print_state(std::string status)
|
|||
print_status = status;
|
||||
}
|
||||
|
||||
std::vector<std::string> MachineObject::get_compatible_machine()
|
||||
{
|
||||
return DeviceManager::get_compatible_machine(printer_type);
|
||||
}
|
||||
|
||||
int MachineObject::connect(bool is_anonymous, bool use_openssl)
|
||||
{
|
||||
if (dev_ip.empty()) return -1;
|
||||
|
@ -5039,4 +5044,20 @@ std::string DeviceManager::load_gcode(std::string type_str, std::string gcode_fi
|
|||
return "";
|
||||
}
|
||||
|
||||
std::vector<std::string> DeviceManager::get_compatible_machine(std::string type_str)
|
||||
{
|
||||
std::vector<std::string> compatible_machine;
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("compatible_machine")) {
|
||||
for (auto res : printer["compatible_machine"])
|
||||
compatible_machine.emplace_back(res.get<std::string>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return compatible_machine;
|
||||
}
|
||||
|
||||
} // namespace Slic3r
|
||||
|
|
|
@ -910,6 +910,7 @@ public:
|
|||
static bool is_in_printing_status(std::string status);
|
||||
|
||||
void set_print_state(std::string status);
|
||||
std::vector<std::string> get_compatible_machine();
|
||||
|
||||
bool is_connected();
|
||||
bool is_connecting();
|
||||
|
@ -1005,6 +1006,7 @@ public:
|
|||
static bool load_filaments_blacklist_config(std::string config_file);
|
||||
static void check_filaments_in_blacklist(std::string tag_vendor, std::string tag_type, bool& in_blacklist, std::string& ac, std::string& info);
|
||||
static std::string load_gcode(std::string type_str, std::string gcode_file);
|
||||
static std::vector<std::string> get_compatible_machine(std::string type_str);
|
||||
};
|
||||
|
||||
} // namespace Slic3r
|
||||
|
|
|
@ -92,6 +92,8 @@ std::string get_print_status_info(PrintDialogStatus status)
|
|||
return "PrintStatusLanModeNoSdcard";
|
||||
case PrintStatusNoSdcard:
|
||||
return "PrintStatusNoSdcard";
|
||||
case PrintStatusUnsupportedPrinter:
|
||||
return "PrintStatusUnsupportedPrinter";
|
||||
case PrintStatusTimelapseNoSdcard:
|
||||
return "PrintStatusTimelapseNoSdcard";
|
||||
case PrintStatusNotSupportedPrintAll:
|
||||
|
@ -2129,7 +2131,12 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
|||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(false);
|
||||
Enable_Refresh_Button(true);
|
||||
} else if (status == PrintDialogStatus::PrintStatusTimelapseNoSdcard) {
|
||||
} else if (status == PrintDialogStatus::PrintStatusUnsupportedPrinter) {
|
||||
wxString msg_text = _L("The selected printer is incompatible with the chosen printer presets.");
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(false);
|
||||
Enable_Refresh_Button(true);
|
||||
}else if (status == PrintDialogStatus::PrintStatusTimelapseNoSdcard) {
|
||||
wxString msg_text = _L("An SD card needs to be inserted to record timelapse.");
|
||||
update_print_status_msg(msg_text, true, true);
|
||||
Enable_Send_Button(true);
|
||||
|
@ -2177,6 +2184,29 @@ void SelectMachineDialog::on_cancel(wxCloseEvent &event)
|
|||
this->EndModal(wxID_CANCEL);
|
||||
}
|
||||
|
||||
bool SelectMachineDialog::is_blocking_printing()
|
||||
{
|
||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) return true;
|
||||
|
||||
MachineObject* obj_ = dev->get_selected_machine();
|
||||
if (obj_ == nullptr) return true;
|
||||
|
||||
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
|
||||
auto source_model = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
|
||||
auto target_model = obj_->printer_type;
|
||||
|
||||
if (source_model != target_model) {
|
||||
std::vector<std::string> compatible_machine = dev->get_compatible_machine(target_model);
|
||||
vector<std::string>::iterator it = find(compatible_machine.begin(), compatible_machine.end(), source_model);
|
||||
if (it == compatible_machine.end()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SelectMachineDialog::is_same_printer_model()
|
||||
{
|
||||
bool result = true;
|
||||
|
@ -3106,7 +3136,11 @@ void SelectMachineDialog::update_show_status()
|
|||
}
|
||||
}
|
||||
|
||||
if (obj_->is_in_upgrading()) {
|
||||
if (is_blocking_printing()) {
|
||||
show_status(PrintDialogStatus::PrintStatusUnsupportedPrinter);
|
||||
return;
|
||||
}
|
||||
else if (obj_->is_in_upgrading()) {
|
||||
show_status(PrintDialogStatus::PrintStatusInUpgrading);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -271,7 +271,8 @@ enum PrintDialogStatus {
|
|||
PrintStatusNeedConsistencyUpgrading,
|
||||
PrintStatusNotSupportedSendToSDCard,
|
||||
PrintStatusNotSupportedPrintAll,
|
||||
PrintStatusBlankPlate
|
||||
PrintStatusBlankPlate,
|
||||
PrintStatusUnsupportedPrinter
|
||||
};
|
||||
|
||||
std::string get_print_status_info(PrintDialogStatus status);
|
||||
|
@ -442,6 +443,7 @@ public:
|
|||
void set_flow_calibration_state(bool state);
|
||||
bool is_show_timelapse();
|
||||
bool is_same_printer_model();
|
||||
bool is_blocking_printing();
|
||||
bool has_tips(MachineObject* obj);
|
||||
bool is_timeout();
|
||||
int update_print_required_data(Slic3r::DynamicPrintConfig config, Slic3r::Model model, Slic3r::PlateDataPtrs plate_data_list, std::string file_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue