NEW:support multiple extruder new control
jira:[device page] Change-Id: Idf68a3385172cbaa123cedb4e2b814c15cc09f07
This commit is contained in:
parent
666e49e299
commit
7700b911a6
|
@ -1633,6 +1633,20 @@ bool MachineObject::is_studio_cmd(int sequence_id)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MachineObject::command_select_extruder(int id)
|
||||||
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(info) << "select_extruder";
|
||||||
|
|
||||||
|
nozzle_selected_count = HOLD_COUNT_MAX;
|
||||||
|
|
||||||
|
json j;
|
||||||
|
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||||
|
j["print"]["command"] = "select_extruder";
|
||||||
|
j["print"]["extruder_index"] = id;
|
||||||
|
|
||||||
|
return this->publish_json(j.dump(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
int MachineObject::command_get_version(bool with_retry)
|
int MachineObject::command_get_version(bool with_retry)
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(info) << "command_get_version";
|
BOOST_LOG_TRIVIAL(info) << "command_get_version";
|
||||||
|
@ -1924,6 +1938,21 @@ int MachineObject::command_set_nozzle(int temp)
|
||||||
return this->publish_gcode(gcode_str);
|
return this->publish_gcode(gcode_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MachineObject::command_set_nozzle_new(int nozzle_id, int temp)
|
||||||
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(info) << "set_nozzle_temp";
|
||||||
|
|
||||||
|
nozzle_selected_count = HOLD_COUNT_MAX;
|
||||||
|
|
||||||
|
json j;
|
||||||
|
j["print"]["sequence_id"] = std::to_string(MachineObject::m_sequence_id++);
|
||||||
|
j["print"]["command"] = "set_nozzle_temp";
|
||||||
|
j["print"]["extruder_index"] = nozzle_id;
|
||||||
|
j["print"]["target_temp"] = temp;
|
||||||
|
|
||||||
|
return this->publish_json(j.dump(), 1);
|
||||||
|
}
|
||||||
|
|
||||||
int MachineObject::command_set_chamber(int temp)
|
int MachineObject::command_set_chamber(int temp)
|
||||||
{
|
{
|
||||||
json j;
|
json j;
|
||||||
|
@ -3306,6 +3335,7 @@ int MachineObject::parse_json(std::string payload, bool key_field_only)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (jj.contains("command")) {
|
if (jj.contains("command")) {
|
||||||
if (jj["command"].get<std::string>() == "ams_change_filament") {
|
if (jj["command"].get<std::string>() == "ams_change_filament") {
|
||||||
if (jj.contains("errno")) {
|
if (jj.contains("errno")) {
|
||||||
|
@ -5685,8 +5715,14 @@ void MachineObject::parse_new_info(json print)
|
||||||
|
|
||||||
m_extder_data = ExtderData();
|
m_extder_data = ExtderData();
|
||||||
m_extder_data.total_extder_count = get_flag_bits(extruder["state"].get<int>(), 0, 3);
|
m_extder_data.total_extder_count = get_flag_bits(extruder["state"].get<int>(), 0, 3);
|
||||||
|
|
||||||
|
if (nozzle_selected_count > 0) {
|
||||||
|
nozzle_selected_count--;
|
||||||
|
} else {
|
||||||
m_extder_data.current_extder_id = get_flag_bits(extruder["state"].get<int>(), 4, 3);
|
m_extder_data.current_extder_id = get_flag_bits(extruder["state"].get<int>(), 4, 3);
|
||||||
m_extder_data.target_extder_id = get_flag_bits(extruder["state"].get<int>(), 8, 3);
|
m_extder_data.target_extder_id = get_flag_bits(extruder["state"].get<int>(), 8, 3);
|
||||||
|
m_extder_data.state = (ExtruderSwitchState) get_flag_bits(extruder["state"].get<int>(), 12, 2);
|
||||||
|
}
|
||||||
|
|
||||||
for (auto it = extruder["info"].begin(); it != extruder["info"].end(); it++) {
|
for (auto it = extruder["info"].begin(); it != extruder["info"].end(); it++) {
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,13 @@ enum ManualPaCaliMethod {
|
||||||
PA_PATTERN,
|
PA_PATTERN,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum ExtruderSwitchState {
|
||||||
|
ES_IDLE = 0,
|
||||||
|
ES_BUSY,
|
||||||
|
ES_SWITCHING,
|
||||||
|
ES_SWITCHING_FAILED
|
||||||
|
};
|
||||||
|
|
||||||
enum AirDuctType {
|
enum AirDuctType {
|
||||||
AIR_FAN_TYPE,
|
AIR_FAN_TYPE,
|
||||||
AIR_DOOR_TYPE
|
AIR_DOOR_TYPE
|
||||||
|
@ -211,6 +218,7 @@ struct ExtderData
|
||||||
int current_extder_id{0};
|
int current_extder_id{0};
|
||||||
int target_extder_id{0};
|
int target_extder_id{0};
|
||||||
int total_extder_count {0};
|
int total_extder_count {0};
|
||||||
|
int state;
|
||||||
std::vector<Extder> extders;
|
std::vector<Extder> extders;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -567,6 +575,7 @@ public:
|
||||||
std::string dev_id;
|
std::string dev_id;
|
||||||
bool local_use_ssl_for_mqtt { true };
|
bool local_use_ssl_for_mqtt { true };
|
||||||
bool local_use_ssl_for_ftp { true };
|
bool local_use_ssl_for_ftp { true };
|
||||||
|
bool m_busy_for_select_extruder {false};
|
||||||
int subscribe_counter{3};
|
int subscribe_counter{3};
|
||||||
std::string dev_connection_type; /* lan | cloud */
|
std::string dev_connection_type; /* lan | cloud */
|
||||||
std::string connection_type() { return dev_connection_type; }
|
std::string connection_type() { return dev_connection_type; }
|
||||||
|
@ -898,6 +907,7 @@ public:
|
||||||
int xcam_prompt_sound_hold_count = 0;
|
int xcam_prompt_sound_hold_count = 0;
|
||||||
int xcam_filament_tangle_detect_count = 0;
|
int xcam_filament_tangle_detect_count = 0;
|
||||||
int ams_print_option_count = 0;
|
int ams_print_option_count = 0;
|
||||||
|
int nozzle_selected_count = 0;
|
||||||
|
|
||||||
//supported features
|
//supported features
|
||||||
bool is_support_chamber_edit{false};
|
bool is_support_chamber_edit{false};
|
||||||
|
@ -992,6 +1002,7 @@ public:
|
||||||
std::string parse_version();
|
std::string parse_version();
|
||||||
void parse_version_func();
|
void parse_version_func();
|
||||||
bool is_studio_cmd(int seq);
|
bool is_studio_cmd(int seq);
|
||||||
|
|
||||||
/* command commands */
|
/* command commands */
|
||||||
int command_get_version(bool with_retry = true);
|
int command_get_version(bool with_retry = true);
|
||||||
int command_request_push_all(bool request_now = false);
|
int command_request_push_all(bool request_now = false);
|
||||||
|
@ -1000,7 +1011,7 @@ public:
|
||||||
int command_set_printer_nozzle(std::string nozzle_type, float diameter);
|
int command_set_printer_nozzle(std::string nozzle_type, float diameter);
|
||||||
int command_set_printer_nozzle2(int id, std::string nozzle_type, float diameter, int flow);
|
int command_set_printer_nozzle2(int id, std::string nozzle_type, float diameter, int flow);
|
||||||
int command_get_access_code();
|
int command_get_access_code();
|
||||||
|
int command_select_extruder(int id);
|
||||||
|
|
||||||
/* command upgrade */
|
/* command upgrade */
|
||||||
int command_upgrade_confirm();
|
int command_upgrade_confirm();
|
||||||
|
@ -1023,6 +1034,7 @@ public:
|
||||||
int command_task_resume();
|
int command_task_resume();
|
||||||
int command_set_bed(int temp);
|
int command_set_bed(int temp);
|
||||||
int command_set_nozzle(int temp);
|
int command_set_nozzle(int temp);
|
||||||
|
int command_set_nozzle_new(int nozzle_id, int temp);
|
||||||
int command_set_chamber(int temp);
|
int command_set_chamber(int temp);
|
||||||
// ams controls
|
// ams controls
|
||||||
int command_ams_switch(int tray_index, int old_temp = 210, int new_temp = 210);
|
int command_ams_switch(int tray_index, int old_temp = 210, int new_temp = 210);
|
||||||
|
|
|
@ -1378,7 +1378,7 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
|
||||||
auto sizer = new wxBoxSizer(wxVERTICAL);
|
auto sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
|
|
||||||
wxWindowID nozzle_id = wxWindow::NewControlId();
|
wxWindowID nozzle_id = wxWindow::NewControlId();
|
||||||
m_tempCtrl_nozzle = new TempInput(parent, nozzle_id, TEMP_BLANK_STR, TempInputType::TEMP_OF_MAIN_NOZZLE_TYPE, TEMP_BLANK_STR, wxString("monitor_nozzle_temp"), wxString("monitor_nozzle_temp_active"),
|
m_tempCtrl_nozzle = new TempInput(parent, nozzle_id, TEMP_BLANK_STR, TempInputType::TEMP_OF_NORMAL_TYPE, TEMP_BLANK_STR, wxString("monitor_nozzle_temp"), wxString("monitor_nozzle_temp_active"),
|
||||||
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
|
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
|
||||||
m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE_OF_SINGLE_NOZZLE);
|
m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE_OF_SINGLE_NOZZLE);
|
||||||
m_tempCtrl_nozzle->SetMinTemp(nozzle_temp_range[0]);
|
m_tempCtrl_nozzle->SetMinTemp(nozzle_temp_range[0]);
|
||||||
|
@ -1393,7 +1393,7 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
|
||||||
m_tempCtrl_nozzle->SetBorderColor(tempinput_border_colour);
|
m_tempCtrl_nozzle->SetBorderColor(tempinput_border_colour);
|
||||||
|
|
||||||
sizer->Add(m_tempCtrl_nozzle, 0, wxEXPAND | wxALL, 1);
|
sizer->Add(m_tempCtrl_nozzle, 0, wxEXPAND | wxALL, 1);
|
||||||
m_tempCtrl_nozzle_deputy = new TempInput(parent, nozzle_id, TEMP_BLANK_STR, TempInputType::TEMP_OF_DEPUTY_NOZZLE_TYPE, TEMP_BLANK_STR, wxString("monitor_nozzle_temp"), wxString("monitor_nozzle_temp_active"),
|
m_tempCtrl_nozzle_deputy = new TempInput(parent, nozzle_id, TEMP_BLANK_STR, TempInputType::TEMP_OF_NORMAL_TYPE, TEMP_BLANK_STR, wxString("monitor_nozzle_temp"), wxString("monitor_nozzle_temp_active"),
|
||||||
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
|
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER);
|
||||||
m_tempCtrl_nozzle_deputy->SetMinSize(TEMP_CTRL_MIN_SIZE_OF_SINGLE_NOZZLE);
|
m_tempCtrl_nozzle_deputy->SetMinSize(TEMP_CTRL_MIN_SIZE_OF_SINGLE_NOZZLE);
|
||||||
m_tempCtrl_nozzle_deputy->SetMinTemp(nozzle_temp_range[0]);
|
m_tempCtrl_nozzle_deputy->SetMinTemp(nozzle_temp_range[0]);
|
||||||
|
@ -1404,7 +1404,7 @@ wxBoxSizer *StatusBasePanel::create_temp_control(wxWindow *parent)
|
||||||
m_tempCtrl_nozzle_deputy->SetBorderColor(tempinput_border_colour);
|
m_tempCtrl_nozzle_deputy->SetBorderColor(tempinput_border_colour);
|
||||||
|
|
||||||
sizer->Add(m_tempCtrl_nozzle_deputy, 0, wxEXPAND | wxALL, 1);
|
sizer->Add(m_tempCtrl_nozzle_deputy, 0, wxEXPAND | wxALL, 1);
|
||||||
//m_tempCtrl_nozzle_deputy->Hide();
|
m_tempCtrl_nozzle_deputy->Hide();
|
||||||
|
|
||||||
m_line_nozzle = new StaticLine(parent);
|
m_line_nozzle = new StaticLine(parent);
|
||||||
m_line_nozzle->SetLineColour(STATIC_BOX_LINE_COL);
|
m_line_nozzle->SetLineColour(STATIC_BOX_LINE_COL);
|
||||||
|
@ -1781,7 +1781,7 @@ wxBoxSizer *StatusBasePanel::create_extruder_control(wxWindow *parent)
|
||||||
StateColor e_ctrl_bg(std::pair<wxColour, int>(BUTTON_PRESS_COL, StateColor::Pressed), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
|
StateColor e_ctrl_bg(std::pair<wxColour, int>(BUTTON_PRESS_COL, StateColor::Pressed), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
|
||||||
StateColor e_ctrl_bd(std::pair<wxColour, int>(BUTTON_HOVER_COL, StateColor::Hovered), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
|
StateColor e_ctrl_bd(std::pair<wxColour, int>(BUTTON_HOVER_COL, StateColor::Hovered), std::pair<wxColour, int>(BUTTON_NORMAL1_COL, StateColor::Normal));
|
||||||
|
|
||||||
m_left_right_btn_panel = new SwitchBoard(panel, _L("Left"), _L("Right"), wxSize(FromDIP(126), FromDIP(26)));
|
m_nozzle_btn_panel = new SwitchBoard(panel, _L("Left"), _L("Right"), wxSize(FromDIP(126), FromDIP(26)));
|
||||||
|
|
||||||
m_bpButton_e_10 = new Button(panel, "", "monitor_extruder_up", 0, FromDIP(22));
|
m_bpButton_e_10 = new Button(panel, "", "monitor_extruder_up", 0, FromDIP(22));
|
||||||
m_bpButton_e_10->SetBorderWidth(2);
|
m_bpButton_e_10->SetBorderWidth(2);
|
||||||
|
@ -1825,7 +1825,7 @@ wxBoxSizer *StatusBasePanel::create_extruder_control(wxWindow *parent)
|
||||||
m_extruder_label->SetForegroundColour(TEXT_LIGHT_FONT_COL);
|
m_extruder_label->SetForegroundColour(TEXT_LIGHT_FONT_COL);
|
||||||
|
|
||||||
bSizer_e_ctrl->Add(0, 0, 0, wxTOP, FromDIP(15));
|
bSizer_e_ctrl->Add(0, 0, 0, wxTOP, FromDIP(15));
|
||||||
bSizer_e_ctrl->Add(m_left_right_btn_panel, 0, wxALIGN_CENTER_HORIZONTAL, 0);
|
bSizer_e_ctrl->Add(m_nozzle_btn_panel, 0, wxALIGN_CENTER_HORIZONTAL, 0);
|
||||||
bSizer_e_ctrl->Add(0, 0, 0, wxTOP, FromDIP(15));
|
bSizer_e_ctrl->Add(0, 0, 0, wxTOP, FromDIP(15));
|
||||||
bSizer_e_ctrl->Add(m_bpButton_e_10, 0, wxALIGN_CENTER_HORIZONTAL, 0);
|
bSizer_e_ctrl->Add(m_bpButton_e_10, 0, wxALIGN_CENTER_HORIZONTAL, 0);
|
||||||
bSizer_e_ctrl->Add(0, 0, 0, wxTOP, FromDIP(7));
|
bSizer_e_ctrl->Add(0, 0, 0, wxTOP, FromDIP(7));
|
||||||
|
@ -2011,7 +2011,11 @@ StatusPanel::StatusPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
|
||||||
if (id == m_tempCtrl_bed->GetType()) {
|
if (id == m_tempCtrl_bed->GetType()) {
|
||||||
on_set_bed_temp();
|
on_set_bed_temp();
|
||||||
} else if (id == m_tempCtrl_nozzle->GetType()) {
|
} else if (id == m_tempCtrl_nozzle->GetType()) {
|
||||||
on_set_nozzle_temp();
|
if (e.GetString() == wxString::Format("%d", MAIN_NOZZLE_ID)) {
|
||||||
|
on_set_nozzle_temp(MAIN_NOZZLE_ID);
|
||||||
|
} else if (e.GetString() == wxString::Format("%d", DEPUTY_NOZZLE_ID)) {
|
||||||
|
on_set_nozzle_temp(DEPUTY_NOZZLE_ID);
|
||||||
|
}
|
||||||
} else if (id == m_tempCtrl_chamber->GetType()) {
|
} else if (id == m_tempCtrl_chamber->GetType()) {
|
||||||
on_set_chamber_temp();
|
on_set_chamber_temp();
|
||||||
}
|
}
|
||||||
|
@ -2050,6 +2054,8 @@ StatusPanel::StatusPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
|
||||||
m_bpButton_z_down_10->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_z_down_10), NULL, this);
|
m_bpButton_z_down_10->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_z_down_10), NULL, this);
|
||||||
m_bpButton_e_10->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_e_up_10), NULL, this);
|
m_bpButton_e_10->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_e_up_10), NULL, this);
|
||||||
m_bpButton_e_down_10->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_e_down_10), NULL, this);
|
m_bpButton_e_down_10->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_e_down_10), NULL, this);
|
||||||
|
m_nozzle_btn_panel->Connect(wxCUSTOMEVT_SELECT_NOZZLE_POS, wxCommandEventHandler(StatusPanel::on_nozzle_selected), NULL, this);
|
||||||
|
|
||||||
//m_button_unload->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_start_unload), NULL, this);
|
//m_button_unload->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_start_unload), NULL, this);
|
||||||
Bind(EVT_AMS_EXTRUSION_CALI, &StatusPanel::on_filament_extrusion_cali, this);
|
Bind(EVT_AMS_EXTRUSION_CALI, &StatusPanel::on_filament_extrusion_cali, this);
|
||||||
Bind(EVT_AMS_LOAD, &StatusPanel::on_ams_load, this);
|
Bind(EVT_AMS_LOAD, &StatusPanel::on_ams_load, this);
|
||||||
|
@ -2113,12 +2119,13 @@ StatusPanel::~StatusPanel()
|
||||||
m_bpButton_z_down_10->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_z_down_10), NULL, this);
|
m_bpButton_z_down_10->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_z_down_10), NULL, this);
|
||||||
m_bpButton_e_10->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_e_up_10), NULL, this);
|
m_bpButton_e_10->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_e_up_10), NULL, this);
|
||||||
m_bpButton_e_down_10->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_e_down_10), NULL, this);
|
m_bpButton_e_down_10->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_axis_ctrl_e_down_10), NULL, this);
|
||||||
|
m_nozzle_btn_panel->Disconnect(wxCUSTOMEVT_SELECT_NOZZLE_POS, wxCommandEventHandler(StatusPanel::on_nozzle_selected), NULL, this);
|
||||||
m_switch_speed->Disconnect(wxEVT_LEFT_DOWN, wxCommandEventHandler(StatusPanel::on_switch_speed), NULL, this);
|
m_switch_speed->Disconnect(wxEVT_LEFT_DOWN, wxCommandEventHandler(StatusPanel::on_switch_speed), NULL, this);
|
||||||
m_calibration_btn->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_start_calibration), NULL, this);
|
m_calibration_btn->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_start_calibration), NULL, this);
|
||||||
m_options_btn->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_show_print_options), NULL, this);
|
m_options_btn->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_show_print_options), NULL, this);
|
||||||
m_parts_btn->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_show_parts_options), NULL, this);
|
m_parts_btn->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_show_parts_options), NULL, this);
|
||||||
//m_button_unload->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_start_unload), NULL, this);
|
//m_button_unload->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StatusPanel::on_start_unload), NULL, this);
|
||||||
|
//
|
||||||
// remove warning dialogs
|
// remove warning dialogs
|
||||||
if (m_print_error_dlg != nullptr)
|
if (m_print_error_dlg != nullptr)
|
||||||
delete m_print_error_dlg;
|
delete m_print_error_dlg;
|
||||||
|
@ -2678,8 +2685,14 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
|
||||||
m_tempCtrl_bed->SetIconNormal();
|
m_tempCtrl_bed->SetIconNormal();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_tempCtrl_nozzle->SetCurrTemp((int) obj->m_extder_data.extders[0].temp);
|
m_tempCtrl_nozzle->SetCurrTemp((int) obj->m_extder_data.extders[MAIN_NOZZLE_ID].temp);
|
||||||
if(nozzle_num == 2 && obj->m_extder_data.extders.size() > 1) m_tempCtrl_nozzle_deputy->SetCurrTemp((int)obj->m_extder_data.extders[0].temp);
|
if (nozzle_num == 2 && obj->m_extder_data.extders.size() > 1) {
|
||||||
|
m_tempCtrl_nozzle->SetCurrType(TEMP_OF_MAIN_NOZZLE_TYPE);
|
||||||
|
m_tempCtrl_nozzle_deputy->SetCurrType(TEMP_OF_DEPUTY_NOZZLE_TYPE);
|
||||||
|
m_tempCtrl_nozzle_deputy->Show();
|
||||||
|
m_tempCtrl_nozzle_deputy->SetCurrTemp((int)obj->m_extder_data.extders[DEPUTY_NOZZLE_ID].temp);
|
||||||
|
}
|
||||||
|
|
||||||
if (obj->nozzle_max_temperature > -1) {
|
if (obj->nozzle_max_temperature > -1) {
|
||||||
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(obj->nozzle_max_temperature);
|
if (m_tempCtrl_nozzle) m_tempCtrl_nozzle->SetMaxTemp(obj->nozzle_max_temperature);
|
||||||
if (m_tempCtrl_nozzle_deputy && nozzle_num >= 2) m_tempCtrl_nozzle_deputy->SetMaxTemp(obj->nozzle_max_temperature);
|
if (m_tempCtrl_nozzle_deputy && nozzle_num >= 2) m_tempCtrl_nozzle_deputy->SetMaxTemp(obj->nozzle_max_temperature);
|
||||||
|
@ -2692,14 +2705,14 @@ void StatusPanel::update_temp_ctrl(MachineObject *obj)
|
||||||
if (m_temp_nozzle_timeout > 0) {
|
if (m_temp_nozzle_timeout > 0) {
|
||||||
m_temp_nozzle_timeout--;
|
m_temp_nozzle_timeout--;
|
||||||
} else {
|
} else {
|
||||||
if (!nozzle_temp_input) { m_tempCtrl_nozzle->SetTagTemp((int) obj->m_extder_data.extders[0].target_temp); }
|
if (!nozzle_temp_input) { m_tempCtrl_nozzle->SetTagTemp((int) obj->m_extder_data.extders[MAIN_NOZZLE_ID].target_temp); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_temp_nozzle_deputy_timeout > 0) {
|
if (m_temp_nozzle_deputy_timeout > 0) {
|
||||||
m_temp_nozzle_deputy_timeout--;
|
m_temp_nozzle_deputy_timeout--;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!nozzle_temp_input && nozzle_num >= 2) { m_tempCtrl_nozzle_deputy->SetTagTemp((int)obj->m_extder_data.extders[0].target_temp); }
|
if (!nozzle_temp_input && nozzle_num >= 2) { m_tempCtrl_nozzle_deputy->SetTagTemp((int)obj->m_extder_data.extders[DEPUTY_NOZZLE_ID].target_temp); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((obj->m_extder_data.extders[0].target_temp - obj->m_extder_data.extders[0].temp) >= TEMP_THRESHOLD_VAL) {
|
if ((obj->m_extder_data.extders[0].target_temp - obj->m_extder_data.extders[0].temp) >= TEMP_THRESHOLD_VAL) {
|
||||||
|
@ -2746,11 +2759,7 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
|
||||||
m_extruder_book->SetSelection(m_nozzle_num);
|
m_extruder_book->SetSelection(m_nozzle_num);
|
||||||
|
|
||||||
/*style*/
|
/*style*/
|
||||||
if (m_nozzle_num == 2) {
|
m_nozzle_btn_panel->Show();
|
||||||
m_left_right_btn_panel->Show();
|
|
||||||
} else {
|
|
||||||
m_left_right_btn_panel->Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_extruderImage[select_index]->setExtruderCount(m_nozzle_num);
|
m_extruderImage[select_index]->setExtruderCount(m_nozzle_num);
|
||||||
m_extruderImage[select_index]->update(ExtruderState::FILLED_LOAD, ExtruderState::FILLED_UNLOAD);
|
m_extruderImage[select_index]->update(ExtruderState::FILLED_LOAD, ExtruderState::FILLED_UNLOAD);
|
||||||
|
@ -2758,16 +2767,17 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
|
||||||
/*current*/
|
/*current*/
|
||||||
if (obj->m_extder_data.current_extder_id == 0xf) {
|
if (obj->m_extder_data.current_extder_id == 0xf) {
|
||||||
m_extruderImage[select_index]->setExtruderUsed("");
|
m_extruderImage[select_index]->setExtruderUsed("");
|
||||||
m_left_right_btn_panel->updateState("");
|
m_nozzle_btn_panel->updateState("");
|
||||||
} else if (obj->m_extder_data.current_extder_id == MAIN_NOZZLE_ID) {
|
} else if (obj->m_extder_data.current_extder_id == MAIN_NOZZLE_ID) {
|
||||||
m_extruderImage[select_index]->setExtruderUsed("right");
|
m_extruderImage[select_index]->setExtruderUsed("right");
|
||||||
m_left_right_btn_panel->updateState("right");
|
m_nozzle_btn_panel->updateState("right");
|
||||||
} else if (obj->m_extder_data.current_extder_id == DEPUTY_NOZZLE_ID) {
|
} else if (obj->m_extder_data.current_extder_id == DEPUTY_NOZZLE_ID) {
|
||||||
m_extruderImage[select_index]->setExtruderUsed("left");
|
m_extruderImage[select_index]->setExtruderUsed("left");
|
||||||
m_left_right_btn_panel->updateState("left");
|
m_nozzle_btn_panel->updateState("left");
|
||||||
}
|
}
|
||||||
Layout();
|
Layout();
|
||||||
} else {
|
} else {
|
||||||
|
m_nozzle_btn_panel->Hide();
|
||||||
m_extruder_book->SetSelection(m_nozzle_num);
|
m_extruder_book->SetSelection(m_nozzle_num);
|
||||||
m_extruderImage[select_index]->setExtruderCount(m_nozzle_num);
|
m_extruderImage[select_index]->setExtruderCount(m_nozzle_num);
|
||||||
}
|
}
|
||||||
|
@ -3855,16 +3865,15 @@ void StatusPanel::on_set_bed_temp()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatusPanel::on_set_nozzle_temp()
|
void StatusPanel::on_set_nozzle_temp(int nozzle_id)
|
||||||
{
|
{
|
||||||
if (!obj) {return;}
|
if (!obj) {return;}
|
||||||
|
|
||||||
wxString str = m_tempCtrl_nozzle->GetTextCtrl()->GetValue();
|
|
||||||
wxString str_deputy;
|
|
||||||
int nozzle_num = obj->m_extder_data.total_extder_count;
|
|
||||||
if (nozzle_num >= 2) str_deputy = m_tempCtrl_nozzle_deputy->GetTextCtrl()->GetValue();
|
|
||||||
try {
|
try {
|
||||||
long nozzle_temp;
|
long nozzle_temp;
|
||||||
|
|
||||||
|
if (nozzle_id == MAIN_NOZZLE_ID) {
|
||||||
|
wxString str = m_tempCtrl_nozzle->GetTextCtrl()->GetValue();
|
||||||
if (str.ToLong(&nozzle_temp) && obj) {
|
if (str.ToLong(&nozzle_temp) && obj) {
|
||||||
set_hold_count(m_temp_nozzle_timeout);
|
set_hold_count(m_temp_nozzle_timeout);
|
||||||
if (nozzle_temp > m_tempCtrl_nozzle->get_max_temp()) {
|
if (nozzle_temp > m_tempCtrl_nozzle->get_max_temp()) {
|
||||||
|
@ -3872,16 +3881,25 @@ void StatusPanel::on_set_nozzle_temp()
|
||||||
m_tempCtrl_nozzle->SetTagTemp(wxString::Format("%d", nozzle_temp));
|
m_tempCtrl_nozzle->SetTagTemp(wxString::Format("%d", nozzle_temp));
|
||||||
m_tempCtrl_nozzle->Warning(false);
|
m_tempCtrl_nozzle->Warning(false);
|
||||||
}
|
}
|
||||||
|
if (m_tempCtrl_nozzle->GetCurrType() == TempInputType::TEMP_OF_NORMAL_TYPE) {
|
||||||
obj->command_set_nozzle(nozzle_temp);
|
obj->command_set_nozzle(nozzle_temp);
|
||||||
|
} else {
|
||||||
|
obj->command_set_nozzle_new(MAIN_NOZZLE_ID, nozzle_temp);
|
||||||
}
|
}
|
||||||
if (nozzle_num >= 2 && str_deputy.ToLong(&nozzle_temp) && obj) {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nozzle_id == DEPUTY_NOZZLE_ID) {
|
||||||
|
wxString str = m_tempCtrl_nozzle_deputy->GetTextCtrl()->GetValue();
|
||||||
|
if (str.ToLong(&nozzle_temp) && obj) {
|
||||||
// set_hold_count(m_temp_nozzle_deputy_timeout);
|
// set_hold_count(m_temp_nozzle_deputy_timeout);
|
||||||
if (nozzle_temp > m_tempCtrl_nozzle_deputy->get_max_temp()) {
|
if (nozzle_temp > m_tempCtrl_nozzle_deputy->get_max_temp()) {
|
||||||
nozzle_temp = m_tempCtrl_nozzle_deputy->get_max_temp();
|
nozzle_temp = m_tempCtrl_nozzle_deputy->get_max_temp();
|
||||||
m_tempCtrl_nozzle_deputy->SetTagTemp(wxString::Format("%d", nozzle_temp));
|
m_tempCtrl_nozzle_deputy->SetTagTemp(wxString::Format("%d", nozzle_temp));
|
||||||
m_tempCtrl_nozzle_deputy->Warning(false);
|
m_tempCtrl_nozzle_deputy->Warning(false);
|
||||||
}
|
}
|
||||||
obj->command_set_nozzle(nozzle_temp);
|
obj->command_set_nozzle_new(DEPUTY_NOZZLE_ID, nozzle_temp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
;
|
;
|
||||||
|
@ -4597,6 +4615,14 @@ void StatusPanel::on_xyz_abs(wxCommandEvent &event)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void StatusPanel::on_nozzle_selected(wxCommandEvent &event)
|
||||||
|
{
|
||||||
|
if (obj) {
|
||||||
|
obj->m_extder_data.current_extder_id = event.GetInt();
|
||||||
|
auto nozzle_id = event.GetInt();obj->command_select_extruder(nozzle_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void StatusPanel::on_show_print_options(wxCommandEvent& event)
|
void StatusPanel::on_show_print_options(wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
if (obj) {
|
if (obj) {
|
||||||
|
|
|
@ -404,7 +404,7 @@ protected:
|
||||||
Button * m_button_clean;
|
Button * m_button_clean;
|
||||||
wxSimplebook* m_extruder_book;
|
wxSimplebook* m_extruder_book;
|
||||||
std::vector<ExtruderImage *> m_extruderImage;
|
std::vector<ExtruderImage *> m_extruderImage;
|
||||||
SwitchBoard * m_left_right_btn_panel;
|
SwitchBoard * m_nozzle_btn_panel;
|
||||||
|
|
||||||
wxStaticText * m_text_tasklist_caption;
|
wxStaticText * m_text_tasklist_caption;
|
||||||
|
|
||||||
|
@ -498,6 +498,7 @@ protected:
|
||||||
virtual void on_axis_ctrl_z_down_10(wxCommandEvent &event) { event.Skip(); }
|
virtual void on_axis_ctrl_z_down_10(wxCommandEvent &event) { event.Skip(); }
|
||||||
virtual void on_axis_ctrl_e_up_10(wxCommandEvent &event) { event.Skip(); }
|
virtual void on_axis_ctrl_e_up_10(wxCommandEvent &event) { event.Skip(); }
|
||||||
virtual void on_axis_ctrl_e_down_10(wxCommandEvent &event) { event.Skip(); }
|
virtual void on_axis_ctrl_e_down_10(wxCommandEvent &event) { event.Skip(); }
|
||||||
|
virtual void on_nozzle_selected(wxCommandEvent &event) { event.Skip(); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StatusBasePanel(wxWindow * parent,
|
StatusBasePanel(wxWindow * parent,
|
||||||
|
@ -620,6 +621,8 @@ protected:
|
||||||
void on_axis_ctrl_e_down_10(wxCommandEvent &event);
|
void on_axis_ctrl_e_down_10(wxCommandEvent &event);
|
||||||
void axis_ctrl_e_hint(bool up_down);
|
void axis_ctrl_e_hint(bool up_down);
|
||||||
|
|
||||||
|
void on_nozzle_selected(wxCommandEvent &event);
|
||||||
|
|
||||||
void on_start_unload(wxCommandEvent &event);
|
void on_start_unload(wxCommandEvent &event);
|
||||||
/* temp control */
|
/* temp control */
|
||||||
void on_bed_temp_kill_focus(wxFocusEvent &event);
|
void on_bed_temp_kill_focus(wxFocusEvent &event);
|
||||||
|
@ -627,7 +630,7 @@ protected:
|
||||||
void on_set_bed_temp();
|
void on_set_bed_temp();
|
||||||
void on_nozzle_temp_kill_focus(wxFocusEvent &event);
|
void on_nozzle_temp_kill_focus(wxFocusEvent &event);
|
||||||
void on_nozzle_temp_set_focus(wxFocusEvent &event);
|
void on_nozzle_temp_set_focus(wxFocusEvent &event);
|
||||||
void on_set_nozzle_temp();
|
void on_set_nozzle_temp(int nozzle_id);
|
||||||
void on_set_chamber_temp();
|
void on_set_chamber_temp();
|
||||||
|
|
||||||
/* extruder apis */
|
/* extruder apis */
|
||||||
|
@ -663,6 +666,7 @@ protected:
|
||||||
void on_auto_leveling(wxCommandEvent &event);
|
void on_auto_leveling(wxCommandEvent &event);
|
||||||
void on_xyz_abs(wxCommandEvent &event);
|
void on_xyz_abs(wxCommandEvent &event);
|
||||||
|
|
||||||
|
|
||||||
void on_show_parts_options(wxCommandEvent& event);
|
void on_show_parts_options(wxCommandEvent& event);
|
||||||
/* print options */
|
/* print options */
|
||||||
void on_show_print_options(wxCommandEvent &event);
|
void on_show_print_options(wxCommandEvent &event);
|
||||||
|
|
|
@ -843,7 +843,7 @@ std::string GenerateRandomString(int length)
|
||||||
return randomString;
|
return randomString;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebViewPanel::SaveBase64ToLocal(std::string Base64Buf, std::string FileName, std::string FileTail, wxString &download_path, wxString &download_file)
|
void WebViewPanel::OpenMakerlab3mf(std::string Base64Buf, std::string FileName)
|
||||||
{
|
{
|
||||||
int nSize = wxBase64DecodedSize(Base64Buf.length());
|
int nSize = wxBase64DecodedSize(Base64Buf.length());
|
||||||
char *DstBuf = new char[nSize + 1];
|
char *DstBuf = new char[nSize + 1];
|
||||||
|
@ -1730,7 +1730,7 @@ void WebViewPanel::SwitchWebContent(std::string modelname, int refresh)
|
||||||
|
|
||||||
wxString strlang = wxGetApp().current_language_code_safe();
|
wxString strlang = wxGetApp().current_language_code_safe();
|
||||||
|
|
||||||
if (modelname.compare("makersupply") == 0)
|
if (modelname.compare("makerlab") == 0)
|
||||||
{
|
{
|
||||||
std::string strRegion = wxGetApp().app_config->get_country_code();
|
std::string strRegion = wxGetApp().app_config->get_country_code();
|
||||||
wxString MakerSupplyUrl;
|
wxString MakerSupplyUrl;
|
||||||
|
@ -1739,18 +1739,20 @@ void WebViewPanel::SwitchWebContent(std::string modelname, int refresh)
|
||||||
else
|
else
|
||||||
MakerSupplyUrl = "https://store.bambulab.com/collections/makers-supply?from=bambustudio";
|
MakerSupplyUrl = "https://store.bambulab.com/collections/makers-supply?from=bambustudio";
|
||||||
|
|
||||||
wxLaunchDefaultBrowser(MakerSupplyUrl);
|
|
||||||
}
|
|
||||||
else if (modelname.compare("makerlab") == 0)
|
|
||||||
{
|
|
||||||
wxString FinalUrl;
|
|
||||||
|
|
||||||
if (!m_MakerLabFirst)
|
if (!m_MakerLabFirst)
|
||||||
{
|
{
|
||||||
UpdateMakerlabStatus();
|
if (m_MakerLab_LastUrl != "")
|
||||||
|
FinalUrl = m_MakerLab_LastUrl;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetMakerlabUrl("");
|
||||||
|
|
||||||
|
FinalUrl = m_MakerLab_LastUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (m_MakerLab_LastUrl != "") m_browserML->LoadURL(m_MakerLab_LastUrl);
|
if (m_MakerLab_LastUrl != "")
|
||||||
|
FinalUrl = m_MakerLab_LastUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_MakerLabFirst = true;
|
m_MakerLabFirst = true;
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#include <wx/dcgraph.h>
|
#include <wx/dcgraph.h>
|
||||||
#include <wx/dcmemory.h>
|
#include <wx/dcmemory.h>
|
||||||
|
|
||||||
|
wxDEFINE_EVENT(wxCUSTOMEVT_SELECT_NOZZLE_POS, wxCommandEvent);
|
||||||
|
|
||||||
SwitchButton::SwitchButton(wxWindow* parent, wxWindowID id)
|
SwitchButton::SwitchButton(wxWindow* parent, wxWindowID id)
|
||||||
: wxBitmapToggleButton(parent, id, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxBU_EXACTFIT)
|
: wxBitmapToggleButton(parent, id, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxBU_EXACTFIT)
|
||||||
, m_on(this, "toggle_on", 16)
|
, m_on(this, "toggle_on", 16)
|
||||||
|
@ -223,8 +225,12 @@ void SwitchBoard::render(wxDC &dc)
|
||||||
|
|
||||||
void SwitchBoard::doRender(wxDC &dc)
|
void SwitchBoard::doRender(wxDC &dc)
|
||||||
{
|
{
|
||||||
|
wxColour disable_color = wxColour(0xCECECE);
|
||||||
|
|
||||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||||
dc.SetBrush(wxBrush(0xeeeeee));
|
|
||||||
|
if (is_enable) {dc.SetBrush(wxBrush(0xeeeeee));
|
||||||
|
} else {dc.SetBrush(disable_color);}
|
||||||
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 8);
|
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 8);
|
||||||
|
|
||||||
/*left*/
|
/*left*/
|
||||||
|
@ -245,7 +251,8 @@ void SwitchBoard::doRender(wxDC &dc)
|
||||||
|
|
||||||
/*right*/
|
/*right*/
|
||||||
if (switch_right) {
|
if (switch_right) {
|
||||||
dc.SetBrush(wxBrush(wxColour(0, 174, 66)));
|
if (is_enable) {dc.SetBrush(wxBrush(wxColour(0, 174, 66)));
|
||||||
|
} else {dc.SetBrush(disable_color);}
|
||||||
dc.DrawRoundedRectangle(GetSize().x / 2, 0, GetSize().x / 2, GetSize().y, 8);
|
dc.DrawRoundedRectangle(GetSize().x / 2, 0, GetSize().x / 2, GetSize().y, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,15 +269,25 @@ void SwitchBoard::doRender(wxDC &dc)
|
||||||
|
|
||||||
void SwitchBoard::on_left_down(wxMouseEvent &evt)
|
void SwitchBoard::on_left_down(wxMouseEvent &evt)
|
||||||
{
|
{
|
||||||
|
if (!is_enable) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int index = -1;
|
||||||
auto pos = ClientToScreen(evt.GetPosition());
|
auto pos = ClientToScreen(evt.GetPosition());
|
||||||
auto rect = ClientToScreen(wxPoint(0, 0));
|
auto rect = ClientToScreen(wxPoint(0, 0));
|
||||||
|
|
||||||
if (pos.x > 0 && pos.x < rect.x + GetSize().x / 2) {
|
if (pos.x > 0 && pos.x < rect.x + GetSize().x / 2) {
|
||||||
switch_left = true;
|
switch_left = true;
|
||||||
switch_right = false;
|
switch_right = false;
|
||||||
|
index = 1;
|
||||||
} else {
|
} else {
|
||||||
switch_left = false;
|
switch_left = false;
|
||||||
switch_right = true;
|
switch_right = true;
|
||||||
|
index = 0;
|
||||||
}
|
}
|
||||||
Refresh();
|
Refresh();
|
||||||
|
|
||||||
|
wxCommandEvent event(wxCUSTOMEVT_SELECT_NOZZLE_POS);
|
||||||
|
event.SetInt(index);
|
||||||
|
wxPostEvent(this, event);
|
||||||
}
|
}
|
|
@ -8,6 +8,8 @@
|
||||||
#include "Label.hpp"
|
#include "Label.hpp"
|
||||||
#include "Button.hpp"
|
#include "Button.hpp"
|
||||||
|
|
||||||
|
wxDECLARE_EVENT(wxCUSTOMEVT_SELECT_NOZZLE_POS, wxCommandEvent);
|
||||||
|
|
||||||
class SwitchButton : public wxBitmapToggleButton
|
class SwitchButton : public wxBitmapToggleButton
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -53,12 +55,16 @@ public:
|
||||||
|
|
||||||
bool switch_left{false};
|
bool switch_left{false};
|
||||||
bool switch_right{false};
|
bool switch_right{false};
|
||||||
|
bool is_enable {true};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void paintEvent(wxPaintEvent &evt);
|
void paintEvent(wxPaintEvent &evt);
|
||||||
void render(wxDC &dc);
|
void render(wxDC &dc);
|
||||||
void doRender(wxDC &dc);
|
void doRender(wxDC &dc);
|
||||||
void on_left_down(wxMouseEvent &evt);
|
void on_left_down(wxMouseEvent &evt);
|
||||||
|
void Enable(){is_enable = true;Refresh();};
|
||||||
|
void Disable(){is_enable = false;Refresh();};
|
||||||
|
bool IsEnabled(){return is_enable;};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !slic3r_GUI_SwitchButton_hpp_
|
#endif // !slic3r_GUI_SwitchButton_hpp_
|
||||||
|
|
|
@ -145,6 +145,7 @@ void TempInput::SetFinish()
|
||||||
{
|
{
|
||||||
wxCommandEvent event(wxCUSTOMEVT_SET_TEMP_FINISH);
|
wxCommandEvent event(wxCUSTOMEVT_SET_TEMP_FINISH);
|
||||||
event.SetInt(temp_type);
|
event.SetInt(temp_type);
|
||||||
|
event.SetString(wxString::Format("%d", m_input_type));
|
||||||
wxPostEvent(this->GetParent(), event);
|
wxPostEvent(this->GetParent(), event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,6 +188,7 @@ void TempInput::SetCurrTemp(int temp)
|
||||||
auto tp = wxString::Format("%d", temp);
|
auto tp = wxString::Format("%d", temp);
|
||||||
if (GetLabel() != tp) {
|
if (GetLabel() != tp) {
|
||||||
SetLabel(tp);
|
SetLabel(tp);
|
||||||
|
Refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -194,6 +196,7 @@ void TempInput::SetCurrTemp(wxString temp)
|
||||||
{
|
{
|
||||||
if (GetLabel() != temp) {
|
if (GetLabel() != temp) {
|
||||||
SetLabel(temp);
|
SetLabel(temp);
|
||||||
|
Refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ public:
|
||||||
void SetCurrTemp(int temp);
|
void SetCurrTemp(int temp);
|
||||||
void SetCurrTemp(wxString temp);
|
void SetCurrTemp(wxString temp);
|
||||||
void SetCurrType(TempInputType type);
|
void SetCurrType(TempInputType type);
|
||||||
|
TempInputType GetCurrType(){return m_input_type;};
|
||||||
|
|
||||||
bool AllisNum(std::string str);
|
bool AllisNum(std::string str);
|
||||||
void SetFinish();
|
void SetFinish();
|
||||||
|
|
Loading…
Reference in New Issue