ENH:Reduce the number of page faults in AMS
Change-Id: I4bfb048ec62c35b515eecbb70c175fa0975d7f92
This commit is contained in:
parent
872978d61b
commit
791be19547
|
@ -284,21 +284,12 @@ void MonitorPanel::select_machine(std::string machine_sn)
|
|||
wxQueueEvent(this, event);
|
||||
}
|
||||
|
||||
void MonitorPanel::on_update_all(wxMouseEvent &event)
|
||||
{
|
||||
if (update_flag) {
|
||||
update_all();
|
||||
Layout();
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void MonitorPanel::on_timer(wxTimerEvent& event)
|
||||
{
|
||||
if (update_flag) {
|
||||
update_all();
|
||||
Layout();
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -314,6 +305,8 @@ void MonitorPanel::on_update_all(wxMouseEvent &event)
|
|||
if (!dev->set_selected_machine(event.GetString().ToStdString()))
|
||||
return;
|
||||
|
||||
m_status_info_panel->reset_ams_group_show_flag();
|
||||
|
||||
set_default();
|
||||
update_all();
|
||||
|
||||
|
@ -324,7 +317,6 @@ void MonitorPanel::on_update_all(wxMouseEvent &event)
|
|||
GUI::wxGetApp().sidebar().load_ams_list(obj_->dev_id, obj_);
|
||||
|
||||
Layout();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MonitorPanel::on_printer_clicked(wxMouseEvent &event)
|
||||
|
@ -350,8 +342,8 @@ void MonitorPanel::on_printer_clicked(wxMouseEvent &event)
|
|||
|
||||
void MonitorPanel::on_size(wxSizeEvent &event)
|
||||
{
|
||||
Layout();
|
||||
Refresh();
|
||||
//Layout();
|
||||
//Refresh();
|
||||
}
|
||||
|
||||
void MonitorPanel::update_all()
|
||||
|
|
|
@ -132,7 +132,6 @@ public:
|
|||
|
||||
StatusPanel* get_status_panel() {return m_status_info_panel;};
|
||||
void select_machine(std::string machine_sn);
|
||||
void on_update_all(wxMouseEvent &event);
|
||||
void on_timer(wxTimerEvent& event);
|
||||
void on_select_printer(wxCommandEvent& event);
|
||||
void on_printer_clicked(wxMouseEvent &event);
|
||||
|
|
|
@ -1552,13 +1552,15 @@ wxBoxSizer *StatusBasePanel::create_ams_group(wxWindow *parent)
|
|||
|
||||
void StatusBasePanel::show_ams_group(bool show)
|
||||
{
|
||||
m_ams_control->Show(true);
|
||||
m_ams_control_box->Show(true);
|
||||
m_ams_control->show_noams_mode();
|
||||
if (m_show_ams_group != show) {
|
||||
Fit();
|
||||
if (m_show_ams_group != show || m_show_ams_group_reset) {
|
||||
m_ams_control->Show(true);
|
||||
m_ams_control_box->Show(true);
|
||||
m_ams_control->show_noams_mode();
|
||||
if (m_show_ams_group != show) { Fit(); }
|
||||
m_show_ams_group = show;
|
||||
m_show_ams_group_reset = false;
|
||||
Layout();
|
||||
}
|
||||
m_show_ams_group = show;
|
||||
}
|
||||
|
||||
void StatusPanel::update_camera_state(MachineObject* obj)
|
||||
|
@ -2008,25 +2010,22 @@ bool StatusPanel::is_task_changed(MachineObject* obj)
|
|||
|
||||
void StatusPanel::update(MachineObject *obj)
|
||||
{
|
||||
|
||||
if (!obj) return;
|
||||
m_project_task_panel->Freeze();
|
||||
update_subtask(obj);
|
||||
m_project_task_panel->Thaw();
|
||||
|
||||
|
||||
#if !BBL_RELEASE_TO_PUBLIC
|
||||
auto delay1 = std::chrono::duration_cast<std::chrono::milliseconds>(obj->last_utc_time - std::chrono::system_clock::now()).count();
|
||||
auto delay2 = std::chrono::duration_cast<std::chrono::milliseconds>(obj->last_push_time - std::chrono::system_clock::now()).count();
|
||||
auto delay = wxString::Format(" %ld/%ld", delay1, delay2);
|
||||
m_staticText_timelapse
|
||||
->SetLabel((obj->is_lan_mode_printer() ? "Local Mqtt" : obj->is_tunnel_mqtt ? "Tunnel Mqtt" : "Cloud Mqtt") + delay);
|
||||
m_bmToggleBtn_timelapse
|
||||
->Enable(!obj->is_lan_mode_printer());
|
||||
m_bmToggleBtn_timelapse
|
||||
->SetValue(obj->is_tunnel_mqtt);
|
||||
auto delay1 = std::chrono::duration_cast<std::chrono::milliseconds>(obj->last_utc_time - std::chrono::system_clock::now()).count();
|
||||
auto delay2 = std::chrono::duration_cast<std::chrono::milliseconds>(obj->last_push_time - std::chrono::system_clock::now()).count();
|
||||
auto delay = wxString::Format(" %ld/%ld", delay1, delay2);
|
||||
m_staticText_timelapse->SetLabel((obj->is_lan_mode_printer() ? "Local Mqtt" : obj->is_tunnel_mqtt ? "Tunnel Mqtt" : "Cloud Mqtt") + delay);
|
||||
m_bmToggleBtn_timelapse->Enable(!obj->is_lan_mode_printer());
|
||||
m_bmToggleBtn_timelapse->SetValue(obj->is_tunnel_mqtt);
|
||||
#endif
|
||||
|
||||
m_machine_ctrl_panel->Freeze();
|
||||
|
||||
//m_machine_ctrl_panel->Freeze();
|
||||
if (obj->is_in_printing() && !obj->can_resume())
|
||||
show_printing_status(false, true);
|
||||
else
|
||||
|
@ -2065,7 +2064,6 @@ void StatusPanel::update(MachineObject *obj)
|
|||
} else {
|
||||
m_options_btn->Hide();
|
||||
}
|
||||
|
||||
m_parts_btn->Show();
|
||||
|
||||
//support edit chamber temp
|
||||
|
@ -2082,14 +2080,13 @@ void StatusPanel::update(MachineObject *obj)
|
|||
|
||||
if (obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
m_tempCtrl_chamber->SetTagTemp(TEMP_BLANK_STR);
|
||||
}if (obj->get_printer_series() == PrinterSeries::SERIES_P1P)
|
||||
}
|
||||
|
||||
if (obj->get_printer_series() == PrinterSeries::SERIES_P1P)
|
||||
{
|
||||
m_tempCtrl_chamber->SetLabel(TEMP_BLANK_STR);
|
||||
m_tempCtrl_chamber->GetTextCtrl()->SetValue(TEMP_BLANK_STR);
|
||||
}
|
||||
|
||||
//m_tempCtrl_chamber->Disable();
|
||||
|
||||
}
|
||||
|
||||
if (!obj->dev_connection_type.empty()) {
|
||||
|
@ -2114,7 +2111,7 @@ void StatusPanel::update(MachineObject *obj)
|
|||
|
||||
update_camera_state(obj);
|
||||
|
||||
m_machine_ctrl_panel->Thaw();
|
||||
//m_machine_ctrl_panel->Thaw();
|
||||
}
|
||||
|
||||
void StatusPanel::show_recenter_dialog() {
|
||||
|
@ -2266,12 +2263,12 @@ void StatusPanel::show_printing_status(bool ctrl_area, bool temp_area)
|
|||
m_bpButton_e_10->Enable();
|
||||
m_bpButton_e_down_10->Enable();
|
||||
|
||||
m_bpButton_z_10->SetIcon("monitor_bed_up");
|
||||
m_bpButton_z_1->SetIcon("monitor_bed_up");
|
||||
m_bpButton_z_down_1->SetIcon("monitor_bed_down");
|
||||
m_bpButton_z_down_10->SetIcon("monitor_bed_down");
|
||||
m_bpButton_e_10->SetIcon("monitor_extruder_up");
|
||||
m_bpButton_e_down_10->SetIcon("monitor_extrduer_down");
|
||||
m_bpButton_z_10->SetIcon("monitor_bed_up");
|
||||
m_bpButton_z_1->SetIcon("monitor_bed_up");
|
||||
m_bpButton_z_down_1->SetIcon("monitor_bed_down");
|
||||
m_bpButton_z_down_10->SetIcon("monitor_bed_down");
|
||||
m_bpButton_e_10->SetIcon("monitor_extruder_up");
|
||||
m_bpButton_e_down_10->SetIcon("monitor_extrduer_down");
|
||||
|
||||
m_staticText_z_tip->SetForegroundColour(TEXT_LIGHT_FONT_COL);
|
||||
m_staticText_e->SetForegroundColour(TEXT_LIGHT_FONT_COL);
|
||||
|
@ -2366,12 +2363,12 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj)
|
|||
if (obj->can_unload_filament()) {
|
||||
if (!m_button_unload->IsShown()) {
|
||||
m_button_unload->Show();
|
||||
m_button_unload->GetParent()->Layout();
|
||||
//m_button_unload->GetParent()->Layout();
|
||||
}
|
||||
} else {
|
||||
if (m_button_unload->IsShown()) {
|
||||
m_button_unload->Hide();
|
||||
m_button_unload->GetParent()->Layout();
|
||||
//m_button_unload->GetParent()->Layout();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2572,7 +2569,6 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
|
||||
m_ams_control->SetAmsModel(AMSModel::NO_AMS, ams_mode);
|
||||
show_ams_group(false);
|
||||
|
||||
m_ams_control->show_auto_refill(false);
|
||||
}
|
||||
else {
|
||||
|
@ -2582,7 +2578,6 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
m_ams_control->show_auto_refill(true);
|
||||
}
|
||||
|
||||
|
||||
if (is_support_virtual_tray) m_ams_control->update_vams_kn_value(obj->vt_tray, obj);
|
||||
if (m_filament_setting_dlg) m_filament_setting_dlg->update();
|
||||
|
||||
|
@ -2592,18 +2587,6 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
info.ams_id = ams->first;
|
||||
if (ams->second->is_exists && info.parse_ams_info(obj, ams->second, obj->ams_calibrate_remain_flag, obj->is_support_ams_humidity)) ams_info.push_back(info);
|
||||
}
|
||||
//if (obj->ams_exist_bits != last_ams_exist_bits || obj->tray_exist_bits != last_tray_exist_bits || obj->tray_is_bbl_bits != last_tray_is_bbl_bits ||
|
||||
// obj->tray_read_done_bits != last_read_done_bits || obj->ams_version != last_ams_version) {
|
||||
// m_ams_control->UpdateAms(ams_info, false);
|
||||
// // select current ams
|
||||
// //if (!obj->m_ams_id.empty()) m_ams_control->SwitchAms(obj->m_ams_id);
|
||||
|
||||
// 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;
|
||||
// last_read_done_bits = obj->tray_read_done_bits;
|
||||
// last_ams_version = obj->ams_version;
|
||||
//}
|
||||
|
||||
// must select a current can
|
||||
m_ams_control->UpdateAms(ams_info, false);
|
||||
|
@ -2643,7 +2626,6 @@ void StatusPanel::update_ams(MachineObject *obj)
|
|||
m_ams_control->SetExtruder(obj->is_filament_at_extruder(), true, obj->m_ams_id, obj->vt_tray.get_color());
|
||||
} else {
|
||||
m_ams_control->SetExtruder(obj->is_filament_at_extruder(), false, obj->m_ams_id, m_ams_control->GetCanColour(obj->m_ams_id, obj->m_tray_id));
|
||||
|
||||
}
|
||||
|
||||
if (obj->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) {
|
||||
|
|
|
@ -374,6 +374,7 @@ protected:
|
|||
wxBoxSizer* m_ams_list;
|
||||
wxStaticText * m_ams_debug;
|
||||
bool m_show_ams_group{false};
|
||||
bool m_show_ams_group_reset{true};
|
||||
AMSControl* m_ams_control;
|
||||
StaticBox* m_ams_control_box;
|
||||
wxStaticBitmap *m_ams_extruder_img;
|
||||
|
@ -442,6 +443,7 @@ public:
|
|||
wxBoxSizer *create_ams_group(wxWindow *parent);
|
||||
wxBoxSizer *create_settings_group(wxWindow *parent);
|
||||
|
||||
void reset_ams_group_show_flag() {m_show_ams_group_reset = true;};
|
||||
void show_ams_group(bool show = true);
|
||||
MediaPlayCtrl* get_media_play_ctrl() {return m_media_play_ctrl;};
|
||||
};
|
||||
|
|
|
@ -314,14 +314,18 @@ Description:AMSextruder
|
|||
**************************************************/
|
||||
void AMSextruderImage::TurnOn(wxColour col)
|
||||
{
|
||||
m_colour = col;
|
||||
Refresh();
|
||||
if (m_colour != col) {
|
||||
m_colour = col;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void AMSextruderImage::TurnOff()
|
||||
{
|
||||
m_colour = AMS_EXTRUDER_DEF_COLOUR;
|
||||
Refresh();
|
||||
if (m_colour != AMS_EXTRUDER_DEF_COLOUR) {
|
||||
m_colour = AMS_EXTRUDER_DEF_COLOUR;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void AMSextruderImage::msw_rescale()
|
||||
|
@ -429,16 +433,22 @@ void AMSextruder::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
|
|||
|
||||
void AMSextruder::OnVamsLoading(bool load, wxColour col)
|
||||
{
|
||||
m_vams_loading = load;
|
||||
if (load)m_current_colur = col;
|
||||
Refresh();
|
||||
if (m_vams_loading != load) {
|
||||
m_vams_loading = load;
|
||||
if (load) m_current_colur = col;
|
||||
//m_current_colur = col;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void AMSextruder::OnAmsLoading(bool load, wxColour col /*= AMS_CONTROL_GRAY500*/)
|
||||
{
|
||||
m_ams_loading = load;
|
||||
if (load)m_current_colur = col;
|
||||
Refresh();
|
||||
if (m_ams_loading != load) {
|
||||
m_ams_loading = load;
|
||||
//m_current_colur = col;
|
||||
if (load) m_current_colur = col;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void AMSextruder::paintEvent(wxPaintEvent& evt)
|
||||
|
@ -542,9 +552,12 @@ AMSVirtualRoad::~AMSVirtualRoad() {}
|
|||
|
||||
void AMSVirtualRoad::OnVamsLoading(bool load, wxColour col)
|
||||
{
|
||||
m_vams_loading = load;
|
||||
if (load)m_current_color = col;
|
||||
Refresh();
|
||||
if (m_vams_loading != load) {
|
||||
m_vams_loading = load;
|
||||
if (load)m_current_color = col;
|
||||
//m_current_color = col;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void AMSVirtualRoad::create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size)
|
||||
|
@ -1324,9 +1337,14 @@ void AMSLib::Update(Caninfo info, bool refresh)
|
|||
if (info.material_colour.Alpha() != 0 && info.material_colour.Alpha() != 255 && info.material_colour.Alpha() != 254 && m_info.material_colour != info.material_colour) {
|
||||
transparent_changed = true;
|
||||
}
|
||||
m_info = info;
|
||||
Layout();
|
||||
if (refresh) Refresh();
|
||||
|
||||
if (m_info == info) {
|
||||
//todo
|
||||
} else {
|
||||
m_info = info;
|
||||
Layout();
|
||||
if (refresh) Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
wxColour AMSLib::GetLibColour() { return m_info.material_colour; }
|
||||
|
@ -1431,9 +1449,14 @@ void AMSRoad::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const
|
|||
|
||||
void AMSRoad::Update(AMSinfo amsinfo, Caninfo info, int canindex, int maxcan)
|
||||
{
|
||||
if (amsinfo == m_amsinfo && m_info == info && m_canindex == canindex) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_amsinfo = amsinfo;
|
||||
m_info = info;
|
||||
m_canindex = canindex;
|
||||
|
||||
if (m_canindex == 0 && maxcan == 1) {
|
||||
m_rode_mode = AMSRoadMode::AMS_ROAD_MODE_END_ONLY;
|
||||
} else if (m_canindex == 0 && maxcan > 1) {
|
||||
|
@ -1449,17 +1472,22 @@ void AMSRoad::Update(AMSinfo amsinfo, Caninfo info, int canindex, int maxcan)
|
|||
|
||||
void AMSRoad::OnVamsLoading(bool load, wxColour col /*= AMS_CONTROL_GRAY500*/)
|
||||
{
|
||||
m_vams_loading = load;
|
||||
if(load)m_road_color = col;
|
||||
Refresh();
|
||||
if (m_vams_loading != load) {
|
||||
m_vams_loading = load;
|
||||
if (load) m_road_color = col;
|
||||
//m_road_color = col;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void AMSRoad::SetPassRoadColour(wxColour col) { m_road_color = col; }
|
||||
|
||||
void AMSRoad::SetMode(AMSRoadMode mode)
|
||||
{
|
||||
m_rode_mode = mode;
|
||||
Refresh();
|
||||
if (m_rode_mode != mode) {
|
||||
m_rode_mode = mode;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void AMSRoad::paintEvent(wxPaintEvent &evt)
|
||||
|
@ -2005,31 +2033,31 @@ void AmsCans::Update(AMSinfo info)
|
|||
Canrefreshs *refresh = m_can_refresh_list[i];
|
||||
if (i < m_can_count) {
|
||||
refresh->canrefresh->Update(info.ams_id, info.cans[i]);
|
||||
refresh->canrefresh->Show();
|
||||
if (!refresh->canrefresh->IsShown()) { refresh->canrefresh->Show();}
|
||||
|
||||
} else {
|
||||
refresh->canrefresh->Hide();
|
||||
if (refresh->canrefresh->IsShown()) { refresh->canrefresh->Hide();}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (auto i = 0; i < m_can_lib_list.GetCount(); i++) {
|
||||
CanLibs *lib = m_can_lib_list[i];
|
||||
if (i < m_can_count) {
|
||||
lib->canLib->Update(info.cans[i]);
|
||||
lib->canLib->Show();
|
||||
if(!lib->canLib->IsShown()) { lib->canLib->Show();}
|
||||
} else {
|
||||
lib->canLib->Hide();
|
||||
if(lib->canLib->IsShown()) { lib->canLib->Hide(); }
|
||||
}
|
||||
}
|
||||
|
||||
if (m_ams_model == AMSModel::GENERIC_AMS) {
|
||||
for (auto i = 0; i < m_can_road_list.GetCount(); i++) {
|
||||
CanRoads* road = m_can_road_list[i];
|
||||
CanRoads *road = m_can_road_list[i];
|
||||
if (i < m_can_count) {
|
||||
road->canRoad->Update(m_info, info.cans[i], i, m_can_count);
|
||||
road->canRoad->Show();
|
||||
}
|
||||
else {
|
||||
road->canRoad->Hide();
|
||||
if (!road->canRoad->IsShown()) { road->canRoad->Show(); }
|
||||
} else {
|
||||
if (road->canRoad->IsShown()) { road->canRoad->Hide(); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3282,10 +3310,13 @@ void AMSControl::show_noams_mode()
|
|||
|
||||
void AMSControl::show_auto_refill(bool show)
|
||||
{
|
||||
m_ams_backup_tip->Show(show);
|
||||
m_img_ams_backup->Show(show);
|
||||
m_amswin->Layout();
|
||||
m_amswin->Fit();
|
||||
if (m_auto_reill_show != show) {
|
||||
m_ams_backup_tip->Show(show);
|
||||
m_img_ams_backup->Show(show);
|
||||
m_amswin->Layout();
|
||||
m_amswin->Fit();
|
||||
m_auto_reill_show = show;
|
||||
}
|
||||
}
|
||||
|
||||
void AMSControl::show_vams(bool show)
|
||||
|
@ -3313,6 +3344,9 @@ void AMSControl::show_vams_kn_value(bool show)
|
|||
|
||||
void AMSControl::update_vams_kn_value(AmsTray tray, MachineObject* obj)
|
||||
{
|
||||
auto last_k_value = m_vams_info.k;
|
||||
auto last_n_value = m_vams_info.n;
|
||||
|
||||
m_vams_lib->m_obj = obj;
|
||||
if (obj->cali_version >= 0) {
|
||||
float k_value = 0;
|
||||
|
@ -3329,11 +3363,15 @@ void AMSControl::update_vams_kn_value(AmsTray tray, MachineObject* obj)
|
|||
m_vams_lib->m_info.k = tray.k;
|
||||
m_vams_lib->m_info.n = tray.n;
|
||||
}
|
||||
|
||||
m_vams_info.material_name = tray.get_display_filament_type();
|
||||
m_vams_info.material_colour = tray.get_color();
|
||||
m_vams_lib->m_info.material_name = tray.get_display_filament_type();
|
||||
m_vams_lib->m_info.material_colour = tray.get_color();
|
||||
m_vams_lib->Refresh();
|
||||
|
||||
if (last_k_value != m_vams_info.k || last_n_value != m_vams_info.n) {
|
||||
m_vams_lib->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void AMSControl::reset_vams()
|
||||
|
@ -3357,7 +3395,7 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> info, bool is_reset)
|
|||
m_button_area->Fit();
|
||||
|
||||
// update item
|
||||
m_ams_info = info;
|
||||
|
||||
if (m_ams_model == AMSModel::GENERIC_AMS){
|
||||
m_ams_cans_list = m_ams_generic_cans_list;
|
||||
}
|
||||
|
@ -3365,20 +3403,24 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> info, bool is_reset)
|
|||
m_ams_cans_list = m_ams_extra_cans_list;
|
||||
}
|
||||
|
||||
if (info.size() > 1) {
|
||||
m_simplebook_amsitems->Show();
|
||||
m_amswin->Layout();
|
||||
m_amswin->Fit();
|
||||
SetSize(m_amswin->GetSize());
|
||||
SetMinSize(m_amswin->GetSize());
|
||||
} else {
|
||||
m_simplebook_amsitems->Hide();
|
||||
m_amswin->Layout();
|
||||
m_amswin->Fit();
|
||||
SetSize(m_amswin->GetSize());
|
||||
SetMinSize(m_amswin->GetSize());
|
||||
if (m_ams_info.size() != info.size()) {
|
||||
if (info.size() > 1) {
|
||||
m_simplebook_amsitems->Show();
|
||||
m_amswin->Layout();
|
||||
m_amswin->Fit();
|
||||
SetSize(m_amswin->GetSize());
|
||||
SetMinSize(m_amswin->GetSize());
|
||||
} else {
|
||||
m_simplebook_amsitems->Hide();
|
||||
m_amswin->Layout();
|
||||
m_amswin->Fit();
|
||||
SetSize(m_amswin->GetSize());
|
||||
SetMinSize(m_amswin->GetSize());
|
||||
}
|
||||
}
|
||||
|
||||
m_ams_info = info;
|
||||
|
||||
for (auto i = 0; i < m_ams_item_list.GetCount(); i++) {
|
||||
AmsItems *item = m_ams_item_list[i];
|
||||
if (i < info.size() && info.size() > 1) {
|
||||
|
@ -3666,8 +3708,7 @@ void AMSControl::SetExtruder(bool on_off, bool is_vams, std::string ams_now, wxC
|
|||
|
||||
if (ams_now != GetCurentShowAms()) {
|
||||
m_extruder->OnAmsLoading(false, col);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
m_extruder->OnAmsLoading(true, col);
|
||||
}
|
||||
}
|
||||
|
@ -3732,11 +3773,9 @@ void AMSControl::SetAmsStep(std::string ams_id, std::string canid, AMSPassRoadTy
|
|||
if (notfound) return;
|
||||
if (cans == nullptr) return;
|
||||
|
||||
|
||||
m_last_ams_id = ams_id;
|
||||
m_last_tray_id = canid;
|
||||
|
||||
|
||||
if (m_ams_model == AMSModel::GENERIC_AMS) {
|
||||
if (step == AMSPassRoadSTEP::AMS_ROAD_STEP_NONE) {
|
||||
cans->amsCans->SetAmsStep(canid, type, AMSPassRoadSTEP::AMS_ROAD_STEP_NONE);
|
||||
|
@ -3751,9 +3790,7 @@ void AMSControl::SetAmsStep(std::string ams_id, std::string canid, AMSPassRoadTy
|
|||
if (step == AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP2) {
|
||||
cans->amsCans->SetAmsStep(canid, type, AMSPassRoadSTEP::AMS_ROAD_STEP_1);
|
||||
cans->amsCans->SetAmsStep(canid, type, AMSPassRoadSTEP::AMS_ROAD_STEP_2);
|
||||
if (m_current_show_ams == ams_id) {
|
||||
m_extruder->OnAmsLoading(true, cans->amsCans->GetTagColr(canid));
|
||||
}
|
||||
if (m_current_show_ams == ams_id) { m_extruder->OnAmsLoading(true, cans->amsCans->GetTagColr(canid)); }
|
||||
}
|
||||
|
||||
if (step == AMSPassRoadSTEP::AMS_ROAD_STEP_COMBO_LOAD_STEP3) {
|
||||
|
|
|
@ -145,6 +145,19 @@ struct Caninfo
|
|||
float k = 0.0f;
|
||||
float n = 0.0f;
|
||||
std::vector<wxColour> material_cols;
|
||||
|
||||
bool operator==(const Caninfo &other) const
|
||||
{
|
||||
return can_id == other.can_id &&
|
||||
material_name == other.material_name &&
|
||||
material_colour == other.material_colour &&
|
||||
material_state == other.material_state &&
|
||||
ctype == other.ctype &&
|
||||
material_remain == other.material_remain &&
|
||||
k == other.k &&
|
||||
n == other.n &&
|
||||
material_cols == other.material_cols;
|
||||
}
|
||||
};
|
||||
|
||||
struct AMSinfo
|
||||
|
@ -158,6 +171,13 @@ public:
|
|||
int curreent_filamentstep;
|
||||
int ams_humidity = 0;
|
||||
|
||||
bool operator==(const AMSinfo &other) const
|
||||
{
|
||||
return ams_id == other.ams_id && cans == other.cans &&
|
||||
current_can_id == other.current_can_id && current_step == other.current_step && current_action == other.current_action &&
|
||||
curreent_filamentstep == other.curreent_filamentstep && ams_humidity == other.ams_humidity;
|
||||
}
|
||||
|
||||
bool parse_ams_info(MachineObject* obj, Ams *ams, bool remain_flag = false, bool humidity_flag = false);
|
||||
};
|
||||
|
||||
|
@ -597,6 +617,7 @@ protected:
|
|||
wxBoxSizer* m_vams_sizer = {nullptr};
|
||||
wxBoxSizer* m_sizer_vams_tips = {nullptr};
|
||||
|
||||
bool m_auto_reill_show = {false};
|
||||
Label* m_ams_backup_tip = {nullptr};
|
||||
Label* m_ams_tip = {nullptr};
|
||||
|
||||
|
|
|
@ -76,15 +76,19 @@ bool Button::SetFont(const wxFont& font)
|
|||
|
||||
void Button::SetIcon(const wxString& icon)
|
||||
{
|
||||
auto tmpBitmap = ScalableBitmap(this, icon.ToStdString(), this->active_icon.px_cnt());
|
||||
if (!icon.IsEmpty()) {
|
||||
//BBS set button icon default size to 20
|
||||
this->active_icon = ScalableBitmap(this, icon.ToStdString(), this->active_icon.px_cnt());
|
||||
if (!tmpBitmap.bmp().IsSameAs(tmpBitmap.bmp())) {
|
||||
this->active_icon = tmpBitmap;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this->active_icon = ScalableBitmap();
|
||||
Refresh();
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void Button::SetInactiveIcon(const wxString &icon)
|
||||
|
|
|
@ -182,14 +182,16 @@ void TempInput::SetTagTemp(wxString temp)
|
|||
void TempInput::SetCurrTemp(int temp)
|
||||
{
|
||||
auto tp = wxString::Format("%d", temp);
|
||||
if (GetLabel() != tp) {
|
||||
SetLabel(tp);
|
||||
if (currentTemp != tp) {
|
||||
currentTemp = tp;
|
||||
SetLabel(tp);
|
||||
}
|
||||
}
|
||||
|
||||
void TempInput::SetCurrTemp(wxString temp)
|
||||
{
|
||||
if (GetLabel() != temp) {
|
||||
if (currentTemp != temp) {
|
||||
currentTemp = temp;
|
||||
SetLabel(temp);
|
||||
}
|
||||
}
|
||||
|
@ -275,9 +277,11 @@ void TempInput::SetMinTemp(int temp) { min_temp = temp; }
|
|||
|
||||
void TempInput::SetLabel(const wxString &label)
|
||||
{
|
||||
wxWindow::SetLabel(label);
|
||||
messureSize();
|
||||
Refresh();
|
||||
if (label != wxWindow::GetLabel()) {
|
||||
wxWindow::SetLabel(label);
|
||||
messureSize();
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void TempInput::SetTextColor(StateColor const &color)
|
||||
|
|
|
@ -64,6 +64,7 @@ public:
|
|||
wxPopupTransientWindow *wdialog{nullptr};
|
||||
int temp_type;
|
||||
bool actice = false;
|
||||
wxString currentTemp;
|
||||
|
||||
|
||||
wxString erasePending(wxString &str);
|
||||
|
|
Loading…
Reference in New Issue