mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-19 05:15:58 +08:00
ENH:keep an unload logic
jira:[for unload] Change-Id: Id30ec71ffa5b2dac89346ea47ca48a62479e3ab1
This commit is contained in:
parent
3328363c85
commit
6cda59f925
@ -2271,41 +2271,6 @@ int MachineObject::command_get_flow_ratio_calibration_result(float nozzle_diamet
|
||||
return -1;
|
||||
}
|
||||
|
||||
int MachineObject::command_unload_filament()
|
||||
{
|
||||
if (get_printer_series() == PrinterSeries::SERIES_X1 && !ams_support_virtual_tray) {
|
||||
// fixed gcode file
|
||||
json j;
|
||||
j["print"]["command"] = "gcode_file";
|
||||
j["print"]["param"] = "/usr/etc/print/filament_unload.gcode";
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
return this->publish_json(j.dump());
|
||||
}
|
||||
else if (get_printer_series() == PrinterSeries::SERIES_P1P || (get_printer_series() == PrinterSeries::SERIES_X1 && ams_support_virtual_tray) ) {
|
||||
std::string gcode = DeviceManager::load_gcode(printer_type, "ams_unload.gcode");
|
||||
if (gcode.empty()) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
json j;
|
||||
j["print"]["command"] = "gcode_line";
|
||||
j["print"]["param"] = gcode;
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
|
||||
if (m_agent)
|
||||
j["print"]["user_id"] = m_agent->get_user_id();
|
||||
|
||||
return this->publish_json(j.dump());
|
||||
}
|
||||
else {
|
||||
json j;
|
||||
j["print"]["command"] = "unload_filament";
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
return this->publish_json(j.dump());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int MachineObject::command_ipcam_record(bool on_off)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << "command_ipcam_record = " << on_off;
|
||||
|
@ -878,8 +878,6 @@ public:
|
||||
int command_start_flow_ratio_calibration(const X1CCalibInfos& calib_data);
|
||||
int command_get_flow_ratio_calibration_result(float nozzle_diameter);
|
||||
|
||||
int command_unload_filament();
|
||||
|
||||
// camera control
|
||||
int command_ipcam_record(bool on_off);
|
||||
int command_ipcam_timelapse(bool on_off);
|
||||
|
@ -3145,7 +3145,7 @@ void StatusPanel::on_axis_ctrl_e_down_10(wxCommandEvent &event)
|
||||
|
||||
void StatusPanel::on_start_unload(wxCommandEvent &event)
|
||||
{
|
||||
if (obj) obj->command_unload_filament();
|
||||
if (obj) obj->command_ams_switch(255);
|
||||
}
|
||||
|
||||
void StatusPanel::on_set_bed_temp()
|
||||
|
Loading…
x
Reference in New Issue
Block a user