95 changed files with 845 additions and 884 deletions
-
6common/lib_tree_model.cpp
-
2eeschema/CMakeLists.txt
-
16eeschema/connection_graph.cpp
-
6eeschema/dialogs/dialog_field_properties.cpp
-
2eeschema/dialogs/dialog_lib_shape_properties.cpp
-
4eeschema/dialogs/dialog_lib_symbol_properties.cpp
-
13eeschema/dialogs/dialog_lib_text_properties.cpp
-
2eeschema/dialogs/dialog_lib_textbox_properties.cpp
-
40eeschema/dialogs/dialog_pin_properties.cpp
-
2eeschema/dialogs/dialog_plot_schematic.cpp
-
2eeschema/dialogs/dialog_sim_model.cpp
-
6eeschema/dialogs/dialog_symbol_properties.cpp
-
4eeschema/dialogs/panel_eeschema_color_settings.cpp
-
13eeschema/eeschema_jobs_handler.cpp
-
8eeschema/eeschema_jobs_handler.h
-
2eeschema/erc.cpp
-
24eeschema/lib_field.cpp
-
4eeschema/lib_field.h
-
12eeschema/lib_item.cpp
-
30eeschema/lib_item.h
-
46eeschema/lib_pin.cpp
-
9eeschema/lib_pin.h
-
33eeschema/lib_shape.cpp
-
4eeschema/lib_shape.h
-
231eeschema/lib_symbol.cpp
-
142eeschema/lib_symbol.h
-
8eeschema/lib_text.cpp
-
4eeschema/lib_text.h
-
28eeschema/lib_textbox.cpp
-
4eeschema/lib_textbox.h
-
4eeschema/printing/sch_printout.cpp
-
4eeschema/sch_base_frame.cpp
-
8eeschema/sch_base_frame.h
-
2eeschema/sch_bitmap.cpp
-
2eeschema/sch_bitmap.h
-
13eeschema/sch_bus_entry.cpp
-
2eeschema/sch_bus_entry.h
-
4eeschema/sch_commit.cpp
-
17eeschema/sch_edit_frame.cpp
-
2eeschema/sch_field.cpp
-
2eeschema/sch_field.h
-
4eeschema/sch_io/kicad_legacy/sch_io_kicad_legacy_lib_cache.cpp
-
6eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_lib_cache.cpp
-
9eeschema/sch_item.cpp
-
102eeschema/sch_item.h
-
2eeschema/sch_junction.cpp
-
2eeschema/sch_junction.h
-
4eeschema/sch_label.cpp
-
2eeschema/sch_label.h
-
4eeschema/sch_line.cpp
-
2eeschema/sch_line.h
-
2eeschema/sch_marker.cpp
-
2eeschema/sch_marker.h
-
2eeschema/sch_no_connect.cpp
-
2eeschema/sch_no_connect.h
-
63eeschema/sch_painter.cpp
-
66eeschema/sch_painter.h
-
2eeschema/sch_pin.cpp
-
2eeschema/sch_pin.h
-
6eeschema/sch_preview_panel.cpp
-
5eeschema/sch_preview_panel.h
-
82eeschema/sch_render_settings.cpp
-
100eeschema/sch_render_settings.h
-
2eeschema/sch_screen.cpp
-
2eeschema/sch_screen.h
-
4eeschema/sch_shape.cpp
-
4eeschema/sch_shape.h
-
29eeschema/sch_sheet.cpp
-
2eeschema/sch_sheet.h
-
4eeschema/sch_sheet_path.cpp
-
2eeschema/sch_sheet_pin.cpp
-
2eeschema/sch_sheet_pin.h
-
93eeschema/sch_symbol.cpp
-
64eeschema/sch_symbol.h
-
4eeschema/sch_table.cpp
-
2eeschema/sch_table.h
-
4eeschema/sch_tablecell.cpp
-
2eeschema/sch_tablecell.h
-
4eeschema/sch_text.cpp
-
2eeschema/sch_text.h
-
4eeschema/sch_textbox.cpp
-
2eeschema/sch_textbox.h
-
2eeschema/sheet.cpp
-
52eeschema/symbol.cpp
-
147eeschema/symbol.h
-
11eeschema/symbol_editor/symbol_editor_plotter.cpp
-
2eeschema/symbol_viewer_frame.cpp
-
4eeschema/tools/symbol_editor_control.cpp
-
2eeschema/tools/symbol_editor_drawing_tools.cpp
-
4eeschema/tools/symbol_editor_edit_tool.cpp
-
17eeschema/tools/symbol_editor_pin_tool.cpp
-
3eeschema/widgets/symbol_diff_widget.cpp
-
7eeschema/widgets/symbol_preview_widget.cpp
-
2include/lib_tree_item.h
-
6include/render_settings.h
@ -0,0 +1,82 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 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 Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <pgm_base.h>
|
|||
#include <kiface_base.h>
|
|||
#include <advanced_config.h>
|
|||
#include <settings/settings_manager.h>
|
|||
#include <eeschema_settings.h>
|
|||
#include <default_values.h>
|
|||
#include <sch_render_settings.h>
|
|||
|
|||
|
|||
SCH_RENDER_SETTINGS::SCH_RENDER_SETTINGS() : |
|||
m_IsSymbolEditor( false ), |
|||
m_ShowUnit( 0 ), |
|||
m_ShowBodyStyle( 0 ), |
|||
m_ShowPinsElectricalType( true ), |
|||
m_ShowHiddenLibPins( true ), // Force showing of hidden pin ( symbol editor specific)
|
|||
m_ShowHiddenLibFields( true ), // Force showing of hidden fields ( symbol editor specific)
|
|||
m_ShowVisibleLibFields( true ), |
|||
m_ShowPinNumbers( false ), |
|||
m_ShowPinNames( false ), |
|||
m_ShowPinElectricalTypes( false ), |
|||
m_ShowDisabled( false ), |
|||
m_ShowGraphicsDisabled( false ), |
|||
m_ShowConnectionPoints( false ), |
|||
m_OverrideItemColors( false ), |
|||
m_LabelSizeRatio( DEFAULT_LABEL_SIZE_RATIO ), |
|||
m_TextOffsetRatio( DEFAULT_TEXT_OFFSET_RATIO ), |
|||
m_PinSymbolSize( DEFAULT_TEXT_SIZE * schIUScale.IU_PER_MILS / 2 ), |
|||
m_Transform() |
|||
{ |
|||
SetDefaultPenWidth( DEFAULT_LINE_WIDTH_MILS * schIUScale.IU_PER_MILS ); |
|||
SetDashLengthRatio( 12 ); // From ISO 128-2
|
|||
SetGapLengthRatio( 3 ); // From ISO 128-2
|
|||
|
|||
m_minPenWidth = KiROUND( ADVANCED_CFG::GetCfg().m_MinPlotPenWidth * schIUScale.IU_PER_MM ); |
|||
} |
|||
|
|||
|
|||
void SCH_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings ) |
|||
{ |
|||
for( int layer = SCH_LAYER_ID_START; layer < SCH_LAYER_ID_END; layer ++) |
|||
m_layerColors[ layer ] = aSettings->GetColor( layer ); |
|||
|
|||
for( int layer = GAL_LAYER_ID_START; layer < GAL_LAYER_ID_END; layer ++) |
|||
m_layerColors[ layer ] = aSettings->GetColor( layer ); |
|||
|
|||
m_backgroundColor = aSettings->GetColor( LAYER_SCHEMATIC_BACKGROUND ); |
|||
|
|||
m_layerColors[LAYER_AUX_ITEMS] = m_layerColors[LAYER_SCHEMATIC_AUX_ITEMS]; |
|||
|
|||
m_OverrideItemColors = aSettings->GetOverrideSchItemColors(); |
|||
} |
|||
|
|||
|
|||
bool SCH_RENDER_SETTINGS::GetShowPageLimits() const |
|||
{ |
|||
EESCHEMA_SETTINGS* cfg = dynamic_cast<EESCHEMA_SETTINGS*>( Kiface().KifaceSettings() ); |
|||
return cfg && cfg->m_Appearance.show_page_limits && !IsPrinting(); |
|||
} |
|||
|
|||
@ -0,0 +1,100 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 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 Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef SCH_RENDER_SETTINGS_H |
|||
#define SCH_RENDER_SETTINGS_H |
|||
|
|||
#include <gal/color4d.h> |
|||
#include <render_settings.h> |
|||
#include <transform.h> |
|||
|
|||
|
|||
using KIGFX::COLOR4D; |
|||
|
|||
|
|||
class SCH_RENDER_SETTINGS : public KIGFX::RENDER_SETTINGS |
|||
{ |
|||
public: |
|||
SCH_RENDER_SETTINGS(); |
|||
|
|||
void LoadColors( const COLOR_SETTINGS* aSettings ) override; |
|||
|
|||
virtual COLOR4D GetColor( const KIGFX::VIEW_ITEM* aItem, int aLayer ) const override |
|||
{ |
|||
return m_layerColors[ aLayer ]; |
|||
} |
|||
|
|||
bool IsBackgroundDark() const override |
|||
{ |
|||
return m_layerColors[ LAYER_SCHEMATIC_BACKGROUND ].GetBrightness() < 0.5; |
|||
} |
|||
|
|||
const KIGFX::COLOR4D& GetBackgroundColor() const override |
|||
{ |
|||
return m_layerColors[ LAYER_SCHEMATIC_BACKGROUND ]; |
|||
} |
|||
|
|||
void SetBackgroundColor( const COLOR4D& aColor ) override |
|||
{ |
|||
m_layerColors[ LAYER_SCHEMATIC_BACKGROUND ] = aColor; |
|||
} |
|||
|
|||
float GetDanglingIndicatorThickness() const |
|||
{ |
|||
return (float) m_defaultPenWidth / 3.0F; |
|||
} |
|||
|
|||
const COLOR4D& GetGridColor() override { return m_layerColors[ LAYER_SCHEMATIC_GRID ]; } |
|||
const COLOR4D& GetCursorColor() override { return m_layerColors[ LAYER_SCHEMATIC_CURSOR ]; } |
|||
|
|||
bool GetShowPageLimits() const override; |
|||
|
|||
public: |
|||
bool m_IsSymbolEditor; |
|||
|
|||
int m_ShowUnit; // Show all units if 0 |
|||
int m_ShowBodyStyle; // Show all body styles if 0 |
|||
|
|||
bool m_ShowPinsElectricalType; |
|||
bool m_ShowHiddenLibPins; // Force showing of hidden pin ( symbol editor specific) |
|||
bool m_ShowHiddenLibFields; // Force showing of hidden fields ( symbol editor specific) |
|||
bool m_ShowVisibleLibFields; |
|||
bool m_ShowPinNumbers; // Force showing of pin numbers (normally symbol-specific) |
|||
bool m_ShowPinNames; // Force showing of pin names (normally symbol-specific) |
|||
bool m_ShowPinElectricalTypes; |
|||
bool m_ShowDisabled; |
|||
bool m_ShowGraphicsDisabled; |
|||
bool m_ShowConnectionPoints; |
|||
|
|||
bool m_OverrideItemColors; |
|||
|
|||
double m_LabelSizeRatio; // Proportion of font size to label box |
|||
double m_TextOffsetRatio; // Proportion of font size to offset text above/below |
|||
// wires, buses, etc. |
|||
int m_PinSymbolSize; |
|||
|
|||
TRANSFORM m_Transform; |
|||
}; |
|||
|
|||
|
|||
#endif /* SCH_RENDER_SETTINGS_H */ |
|||
@ -0,0 +1,52 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 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 Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#include <symbol.h>
|
|||
|
|||
|
|||
void SYMBOL::ViewGetLayers( int aLayers[], int& aCount ) const |
|||
{ |
|||
aCount = 0; |
|||
|
|||
// Pins are drawn by their parent symbol, so the parent must draw to LAYER_DANGLING
|
|||
if( Type() == SCH_SYMBOL_T ) |
|||
aLayers[aCount++] = LAYER_DANGLING; |
|||
|
|||
// Same for operating point currents
|
|||
if( Type() == SCH_SYMBOL_T ) |
|||
aLayers[aCount++] = LAYER_OP_CURRENTS; |
|||
|
|||
aLayers[aCount++] = LAYER_DEVICE; |
|||
aLayers[aCount++] = LAYER_REFERENCEPART; |
|||
aLayers[aCount++] = LAYER_VALUEPART; |
|||
aLayers[aCount++] = LAYER_FIELDS; |
|||
|
|||
if( Type() == LIB_SYMBOL_T ) |
|||
aLayers[aCount++] = LAYER_PRIVATE_NOTES; |
|||
|
|||
aLayers[aCount++] = LAYER_DEVICE_BACKGROUND; |
|||
aLayers[aCount++] = LAYER_NOTES_BACKGROUND; |
|||
aLayers[aCount++] = LAYER_SELECTION_SHADOWS; |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,147 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2024 KiCad Developers, see change_log.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 Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef SYMBOL_H |
|||
#define SYMBOL_H |
|||
|
|||
#include <lib_id.h> |
|||
#include <sch_item.h> |
|||
|
|||
/** |
|||
* A base class for LIB_SYMBOL and SCH_SYMBOL. |
|||
*/ |
|||
class SYMBOL : public SCH_ITEM |
|||
{ |
|||
public: |
|||
void init() |
|||
{ |
|||
m_pinNameOffset = 0; |
|||
m_showPinNames = true; |
|||
m_showPinNumbers = true; |
|||
m_excludedFromSim = false; |
|||
m_excludedFromBOM = false; |
|||
m_excludedFromBoard = false; |
|||
}; |
|||
|
|||
SYMBOL( KICAD_T idType ) : |
|||
SCH_ITEM( nullptr, idType ) |
|||
{ |
|||
init(); |
|||
}; |
|||
|
|||
SYMBOL( EDA_ITEM* aParent, KICAD_T idType ) : |
|||
SCH_ITEM( aParent, idType ) |
|||
{ |
|||
init(); |
|||
}; |
|||
|
|||
SYMBOL( const SYMBOL& base ) : |
|||
SCH_ITEM( base ), |
|||
m_pinNameOffset( base.m_pinNameOffset ), |
|||
m_showPinNames( base.m_showPinNames ), |
|||
m_showPinNumbers( base.m_showPinNumbers ), |
|||
m_excludedFromSim( base.m_excludedFromSim ), |
|||
m_excludedFromBOM( base.m_excludedFromBOM ), |
|||
m_excludedFromBoard( base.m_excludedFromBoard ) |
|||
{ }; |
|||
|
|||
virtual ~SYMBOL() { }; |
|||
|
|||
virtual const LIB_ID& GetLibId() const = 0; |
|||
virtual wxString GetDescription() const = 0; |
|||
virtual wxString GetKeyWords() const = 0; |
|||
|
|||
virtual bool IsPower() const = 0; |
|||
virtual bool IsNormal() const = 0; |
|||
|
|||
/** |
|||
* Test if symbol has more than one body conversion type (DeMorgan). |
|||
* |
|||
* @return True if symbol has more than one conversion. |
|||
*/ |
|||
virtual bool HasAlternateBodyStyle() const = 0; |
|||
|
|||
/** |
|||
* @return true if the symbol has multiple units per symbol. |
|||
*/ |
|||
virtual bool IsMulti() const = 0; |
|||
|
|||
/** |
|||
* @return the number of units defined for the symbol. |
|||
*/ |
|||
virtual int GetUnitCount() const = 0; |
|||
|
|||
/** |
|||
* Set the offset in mils of the pin name text from the pin symbol. |
|||
* |
|||
* Set the offset to 0 to draw the pin name above the pin symbol. |
|||
* |
|||
* @param aOffset - The offset in mils. |
|||
*/ |
|||
void SetPinNameOffset( int aOffset ) { m_pinNameOffset = aOffset; } |
|||
int GetPinNameOffset() const { return m_pinNameOffset; } |
|||
|
|||
/** |
|||
* Set or clear the pin name visibility flag. |
|||
*/ |
|||
void SetShowPinNames( bool aShow ) { m_showPinNames = aShow; } |
|||
bool GetShowPinNames() const { return m_showPinNames; } |
|||
|
|||
/** |
|||
* Set or clear the pin number visibility flag. |
|||
*/ |
|||
void SetShowPinNumbers( bool aShow ) { m_showPinNumbers = aShow; } |
|||
bool GetShowPinNumbers() const { return m_showPinNumbers; } |
|||
|
|||
/** |
|||
* Set or clear the exclude from simulation flag. |
|||
*/ |
|||
void SetExcludedFromSim( bool aExcludeFromSim ) override { m_excludedFromSim = aExcludeFromSim; } |
|||
bool GetExcludedFromSim() const override { return m_excludedFromSim; } |
|||
|
|||
/** |
|||
* Set or clear the exclude from schematic bill of materials flag. |
|||
*/ |
|||
void SetExcludedFromBOM( bool aExcludeFromBOM ) { m_excludedFromBOM = aExcludeFromBOM; } |
|||
bool GetExcludedFromBOM() const { return m_excludedFromBOM; } |
|||
|
|||
/** |
|||
* Set or clear exclude from board netlist flag. |
|||
*/ |
|||
void SetExcludedFromBoard( bool aExcludeFromBoard ) { m_excludedFromBoard = aExcludeFromBoard; } |
|||
bool GetExcludedFromBoard() const { return m_excludedFromBoard; } |
|||
|
|||
void ViewGetLayers( int aLayers[], int& aCount ) const override; |
|||
|
|||
protected: |
|||
int m_pinNameOffset; ///< The offset in mils to draw the pin name. Set to |
|||
///< 0 to draw the pin name above the pin. |
|||
bool m_showPinNames; |
|||
bool m_showPinNumbers; |
|||
|
|||
bool m_excludedFromSim; |
|||
bool m_excludedFromBOM; |
|||
bool m_excludedFromBoard; |
|||
}; |
|||
|
|||
#endif // SYMBOL_H |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue