MCPcopy Create free account
hub / github.com/KiCad/kicad-source-mirror / UpdateAxisVisibility

Method UpdateAxisVisibility

eeschema/sim/sim_plot_tab.cpp:1152–1200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1150
1151
1152void SIM_PLOT_TAB::UpdateAxisVisibility()
1153{
1154 bool hasY1Traces = false;
1155 bool hasY2Traces = false;
1156 bool hasY3Traces = false;
1157
1158 for( const auto& [ name, trace ] : m_traces )
1159 {
1160 if( !trace )
1161 continue;
1162
1163 if( trace->GetType() & SPT_POWER )
1164 {
1165 hasY3Traces = true;
1166 }
1167 else if( ( trace->GetType() & SPT_AC_PHASE )
1168 || ( ( GetSimType() != ST_AC ) && ( trace->GetType() & SPT_CURRENT ) ) )
1169 {
1170 hasY2Traces = true;
1171 }
1172 else
1173 {
1174 hasY1Traces = true;
1175 }
1176 }
1177
1178 bool visibilityChanged = false;
1179
1180 if( m_axis_y1 && m_axis_y1->IsVisible() != hasY1Traces )
1181 {
1182 m_axis_y1->SetVisible( hasY1Traces );
1183 visibilityChanged = true;
1184 }
1185
1186 if( m_axis_y2 && m_axis_y2->IsVisible() != hasY2Traces )
1187 {
1188 m_axis_y2->SetVisible( hasY2Traces );
1189 visibilityChanged = true;
1190 }
1191
1192 if( m_axis_y3 && m_axis_y3->IsVisible() != hasY3Traces )
1193 {
1194 m_axis_y3->SetVisible( hasY3Traces );
1195 visibilityChanged = true;
1196 }
1197
1198 if( visibilityChanged )
1199 m_plotWin->UpdateAll();
1200}
1201
1202
1203void SIM_PLOT_TAB::DeleteTrace( TRACE* aTrace )

Callers

nothing calls this directly

Calls 4

GetTypeMethod · 0.45
IsVisibleMethod · 0.45
SetVisibleMethod · 0.45
UpdateAllMethod · 0.45

Tested by

no test coverage detected