diff --git a/eeschema/sim/sim_plot_tab.cpp b/eeschema/sim/sim_plot_tab.cpp index 6162546dfa..8051c0357a 100644 --- a/eeschema/sim/sim_plot_tab.cpp +++ b/eeschema/sim/sim_plot_tab.cpp @@ -818,11 +818,18 @@ void SIM_PLOT_TAB::OnLanguageChanged() void SIM_PLOT_TAB::UpdateTraceStyle( TRACE* trace ) { int type = trace->GetType(); - wxPenStyle penStyle = ( ( ( type & SPT_AC_PHASE ) || ( type & SPT_CURRENT ) ) && m_dotted_cp ) - ? wxPENSTYLE_DOT - : wxPENSTYLE_SOLID; - trace->SetPen( wxPen( trace->GetTraceColour(), 2, penStyle ) ); + wxPenStyle penStyle; + if( ( type & SPT_AC_GAIN ) > 0 ) + penStyle = wxPENSTYLE_SOLID; + else if( ( type & SPT_AC_PHASE ) > 0 ) + penStyle = m_dotted_cp ? wxPENSTYLE_DOT : wxPENSTYLE_SOLID; + else if( ( type & SPT_CURRENT ) > 0 ) + penStyle = m_dotted_cp ? wxPENSTYLE_DOT : wxPENSTYLE_SOLID; + else + penStyle = wxPENSTYLE_SOLID; + + trace->SetPen( wxPen( trace->GetTraceColour(), 2, penStyle ) ); m_sessionTraceColors[ trace->GetName() ] = trace->GetTraceColour(); } diff --git a/eeschema/sim/simulator_frame_ui.cpp b/eeschema/sim/simulator_frame_ui.cpp index ca0725822c..7c22f754d5 100644 --- a/eeschema/sim/simulator_frame_ui.cpp +++ b/eeschema/sim/simulator_frame_ui.cpp @@ -2456,23 +2456,43 @@ void SIMULATOR_FRAME_UI::updatePlotCursors() auto getUnitsY = [&]( TRACE* aTrace ) -> wxString { - if( ( aTrace->GetType() & SPT_AC_PHASE ) || ( aTrace->GetType() & SPT_CURRENT ) ) - return plotTab->GetUnitsY2(); - else if( aTrace->GetType() & SPT_POWER ) - return plotTab->GetUnitsY3(); + if( plotTab->GetSimType() == ST_AC ) + { + if( aTrace->GetType() & SPT_AC_PHASE ) + return plotTab->GetUnitsY2(); + else + return plotTab->GetUnitsY1(); + } else - return plotTab->GetUnitsY1(); + { + if( aTrace->GetType() & SPT_POWER ) + return plotTab->GetUnitsY3(); + else if( aTrace->GetType() & SPT_CURRENT ) + return plotTab->GetUnitsY2(); + else + return plotTab->GetUnitsY1(); + } }; auto getNameY = [&]( TRACE* aTrace ) -> wxString { - if( ( aTrace->GetType() & SPT_AC_PHASE ) || ( aTrace->GetType() & SPT_CURRENT ) ) - return plotTab->GetLabelY2(); - else if( aTrace->GetType() & SPT_POWER ) - return plotTab->GetLabelY3(); + if( plotTab->GetSimType() == ST_AC ) + { + if( aTrace->GetType() & SPT_AC_PHASE ) + return plotTab->GetLabelY2(); + else + return plotTab->GetLabelY1(); + } else - return plotTab->GetLabelY1(); + { + if( aTrace->GetType() & SPT_POWER ) + return plotTab->GetLabelY3(); + else if( aTrace->GetType() & SPT_CURRENT ) + return plotTab->GetLabelY2(); + else + return plotTab->GetLabelY1(); + } }; auto formatValue =