ADDED operating point overlay for SCH_EDIT_FRAME.

Fixes https://gitlab.com/kicad/code/kicad/issues/11253
This commit is contained in:
Jeff Young 2023-02-09 17:18:56 +00:00
parent 2a5bb71fbd
commit bc108023b3
41 changed files with 1208 additions and 39 deletions

View File

@ -4,7 +4,7 @@
* Copyright (C) 2018 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2012 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -43,12 +43,24 @@ int GetPenSizeForBold( int aTextSize )
}
int GetPenSizeForDemiBold( int aTextSize )
{
return KiROUND( aTextSize / 6 );
}
int GetPenSizeForBold( const wxSize& aTextSize )
{
return GetPenSizeForBold( std::min( aTextSize.x, aTextSize.y ) );
}
int GetPenSizeForDemiBold( const wxSize& aTextSize )
{
return GetPenSizeForDemiBold( std::min( aTextSize.x, aTextSize.y ) );
}
int GetPenSizeForNormal( int aTextSize )
{
return KiROUND( aTextSize / 8.0 );

View File

@ -147,6 +147,8 @@ wxString LayerName( int aLayer )
case LAYER_SELECTION_SHADOWS: return _( "Selection highlight" );
case LAYER_SCHEMATIC_DRAWINGSHEET: return _( "Drawing sheet" );
case LAYER_SCHEMATIC_PAGE_LIMITS: return _( "Page limits" );
case LAYER_OP_VOLTAGES: return _( "Operating point voltages" );
case LAYER_OP_CURRENTS: return _( "Operating point currents" );
// GAL_LAYER_ID

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -73,6 +73,8 @@ static const std::map<int, COLOR4D> s_defaultTheme =
{ LAYER_WIRE, CSS_COLOR( 0, 150, 0, 1 ) },
{ LAYER_SCHEMATIC_DRAWINGSHEET, CSS_COLOR( 132, 0, 0, 1 ) },
{ LAYER_SCHEMATIC_PAGE_LIMITS, CSS_COLOR( 181, 181, 181, 1 ) },
{ LAYER_OP_VOLTAGES, CSS_COLOR( 132, 0, 50, 1 ) },
{ LAYER_OP_CURRENTS, CSS_COLOR( 224, 0, 12, 1 ) },
{ LAYER_GERBVIEW_AXES, CSS_COLOR( 0, 0, 132, 1 ) },
{ LAYER_GERBVIEW_BACKGROUND, CSS_COLOR( 0, 0, 0, 1 ) },
@ -287,6 +289,8 @@ static const std::map<int, COLOR4D> s_classicTheme =
{ LAYER_VALUEPART, COLOR4D( CYAN ) },
{ LAYER_WIRE, COLOR4D( GREEN ) },
{ LAYER_SCHEMATIC_DRAWINGSHEET, COLOR4D( RED ) },
{ LAYER_OP_VOLTAGES, COLOR4D( DARKMAGENTA ) },
{ LAYER_OP_CURRENTS, COLOR4D( RED ) },
{ LAYER_GERBVIEW_AXES, COLOR4D( BLUE ) },
{ LAYER_GERBVIEW_BACKGROUND, COLOR4D( BLACK ) },

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2021-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -94,6 +94,8 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath )
CLR( "schematic.wire", LAYER_WIRE );
CLR( "schematic.worksheet", LAYER_SCHEMATIC_DRAWINGSHEET );
CLR( "schematic.page_limits", LAYER_SCHEMATIC_PAGE_LIMITS );
CLR( "schematic.op_voltages", LAYER_OP_VOLTAGES );
CLR( "schematic.op_currents", LAYER_OP_CURRENTS );
CLR( "gerbview.axes", LAYER_GERBVIEW_AXES );
CLR( "gerbview.background", LAYER_GERBVIEW_BACKGROUND );

View File

@ -33,7 +33,7 @@ DIALOG_SIM_FORMAT_VALUE_BASE::DIALOG_SIM_FORMAT_VALUE_BASE( wxWindow* parent, wx
m_rangeLabel->Wrap( -1 );
fgSizer->Add( m_rangeLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
wxString m_rangeCtrlChoices[] = { _("auto"), _("f"), _("p"), _("n"), _("u"), _("m"), wxEmptyString, _("K"), _("M"), _("G"), _("T"), _("P") };
wxString m_rangeCtrlChoices[] = { _("Auto"), _("f"), _("p"), _("n"), _("u"), _("m"), wxEmptyString, _("K"), _("M"), _("G"), _("T"), _("P") };
int m_rangeCtrlNChoices = sizeof( m_rangeCtrlChoices ) / sizeof( wxString );
m_rangeCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_rangeCtrlNChoices, m_rangeCtrlChoices, 0 );
m_rangeCtrl->SetSelection( 0 );

View File

@ -279,7 +279,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;auto&quot; &quot;f&quot; &quot;p&quot; &quot;n&quot; &quot;u&quot; &quot;m&quot; &quot;&quot; &quot;K&quot; &quot;M&quot; &quot;G&quot; &quot;T&quot; &quot;P&quot;</property>
<property name="choices">&quot;Auto&quot; &quot;f&quot; &quot;p&quot; &quot;n&quot; &quot;u&quot; &quot;m&quot; &quot;&quot; &quot;K&quot; &quot;M&quot; &quot;G&quot; &quot;T&quot; &quot;P&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>

View File

@ -58,6 +58,8 @@ void PANEL_EESCHEMA_DISPLAY_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* cf
m_checkShowERCErrors->SetValue( cfg->m_Appearance.show_erc_errors );
m_checkShowERCWarnings->SetValue( cfg->m_Appearance.show_erc_warnings );
m_checkShowERCExclusions->SetValue( cfg->m_Appearance.show_erc_exclusions );
m_checkShowOPVoltages->SetValue( cfg->m_Appearance.show_op_voltages );
m_checkShowOPCurrents->SetValue( cfg->m_Appearance.show_op_currents );
m_checkPageLimits->SetValue( cfg->m_Appearance.show_page_limits );
m_checkSelDrawChildItems->SetValue( cfg->m_Selection.draw_selected_children );
@ -98,6 +100,8 @@ bool PANEL_EESCHEMA_DISPLAY_OPTIONS::TransferDataFromWindow()
cfg->m_Appearance.show_erc_warnings = m_checkShowERCWarnings->GetValue();
cfg->m_Appearance.show_erc_errors = m_checkShowERCErrors->GetValue();
cfg->m_Appearance.show_erc_exclusions = m_checkShowERCExclusions->GetValue();
cfg->m_Appearance.show_op_voltages = m_checkShowOPVoltages->GetValue();
cfg->m_Appearance.show_op_currents = m_checkShowOPCurrents->GetValue();
cfg->m_Appearance.show_page_limits = m_checkPageLimits->GetValue();
cfg->m_Selection.draw_selected_children = m_checkSelDrawChildItems->GetValue();

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -65,6 +65,12 @@ PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE::PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE( wxWind
m_checkShowERCExclusions = new wxCheckBox( this, wxID_ANY, _("Show ERC exclusions"), wxDefaultPosition, wxDefaultSize, 0 );
bAppearanceSizer->Add( m_checkShowERCExclusions, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkShowOPVoltages = new wxCheckBox( this, wxID_ANY, _("Show OP voltages"), wxDefaultPosition, wxDefaultSize, 0 );
bAppearanceSizer->Add( m_checkShowOPVoltages, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkShowOPCurrents = new wxCheckBox( this, wxID_ANY, _("Show OP currents"), wxDefaultPosition, wxDefaultSize, 0 );
bAppearanceSizer->Add( m_checkShowOPCurrents, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_checkPageLimits = new wxCheckBox( this, wxID_ANY, _("Show page limi&ts"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkPageLimits->SetValue(true);
bAppearanceSizer->Add( m_checkPageLimits, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -661,6 +661,134 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show OP voltages</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkShowOPVoltages</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Show OP currents</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkShowOPCurrents</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -47,6 +47,8 @@ class PANEL_EESCHEMA_DISPLAY_OPTIONS_BASE : public RESETTABLE_PANEL
wxCheckBox* m_checkShowERCErrors;
wxCheckBox* m_checkShowERCWarnings;
wxCheckBox* m_checkShowERCExclusions;
wxCheckBox* m_checkShowOPVoltages;
wxCheckBox* m_checkShowOPCurrents;
wxCheckBox* m_checkPageLimits;
wxStaticText* m_selectionLabel;
wxStaticLine* m_staticline2;

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -116,6 +116,11 @@ bool PANEL_SETUP_FORMATTING::TransferDataToWindow()
#undef SET_VALUE
m_vPrecisionCtrl->SetValue( settings.m_OPO_VPrecision );
m_vRangeCtrl->SetStringSelection( settings.m_OPO_VRange );
m_iPrecisionCtrl->SetValue( settings.m_OPO_IPrecision );
m_iRangeCtrl->SetStringSelection( settings.m_OPO_IRange );
return true;
}
@ -167,6 +172,20 @@ bool PANEL_SETUP_FORMATTING::TransferDataFromWindow()
#undef GET_VALUE
settings.m_OPO_VPrecision = m_vPrecisionCtrl->GetValue();
if( m_vRangeCtrl->GetSelection() == 0 )
settings.m_OPO_VRange = wxS( "~V" );
else
settings.m_OPO_VRange = m_vRangeCtrl->GetStringSelection();
settings.m_OPO_IPrecision = m_iPrecisionCtrl->GetValue();
if( m_iRangeCtrl->GetSelection() == 0 )
settings.m_OPO_IRange = wxS( "~A" );
else
settings.m_OPO_IRange = m_iRangeCtrl->GetStringSelection();
return true;
}

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -247,7 +247,60 @@ PANEL_SETUP_FORMATTING_BASE::PANEL_SETUP_FORMATTING_BASE( wxWindow* parent, wxWi
sbSizer6->Add( m_dashedLineHelp, 0, wxALL, 5 );
bRightColumn->Add( sbSizer6, 1, wxEXPAND|wxALL, 5 );
bRightColumn->Add( sbSizer6, 0, wxEXPAND|wxALL, 5 );
wxStaticBoxSizer* sbSizer7;
sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Operating-point Overlay") ), wxVERTICAL );
wxFlexGridSizer* fgSizer;
fgSizer = new wxFlexGridSizer( 4, 2, 6, 0 );
fgSizer->AddGrowableCol( 1 );
fgSizer->SetFlexibleDirection( wxBOTH );
fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
wxStaticText* vPrecisionLabel;
vPrecisionLabel = new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY, _("Significant digits (voltages):"), wxDefaultPosition, wxDefaultSize, 0 );
vPrecisionLabel->Wrap( -1 );
fgSizer->Add( vPrecisionLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_vPrecisionCtrl = new wxSpinCtrl( sbSizer7->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 10, 3 );
fgSizer->Add( m_vPrecisionCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxStaticText* vRangeLabel;
vRangeLabel = new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY, _("Range (voltages):"), wxDefaultPosition, wxDefaultSize, 0 );
vRangeLabel->Wrap( -1 );
fgSizer->Add( vRangeLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
wxString m_vRangeCtrlChoices[] = { _("Auto"), _("fV"), _("pV"), _("nV"), _("uV"), _("mV"), _("V"), _("KV"), _("MV"), _("GV"), _("TV"), _("PV") };
int m_vRangeCtrlNChoices = sizeof( m_vRangeCtrlChoices ) / sizeof( wxString );
m_vRangeCtrl = new wxChoice( sbSizer7->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_vRangeCtrlNChoices, m_vRangeCtrlChoices, 0 );
m_vRangeCtrl->SetSelection( 0 );
fgSizer->Add( m_vRangeCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
wxStaticText* iPrecisionLabel;
iPrecisionLabel = new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY, _("Significant digits (currents):"), wxDefaultPosition, wxDefaultSize, 0 );
iPrecisionLabel->Wrap( -1 );
fgSizer->Add( iPrecisionLabel, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_iPrecisionCtrl = new wxSpinCtrl( sbSizer7->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 10, 3 );
fgSizer->Add( m_iPrecisionCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxStaticText* iRangeLabel;
iRangeLabel = new wxStaticText( sbSizer7->GetStaticBox(), wxID_ANY, _("Range (currents):"), wxDefaultPosition, wxDefaultSize, 0 );
iRangeLabel->Wrap( -1 );
fgSizer->Add( iRangeLabel, 0, wxRIGHT|wxLEFT, 5 );
wxString m_iRangeCtrlChoices[] = { _("Auto"), _("fA"), _("pA"), _("nA"), _("uA"), _("mA"), _("A"), _("KA"), _("MA"), _("GA"), _("TA"), _("PA") };
int m_iRangeCtrlNChoices = sizeof( m_iRangeCtrlChoices ) / sizeof( wxString );
m_iRangeCtrl = new wxChoice( sbSizer7->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_iRangeCtrlNChoices, m_iRangeCtrlChoices, 0 );
m_iRangeCtrl->SetSelection( 0 );
fgSizer->Add( m_iRangeCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
sbSizer7->Add( fgSizer, 1, wxEXPAND, 5 );
bRightColumn->Add( sbSizer7, 1, wxEXPAND|wxALL, 5 );
bPanelSizer->Add( bRightColumn, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );

View File

@ -1924,7 +1924,7 @@
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Dashed Lines</property>
@ -2264,6 +2264,534 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Operating-point Overlay</property>
<property name="minimum_size"></property>
<property name="name">sbSizer7</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">2</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="rows">4</property>
<property name="vgap">6</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Significant digits (voltages):</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">vPrecisionLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">none</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxSpinCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="initial">3</property>
<property name="max">10</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min">1</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_vPrecisionCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Range (voltages):</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">vRangeLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">none</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Auto&quot; &quot;fV&quot; &quot;pV&quot; &quot;nV&quot; &quot;uV&quot; &quot;mV&quot; &quot;V&quot; &quot;KV&quot; &quot;MV&quot; &quot;GV&quot; &quot;TV&quot; &quot;PV&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_vRangeCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Significant digits (currents):</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">iPrecisionLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">none</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxSpinCtrl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="initial">3</property>
<property name="max">10</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min">1</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_iPrecisionCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style">wxSP_ARROW_KEYS</property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="value"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Range (currents):</property>
<property name="markup">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">iRangeLabel</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">none</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxChoice" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="choices">&quot;Auto&quot; &quot;fA&quot; &quot;pA&quot; &quot;nA&quot; &quot;uA&quot; &quot;mA&quot; &quot;A&quot; &quot;KA&quot; &quot;MA&quot; &quot;GA&quot; &quot;TA&quot; &quot;PA&quot;</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_iRangeCtrl</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b3)
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -22,6 +22,7 @@
#include <wx/textctrl.h>
#include <wx/checkbox.h>
#include <wx/radiobut.h>
#include <wx/spinctrl.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
@ -71,6 +72,10 @@ class PANEL_SETUP_FORMATTING_BASE : public wxPanel
wxStaticText* gapLengthLabel;
wxTextCtrl* m_gapLengthCtrl;
wxStaticText* m_dashedLineHelp;
wxSpinCtrl* m_vPrecisionCtrl;
wxChoice* m_vRangeCtrl;
wxSpinCtrl* m_iPrecisionCtrl;
wxChoice* m_iRangeCtrl;
// Virtual event handlers, override them in your derived class
virtual void onCheckBoxIref( wxCommandEvent& event ) { event.Skip(); }

View File

@ -102,6 +102,7 @@ void SCH_EDIT_FRAME::ShowSchematicSetupDialog( const wxString& aInitialPage )
GetCanvas()->GetView()->MarkDirty();
GetCanvas()->GetView()->UpdateAllItems( KIGFX::REPAINT );
RefreshOperatingPointDisplay();
GetCanvas()->Refresh();
}
}

View File

@ -133,6 +133,12 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
m_params.emplace_back( new PARAM<bool>( "appearance.show_erc_exclusions",
&m_Appearance.show_erc_exclusions, false ) );
m_params.emplace_back( new PARAM<bool>( "appearance.show_op_voltages",
&m_Appearance.show_op_voltages, true ) );
m_params.emplace_back( new PARAM<bool>( "appearance.show_op_currents",
&m_Appearance.show_op_currents, true ) );
m_params.emplace_back( new PARAM<bool>( "appearance.show_illegal_symbol_lib_dialog",
&m_Appearance.show_illegal_symbol_lib_dialog, true ) );

View File

@ -63,6 +63,8 @@ public:
bool show_erc_warnings;
bool show_erc_errors;
bool show_erc_exclusions;
bool show_op_voltages;
bool show_op_currents;
bool show_illegal_symbol_lib_dialog;
bool show_page_limits;
bool show_sexpr_file_convert_warning;

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -1187,12 +1187,13 @@ const BOX2I LIB_PIN::ViewBBox() const
void LIB_PIN::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 3;
aCount = 4;
aLayers[0] = LAYER_DANGLING; // We don't really show dangling vs non-dangling (since there
// are no connections in the symbol editor), but it's still
// a good visual indication of which end of the pin is which.
aLayers[1] = LAYER_DEVICE;
aLayers[2] = LAYER_SELECTION_SHADOWS;
aLayers[3] = LAYER_OP_CURRENTS;
}

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Jean-Pierre Charras, jaen-pierre.charras at wanadoo.fr
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -166,6 +166,11 @@ public:
// Do not create a copy constructor. The one generated by the compiler is adequate.
// No, LIB_PINs don't really have operating poinst. But we draw SCH_PINs through their LIB_PIN
// counterparts, so here we are....
const wxString& GetOperatingPoint() const { return m_operatingPoint; }
void SetOperatingPoint( const wxString& aText ) { m_operatingPoint = aText; }
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override;
#endif
@ -299,6 +304,10 @@ protected:
int m_nameTextSize;
std::map<wxString, ALT> m_alternates; // Map of alternate name to ALT structure
wxString m_operatingPoint; // No, LIB_PINs don't really have operating points.
// But we draw SCH_PINs through their LIB_PIN
// counterparts, so here we are....
};

View File

@ -207,6 +207,8 @@ void SCH_EDIT_FRAME::doReCreateMenuBar()
viewMenu->Add( EE_ACTIONS::toggleERCErrors, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleERCWarnings, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleERCExclusions, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleOPVoltages, ACTION_MENU::CHECK );
viewMenu->Add( EE_ACTIONS::toggleOPCurrents, ACTION_MENU::CHECK );
#ifdef __APPLE__
viewMenu->AppendSeparator();

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2014-2019 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -168,6 +168,11 @@ void SCH_DRAW_PANEL::setDefaultLayerDeps()
m_view->SetLayerTarget( LAYER_DRAWINGSHEET, KIGFX::TARGET_NONCACHED );
m_view->SetLayerDisplayOnly( LAYER_DRAWINGSHEET ) ;
m_view->SetLayerTarget( LAYER_OP_VOLTAGES, KIGFX::TARGET_OVERLAY );
m_view->SetLayerDisplayOnly( LAYER_OP_VOLTAGES );
m_view->SetLayerTarget( LAYER_OP_CURRENTS, KIGFX::TARGET_OVERLAY );
m_view->SetLayerDisplayOnly( LAYER_OP_CURRENTS );
// m_view->SetLayerTarget( LAYER_SELECTION_SHADOWS, KIGFX::TARGET_NONCACHED );
// m_view->SetLayerDisplayOnly( LAYER_SELECTION_SHADOWS ) ;
}

View File

@ -248,6 +248,12 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
LoadProjectSettings();
view->SetLayerVisible( LAYER_ERC_ERR, cfg->m_Appearance.show_erc_errors );
view->SetLayerVisible( LAYER_ERC_WARN, cfg->m_Appearance.show_erc_warnings );
view->SetLayerVisible( LAYER_ERC_EXCLUSION, cfg->m_Appearance.show_erc_exclusions );
view->SetLayerVisible( LAYER_OP_VOLTAGES, cfg->m_Appearance.show_op_voltages );
view->SetLayerVisible( LAYER_OP_CURRENTS, cfg->m_Appearance.show_op_currents );
initScreenZoom();
m_hierarchy->Connect( wxEVT_SIZE,
@ -496,6 +502,20 @@ void SCH_EDIT_FRAME::setupUIConditions()
return cfg && cfg->m_Appearance.show_erc_exclusions;
};
auto showOPVoltagesCond =
[this]( const SELECTION& )
{
EESCHEMA_SETTINGS* cfg = eeconfig();
return cfg && cfg->m_Appearance.show_op_voltages;
};
auto showOPCurrentsCond =
[this]( const SELECTION& )
{
EESCHEMA_SETTINGS* cfg = eeconfig();
return cfg && cfg->m_Appearance.show_op_currents;
};
auto showAnnotateAutomaticallyCond =
[this]( const SELECTION& )
{
@ -554,6 +574,8 @@ void SCH_EDIT_FRAME::setupUIConditions()
mgr->SetConditions( EE_ACTIONS::toggleERCErrors, CHECK( showERCErrorsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleERCWarnings, CHECK( showERCWarningsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleERCExclusions, CHECK( showERCExclusionsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleOPVoltages, CHECK( showOPVoltagesCond ) );
mgr->SetConditions( EE_ACTIONS::toggleOPCurrents, CHECK( showOPCurrentsCond ) );
mgr->SetConditions( EE_ACTIONS::toggleAnnotateAuto, CHECK( showAnnotateAutomaticallyCond ) );
mgr->SetConditions( ACTIONS::toggleBoundingBoxes, CHECK( cond.BoundingBoxes() ) );
@ -1258,6 +1280,11 @@ void SCH_EDIT_FRAME::PrintPage( const RENDER_SETTINGS* aSettings )
void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
{
SCHEMATIC_SETTINGS& settings = m_schematic->Settings();
SIM_LIB_MGR simLibMgr( &Prj() );
// Update items which may have ${OP} text variables
//
GetCanvas()->GetView()->UpdateAllItemsConditionally(
[&]( KIGFX::VIEW_ITEM* aItem ) -> int
{
@ -1291,6 +1318,89 @@ void SCH_EDIT_FRAME::RefreshOperatingPointDisplay()
return flags;
} );
// Update OP overlay items
//
for( SCH_ITEM* item : GetScreen()->Items() )
{
if( item->Type() == SCH_LINE_T )
{
static_cast<SCH_LINE*>( item )->SetOperatingPoint( wxEmptyString );
// update value from netlist, below
}
else if( item->Type() == SCH_SYMBOL_T )
{
SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
wxString ref = symbol->GetRef( &GetCurrentSheet() );
std::vector<SCH_PIN*> pins = symbol->GetPins( &GetCurrentSheet() );
for( SCH_PIN* pin : pins )
pin->SetOperatingPoint( wxEmptyString );
if( pins.size() == 2 )
{
wxString op = m_schematic->GetOperatingPoint( ref, settings.m_OPO_IPrecision,
settings.m_OPO_IRange );
if( !op.IsEmpty() && op != wxS( "?" ) )
pins[0]->SetOperatingPoint( op );
}
else
{
SIM_MODEL& model = simLibMgr.CreateModel( &GetCurrentSheet(), *symbol ).model;
for( const auto& modelPin : model.GetPins() )
{
SCH_PIN* symbolPin = symbol->GetPin( modelPin.get().symbolPinNumber );
wxString signalName = ref + wxS( ":" ) + modelPin.get().name;
wxString op = m_schematic->GetOperatingPoint( signalName,
settings.m_OPO_IPrecision,
settings.m_OPO_IRange );
if( symbolPin && !op.IsEmpty() && op != wxS( "?" ) )
{
symbolPin->SetOperatingPoint( op );
GetCanvas()->GetView()->Update( symbol );
}
}
}
}
}
for( const auto& [ key, subgraphList ] : m_schematic->m_connectionGraph->GetNetMap() )
{
wxString op = m_schematic->GetOperatingPoint( key.Name, settings.m_OPO_VPrecision,
settings.m_OPO_VRange );
if( !op.IsEmpty() )
{
for( CONNECTION_SUBGRAPH* subgraph : subgraphList )
{
SCH_LINE* longestWire = nullptr;
double length = 0.0;
for( SCH_ITEM* item : subgraph->m_items )
{
if( item->IsType( { SCH_ITEM_LOCATE_WIRE_T } ) )
{
SCH_LINE* wire = static_cast<SCH_LINE*>( item );
if( wire->GetLength() > length )
{
longestWire = wire;
length = wire->GetLength();
}
}
}
if( longestWire )
{
longestWire->SetOperatingPoint( op );
GetCanvas()->GetView()->Update( longestWire );
}
}
}
}
GetCanvas()->ForceRefresh();
}
@ -1603,6 +1713,10 @@ void SCH_EDIT_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVars
view->SetLayerVisible( LAYER_ERC_ERR, cfg->m_Appearance.show_erc_errors );
view->SetLayerVisible( LAYER_ERC_WARN, cfg->m_Appearance.show_erc_warnings );
view->SetLayerVisible( LAYER_ERC_EXCLUSION, cfg->m_Appearance.show_erc_exclusions );
view->SetLayerVisible( LAYER_OP_VOLTAGES, cfg->m_Appearance.show_op_voltages );
view->SetLayerVisible( LAYER_OP_CURRENTS, cfg->m_Appearance.show_op_currents );
RefreshOperatingPointDisplay();
settings.m_TemplateFieldNames.DeleteAllFieldNameTemplates( true /* global */ );
@ -1871,6 +1985,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
// update the References
GetCurrentSheet().UpdateAllScreenReferences();
SetSheetNumberAndCount();
RefreshOperatingPointDisplay();
EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -85,8 +85,11 @@ SCH_LINE::SCH_LINE( const SCH_LINE& aLine ) :
m_lastResolvedLineStyle = aLine.m_lastResolvedLineStyle;
m_lastResolvedWidth = aLine.m_lastResolvedWidth;
m_lastResolvedColor = aLine.m_lastResolvedColor;
m_operatingPoint = aLine.m_operatingPoint;
}
wxString SCH_LINE::GetNetname( const SCH_SHEET_PATH& aSheet )
{
std::list<const SCH_LINE *> checkedLines;
@ -94,6 +97,7 @@ wxString SCH_LINE::GetNetname( const SCH_SHEET_PATH& aSheet )
return FindWireSegmentNetNameRecursive( this, checkedLines, aSheet );
}
wxString SCH_LINE::FindWireSegmentNetNameRecursive( SCH_LINE *line,
std::list<const SCH_LINE *> &checkedLines,
const SCH_SHEET_PATH& aSheet ) const
@ -125,6 +129,7 @@ wxString SCH_LINE::FindWireSegmentNetNameRecursive( SCH_LINE *line,
return "";
}
EDA_ITEM* SCH_LINE::Clone() const
{
return new SCH_LINE( *this );
@ -181,10 +186,36 @@ void SCH_LINE::Show( int nestLevel, std::ostream& os ) const
void SCH_LINE::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 3;
aCount = 4;
aLayers[0] = LAYER_DANGLING;
aLayers[1] = m_layer;
aLayers[2] = LAYER_SELECTION_SHADOWS;
aLayers[3] = LAYER_OP_VOLTAGES;
}
double SCH_LINE::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
{
constexpr double HIDE = std::numeric_limits<double>::max();
constexpr double SHOW = 0.0;
if( aLayer == LAYER_OP_VOLTAGES )
{
if( m_start == m_end )
return HIDE;
int height = std::abs( m_end.y - m_start.y );
int width = std::abs( m_end.x - m_start.x );
// Operating points will be shown only if zoom is appropriate
if( height == 0 )
return (double) schIUScale.mmToIU( 15 ) / width;
else
return (double) schIUScale.mmToIU( 5 ) / height;
}
// Other layers are always drawn.
return SHOW;
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -197,6 +197,8 @@ public:
void ViewGetLayers( int aLayers[], int& aCount ) const override;
double ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const override;
const BOX2I GetBoundingBox() const override;
/**
@ -295,6 +297,9 @@ public:
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;
const wxString& GetOperatingPoint() const { return m_operatingPoint; }
void SetOperatingPoint( const wxString& aText ) { m_operatingPoint = aText; }
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override;
#endif
@ -347,6 +352,8 @@ private:
mutable PLOT_DASH_TYPE m_lastResolvedLineStyle;
mutable int m_lastResolvedWidth;
mutable COLOR4D m_lastResolvedColor;
wxString m_operatingPoint;
};

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 CERN
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
@ -30,6 +30,7 @@
#include <symbol_library.h>
#include <connection_graph.h>
#include <gal/graphics_abstraction_layer.h>
#include <callback_gal.h>
#include <geometry/shape_segment.h>
#include <geometry/shape_simple.h>
#include <gr_text.h>
@ -565,6 +566,16 @@ float SCH_PAINTER::getTextThickness( const EDA_ITEM* aItem ) const
}
int SCH_PAINTER::getOperatingPointTextSize() const
{
int docTextSize = schIUScale.MilsToIU( 50 );
int screenTextSize = std::abs( (int) m_gal->GetScreenWorldMatrix().GetScale().y * 7 );
// 66% zoom-relative
return KiROUND( ( docTextSize + screenTextSize * 2 ) / 3 );
}
static VECTOR2D mapCoords( const VECTOR2D& aCoord )
{
return VECTOR2D( aCoord.x, -aCoord.y );
@ -617,6 +628,52 @@ void SCH_PAINTER::bitmapText( const wxString& aText, const VECTOR2D& aPosition,
}
void SCH_PAINTER::knockoutText( const wxString& aText, const VECTOR2D& aPosition,
const TEXT_ATTRIBUTES& aAttrs )
{
TEXT_ATTRIBUTES attrs( aAttrs );
KIFONT::FONT* font = aAttrs.m_Font;
if( !font )
{
font = KIFONT::FONT::GetFont( eeconfig()->m_Appearance.default_font, attrs.m_Bold,
attrs.m_Italic );
}
KIGFX::GAL_DISPLAY_OPTIONS empty_opts;
SHAPE_POLY_SET knockouts;
CALLBACK_GAL callback_gal( empty_opts,
// Polygon callback
[&]( const SHAPE_LINE_CHAIN& aPoly )
{
knockouts.AddOutline( aPoly );
} );
callback_gal.SetIsFill( false );
callback_gal.SetIsStroke( true );
callback_gal.SetLineWidth( (float) attrs.m_StrokeWidth );
font->Draw( &callback_gal, aText, aPosition, attrs );
BOX2I bbox = knockouts.BBox( attrs.m_StrokeWidth * 2 );
SHAPE_POLY_SET finalPoly;
finalPoly.NewOutline();
finalPoly.Append( bbox.GetLeft(), bbox.GetTop() );
finalPoly.Append( bbox.GetRight(), bbox.GetTop() );
finalPoly.Append( bbox.GetRight(), bbox.GetBottom() );
finalPoly.Append( bbox.GetLeft(), bbox.GetBottom() );
finalPoly.BooleanSubtract( knockouts, SHAPE_POLY_SET::PM_FAST );
finalPoly.Fracture( SHAPE_POLY_SET::PM_FAST );
m_gal->SetIsStroke( false );
m_gal->SetIsFill( true );
m_gal->SetFillColor( attrs.m_Color );
m_gal->DrawPolygon( finalPoly );
}
void SCH_PAINTER::boxText( const wxString& aText, const VECTOR2D& aPosition,
const TEXT_ATTRIBUTES& aAttrs )
{
@ -1232,6 +1289,7 @@ void SCH_PAINTER::draw( const LIB_PIN *aPin, int aLayer, bool aDimmed )
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
bool drawingDangling = aLayer == LAYER_DANGLING;
bool drawingOP = aLayer == LAYER_OP_CURRENTS;
bool isDangling = m_schSettings.m_IsSymbolEditor || aPin->HasFlag( IS_DANGLING );
if( drawingShadows && !( aPin->IsBrightened() || aPin->IsSelected() ) )
@ -1292,6 +1350,40 @@ void SCH_PAINTER::draw( const LIB_PIN *aPin, int aLayer, bool aDimmed )
break;
}
if( drawingOP && !aPin->GetOperatingPoint().IsEmpty() )
{
int textSize = getOperatingPointTextSize();
VECTOR2I mid = ( p0 + pos ) / 2;
int textOffset = KiROUND( textSize * 0.22 );
TEXT_ATTRIBUTES attrs;
if( len > KiROUND( textSize * 1.8 ) )
{
if( dir.x == 0 )
{
mid.x += KiROUND( textOffset * 1.2 );
attrs.m_Angle = ANGLE_HORIZONTAL;
}
else
{
mid.y -= KiROUND( textOffset * 1.2 );
attrs.m_Angle = ANGLE_VERTICAL;
}
attrs.m_Halign = GR_TEXT_H_ALIGN_LEFT;
attrs.m_Valign = GR_TEXT_V_ALIGN_CENTER;
attrs.m_Font = KIFONT::FONT::GetFont(); // always use stroke font for performance
attrs.m_Size = VECTOR2I( textSize, textSize );
attrs.m_StrokeWidth = GetPenSizeForDemiBold( textSize );
attrs.m_Color = m_schSettings.GetLayerColor( LAYER_OP_CURRENTS );
knockoutText( aPin->GetOperatingPoint(), mid, attrs );
}
return;
}
VECTOR2D pc;
m_gal->SetIsStroke( true );
@ -1706,6 +1798,7 @@ void SCH_PAINTER::draw( const SCH_LINE *aLine, int aLayer )
{
bool drawingShadows = aLayer == LAYER_SELECTION_SHADOWS;
bool drawingDangling = aLayer == LAYER_DANGLING;
bool drawingOP = aLayer == LAYER_OP_VOLTAGES;
if( drawingShadows && !( aLine->IsBrightened() || aLine->IsSelected() ) )
return;
@ -1747,6 +1840,35 @@ void SCH_PAINTER::draw( const SCH_LINE *aLine, int aLayer )
if( drawingDangling )
return;
if( drawingOP && !aLine->GetOperatingPoint().IsEmpty() )
{
int textSize = getOperatingPointTextSize();
VECTOR2I pos = aLine->GetMidPoint();
int textOffset = KiROUND( textSize * 0.22 );
TEXT_ATTRIBUTES attrs;
if( aLine->GetStartPoint().y == aLine->GetEndPoint().y )
{
pos.y -= textOffset;
attrs.m_Halign = GR_TEXT_H_ALIGN_CENTER;
attrs.m_Valign = GR_TEXT_V_ALIGN_BOTTOM;
}
else
{
pos.x += KiROUND( textOffset * 1.2 );
attrs.m_Halign = GR_TEXT_H_ALIGN_LEFT;
attrs.m_Valign = GR_TEXT_V_ALIGN_CENTER;
}
attrs.m_Font = KIFONT::FONT::GetFont(); // always use stroke font for performance
attrs.m_Size = VECTOR2I( textSize, textSize );
attrs.m_StrokeWidth = GetPenSizeForDemiBold( textSize );
attrs.m_Color = m_schSettings.GetLayerColor( LAYER_OP_VOLTAGES );
knockoutText( aLine->GetOperatingPoint(), pos, attrs );
return;
}
m_gal->SetIsStroke( true );
m_gal->SetStrokeColor( color );
m_gal->SetLineWidth( width );
@ -2300,6 +2422,8 @@ void SCH_PAINTER::draw( const SCH_SYMBOL* aSymbol, int aLayer )
tempPin->SetFlags( IS_DANGLING );
else
tempPin->ClearFlags( IS_DANGLING );
tempPin->SetOperatingPoint( symbolPin->GetOperatingPoint() );
}
draw( &tempSymbol, aLayer, false, aSymbol->GetUnit(), aSymbol->GetConvert(), aSymbol->GetDNP() );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2019-2020 CERN
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
*
@ -189,6 +189,8 @@ private:
float getLineWidth( const EDA_ITEM* aItem, bool aDrawingShadows ) const;
float getTextThickness( const EDA_ITEM* aItem ) const;
int getOperatingPointTextSize() const;
bool setDeviceColors( const LIB_ITEM* aItem, int aLayer, bool aDimmed );
void triLine( const VECTOR2D &a, const VECTOR2D &b, const VECTOR2D &c );
@ -196,7 +198,10 @@ private:
const TEXT_ATTRIBUTES& aAttributes );
void bitmapText( const wxString& aText, const VECTOR2D& aPosition,
const TEXT_ATTRIBUTES& aAttributes );
void boxText( const wxString& aText, const VECTOR2D& aPosition, const TEXT_ATTRIBUTES& aAttrs );
void knockoutText( const wxString& aText, const VECTOR2D& aPosition,
const TEXT_ATTRIBUTES& aAttrs );
void boxText( const wxString& aText, const VECTOR2D& aPosition,
const TEXT_ATTRIBUTES& aAttrs );
public:
static std::vector<KICAD_T> g_ScaledSelectionTypes;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 CERN
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
* @author Jon Evans <jon@craftyjon.com>
*
* This program is free software; you can redistribute it and/or
@ -152,10 +152,11 @@ const BOX2I SCH_PIN::ViewBBox() const
void SCH_PIN::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 3;
aCount = 4;
aLayers[0] = LAYER_DANGLING;
aLayers[1] = LAYER_DEVICE;
aLayers[2] = LAYER_SELECTION_SHADOWS;
aLayers[3] = LAYER_OP_CURRENTS;
}

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 CERN
* Copyright (C) 2019-2021 KiCad Developers, see AUTHOR.txt for contributors.
* Copyright (C) 2019-2023 KiCad Developers, see AUTHOR.txt for contributors.
* @author Jon Evans <jon@craftyjon.com>
*
* This program is free software; you can redistribute it and/or
@ -159,6 +159,8 @@ public:
bool ConnectionPropagatesTo( const EDA_ITEM* aItem ) const override;
const wxString& GetOperatingPoint() const { return m_operatingPoint; }
void SetOperatingPoint( const wxString& aText ) { m_operatingPoint = aText; }
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const override {}
@ -175,6 +177,8 @@ private:
/// The name that this pin connection will drive onto a net.
std::recursive_mutex m_netmap_mutex;
std::map<const SCH_SHEET_PATH, std::pair<wxString, bool>> m_net_name_map;
wxString m_operatingPoint;
};
#endif

View File

@ -244,15 +244,16 @@ bool SCH_SYMBOL::IsMissingLibSymbol() const
void SCH_SYMBOL::ViewGetLayers( int aLayers[], int& aCount ) const
{
aCount = 7;
aCount = 8;
aLayers[0] = LAYER_DANGLING; // Pins are drawn by their parent symbol, so the parent
// symbol needs to draw to LAYER_DANGLING
aLayers[1] = LAYER_DEVICE;
aLayers[2] = LAYER_REFERENCEPART;
aLayers[3] = LAYER_VALUEPART;
aLayers[4] = LAYER_FIELDS;
aLayers[5] = LAYER_DEVICE_BACKGROUND;
aLayers[6] = LAYER_SELECTION_SHADOWS;
aLayers[1] = LAYER_OP_CURRENTS; // Same for pin operating points
aLayers[2] = LAYER_DEVICE;
aLayers[3] = LAYER_REFERENCEPART;
aLayers[4] = LAYER_VALUEPART;
aLayers[5] = LAYER_FIELDS;
aLayers[6] = LAYER_DEVICE_BACKGROUND;
aLayers[7] = LAYER_SELECTION_SHADOWS;
}

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2018-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -46,6 +46,7 @@ static const int SCH_LAYER_ORDER[] =
{
LAYER_GP_OVERLAY, LAYER_SELECT_OVERLAY,
LAYER_ERC_ERR, LAYER_ERC_WARN, LAYER_ERC_EXCLUSION, LAYER_DANGLING,
LAYER_OP_VOLTAGES, LAYER_OP_CURRENTS,
LAYER_REFERENCEPART, LAYER_VALUEPART, LAYER_FIELDS,
LAYER_INTERSHEET_REFS, LAYER_NETCLASS_REFS,
LAYER_BUS_JUNCTION, LAYER_JUNCTION, LAYER_NOCONNECT,

View File

@ -32,6 +32,7 @@
#include <sim/spice_settings.h>
#include <sch_label.h>
#include <sim/spice_value.h>
#include <netlist_exporter_spice.h>
SCHEMATIC::SCHEMATIC( PROJECT* aPrj ) :
EDA_ITEM( nullptr, SCHEMATIC_T ),
@ -629,7 +630,13 @@ void SCHEMATIC::RecomputeIntersheetRefs( const std::function<void( SCH_GLOBALLAB
wxString SCHEMATIC::GetOperatingPoint( const wxString& aNetName, int aPrecision,
const wxString& aRange )
{
auto it = m_operatingPoints.find( aNetName );
std::string spiceNetName( aNetName.Lower().ToStdString() );
NETLIST_EXPORTER_SPICE::ConvertToSpiceMarkup( spiceNetName );
if( spiceNetName == "gnd" || spiceNetName == "0" )
return wxEmptyString;
auto it = m_operatingPoints.find( spiceNetName );
if( it != m_operatingPoints.end() )
return SPICE_VALUE( it->second ).ToString( aPrecision, aRange );

View File

@ -52,6 +52,10 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
m_IntersheetRefsSuffix( DEFAULT_IREF_SUFFIX ),
m_DashedLineDashRatio( 12.0 ),
m_DashedLineGapRatio( 3.0 ),
m_OPO_VPrecision( 3 ),
m_OPO_VRange( wxS( "~V" ) ),
m_OPO_IPrecision( 3 ),
m_OPO_IRange( wxS( "~A" ) ),
m_SpiceCurSheetAsRoot( false ),
m_SpiceSaveAllVoltages( false ),
m_SpiceSaveAllCurrents( false ),
@ -100,6 +104,18 @@ SCHEMATIC_SETTINGS::SCHEMATIC_SETTINGS( JSON_SETTINGS* aParent, const std::strin
m_params.emplace_back( new PARAM<double>( "drawing.dashed_lines_gap_length_ratio",
&m_DashedLineGapRatio, 3.0 ) ); // Default from ISO 128-2
m_params.emplace_back( new PARAM<int>( "drawing.operating_point_overlay_v_precision",
&m_OPO_VPrecision, 3 ) );
m_params.emplace_back( new PARAM<wxString>( "drawing.operating_point_overlay_v_range",
&m_OPO_VRange, wxS( "~V" ) ) );
m_params.emplace_back( new PARAM<int>( "drawing.operating_point_overlay_i_precision",
&m_OPO_VPrecision, 3 ) );
m_params.emplace_back( new PARAM<wxString>( "drawing.operating_point_overlay_i_range",
&m_OPO_VRange, wxS( "~A" ) ) );
m_params.emplace_back( new PARAM_SCALED<int>( "drawing.default_line_thickness",
&m_DefaultLineWidth, schIUScale.MilsToIU( defaultLineThickness ), schIUScale.MilsToIU( 5 ), schIUScale.MilsToIU( 1000 ),
1 / schIUScale.IU_PER_MILS ) );

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -63,6 +63,11 @@ public:
double m_DashedLineDashRatio; // Dash length as ratio of the lineWidth
double m_DashedLineGapRatio; // Gap length as ratio of the lineWidth
int m_OPO_VPrecision; // Operating-point overlay voltage significant digits
wxString m_OPO_VRange; // Operating-point overlay voltage range
int m_OPO_IPrecision; // Operating-point overlay current significant digits
wxString m_OPO_IRange; // Operating-point overlay current range
wxString m_SchDrawingSheetFileName;
wxString m_PlotDirectoryName;

View File

@ -2002,8 +2002,9 @@ void SIM_PLOT_FRAME::onSimFinished( wxCommandEvent& aEvent )
signal = signal.SubString( 2, signal.Length() - 2 );
schematic.SetOperatingPoint( signal, val_list.at( 0 ) );
m_schematicFrame->RefreshOperatingPointDisplay();
}
m_schematicFrame->RefreshOperatingPointDisplay();
}
m_lastSimPlot = plotPanelWindow;

View File

@ -704,6 +704,16 @@ TOOL_ACTION EE_ACTIONS::toggleERCExclusions( "eeschema.EditorControl.showERCExcl
_( "Show ERC Exclusions" ),
_( "Show markers for excluded electrical rules checker violations" ) );
TOOL_ACTION EE_ACTIONS::toggleOPVoltages( "eeschema.EditorControl.showOperatingPointVoltages",
AS_GLOBAL, 0, "",
_( "Show OP Voltages" ),
_( "Show operating point voltage data from simulation" ) );
TOOL_ACTION EE_ACTIONS::toggleOPCurrents( "eeschema.EditorControl.showOperatingPointCurrents",
AS_GLOBAL, 0, "",
_( "Show OP Currents" ),
_( "Show operating point current data from simulation" ) );
TOOL_ACTION EE_ACTIONS::lineModeFree( "eeschema.EditorControl.lineModeFree",
AS_GLOBAL, 0, "",
_( "Line Mode for Wires and Buses" ), _( "Draw and drag at any angle" ),

View File

@ -215,6 +215,8 @@ public:
static TOOL_ACTION toggleERCWarnings;
static TOOL_ACTION toggleERCErrors;
static TOOL_ACTION toggleERCExclusions;
static TOOL_ACTION toggleOPVoltages;
static TOOL_ACTION toggleOPCurrents;
static TOOL_ACTION toggleSyncedPinsMode;
static TOOL_ACTION restartMove;
static TOOL_ACTION selectOnPCB;

View File

@ -2153,6 +2153,30 @@ int SCH_EDITOR_CONTROL::ToggleERCExclusions( const TOOL_EVENT& aEvent )
}
int SCH_EDITOR_CONTROL::ToggleOPVoltages( const TOOL_EVENT& aEvent )
{
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
cfg->m_Appearance.show_op_voltages = !cfg->m_Appearance.show_op_voltages;
getView()->SetLayerVisible( LAYER_OP_VOLTAGES, cfg->m_Appearance.show_op_voltages );
m_frame->RefreshOperatingPointDisplay();
return 0;
}
int SCH_EDITOR_CONTROL::ToggleOPCurrents( const TOOL_EVENT& aEvent )
{
EESCHEMA_SETTINGS* cfg = m_frame->eeconfig();
cfg->m_Appearance.show_op_currents = !cfg->m_Appearance.show_op_currents;
getView()->SetLayerVisible( LAYER_OP_CURRENTS, cfg->m_Appearance.show_op_currents );
m_frame->RefreshOperatingPointDisplay();
return 0;
}
int SCH_EDITOR_CONTROL::ChangeLineMode( const TOOL_EVENT& aEvent )
{
m_frame->eeconfig()->m_Drawing.line_mode = aEvent.Parameter<int>();
@ -2347,6 +2371,8 @@ void SCH_EDITOR_CONTROL::setTransitions()
Go( &SCH_EDITOR_CONTROL::ToggleERCWarnings, EE_ACTIONS::toggleERCWarnings.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleERCErrors, EE_ACTIONS::toggleERCErrors.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleERCExclusions, EE_ACTIONS::toggleERCExclusions.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleOPVoltages, EE_ACTIONS::toggleOPVoltages.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ToggleOPCurrents, EE_ACTIONS::toggleOPCurrents.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineModeFree.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineMode90.MakeEvent() );
Go( &SCH_EDITOR_CONTROL::ChangeLineMode, EE_ACTIONS::lineMode45.MakeEvent() );

View File

@ -132,6 +132,8 @@ public:
int ToggleERCWarnings( const TOOL_EVENT& aEvent );
int ToggleERCErrors( const TOOL_EVENT& aEvent );
int ToggleERCExclusions( const TOOL_EVENT& aEvent );
int ToggleOPVoltages( const TOOL_EVENT& aEvent );
int ToggleOPCurrents( const TOOL_EVENT& aEvent );
int ChangeLineMode( const TOOL_EVENT& aEvent );
int NextLineMode( const TOOL_EVENT& aEvent );
int ToggleAnnotateAuto( const TOOL_EVENT& aEvent );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009-2014 Jerry Jacobs
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -71,6 +71,13 @@ int Clamp_Text_PenSize( int aPenSize, const VECTOR2I& aSize, bool aStrict = fals
int GetPenSizeForBold( int aTextSize );
int GetPenSizeForBold( const wxSize& aTextSize );
/**
* @param aTextSize the char size (height or width).
* @return the "best" value for a pen size to draw/plot a demibold text.
*/
int GetPenSizeForDemiBold( int aTextSize );
int GetPenSizeForDemiBold( const wxSize& aTextSize );
/**
* @param aTextSize = the char size (height or width).
* @return the "best" value for a pen size to draw/plot a non-bold text.

View File

@ -384,6 +384,8 @@ enum SCH_LAYER_ID: int
LAYER_BUS_JUNCTION,
LAYER_SCHEMATIC_AUX_ITEMS,
LAYER_SCHEMATIC_ANCHOR,
LAYER_OP_VOLTAGES,
LAYER_OP_CURRENTS,
SCH_LAYER_ID_END
};

View File

@ -209,25 +209,30 @@
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_label_syntax": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "warning",
"no_connect_dangling": "warning",
"pin_not_connected": "error",
"pin_not_driven": "error",
"pin_to_pin": "warning",
"pin_to_pin": "error",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "error",
@ -298,6 +303,10 @@
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~V",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
@ -319,7 +328,9 @@
"page_layout_descr_file": "",
"plot_directory": "",
"spice_adjust_passive_values": false,
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,