FIX:Disable when the AMS slot is empty

jira:[STUDIO-12764]

Change-Id: I9baea63965159f9416d91e6dea40962ec292b9e2
(cherry picked from commit 5aff60e9840343e5465833259cca2d8658a8fce7)
This commit is contained in:
milk
2025-06-26 17:52:13 +08:00
committed by Noisyfox
parent 18b9bffd02
commit 3a3f6d3a43

View File

@@ -1323,7 +1323,7 @@ void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data, bool remai
// temp
if (tray_data[i].type == EMPTY) {
m_mapping_item->set_data(m_tag_material, wxColour(0xCE, 0xCE, 0xCE), "-", remain_detect_flag, tray_data[i]);
m_mapping_item->set_data(m_tag_material, wxColour(0xEE, 0xEE, 0xEE), "-", remain_detect_flag, tray_data[i]);
m_mapping_item->Bind(wxEVT_LEFT_DOWN, [this, tray_data, i, m_mapping_item](wxMouseEvent &e) {
if (!m_mapping_from_multi_machines) {
@@ -1476,8 +1476,8 @@ static void _DrawRemainArea(const MappingItem *item, const TrayData &dd, bool su
int full_range_width = size.x;
/*range background*/
dc.SetPen(wxColour(0xE4E4E4));
dc.SetBrush(wxColour(0xE4E4E4));
dc.SetPen(wxColour("#E4E4E4"));
dc.SetBrush(wxColour("#E4E4E4"));
int bg_height = item->FromDIP(6);
int bg_width = full_range_width - (2 * x_margin);
dc.DrawRoundedRectangle(x_margin, y_margin, bg_width, bg_height, item->FromDIP(2));
@@ -1534,7 +1534,10 @@ void MappingItem::render(wxDC &dc)
dc.SetFont(::Label::Head_13);
auto txt_colour = m_coloul.GetLuminance() < 0.6 ? *wxWHITE : wxColour(0x26, 0x2E, 0x30);
txt_colour = m_unmatch ? wxColour(0xCE, 0xCE, 0xCE) : txt_colour;
if (m_unmatch || m_name == "-") { txt_colour = wxColour(0xCE, 0xCE, 0xCE); }
// txt_colour = m_unmatch ? wxColour(0xCE, 0xCE, 0xCE) : txt_colour;
if (m_coloul.Alpha() == 0) txt_colour = wxColour(0x26, 0x2E, 0x30);
dc.SetTextForeground(txt_colour);
@@ -1631,7 +1634,7 @@ void MappingItem::doRender(wxDC &dc)
dc.DrawRectangle(0, (size.y - MAPPING_ITEM_REAL_SIZE.y) / 2 + get_remain_area_height(), MAPPING_ITEM_REAL_SIZE.x, MAPPING_ITEM_REAL_SIZE.y);
}
wxColour side_colour = wxColour(0xE4E4E4);
wxColour side_colour = wxColour("#E4E4E4");
dc.SetPen(side_colour);
dc.SetBrush(wxBrush(side_colour));
@@ -1983,14 +1986,14 @@ AmsIntroducePopup::AmsIntroducePopup(wxWindow* parent)
m_staticText_top = new Label(this, _L("Do not Enable AMS"));
m_staticText_top->SetFont(::Label::Head_13);
// m_staticText_top->SetForegroundColour(wxColour(0x323A3D));
// m_staticText_top->SetForegroundColour(wxColour("#323A3D"));
m_staticText_top->Wrap(-1);
bSizer4->Add(m_staticText_top, 0, wxALL, 5);
m_staticText_bottom = new Label(this, _L("Print using materials mounted on the back of the case"));
m_staticText_bottom->Wrap(-1);
m_staticText_bottom->SetFont(::Label::Body_13);
m_staticText_bottom->SetForegroundColour(wxColour(0x6B6B6B));
m_staticText_bottom->SetForegroundColour(wxColour("#6B6B6B"));
bSizer4->Add(m_staticText_bottom, 0, wxALL, 5);
wxBoxSizer* bSizer5;
@@ -2550,7 +2553,7 @@ void AmsRMGroup::doRender(wxDC& dc)
dc.SetPen(*wxTRANSPARENT_PEN);
if (tray_color == *wxWHITE) dc.SetPen(wxPen(wxColour(0xEEEEEE), 2));
if (tray_color == *wxWHITE) dc.SetPen(wxPen(wxColour("#EEEEEE"), 2));
dc.SetBrush(wxBrush(tray_color));
int x = size.x / 2;
@@ -2600,14 +2603,14 @@ void AmsRMGroup::doRender(wxDC& dc)
//draw tray
dc.SetFont(::Label::Body_12);
auto text_size = dc.GetTextExtent(tray_name);
dc.SetTextForeground(tray_color.GetLuminance() < 0.6 ? *wxWHITE : wxColour(0x262E30));
if (tray_color.Alpha() == 0) {dc.SetTextForeground(wxColour(0x262E30));}
dc.SetTextForeground(tray_color.GetLuminance() < 0.6 ? *wxWHITE : wxColour("#262E30"));
if (tray_color.Alpha() == 0) { dc.SetTextForeground(wxColour("#262E30")); }
dc.DrawText(tray_name, x_center - text_size.x / 2, size.y - y_center - text_size.y / 2);
//draw split line
dc.SetPen(wxPen(*wxWHITE, 2));
if (tray_color.Alpha() == 0) {dc.SetPen(wxPen(wxColour(0xCECECE), 2));}
if (tray_color.Alpha() == 0) { dc.SetPen(wxPen(wxColour("#CECECE"), 2)); }
dc.SetBrush(*wxTRANSPARENT_BRUSH);
auto pos_sp_start = CalculateEndpoint(wxPoint(x, y), (360 - startAngle), size.x / 2 - FromDIP(3));
dc.DrawLine(wxPoint(x, y), pos_sp_start);
@@ -2631,7 +2634,7 @@ void AmsRMGroup::doRender(wxDC& dc)
//dc.DrawBitmap(bitmap_backup_tips_1.bmp(), wxPoint((size.x - bitmap_backup_tips_1.GetBmpSize().x) / 2, (size.y - bitmap_backup_tips_1.GetBmpSize().y) / 2));
//draw material
dc.SetTextForeground(wxColour(0x323A3D));
dc.SetTextForeground(wxColour("#323A3D"));
dc.SetFont(Label::Head_15);
auto text_size = dc.GetTextExtent(m_material_name);
dc.DrawText(m_material_name, (size.x - text_size.x) / 2,(size.y - text_size.y) / 2 - FromDIP(12));
@@ -2705,7 +2708,7 @@ void AmsHumidityLevelList::doRender(wxDC& dc)
//dry / wet
dc.SetTextForeground(wxColour(0x989898));
dc.SetTextForeground(wxColour("#989898"));
dc.SetFont(::Label::Head_20);
auto font_top = GetSize().y - dc.GetTextExtent(_L("DRY")).GetHeight();