NEW:new extrusion command
jira:[none ] Change-Id: I721ce4b2eb5ab02a88dc370f14bbfdb1b91f40a1 (cherry picked from commit 79c534375f7650480208a662e0a8302bc4ff6c45)
This commit is contained in:
parent
889c6165f9
commit
7dd335f134
|
@ -2308,6 +2308,15 @@ int MachineObject::command_axis_control(std::string axis, double unit, double in
|
|||
return this->publish_gcode(cmd);
|
||||
}
|
||||
|
||||
int MachineObject::command_extruder_control(int nozzle_id, double val)
|
||||
{
|
||||
json j;
|
||||
j["print"]["command"] = "set_extrusion_length";
|
||||
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||
j["print"]["extruder_index"] = nozzle_id;
|
||||
j["print"]["length"] = (int)val;
|
||||
return this->publish_json(j.dump());
|
||||
}
|
||||
|
||||
bool MachineObject::is_support_command_calibration()
|
||||
{
|
||||
|
|
|
@ -1086,6 +1086,7 @@ public:
|
|||
// axis string is X, Y, Z, E
|
||||
int command_axis_control(std::string axis, double unit = 1.0f, double input_val = 1.0f, int speed = 3000);
|
||||
|
||||
int command_extruder_control(int nozzle_id, double val);
|
||||
// calibration printer
|
||||
bool is_support_command_calibration();
|
||||
int command_start_calibration(bool vibration, bool bed_leveling, bool xcam_cali, bool motor_noise);
|
||||
|
|
|
@ -3953,8 +3953,14 @@ void StatusPanel::axis_ctrl_e_hint(bool up_down)
|
|||
void StatusPanel::on_axis_ctrl_e_up_10(wxCommandEvent &event)
|
||||
{
|
||||
if (obj) {
|
||||
if (obj->m_extder_data.extders[0].temp >= TEMP_THRESHOLD_ALLOW_E_CTRL || (wxGetApp().app_config->get("not_show_ectrl_hint") == "1"))
|
||||
obj->command_axis_control("E", 1.0, -10.0f, 900);
|
||||
auto current_nozzle_id = obj->m_extder_data.current_extder_id;
|
||||
if (obj->m_extder_data.extders[current_nozzle_id].temp >= TEMP_THRESHOLD_ALLOW_E_CTRL || (wxGetApp().app_config->get("not_show_ectrl_hint") == "1"))
|
||||
if (obj->is_enable_np) {
|
||||
obj->command_extruder_control(current_nozzle_id, -10.0f);
|
||||
} else {
|
||||
obj->command_axis_control("E", 1.0, -10.0f, 900);
|
||||
}
|
||||
|
||||
else
|
||||
axis_ctrl_e_hint(true);
|
||||
}
|
||||
|
@ -3963,8 +3969,13 @@ void StatusPanel::on_axis_ctrl_e_up_10(wxCommandEvent &event)
|
|||
void StatusPanel::on_axis_ctrl_e_down_10(wxCommandEvent &event)
|
||||
{
|
||||
if (obj) {
|
||||
if (obj->m_extder_data.extders[0].temp >= TEMP_THRESHOLD_ALLOW_E_CTRL || (wxGetApp().app_config->get("not_show_ectrl_hint") == "1"))
|
||||
obj->command_axis_control("E", 1.0, 10.0f, 900);
|
||||
auto current_nozzle_id = obj->m_extder_data.current_extder_id;
|
||||
if (obj->m_extder_data.extders[current_nozzle_id].temp >= TEMP_THRESHOLD_ALLOW_E_CTRL || (wxGetApp().app_config->get("not_show_ectrl_hint") == "1"))
|
||||
if (obj->is_enable_np) {
|
||||
obj->command_extruder_control(current_nozzle_id, 10.0f);
|
||||
} else {
|
||||
obj->command_axis_control("E", 1.0, 10.0f, 900);
|
||||
}
|
||||
else
|
||||
axis_ctrl_e_hint(false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue