mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
NEW: add extrusion calibration
1. display factor of extrusion calibration 2. add progress to calibration extrusion 3. support ext spool Change-Id: Ic124a0097f16e6287c09f5f133eea84eeefb4000 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
582ec2c109
commit
eed072eccf
16 changed files with 2250 additions and 420 deletions
|
@ -646,27 +646,31 @@ wxBoxSizer *StatusBasePanel::create_temp_axis_group(wxWindow *parent)
|
|||
box->SetBorderColor(box_border_colour);
|
||||
box->SetCornerRadius(5);
|
||||
|
||||
box->SetMinSize(wxSize(FromDIP(530), -1));
|
||||
box->SetMaxSize(wxSize(FromDIP(530), -1));
|
||||
box->SetMinSize(wxSize(FromDIP(578), -1));
|
||||
box->SetMaxSize(wxSize(FromDIP(578), -1));
|
||||
|
||||
wxBoxSizer *content_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *m_temp_ctrl = create_temp_control(box);
|
||||
content_sizer->Add(m_temp_ctrl, 0, wxEXPAND | wxALL, FromDIP(5));
|
||||
|
||||
|
||||
m_temp_extruder_line = new StaticLine(box, true);
|
||||
m_temp_extruder_line->SetLineColour(STATIC_BOX_LINE_COL);
|
||||
content_sizer->Add(m_temp_extruder_line, 0, wxEXPAND, 1);
|
||||
content_sizer->Add(FromDIP(9), 0, 0, wxEXPAND, 1);
|
||||
|
||||
|
||||
auto m_axis_sizer = create_axis_control(box);
|
||||
content_sizer->Add(m_axis_sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0);
|
||||
|
||||
|
||||
wxBoxSizer *bed_sizer = create_bed_control(box);
|
||||
content_sizer->Add(bed_sizer, 0, wxEXPAND | wxLEFT | wxTOP| wxBOTTOM, FromDIP(12));
|
||||
|
||||
content_sizer->Add(0, 0, 0, wxLEFT, FromDIP(12));
|
||||
|
||||
wxBoxSizer *extruder_sizer = create_extruder_control(box);
|
||||
|
||||
content_sizer->Add(m_temp_ctrl, 0, wxEXPAND | wxALL, FromDIP(5));
|
||||
content_sizer->Add(m_temp_extruder_line, 0, wxEXPAND, 1);
|
||||
content_sizer->Add(FromDIP(9), 0, 0, wxEXPAND, 1);
|
||||
content_sizer->Add(0, 0, 0, wxLEFT, FromDIP(18));
|
||||
content_sizer->Add(m_axis_sizer, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0);
|
||||
content_sizer->Add(0, 0, 0, wxLEFT, FromDIP(18));
|
||||
content_sizer->Add(bed_sizer, 0, wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, FromDIP(12));
|
||||
content_sizer->Add(0, 0, 0, wxLEFT, FromDIP(18));
|
||||
content_sizer->Add(extruder_sizer, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(12));
|
||||
|
||||
box->SetSizer(content_sizer);
|
||||
|
@ -1032,7 +1036,6 @@ wxBoxSizer *StatusBasePanel::create_extruder_control(wxWindow *parent)
|
|||
bSizer_e_ctrl->Add(0, 0, 1, wxEXPAND, 0);
|
||||
bSizer_e_ctrl->Add(m_button_unload, 0, wxALIGN_CENTER_HORIZONTAL| wxTOP|wxBOTTOM, FromDIP(5));
|
||||
|
||||
|
||||
bSizer_e_ctrl->Add(0, FromDIP(9), 0, wxEXPAND, 0);
|
||||
|
||||
m_staticText_e = new wxStaticText(panel, wxID_ANY, _L("Extruder"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
|
@ -1062,7 +1065,7 @@ wxBoxSizer *StatusBasePanel::create_ams_group(wxWindow *parent)
|
|||
m_ams_control_box->SetBorderColor(box_border_colour);
|
||||
m_ams_control_box->SetCornerRadius(5);
|
||||
|
||||
m_ams_control_box->SetMinSize(wxSize(FromDIP(530), -1));
|
||||
m_ams_control_box->SetMinSize(wxSize(FromDIP(578), -1));
|
||||
m_ams_control_box->SetBackgroundColour(*wxWHITE);
|
||||
#if !BBL_RELEASE_TO_PUBLIC
|
||||
m_ams_debug = new wxStaticText(m_ams_control_box, wxID_ANY, _L("Debug Info"), wxDefaultPosition, wxDefaultSize, 0);
|
||||
|
@ -1083,13 +1086,12 @@ wxBoxSizer *StatusBasePanel::create_ams_group(wxWindow *parent)
|
|||
return sizer;
|
||||
}
|
||||
|
||||
void StatusBasePanel::show_ams_group(bool show)
|
||||
void StatusBasePanel::show_ams_group(bool show, bool support_virtual_tray)
|
||||
{
|
||||
if (m_show_ams_group != show) {
|
||||
m_ams_control->Show(show);
|
||||
m_ams_control_box->Show(show);
|
||||
Fit();
|
||||
}
|
||||
m_ams_control->Show(true);
|
||||
m_ams_control_box->Show(true);
|
||||
m_ams_control->show_noams_mode(show, support_virtual_tray);
|
||||
Fit();
|
||||
m_show_ams_group = show;
|
||||
}
|
||||
|
||||
|
@ -1248,12 +1250,14 @@ StatusPanel::StatusPanel(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
|
|||
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_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_LOAD, &StatusPanel::on_ams_load, this);
|
||||
Bind(EVT_AMS_UNLOAD, &StatusPanel::on_ams_unload, this);
|
||||
Bind(EVT_AMS_SETTINGS, &StatusPanel::on_ams_setting_click, this);
|
||||
Bind(EVT_AMS_REFRESH_RFID, &StatusPanel::on_ams_refresh_rfid, this);
|
||||
Bind(EVT_AMS_ON_SELECTED, &StatusPanel::on_ams_selected, this);
|
||||
Bind(EVT_AMS_ON_FILAMENT_EDIT, &StatusPanel::on_filament_edit, this);
|
||||
Bind(EVT_VAMS_ON_FILAMENT_EDIT, &StatusPanel::on_ext_spool_edit, this);
|
||||
Bind(EVT_AMS_GUIDE_WIKI, &StatusPanel::on_ams_guide, this);
|
||||
Bind(EVT_AMS_RETRY, &StatusPanel::on_ams_retry, this);
|
||||
Bind(EVT_FAN_CHANGED, &StatusPanel::on_fan_changed, this);
|
||||
|
@ -1317,7 +1321,7 @@ void StatusPanel::init_scaled_buttons()
|
|||
//m_button_abort->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
|
||||
//m_button_abort->SetCornerRadius(FromDIP(12));
|
||||
m_button_clean->SetMinSize(wxSize(FromDIP(48), FromDIP(24)));
|
||||
m_button_clean->SetCornerRadius(FromDIP(12));
|
||||
m_button_clean->SetCornerRadius(FromDIP(12));
|
||||
m_button_unload->SetMinSize(wxSize(-1, FromDIP(24)));
|
||||
m_button_unload->SetCornerRadius(FromDIP(12));
|
||||
m_bpButton_z_10->SetMinSize(Z_BUTTON_SIZE);
|
||||
|
@ -1490,6 +1494,15 @@ void StatusPanel::update(MachineObject *obj)
|
|||
update_cali(obj);
|
||||
|
||||
if (obj) {
|
||||
// update extrusion calibration
|
||||
if (obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI)) {
|
||||
if (m_extrusion_cali_dlg) {
|
||||
m_extrusion_cali_dlg->update_machine_obj(obj);
|
||||
m_extrusion_cali_dlg->update();
|
||||
}
|
||||
}
|
||||
|
||||
// update calibration status
|
||||
if (calibration_dlg == nullptr) {
|
||||
calibration_dlg = new CalibrationDialog();
|
||||
calibration_dlg->update_machine_obj(obj);
|
||||
|
@ -1870,19 +1883,30 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
last_read_done_bits = -1;
|
||||
last_reading_bits = -1;
|
||||
last_ams_version = -1;
|
||||
m_ams_control->show_vams(false);
|
||||
m_ams_control->EnterNoneAMSMode();
|
||||
show_ams_group(false);
|
||||
show_ams_group(false, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI));
|
||||
BOOST_LOG_TRIVIAL(trace) << "machine object" << obj->dev_name << " was disconnected, set show_ams_group is false";
|
||||
return;
|
||||
}
|
||||
|
||||
bool is_support_extrusion_cali = obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI);
|
||||
if (is_support_extrusion_cali) {
|
||||
m_ams_control->show_vams(true);
|
||||
m_ams_control->update_vams_kn_value(obj->vt_tray);
|
||||
}
|
||||
else {
|
||||
m_ams_control->show_vams(false);
|
||||
}
|
||||
|
||||
if (obj->amsList.empty() || obj->ams_exist_bits == 0) {
|
||||
m_ams_control->EnterNoneAMSMode();
|
||||
show_ams_group(false);
|
||||
show_ams_group(false, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI));
|
||||
update_ams_control_state("", is_support_extrusion_cali);
|
||||
BOOST_LOG_TRIVIAL(trace) << "machine object" << obj->dev_name << " ams nonexistent, set show_ams_group is false";
|
||||
return;
|
||||
} else {
|
||||
show_ams_group(true);
|
||||
show_ams_group(true, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI));
|
||||
if (m_filament_setting_dlg) m_filament_setting_dlg->update();
|
||||
|
||||
std::vector<AMSinfo> ams_info;
|
||||
|
@ -1904,10 +1928,9 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
// last_ams_version = obj->ams_version;
|
||||
//}
|
||||
|
||||
// select current ams
|
||||
// if (!obj->m_ams_id.empty()) m_ams_control->SwitchAms(obj->m_ams_id);
|
||||
// must select a current can
|
||||
m_ams_control->UpdateAms(ams_info, false, is_support_extrusion_cali);
|
||||
|
||||
m_ams_control->UpdateAms(ams_info, false);
|
||||
last_tray_exist_bits = obj->tray_exist_bits;
|
||||
last_ams_exist_bits = obj->ams_exist_bits;
|
||||
last_tray_is_bbl_bits = obj->tray_is_bbl_bits;
|
||||
|
@ -1916,12 +1939,6 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
last_ams_version = obj->ams_version;
|
||||
}
|
||||
|
||||
if (!obj->is_ams_unload()) {
|
||||
; // TODO set filament step to load
|
||||
} else {
|
||||
; // TODO set filament step to unload
|
||||
}
|
||||
|
||||
std::string curr_ams_id = m_ams_control->GetCurentAms();
|
||||
std::string curr_can_id = m_ams_control->GetCurrentCan(curr_ams_id);
|
||||
|
||||
|
@ -2022,20 +2039,36 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
}
|
||||
} catch (...) {}
|
||||
}
|
||||
// update rfid button style
|
||||
|
||||
update_ams_control_state(curr_ams_id, is_support_extrusion_cali);
|
||||
}
|
||||
|
||||
void StatusPanel::update_ams_control_state(std::string ams_id, bool is_support_virtual_tray)
|
||||
{
|
||||
// update load/unload enable state
|
||||
if (obj->is_in_printing() && !obj->can_resume()) {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_PRINTING);
|
||||
} else {
|
||||
if (ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_VIRTUAL, is_support_virtual_tray);
|
||||
}
|
||||
else if (obj->is_in_extrusion_cali()) {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_CALI, is_support_virtual_tray);
|
||||
}
|
||||
else if (!obj->has_ams()) {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_NOAMS, is_support_virtual_tray);
|
||||
}
|
||||
else if (obj->is_in_printing() && !obj->can_resume()) {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_PRINTING, is_support_virtual_tray);
|
||||
}
|
||||
else {
|
||||
if (obj->ams_status_main != AMS_STATUS_MAIN_FILAMENT_CHANGE) {
|
||||
if (obj->m_tray_now == "255") {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_LOAD);
|
||||
} else {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_NORMAL);
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_LOAD, is_support_virtual_tray);
|
||||
}
|
||||
} else {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_PRINTING);
|
||||
else {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_NORMAL, is_support_virtual_tray);
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_ams_control->SetActionState(AMSAction::AMS_ACTION_PRINTING, is_support_virtual_tray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2500,6 +2533,42 @@ void StatusPanel::on_ams_setting_click(SimpleEvent &event)
|
|||
}
|
||||
}
|
||||
|
||||
void StatusPanel::on_filament_extrusion_cali(wxCommandEvent &event)
|
||||
{
|
||||
if (!m_extrusion_cali_dlg)
|
||||
m_extrusion_cali_dlg = new ExtrusionCalibration((wxWindow*)this, wxID_ANY);
|
||||
|
||||
if (obj) {
|
||||
m_extrusion_cali_dlg->obj = obj;
|
||||
std::string ams_id = m_ams_control->GetCurentAms();
|
||||
std::string tray_id = m_ams_control->GetCurrentCan(ams_id);
|
||||
if (tray_id.empty() && ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) != 0) {
|
||||
wxString txt = _L("Please select an AMS slot before calibration");
|
||||
MessageDialog msg_dlg(nullptr, txt, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
|
||||
int ams_id_int = 0;
|
||||
int tray_id_int = 0;
|
||||
if (ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) {
|
||||
tray_id_int = VIRTUAL_TRAY_ID;
|
||||
} else {
|
||||
ams_id_int = atoi(ams_id.c_str());
|
||||
tray_id_int = atoi(tray_id.c_str());
|
||||
}
|
||||
|
||||
try {
|
||||
m_extrusion_cali_dlg->ams_id = ams_id_int;
|
||||
m_extrusion_cali_dlg->tray_id = tray_id_int;
|
||||
m_extrusion_cali_dlg->SetPosition(m_ams_control->GetScreenPosition());
|
||||
m_extrusion_cali_dlg->Popup();
|
||||
} catch(...) {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StatusPanel::on_filament_edit(wxCommandEvent &event)
|
||||
{
|
||||
// update params
|
||||
|
@ -2507,36 +2576,77 @@ void StatusPanel::on_filament_edit(wxCommandEvent &event)
|
|||
if (obj) {
|
||||
m_filament_setting_dlg->obj = obj;
|
||||
std::string ams_id = m_ams_control->GetCurentAms();
|
||||
std::string tray_id = event.GetString().ToStdString(); // m_ams_control->GetCurrentCan(ams_id);
|
||||
try {
|
||||
int ams_id_int = atoi(ams_id.c_str());
|
||||
int tray_id_int = atoi(tray_id.c_str());
|
||||
m_filament_setting_dlg->ams_id = ams_id_int;
|
||||
int ams_id_int = 0;
|
||||
int tray_id_int = 0;
|
||||
if (ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) {
|
||||
tray_id_int = VIRTUAL_TRAY_ID;
|
||||
m_filament_setting_dlg->ams_id = ams_id_int;
|
||||
m_filament_setting_dlg->tray_id = tray_id_int;
|
||||
m_filament_setting_dlg->SetPosition(m_ams_control->GetScreenPosition());
|
||||
wxString k_val;
|
||||
wxString n_val;
|
||||
k_val = wxString::Format("%.2f", obj->vt_tray.k);
|
||||
n_val = wxString::Format("%.2f", obj->vt_tray.n);
|
||||
m_filament_setting_dlg->SetPosition(m_ams_control->GetScreenPosition());
|
||||
m_filament_setting_dlg->Popup(wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString, k_val, n_val);
|
||||
} else {
|
||||
std::string tray_id = event.GetString().ToStdString(); // m_ams_control->GetCurrentCan(ams_id);
|
||||
try {
|
||||
ams_id_int = atoi(ams_id.c_str());
|
||||
tray_id_int = atoi(tray_id.c_str());
|
||||
m_filament_setting_dlg->ams_id = ams_id_int;
|
||||
m_filament_setting_dlg->tray_id = tray_id_int;
|
||||
|
||||
std::string sn_number;
|
||||
std::string filament;
|
||||
std::string temp_max;
|
||||
std::string temp_min;
|
||||
auto it = obj->amsList.find(ams_id);
|
||||
if (it != obj->amsList.end()) {
|
||||
auto tray_it = it->second->trayList.find(tray_id);
|
||||
if (tray_it != it->second->trayList.end()) {
|
||||
wxColor color = AmsTray::decode_color(tray_it->second->color);
|
||||
m_filament_setting_dlg->set_color(color);
|
||||
m_filament_setting_dlg->ams_filament_id = tray_it->second->setting_id;
|
||||
m_filament_setting_dlg->m_is_third = !MachineObject::is_bbl_filament(tray_it->second->tag_uid);
|
||||
if (!m_filament_setting_dlg->m_is_third) {
|
||||
sn_number = tray_it->second->uuid;
|
||||
filament = tray_it->second->sub_brands;
|
||||
temp_max = tray_it->second->nozzle_temp_max;
|
||||
temp_min = tray_it->second->nozzle_temp_min;
|
||||
std::string sn_number;
|
||||
std::string filament;
|
||||
std::string temp_max;
|
||||
std::string temp_min;
|
||||
wxString k_val;
|
||||
wxString n_val;
|
||||
auto it = obj->amsList.find(ams_id);
|
||||
if (it != obj->amsList.end()) {
|
||||
auto tray_it = it->second->trayList.find(tray_id);
|
||||
if (tray_it != it->second->trayList.end()) {
|
||||
k_val = wxString::Format("%.2f", tray_it->second->k);
|
||||
n_val = wxString::Format("%.2f", tray_it->second->n);
|
||||
wxColor color = AmsTray::decode_color(tray_it->second->color);
|
||||
m_filament_setting_dlg->set_color(color);
|
||||
m_filament_setting_dlg->ams_filament_id = tray_it->second->setting_id;
|
||||
m_filament_setting_dlg->m_is_third = !MachineObject::is_bbl_filament(tray_it->second->tag_uid);
|
||||
if (!m_filament_setting_dlg->m_is_third) {
|
||||
sn_number = tray_it->second->uuid;
|
||||
filament = tray_it->second->sub_brands;
|
||||
temp_max = tray_it->second->nozzle_temp_max;
|
||||
temp_min = tray_it->second->nozzle_temp_min;
|
||||
}
|
||||
}
|
||||
}
|
||||
m_filament_setting_dlg->SetPosition(m_ams_control->GetScreenPosition());
|
||||
m_filament_setting_dlg->Popup(filament, sn_number, temp_min, temp_max, k_val, n_val);
|
||||
}
|
||||
catch (...) {
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StatusPanel::on_ext_spool_edit(wxCommandEvent &event)
|
||||
{
|
||||
// update params
|
||||
if (!m_filament_setting_dlg) m_filament_setting_dlg = new AMSMaterialsSetting((wxWindow*)this, wxID_ANY);
|
||||
if (obj) {
|
||||
m_filament_setting_dlg->obj = obj;
|
||||
try {
|
||||
m_filament_setting_dlg->tray_id = VIRTUAL_TRAY_ID;
|
||||
wxString k_val;
|
||||
wxString n_val;
|
||||
k_val = wxString::Format("%.2f", obj->vt_tray.k);
|
||||
n_val = wxString::Format("%.2f", obj->vt_tray.n);
|
||||
m_filament_setting_dlg->SetPosition(m_ams_control->GetScreenPosition());
|
||||
m_filament_setting_dlg->Popup(filament, sn_number, temp_min, temp_max);
|
||||
} catch (...) {
|
||||
m_filament_setting_dlg->Popup(wxEmptyString, wxEmptyString, wxEmptyString, wxEmptyString, k_val, n_val);
|
||||
}
|
||||
catch (...) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
@ -2557,6 +2667,10 @@ void StatusPanel::on_ams_refresh_rfid(wxCommandEvent &event)
|
|||
}
|
||||
|
||||
std::string curr_ams_id = m_ams_control->GetCurentAms();
|
||||
// do not support refresh rfid for VIRTUAL_TRAY_ID
|
||||
if (curr_ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) {
|
||||
return;
|
||||
}
|
||||
std::string curr_can_id = event.GetString().ToStdString();
|
||||
|
||||
std::map<std::string, Ams *>::iterator it = obj->amsList.find(curr_ams_id);
|
||||
|
@ -2583,27 +2697,31 @@ void StatusPanel::on_ams_selected(wxCommandEvent &event)
|
|||
{
|
||||
if (obj) {
|
||||
std::string curr_ams_id = m_ams_control->GetCurentAms();
|
||||
std::string curr_can_id = event.GetString().ToStdString();
|
||||
|
||||
std::map<std::string, Ams *>::iterator it = obj->amsList.find(curr_ams_id);
|
||||
if (it == obj->amsList.end()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "ams: find " << curr_ams_id << " failed";
|
||||
if (curr_ams_id.compare(std::to_string(VIRTUAL_TRAY_ID)) == 0) {
|
||||
update_ams_control_state(curr_ams_id, true);
|
||||
return;
|
||||
} else {
|
||||
std::string curr_can_id = event.GetString().ToStdString();
|
||||
std::map<std::string, Ams *>::iterator it = obj->amsList.find(curr_ams_id);
|
||||
if (it == obj->amsList.end()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "ams: find " << curr_ams_id << " failed";
|
||||
return;
|
||||
}
|
||||
auto tray_it = it->second->trayList.find(curr_can_id);
|
||||
if (tray_it == it->second->trayList.end()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "ams: find " << curr_can_id << " failed";
|
||||
return;
|
||||
}
|
||||
try {
|
||||
int tray_index = atoi(curr_ams_id.c_str()) * 4 + atoi(tray_it->second->id.c_str());
|
||||
obj->command_ams_select_tray(std::to_string(tray_index));
|
||||
} catch (...) {
|
||||
;
|
||||
}
|
||||
update_ams_control_state(curr_ams_id, obj->is_function_supported(PrinterFunction::FUNC_EXTRUSION_CALI));
|
||||
}
|
||||
auto tray_it = it->second->trayList.find(curr_can_id);
|
||||
if (tray_it == it->second->trayList.end()) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "ams: find " << curr_can_id << " failed";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
int tray_index = atoi(curr_ams_id.c_str()) * 4 + atoi(tray_it->second->id.c_str());
|
||||
obj->command_ams_select_tray(std::to_string(tray_index));
|
||||
} catch (...) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void StatusPanel::on_ams_guide(wxCommandEvent& event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue