FIX: remove some unnecessary refresh to reduce page faults

jira: [none]
Change-Id: If4dae82f7aae243db033fe9c8d4d1ab25f625557
(cherry picked from commit b1fa2421c0425ad077b899e1d793cde219826042)
This commit is contained in:
xin.zhang
2025-02-10 20:08:12 +08:00
committed by Noisyfox
parent 319e93ba4d
commit 6c8c4ab3dc
3 changed files with 37 additions and 25 deletions

View File

@@ -687,7 +687,6 @@ void AMSextruder::OnAmsLoading(bool load, int nozzle_id, wxColour col /*= AMS_CO
}
}
}
Refresh();
}
void AMSextruder::updateNozzleNum(int nozzle_num)
@@ -2286,21 +2285,25 @@ void AMSRoadDownPart::doRender(wxDC& dc)
void AMSRoadDownPart::UpdatePassRoad(AMSPanelPos pos, int len, AMSPassRoadSTEP step) {
if (m_nozzle_num >= 2){
if (pos == AMSPanelPos::LEFT_PANEL){
if (m_left_road_length == len && m_pass_road_left_step == step){ return; }
m_left_road_length = len;;
m_pass_road_left_step = step;
}
else{
if (m_right_road_length == len && m_pass_road_right_step == step) { return; }
m_right_road_length = len;
m_pass_road_right_step = step;
}
}
else{
if (pos == AMSPanelPos::LEFT_PANEL) {
if (m_left_road_length == len && m_pass_road_left_step == step && m_right_road_length == -1) { return; }
m_left_road_length = len;
m_right_road_length = -1;
m_pass_road_left_step = step;
}
else {
if (m_right_road_length == len && m_pass_road_right_step == step && m_left_road_length == -1) { return; }
m_right_road_length = len;
m_left_road_length = -1;
m_pass_road_right_step = step;