fix: remove dead code

This commit is contained in:
Ian Chua
2026-10-08 15:56:20 +08:00
parent acc1d6fd21
commit 7515fb480f
3 changed files with 5 additions and 87 deletions
+4 -10
View File
@@ -1167,16 +1167,10 @@ void AMSControl::UpdateAms(const std::string &series_name,
m_dev_id = dev_id;
if (fresh){
ClearAms();
// Keep the established Bambu left/right AMS presentation. Generic N-nozzle
// tabs are for non-Bambu printers; the current checkout exposes this behavior
// through PresetBundle::is_bbl_vendor().
const bool is_bbl_behavior = wxGetApp().preset_bundle && wxGetApp().preset_bundle->is_bbl_vendor();
if (is_bbl_behavior) {
if (m_total_ext_count == 1)
CreateAmsSingleNozzle(series_name, printer_type);
else if (m_total_ext_count == 2)
CreateAmsDoubleNozzle(series_name, printer_type);
}
if (m_total_ext_count == 1)
CreateAmsSingleNozzle(series_name, printer_type);
else if (m_total_ext_count == 2)
CreateAmsDoubleNozzle(series_name, printer_type);
else
CreateAmsMultiNozzle(series_name, printer_type);
+1 -65
View File
@@ -2467,16 +2467,9 @@ void AMSRoadDownPart::UpdateRight(int nozzle_num, AMSRoadShowMode mode)
void AMSRoadDownPart::SetNozzleCount(int nozzle_num)
{
const int new_nozzle_num = std::max(1, nozzle_num);
if (m_nozzle_num == new_nozzle_num &&
(new_nozzle_num <= 2 || static_cast<int>(m_generic_road_states.size()) == new_nozzle_num)) {
return;
}
if (m_nozzle_num == new_nozzle_num) return;
m_nozzle_num = new_nozzle_num;
if (m_nozzle_num > 2)
m_generic_road_states.resize(m_nozzle_num);
else
m_generic_road_states.clear();
Refresh();
}
@@ -2490,19 +2483,6 @@ void AMSRoadDownPart::SetSingleSideLayout(bool enabled, AMSPanelPos pos)
Refresh();
}
void AMSRoadDownPart::UpdateNozzle(int nozzle_id, AMSRoadShowMode mode)
{
if (nozzle_id < 0) return;
if (nozzle_id >= static_cast<int>(m_generic_road_states.size()))
m_generic_road_states.resize(nozzle_id + 1);
auto &state = m_generic_road_states[nozzle_id];
if (state.mode == mode && m_nozzle_num > 2) return;
state.mode = mode;
m_nozzle_num = std::max(m_nozzle_num, nozzle_id + 1);
Refresh();
}
void AMSRoadDownPart::OnVamsLoading(bool load, wxColour col /*= AMS_CONTROL_GRAY500*/)
{
/*m_vams_loading = load;
@@ -2532,17 +2512,6 @@ void AMSRoadDownPart::SetPassRoadColour(bool left, wxColour col)
Refresh();
}
void AMSRoadDownPart::SetPassRoadColour(int nozzle_id, wxColour col)
{
if (nozzle_id < 0) return;
if (nozzle_id >= static_cast<int>(m_generic_road_states.size()))
m_generic_road_states.resize(nozzle_id + 1);
if (m_generic_road_states[nozzle_id].road_color == col) return;
m_generic_road_states[nozzle_id].road_color = col;
Refresh();
}
void AMSRoadDownPart::SetShowMode(AMSRoadShowMode left_mode, AMSRoadShowMode right_mode)
{
if (m_left_rode_mode == left_mode && m_right_rode_mode == right_mode) { return; }
@@ -2588,26 +2557,6 @@ void AMSRoadDownPart::doRender(wxDC& dc)
else { dc.SetPen(wxPen(m_road_color, m_passroad_width, wxPENSTYLE_SOLID)); }*/
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID));
if (m_nozzle_num > 2) {
const int nozzle_count = std::min(m_nozzle_num, static_cast<int>(m_generic_road_states.size()));
for (int nozzle_id = 0; nozzle_id < nozzle_count; ++nozzle_id) {
const auto &state = m_generic_road_states[nozzle_id];
if (state.mode == AMSRoadShowMode::AMS_ROAD_MODE_NONE) continue;
const int x = size.x * (nozzle_id + 1) / (nozzle_count + 1);
dc.SetPen(wxPen(AMS_CONTROL_GRAY500, 2, wxPENSTYLE_SOLID));
dc.DrawLine(x, size.y / 2, x, size.y);
if (state.road_length > 0 &&
(state.pass_road_step == AMSPassRoadSTEP::AMS_ROAD_STEP_2 ||
state.pass_road_step == AMSPassRoadSTEP::AMS_ROAD_STEP_3)) {
dc.SetPen(wxPen(_get_diff_clr(this, state.road_color), 4, wxPENSTYLE_SOLID));
dc.DrawLine(x - FromDIP(state.road_length), size.y / 2, x, size.y / 2);
}
}
return;
}
auto xpos = left_nozzle_pos.x;
if (m_single_side_layout) {
dc.DrawLine(size.x / 2, 0, size.x / 2, size.y);
@@ -2816,19 +2765,6 @@ void AMSRoadDownPart::UpdatePassRoad(AMSPanelPos pos, int len, AMSPassRoadSTEP s
Refresh();
}
void AMSRoadDownPart::UpdatePassRoad(int nozzle_id, int len, AMSPassRoadSTEP step)
{
if (nozzle_id < 0) return;
if (nozzle_id >= static_cast<int>(m_generic_road_states.size()))
m_generic_road_states.resize(nozzle_id + 1);
auto &state = m_generic_road_states[nozzle_id];
if (state.road_length == len && state.pass_road_step == step) return;
state.road_length = len;
state.pass_road_step = step;
Refresh();
}
void AMSRoadDownPart::msw_rescale() {
Layout();
Fit();
-12
View File
@@ -686,14 +686,11 @@ public:
void UpdateRight(int nozzle_num, AMSRoadShowMode mode);
void SetNozzleCount(int nozzle_num);
void SetSingleSideLayout(bool enabled, AMSPanelPos pos = AMSPanelPos::LEFT_PANEL);
void UpdateNozzle(int nozzle_id, AMSRoadShowMode mode);
void OnVamsLoading(bool load, wxColour col = AMS_CONTROL_GRAY500);
void SetPassRoadColour(bool left, wxColour col);
void SetPassRoadColour(int nozzle_id, wxColour col);
void SetShowMode(AMSRoadShowMode left_mode, AMSRoadShowMode right_mode);
void UpdatePassRoad(AMSPanelPos pos, int len, AMSPassRoadSTEP step);
void UpdatePassRoad(int nozzle_id, int len, AMSPassRoadSTEP step);
void paintEvent(wxPaintEvent& evt);
void render(wxDC& dc);
@@ -715,15 +712,6 @@ private:
AMSPassRoadSTEP m_pass_road_right_step = {AMSPassRoadSTEP::AMS_ROAD_STEP_NONE};
std::map<int, wxColour> m_road_color;
struct GenericRoadState
{
AMSRoadShowMode mode{AMSRoadShowMode::AMS_ROAD_MODE_NONE};
int road_length{-1};
AMSPassRoadSTEP pass_road_step{AMSPassRoadSTEP::AMS_ROAD_STEP_NONE};
wxColour road_color{AMS_CONTROL_GRAY500};
};
std::vector<GenericRoadState> m_generic_road_states;
};
/*************************************************