FIX: switch to 0.2 from 0.4 nozzle, AMS item display 0.0

jira: STUDIO-7816
Change-Id: I03585f73ff1ef7573f9ea1a93b79a981958e06d3
This commit is contained in:
zhimin.zeng 2024-10-31 18:02:20 +08:00 committed by Lane.Wei
parent 30caad8138
commit c418445a2f
1 changed files with 78 additions and 78 deletions

View File

@ -43,7 +43,7 @@ bool AMSinfo::parse_ams_info(MachineObject *obj, Ams *ams, bool remain_flag, boo
else {
this->ams_humidity = -1;
}
cans.clear();
for (int i = 0; i < 4; i++) {
auto it = ams->trayList.find(std::to_string(i));
@ -72,15 +72,15 @@ bool AMSinfo::parse_ams_info(MachineObject *obj, Ams *ams, bool remain_flag, boo
} else {
info.material_state = AMSCanType::AMS_CAN_TYPE_THIRDBRAND;
}
if (!MachineObject::is_bbl_filament(it->second->tag_uid) || !remain_flag) {
info.material_remain = 100;
} else {
info.material_remain = it->second->remain < 0 ? 0 : it->second->remain;
info.material_remain = it->second->remain > 100 ? 100 : info.material_remain;
}
} else {
info.can_id = it->second->id;
info.material_name = "";
@ -128,7 +128,7 @@ AMSrefresh::AMSrefresh(wxWindow *parent, int number, Caninfo info, const wxPoint
create(parent, wxID_ANY, pos, size);
}
AMSrefresh::~AMSrefresh()
AMSrefresh::~AMSrefresh()
{
if (m_playing_timer) {
m_playing_timer->Stop();
@ -141,7 +141,7 @@ void AMSrefresh::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, con
{
wxWindow::Create(parent, id, pos, size, wxBORDER_NONE);
SetBackgroundColour(AMS_CONTROL_DEF_BLOCK_BK_COLOUR);
Bind(wxEVT_TIMER, &AMSrefresh::on_timer, this);
Bind(wxEVT_PAINT, &AMSrefresh::paintEvent, this);
Bind(wxEVT_ENTER_WINDOW, &AMSrefresh::OnEnterWindow, this);
@ -178,7 +178,7 @@ void AMSrefresh::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, con
SetMaxSize(AMS_REFRESH_SIZE);
}
void AMSrefresh::on_timer(wxTimerEvent &event)
void AMSrefresh::on_timer(wxTimerEvent &event)
{
//if (m_rotation_angle >= m_rfid_bitmap_list.size()) {
// m_rotation_angle = 0;
@ -218,7 +218,7 @@ void AMSrefresh::OnLeaveWindow(wxMouseEvent &evt)
}
void AMSrefresh::OnClick(wxMouseEvent &evt) {
post_event(wxCommandEvent(EVT_AMS_REFRESH_RFID));
post_event(wxCommandEvent(EVT_AMS_REFRESH_RFID));
}
void AMSrefresh::post_event(wxCommandEvent &&event)
@ -316,7 +316,7 @@ void AMSrefresh::DoSetSize(int x, int y, int width, int height, int sizeFlags)
/*************************************************
Description:AMSextruder
**************************************************/
void AMSextruderImage::TurnOn(wxColour col)
void AMSextruderImage::TurnOn(wxColour col)
{
if (m_colour != col) {
m_colour = col;
@ -324,7 +324,7 @@ void AMSextruderImage::TurnOn(wxColour col)
}
}
void AMSextruderImage::TurnOff()
void AMSextruderImage::TurnOff()
{
if (m_colour != AMS_EXTRUDER_DEF_COLOUR) {
m_colour = AMS_EXTRUDER_DEF_COLOUR;
@ -332,7 +332,7 @@ void AMSextruderImage::TurnOff()
}
}
void AMSextruderImage::msw_rescale()
void AMSextruderImage::msw_rescale()
{
//m_ams_extruder.SetSize(AMS_EXTRUDER_BITMAP_SIZE);
//auto image = m_ams_extruder.ConvertToImage();
@ -340,7 +340,7 @@ void AMSextruderImage::msw_rescale()
Refresh();
}
void AMSextruderImage::paintEvent(wxPaintEvent &evt)
void AMSextruderImage::paintEvent(wxPaintEvent &evt)
{
wxPaintDC dc(this);
render(dc);
@ -367,8 +367,8 @@ void AMSextruderImage::render(wxDC &dc)
#endif
}
void AMSextruderImage::doRender(wxDC &dc)
{
void AMSextruderImage::doRender(wxDC &dc)
{
auto size = GetSize();
dc.SetPen(*wxTRANSPARENT_PEN);
dc.SetBrush(m_colour);
@ -377,9 +377,9 @@ void AMSextruderImage::doRender(wxDC &dc)
}
AMSextruderImage::AMSextruderImage(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
AMSextruderImage::AMSextruderImage(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
{
wxWindow::Create(parent, id, pos, AMS_EXTRUDER_BITMAP_SIZE);
wxWindow::Create(parent, id, pos, AMS_EXTRUDER_BITMAP_SIZE);
SetBackgroundColour(*wxWHITE);
m_ams_extruder = ScalableBitmap(this, "monitor_ams_extruder",55);
@ -400,7 +400,7 @@ AMSextruder::AMSextruder(wxWindow *parent, wxWindowID id, const wxPoint &pos, co
AMSextruder::~AMSextruder() {}
void AMSextruder::TurnOn(wxColour col)
{
{
m_amsSextruder->TurnOn(col);
}
@ -485,7 +485,7 @@ void AMSextruder::render(wxDC& dc)
void AMSextruder::doRender(wxDC& dc)
{
//m_current_colur =
//m_current_colur =
wxSize size = GetSize();
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
@ -675,7 +675,7 @@ void AMSLib::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const w
m_bitmap_extra_tray_left_selected = ScalableBitmap(this, "extra_ams_tray_left_selected", 80);
m_bitmap_extra_tray_right_selected = ScalableBitmap(this, "extra_ams_tray_right_selected", 80);
m_sizer_body->Add(0, 0, 1, wxEXPAND, 0);
m_sizer_body->Add(m_sizer_edit, 0, wxALIGN_CENTER, 0);
@ -685,13 +685,13 @@ void AMSLib::create(wxWindow *parent, wxWindowID id, const wxPoint &pos, const w
}
void AMSLib::on_enter_window(wxMouseEvent &evt)
{
{
m_hover = true;
Refresh();
}
void AMSLib::on_leave_window(wxMouseEvent &evt)
{
{
m_hover = false;
Refresh();
}
@ -737,7 +737,7 @@ void AMSLib::on_left_down(wxMouseEvent &evt)
void AMSLib::paintEvent(wxPaintEvent &evt)
{
wxPaintDC dc(this);
wxPaintDC dc(this);
render(dc);
}
@ -860,7 +860,7 @@ void AMSLib::render_generic_text(wxDC &dc)
if (m_info.material_name.empty()) {
show_k_value = false;
}
else if (m_info.cali_idx == -1) {
else if (m_info.cali_idx == -1 || (m_obj && (CalibUtils::get_selected_calib_idx(m_obj->pa_calib_tab, m_info.cali_idx) == -1))) {
get_default_k_n_value(m_info.filament_id, m_info.k, m_info.n);
}
@ -899,7 +899,7 @@ void AMSLib::render_generic_text(wxDC &dc)
if (m_info.material_name.empty() /*&& m_info.material_state != AMSCanType::AMS_CAN_TYPE_VIRTUAL*/) {
auto tsize = dc.GetMultiLineTextExtent("?");
auto pot = wxPoint(0, 0);
if (m_obj && show_k_value) {
pot = wxPoint((libsize.x - tsize.x) / 2, (libsize.y - tsize.y) / 2 - FromDIP(9));
}
@ -1008,21 +1008,21 @@ void AMSLib::render_extra_lib(wxDC& dc)
//draw road
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
if (m_pass_road) {
dc.SetPen(wxPen(m_info.material_colour, 6, wxSOLID));
}
if (m_can_index == 0 || m_can_index == 3) {
dc.DrawLine(size.x / 2, size.y / 2, size.x / 2, size.y);
}
else {
dc.DrawLine(size.x / 2, size.y / 2, size.x / 2, 0);
}
//draw def background
dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
@ -1172,7 +1172,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
//draw remain
auto alpha = m_info.material_colour.Alpha();
int height = size.y - FromDIP(8);
int curr_height = height * float(m_info.material_remain * 1.0 / 100.0);
int curr_height = height * float(m_info.material_remain * 1.0 / 100.0);
dc.SetFont(::Label::Body_13);
int top = height - curr_height;
@ -1180,7 +1180,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
if (curr_height >= FromDIP(6)) {
//transparent
if (alpha == 0) {
dc.DrawBitmap(m_bitmap_transparent.bmp(), FromDIP(4), FromDIP(4));
}
@ -1198,7 +1198,7 @@ void AMSLib::render_generic_lib(wxDC &dc)
replace.push_back(fill_replace);
m_bitmap_transparent = ScalableBitmap(this, "transparent_ams_lib", 68, false, false, true, replace);
transparent_changed = false;
}
dc.DrawBitmap(m_bitmap_transparent.bmp(), FromDIP(4), FromDIP(4));
}
@ -1391,7 +1391,7 @@ void AMSLib::msw_rescale()
Description:AMSRoad
**************************************************/
AMSRoad::AMSRoad() : m_road_def_color(AMS_CONTROL_GRAY500), m_road_color(AMS_CONTROL_GRAY500) {}
AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, int maxcan, const wxPoint &pos, const wxSize &size)
AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, int maxcan, const wxPoint &pos, const wxSize &size)
: AMSRoad()
{
m_info = info;
@ -1428,7 +1428,7 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in
create(parent, id, pos, virtual_size);
}
Bind(wxEVT_PAINT, &AMSRoad::paintEvent, this);
wxWindow::SetBackgroundColour(AMS_CONTROL_DEF_BLOCK_BK_COLOUR);
@ -1437,7 +1437,7 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in
auto mouse_pos = ClientToScreen(e.GetPosition());
auto rect = ClientToScreen(wxPoint(0, 0));
if (mouse_pos.x > rect.x + GetSize().x - FromDIP(40) &&
if (mouse_pos.x > rect.x + GetSize().x - FromDIP(40) &&
mouse_pos.y > rect.y + GetSize().y - FromDIP(40)) {
wxCommandEvent show_event(EVT_AMS_SHOW_HUMIDITY_TIPS);
wxPostEvent(GetParent()->GetParent(), show_event);
@ -1456,7 +1456,7 @@ 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) {
if (amsinfo == m_amsinfo && m_info == info && m_canindex == canindex) {
return;
}
@ -1573,7 +1573,7 @@ void AMSRoad::doRender(wxDC &dc)
if (m_road_color.Alpha() == 0) {dc.SetPen(wxPen(*wxWHITE, m_passroad_width, wxSOLID));}
else {dc.SetPen(wxPen(m_road_color, m_passroad_width, wxSOLID));}
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
// left pass mode
@ -1831,17 +1831,17 @@ void AMSItem::doRender(wxDC &dc)
if(iter->material_state==AMSCanType::AMS_CAN_TYPE_EMPTY){
dc.SetPen(wxPen(wxColor(0, 0, 0)));
dc.DrawRoundedRectangle(rect, 2);
dc.DrawLine(rect.GetRight()-1, rect.GetTop()+1, rect.GetLeft()+1, rect.GetBottom()-1);
}
dc.DrawLine(rect.GetRight()-1, rect.GetTop()+1, rect.GetLeft()+1, rect.GetBottom()-1);
}
else {
dc.DrawRoundedRectangle(rect, 2);
}
}
}
left += AMS_ITEM_CUBE_SIZE.x;
left += m_space;
}
@ -1943,7 +1943,7 @@ void AmsCans::AddCan(Caninfo caninfo, int canindex, int maxcan, wxBoxSizer* size
amscan->SetBackgroundColour(AMS_CONTROL_DEF_BLOCK_BK_COLOUR);
wxBoxSizer* m_sizer_ams = new wxBoxSizer(wxVERTICAL);
auto m_panel_refresh = new AMSrefresh(amscan, m_can_count, caninfo);
auto m_panel_lib = new AMSLib(amscan, caninfo);
@ -2014,7 +2014,7 @@ void AmsCans::AddCan(Caninfo caninfo, int canindex, int maxcan, wxBoxSizer* size
sizer->Add(amscan, 0, wxALL, 0);
}
}
Canrefreshs* canrefresh = new Canrefreshs;
canrefresh->canID = caninfo.can_id;
canrefresh->canrefresh = m_panel_refresh;
@ -2041,7 +2041,7 @@ void AmsCans::Update(AMSinfo info)
if (i < m_can_count) {
refresh->canrefresh->Update(info.ams_id, info.cans[i]);
if (!refresh->canrefresh->IsShown()) { refresh->canrefresh->Show();}
} else {
if (refresh->canrefresh->IsShown()) { refresh->canrefresh->Hide();}
}
@ -2086,8 +2086,8 @@ void AmsCans::SelectCan(std::string canid)
{
for (auto i = 0; i < m_can_lib_list.GetCount(); i++) {
CanLibs *lib = m_can_lib_list[i];
if (lib->canLib->m_info.can_id == canid) {
m_canlib_selection = lib->canLib->m_can_index;
if (lib->canLib->m_info.can_id == canid) {
m_canlib_selection = lib->canLib->m_can_index;
}
}
@ -2106,7 +2106,7 @@ void AmsCans::SelectCan(std::string canid)
}
}
wxColour AmsCans::GetTagColr(wxString canid)
wxColour AmsCans::GetTagColr(wxString canid)
{
auto tag_colour = *wxWHITE;
for (auto i = 0; i < m_can_lib_list.GetCount(); i++) {
@ -2143,7 +2143,7 @@ void AmsCans::SetAmsStep(wxString canid, AMSPassRoadType type, AMSPassRoadSTEP s
return;
}
auto tag_can_index = -1;
for (auto i = 0; i < m_can_road_list.GetCount(); i++) {
CanRoads *road = m_can_road_list[i];
@ -2278,7 +2278,7 @@ void AmsCans::doRender(wxDC& dc)
}
}
// A1
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxSOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH));
@ -2318,7 +2318,7 @@ void AmsCans::doRender(wxDC& dc)
dc.DrawLine(a4_left, FromDIP(30), a4_left, a4_top);
dc.DrawLine(a4_left, a4_top, end_top, a4_top);
if (!m_road_canid.empty()) {
if (m_road_canid == "0") {
dc.SetPen(wxPen(m_road_colour, passroad_width, wxSOLID));
@ -2384,11 +2384,11 @@ void AmsCans::StopRridLoading(wxString canid)
}
}
void AmsCans::msw_rescale()
void AmsCans::msw_rescale()
{
for (auto i = 0; i < m_can_refresh_list.GetCount(); i++) {
Canrefreshs *refresh = m_can_refresh_list[i];
refresh->canrefresh->msw_rescale();
refresh->canrefresh->msw_rescale();
}
for (auto i = 0; i < m_can_lib_list.GetCount(); i++) {
@ -2410,7 +2410,7 @@ void AmsCans::show_sn_value(bool show)
Description:AMSControl
**************************************************/
// WX_DEFINE_OBJARRAY(AmsItemsHash);
AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size)
: wxSimplebook(parent, wxID_ANY, pos, size)
, m_Humidity_tip_popup(AmsHumidityTipPopup(this))
, m_ams_introduce_popup(AmsIntroducePopup(this))
@ -2430,7 +2430,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_simplebook_amsitems->SetSizer(m_sizer_amsitems);
m_simplebook_amsitems->Layout();
m_sizer_amsitems->Fit(m_simplebook_amsitems);
m_panel_top = new wxPanel(m_simplebook_amsitems, wxID_ANY, wxDefaultPosition, wxSize(-1, AMS_CAN_ITEM_HEIGHT_SIZE));
m_sizer_top = new wxBoxSizer(wxHORIZONTAL);
m_panel_top->SetSizer(m_sizer_top);
@ -2498,7 +2498,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_ams_backup_tip->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {post_event(SimpleEvent(EVT_AMS_FILAMENT_BACKUP)); });
m_img_ams_backup->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {post_event(SimpleEvent(EVT_AMS_FILAMENT_BACKUP)); });
//ams cans
m_panel_can = new StaticBox(m_amswin, wxID_ANY, wxDefaultPosition, AMS_CANS_SIZE, wxBORDER_NONE);
@ -2565,22 +2565,22 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
//m_sizer_left_bottom->Add(0, 0, 0, wxEXPAND, 0);
StateColor btn_bg_green(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(27, 136, 68), StateColor::Pressed),
std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
StateColor btn_bg_white(std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Disabled),
std::pair<wxColour, int>(AMS_CONTROL_DISABLE_COLOUR, StateColor::Pressed),
std::pair<wxColour, int>(AMS_CONTROL_DEF_BLOCK_BK_COLOUR, StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_WHITE_COLOUR, StateColor::Normal));
StateColor btn_bd_green(std::pair<wxColour, int>(wxColour(255,255,254), StateColor::Disabled),
StateColor btn_bd_green(std::pair<wxColour, int>(wxColour(255,255,254), StateColor::Disabled),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Enabled));
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255,255,254), StateColor::Disabled),
StateColor btn_bd_white(std::pair<wxColour, int>(wxColour(255,255,254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(38, 46, 48), StateColor::Enabled));
StateColor btn_text_green(std::pair<wxColour, int>(wxColour(255,255,254), StateColor::Disabled),
StateColor btn_text_green(std::pair<wxColour, int>(wxColour(255,255,254), StateColor::Disabled),
std::pair<wxColour, int>(wxColour(255,255,254), StateColor::Enabled));
StateColor btn_text_white(std::pair<wxColour, int>(wxColour(255, 255, 254), StateColor::Disabled),
@ -2599,7 +2599,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_button_extruder_feed->SetBackgroundColor(btn_bg_green);
m_button_extruder_feed->SetBorderColor(btn_bd_green);
m_button_extruder_feed->SetTextColor(btn_text_green);
if (wxGetApp().app_config->get("language") == "de_DE") m_button_extruder_feed->SetFont(Label::Body_9);
if (wxGetApp().app_config->get("language") == "fr_FR") m_button_extruder_feed->SetFont(Label::Body_9);
@ -2938,7 +2938,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_button_extruder_feed->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_filament_load), NULL, this);
m_button_extruder_back->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AMSControl::on_filament_unload), NULL, this);
m_button_ams_setting->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent& e) {
m_button_ams_setting->SetBitmap(m_button_ams_setting_hover.bmp());
e.Skip();
@ -2955,7 +2955,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
});
Bind(EVT_AMS_SHOW_HUMIDITY_TIPS, [this](wxCommandEvent& evt) {
wxPoint img_pos = ClientToScreen(wxPoint(0, 0));
wxPoint popup_pos(img_pos.x - m_Humidity_tip_popup.GetSize().GetWidth() + FromDIP(150), img_pos.y - FromDIP(80));
m_Humidity_tip_popup.Position(popup_pos, wxSize(0, 0));
@ -2965,11 +2965,11 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons
m_Humidity_tip_popup.set_humidity_level(m_ams_info[i].ams_humidity);
}
}
}
m_Humidity_tip_popup.Popup();
});
m_button_guide->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
post_event(wxCommandEvent(EVT_AMS_GUIDE_WIKI));
@ -3013,13 +3013,13 @@ std::string AMSControl::GetCurrentCan(std::string amsid)
return current_can;
}
wxColour AMSControl::GetCanColour(std::string amsid, std::string canid)
wxColour AMSControl::GetCanColour(std::string amsid, std::string canid)
{
wxColour col = *wxWHITE;
for (auto i = 0; i < m_ams_info.size(); i++) {
if (m_ams_info[i].ams_id == amsid) {
if (m_ams_info[i].ams_id == amsid) {
for (auto o = 0; o < m_ams_info[i].cans.size(); o++) {
if (m_ams_info[i].cans[o].can_id == canid) {
if (m_ams_info[i].cans[o].can_id == canid) {
col = m_ams_info[i].cans[o].material_colour;
}
}
@ -3069,9 +3069,9 @@ void AMSControl::EnterGenericAMSMode()
m_vams_lib->m_ams_model = AMSModel::GENERIC_AMS;
m_ams_tip->SetLabel(_L("AMS"));
m_img_vams_tip->SetBitmap(create_scaled_bitmap("enable_ams", this, 16));
m_img_vams_tip->SetBitmap(create_scaled_bitmap("enable_ams", this, 16));
m_img_vams_tip->Enable();
m_img_amsmapping_tip->SetBitmap(create_scaled_bitmap("enable_ams", this, 16));
m_img_amsmapping_tip->SetBitmap(create_scaled_bitmap("enable_ams", this, 16));
m_img_amsmapping_tip->Enable();
m_simplebook_ams->SetSelection(1);
@ -3096,7 +3096,7 @@ void AMSControl::EnterExtraAMSMode()
m_simplebook_amsitems->Show();
m_simplebook_amsitems->SetSelection(1);
m_vams_lib->m_ams_model = AMSModel::EXTRA_AMS;
m_ams_tip->SetLabel(wxEmptyString);
m_img_vams_tip->SetBitmap(create_scaled_bitmap("enable_ams_disable", this, 16));
@ -3270,8 +3270,8 @@ void AMSControl::CreateAms()
std::vector<AMSinfo> ams_info{ams1, ams2, ams3, ams4};
std::vector<AMSinfo>::iterator it;
Freeze();
for (it = ams_info.begin(); it != ams_info.end(); it++) {
AddAmsItems(*it);
for (it = ams_info.begin(); it != ams_info.end(); it++) {
AddAmsItems(*it);
AddAms(*it);
AddExtraAms(*it);
m_ams_info.push_back(*it);
@ -3281,7 +3281,7 @@ void AMSControl::CreateAms()
Thaw();
}
void AMSControl::Reset()
void AMSControl::Reset()
{
auto caninfo0_0 = Caninfo{"0", "", *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE};
auto caninfo0_1 = Caninfo{"1", "", *wxWHITE, AMSCanType::AMS_CAN_TYPE_NONE};
@ -3380,7 +3380,7 @@ void AMSControl::update_vams_kn_value(AmsTray tray, MachineObject* obj)
m_vams_lib->m_info.cali_idx = tray.cali_idx;
m_vams_lib->m_info.filament_id = tray.filament_setting_id;
if (last_k_value != m_vams_info.k || last_n_value != m_vams_info.n) {
if (last_k_value != m_vams_info.k || last_n_value != m_vams_info.n) {
m_vams_lib->Refresh();
}
}
@ -3407,10 +3407,10 @@ void AMSControl::UpdateAms(std::vector<AMSinfo> info, bool is_reset)
std::string curr_can_id = GetCurrentCan(curr_ams_id);
m_button_area->Layout();
m_button_area->Fit();
m_button_area->Fit();
// update item
if (m_ams_model == AMSModel::GENERIC_AMS){
m_ams_cans_list = m_ams_generic_cans_list;
}
@ -3571,7 +3571,7 @@ void AMSControl::SwitchAms(std::string ams_id)
for (auto i = 0; i < m_ams_cans_list.GetCount(); i++) {
AmsCansWindow *cans = m_ams_cans_list[i];
if (cans->amsCans->m_info.ams_id == ams_id) {
if (cans->amsCans->m_info.ams_id == ams_id) {
if (m_ams_model == AMSModel::GENERIC_AMS) {
m_simplebook_generic_cans->SetSelection(cans->amsCans->m_selection);
@ -3683,7 +3683,7 @@ void AMSControl::ShowFilamentTip(bool hasams)
m_tip_right_top->Hide();
m_tip_load_info->SetLabelText(wxEmptyString);
}
m_tip_load_info->SetMinSize(AMS_STEP_SIZE);
m_tip_load_info->Wrap(AMS_STEP_SIZE.x - FromDIP(5));
m_sizer_right_tip->Layout();