mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 00:21:31 +00:00
Fix more broken Doxygen comment specifiers.
This commit is contained in:
parent
5a90643b8b
commit
4619d5e112
cvpcb
eeschema
bom_plugins.h
dialogs
netlist_exporters
sch_draw_panel.hsch_plugins/eagle
sch_preview_panel.hsch_reference_list.hsch_sheet_path.hsim
netlist_exporter_pspice_sim.hngspice.hsim_plot_frame.hsim_plot_panel.hsim_types.hspice_simulator.hspice_value.h
symbol_editor
symbol_tree_synchronizing_adapter.htools
backannotate.hee_actions.hee_inspection_tool.hee_point_editor.hee_selection_tool.hee_tool_base.hreannotate.hsch_drawing_tools.hsch_edit_tool.hsch_editor_control.hsch_line_wire_bus_tool.hsch_move_tool.hsch_navigate_tool.hsymbol_editor_control.hsymbol_editor_edit_tool.hsymbol_editor_move_tool.hsymbol_editor_pin_tool.h
widgets
gerbview
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
|
||||
* Copyright (C) 2007-2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2007-2021 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
|
||||
@ -38,8 +38,7 @@ class REPORTER;
|
||||
|
||||
|
||||
/**
|
||||
* DISPLAY_FOOTPRINTS_FRAME
|
||||
* is used to display footprints.
|
||||
* Display footprints.
|
||||
*/
|
||||
class DISPLAY_FOOTPRINTS_FRAME : public PCB_BASE_FRAME
|
||||
{
|
||||
@ -54,18 +53,17 @@ public:
|
||||
void ReCreateOptToolbar() override;
|
||||
|
||||
/**
|
||||
* Function InitDisplay
|
||||
* Refresh the full display for this frame:
|
||||
* Set the title, the status line and redraw the canvas
|
||||
* Must be called after the footprint to display is modifed
|
||||
* Must be called after the footprint to display is modified
|
||||
*/
|
||||
void InitDisplay();
|
||||
|
||||
///> @copydoc PCB_BASE_FRAME::GetModel()
|
||||
///< @copydoc PCB_BASE_FRAME::GetModel()
|
||||
BOARD_ITEM_CONTAINER* GetModel() const override;
|
||||
|
||||
/**
|
||||
* update the gal canvas (view, colors ...)
|
||||
* Update the gal canvas (view, colors ...).
|
||||
*/
|
||||
void updateView();
|
||||
|
||||
@ -76,22 +74,20 @@ public:
|
||||
|
||||
MAGNETIC_SETTINGS* GetMagneticItemsSettings() override;
|
||||
|
||||
///> @copydoc EDA_DRAW_FRAME::UpdateMsgPanel()
|
||||
///< @copydoc EDA_DRAW_FRAME::UpdateMsgPanel()
|
||||
void UpdateMsgPanel() override;
|
||||
|
||||
COLOR_SETTINGS* GetColorSettings() const override;
|
||||
|
||||
/**
|
||||
* Function GetGridColor() , virtual
|
||||
* @return the color of the grid
|
||||
* @return the color of the grid.
|
||||
*/
|
||||
COLOR4D GetGridColor() override;
|
||||
|
||||
FOOTPRINT* GetFootprint( const wxString& aFootprintName, REPORTER& aReporter );
|
||||
|
||||
/* SaveCopyInUndoList() virtual
|
||||
* currently: do nothing in CvPcb.
|
||||
* but but be defined because it is a pure virtual in PCB_BASE_FRAME
|
||||
/**
|
||||
* Does nothing in CvPcb but defined because it is a pure virtual in #PCB_BASE_FRAME.
|
||||
*/
|
||||
void SaveCopyInUndoList( EDA_ITEM* aItemToCopy, UNDO_REDO aTypeCommand = UNDO_REDO::UNSPECIFIED,
|
||||
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
|
||||
@ -100,13 +96,14 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
* Function SaveCopyInUndoList (overloaded).
|
||||
* Creates a new entry in undo list of commands.
|
||||
* add a list of pickers to handle a list of items
|
||||
* @param aItemsList = the list of items modified by the command to undo
|
||||
* @param aTypeCommand = command type (see enum UNDO_REDO)
|
||||
* @param aTransformPoint = the reference point of the transformation,
|
||||
* for commands like move
|
||||
* Create a new entry in undo list of commands.
|
||||
*
|
||||
* Add a list of pickers to handle a list of items.
|
||||
*
|
||||
* @param aItemsList is the list of items modified by the command to undo
|
||||
* @param aTypeCommand is command type (see enum UNDO_REDO)
|
||||
* @param aTransformPoint is the reference point of the transformation,
|
||||
* for commands like move
|
||||
*/
|
||||
void SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList, UNDO_REDO aTypeCommand,
|
||||
const wxPoint& aTransformPoint = wxPoint( 0, 0 ) ) override
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2013-2016 CERN
|
||||
* Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -32,10 +32,10 @@
|
||||
class TOOL_ACTION;
|
||||
|
||||
/**
|
||||
* CVPCB_ACTIONS
|
||||
* Gather all the actions that are shared by tools.
|
||||
*
|
||||
* Gathers all the actions that are shared by tools. The instance of CVPCB_ACTIONS is created
|
||||
* inside of ACTION_MANAGER object that registers the actions.
|
||||
* The instance of CVPCB_ACTIONS is created inside of ACTION_MANAGER object that registers
|
||||
* the actions.
|
||||
*/
|
||||
class CVPCB_ACTIONS : public ACTIONS
|
||||
{
|
||||
@ -70,7 +70,7 @@ public:
|
||||
static TOOL_ACTION filterFPbyPin;
|
||||
static TOOL_ACTION FilterFPbyLibrary;
|
||||
|
||||
///> @copydoc COMMON_ACTIONS::TranslateLegacyId()
|
||||
///< @copydoc COMMON_ACTIONS::TranslateLegacyId()
|
||||
virtual OPT<TOOL_EVENT> TranslateLegacyId( int aId ) override { return OPT<TOOL_EVENT>(); }
|
||||
};
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-2021 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
|
||||
@ -29,8 +29,6 @@
|
||||
|
||||
|
||||
/**
|
||||
* CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL
|
||||
*
|
||||
* Selection tool for the footprint viewer in cvpcb.
|
||||
*/
|
||||
class CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL : public TOOL_INTERACTIVE
|
||||
@ -46,8 +44,6 @@ public:
|
||||
void Reset( RESET_REASON aReason ) override;
|
||||
|
||||
/**
|
||||
* Function Main()
|
||||
*
|
||||
* The main loop.
|
||||
*/
|
||||
int Main( const TOOL_EVENT& aEvent );
|
||||
@ -69,7 +65,7 @@ public:
|
||||
*/
|
||||
int UpdateMenu( const TOOL_EVENT& aEvent );
|
||||
|
||||
///> Sets up handlers for various events.
|
||||
///< Sets up handlers for various events.
|
||||
void setTransitions() override;
|
||||
|
||||
private:
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -32,11 +34,11 @@
|
||||
#include <memory>
|
||||
|
||||
/**
|
||||
* Class handling a Bill of Material output generator.
|
||||
* Bill of material output generator.
|
||||
*
|
||||
* A Material output generator is an external application called by Eeschema to create
|
||||
* a BOM from our intermediate xml netlist.
|
||||
* A generator can be a script or an executable that can read the intermediate xml netlist
|
||||
* file and generates a output (the BOM file)
|
||||
* a BOM from our intermediate XML netlist. A generator can be a script or an executable
|
||||
* that can read the intermediate XML netlist file and generates a output (the BOM file)
|
||||
*/
|
||||
class BOM_GENERATOR_HANDLER
|
||||
{
|
||||
@ -44,25 +46,24 @@ public:
|
||||
typedef std::unique_ptr<BOM_GENERATOR_HANDLER> PTR;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param aFile is path to the plugin file.
|
||||
*/
|
||||
BOM_GENERATOR_HANDLER( const wxString& aFile );
|
||||
|
||||
/**
|
||||
* Returns true if the plugin is ready to work, i.e. if the plugin file
|
||||
* is found an readable
|
||||
* Return true if the plugin is ready to work, i.e. if the plugin file is found and readable.
|
||||
*/
|
||||
bool IsOk() { return m_isOk; }
|
||||
|
||||
/**
|
||||
* Returns true if a file name matches a recognized plugin format.
|
||||
* Return true if a file name matches a recognized plugin format.
|
||||
*
|
||||
* @param aFile is path to the plugin file.
|
||||
*/
|
||||
static bool IsValidGenerator( const wxString& aFile );
|
||||
|
||||
/**
|
||||
* Returns plugin description stored in the plugin header file (if available).
|
||||
* Return plugin description stored in the plugin header file (if available).
|
||||
*/
|
||||
const wxString& GetInfo() const
|
||||
{
|
||||
@ -70,7 +71,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the file name of the plugin.
|
||||
* Return the file name of the plugin.
|
||||
*/
|
||||
const wxFileName& GetFile() const
|
||||
{
|
||||
@ -78,7 +79,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the customisable plugin name.
|
||||
* Return the customisable plugin name.
|
||||
*/
|
||||
const wxString& GetName() const
|
||||
{
|
||||
@ -86,7 +87,8 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the customisable plugin name.
|
||||
* Set the customisable plugin name.
|
||||
*
|
||||
* @param aName is the new name.
|
||||
*/
|
||||
void SetName( const wxString& aName )
|
||||
@ -95,7 +97,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the command to execute the plugin.
|
||||
* Return the command to execute the plugin.
|
||||
*/
|
||||
const wxString& GetCommand() const
|
||||
{
|
||||
@ -103,7 +105,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the command to execute the plugin.
|
||||
* Set the command to execute the plugin.
|
||||
*/
|
||||
void SetCommand( const wxString& aCommand )
|
||||
{
|
||||
@ -120,27 +122,28 @@ public:
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Reads the plugin file header.
|
||||
* Read the plugin file header.
|
||||
*
|
||||
* @param aEndSection is a string marking end of the header.
|
||||
*/
|
||||
wxString readHeader( const wxString& aEndSection );
|
||||
|
||||
///> true if the plugin is working (i.e. if the plugin file exists and was read
|
||||
///< true if the plugin is working (i.e. if the plugin file exists and was read
|
||||
bool m_isOk;
|
||||
|
||||
///> Path to the plugin
|
||||
///< Path to the plugin
|
||||
const wxFileName m_file;
|
||||
|
||||
///> User customisable name
|
||||
///< User customisable name
|
||||
wxString m_name;
|
||||
|
||||
///> Command to execute the plugin
|
||||
///< Command to execute the plugin
|
||||
wxString m_cmd;
|
||||
|
||||
///> Description of the plugin (normally from the plugin header)
|
||||
///< Description of the plugin (normally from the plugin header)
|
||||
wxString m_info;
|
||||
|
||||
///> Plugin specific options
|
||||
///< Plugin specific options
|
||||
wxArrayString m_options;
|
||||
};
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2020 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Wayne Stambaugh <stambaughw@gmail.com>
|
||||
*
|
||||
@ -63,7 +64,7 @@ protected:
|
||||
checkAll( false );
|
||||
}
|
||||
|
||||
///> Selects or deselects all fields in the listbox widget
|
||||
///< Select or deselect all fields in the listbox widget
|
||||
void checkAll( bool aCheck );
|
||||
|
||||
private:
|
||||
@ -77,7 +78,7 @@ private:
|
||||
SCH_COMPONENT* m_symbol;
|
||||
MODE m_mode;
|
||||
|
||||
///> Set of field names that should have values updated
|
||||
///< Set of field names that should have values updated
|
||||
std::set<wxString> m_updateFields;
|
||||
};
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016-2017 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -45,30 +47,35 @@ public:
|
||||
|
||||
private:
|
||||
/**
|
||||
* Parse a string describing a power source, so appropriate settings are checked in the dialog
|
||||
* Parse a string describing a power source, so appropriate settings are checked in the dialog.
|
||||
*
|
||||
* @param aModel contains the string to be parse (e.g. sin(0 1 10k))
|
||||
* @return True if the input string was parsed without errors.
|
||||
*/
|
||||
bool parsePowerSource( const wxString& aModel );
|
||||
|
||||
/**
|
||||
* Generates a string to describe power source parameters, basing on the current selection.
|
||||
* Generate a string to describe power source parameters, basing on the current selection.
|
||||
*
|
||||
* If there are missing fields, it will not modify the target string.
|
||||
*
|
||||
* @param aTarget is the destination for the generated string.
|
||||
* @return True if the string was saved successfully.
|
||||
*/
|
||||
bool generatePowerSource( wxString& aTarget ) const;
|
||||
|
||||
/**
|
||||
* Loads a list of components (.model and .subckt) from a spice library
|
||||
* file and adds them to a combo box.
|
||||
* Load a list of components (.model and .subckt) from a spice library file and add them to
|
||||
* a combo box.
|
||||
*
|
||||
* @param aComboBox is the target combo box
|
||||
* @param aFilePath is path to the library file
|
||||
*/
|
||||
void loadLibrary( const wxString& aFilePath );
|
||||
|
||||
/**
|
||||
* Returns or creates a field in the edited schematic fields vector.
|
||||
* Return or create a field in the edited schematic fields vector.
|
||||
*
|
||||
* @param aFieldType is an SPICE_FIELD enum value.
|
||||
* @return Requested field.
|
||||
*/
|
||||
@ -76,7 +83,8 @@ private:
|
||||
LIB_FIELD& getLibField( int aFieldType );
|
||||
|
||||
/**
|
||||
* Adds a value to the PWL values list.
|
||||
* Add a value to the PWL values list.
|
||||
*
|
||||
* @param aTime is the time value.
|
||||
* @param aValue is the source value at the given time.
|
||||
* @return True if request has completed successfully, false if the data is invalid.
|
||||
@ -88,7 +96,7 @@ private:
|
||||
|
||||
// The default dialog Validate() calls the validators of all widgets.
|
||||
// This is not what we want; We want only validators of the selected page
|
||||
// of the notbooks. So disable the wxDialog::Validate(), and let our
|
||||
// of the notebooks. So disable the wxDialog::Validate(), and let our
|
||||
// TransferDataFromWindow doing the job.
|
||||
virtual bool Validate() override
|
||||
{
|
||||
@ -105,7 +113,7 @@ private:
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the internal settings
|
||||
* Initialize the internal settings.
|
||||
*/
|
||||
void Init();
|
||||
|
||||
@ -122,26 +130,26 @@ private:
|
||||
void onRandomSourceType( wxCommandEvent& event ) override;
|
||||
void onTypeSelected( wxCommandEvent& event ) override;
|
||||
|
||||
///> Edited component
|
||||
///< Edited component
|
||||
SCH_COMPONENT& m_component;
|
||||
|
||||
///> Fields from the component properties dialog
|
||||
///< Fields from the component properties dialog
|
||||
std::vector<SCH_FIELD>* m_schfields;
|
||||
std::vector<LIB_FIELD>* m_libfields;
|
||||
bool m_useSchFields;
|
||||
|
||||
///> Temporary field values
|
||||
///< Temporary field values
|
||||
std::map<int, wxString> m_fieldsTmp;
|
||||
|
||||
struct MODEL
|
||||
{
|
||||
///> Line number in the library file
|
||||
///< Line number in the library file
|
||||
int line;
|
||||
|
||||
///> Type of the device
|
||||
///< Type of the device
|
||||
SPICE_PRIMITIVE model;
|
||||
|
||||
///> Convert string to model
|
||||
///< Convert string to model
|
||||
static SPICE_PRIMITIVE parseModelType( const wxString& aValue );
|
||||
|
||||
MODEL( int aLine, enum SPICE_PRIMITIVE aModel )
|
||||
@ -150,10 +158,10 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
///> Models available in the selected library file
|
||||
///< Models available in the selected library file
|
||||
std::map<wxString, MODEL> m_models;
|
||||
|
||||
///> Column identifiers for PWL power source value list
|
||||
///< Column identifiers for PWL power source value list
|
||||
long m_pwlTimeCol, m_pwlValueCol;
|
||||
|
||||
SPICE_VALIDATOR m_spiceValidator;
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 1992-2013 jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 1992-2017 KiCad Developers
|
||||
* Copyright (C) 1992-2021 KiCad Developers
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@ -34,8 +34,8 @@ class PROJECT;
|
||||
|
||||
/// Flags for Spice netlist generation (can be combined)
|
||||
enum SPICE_NETLIST_OPTIONS {
|
||||
NET_ADJUST_INCLUDE_PATHS = 8, // use full paths for included files (if they are in search path)
|
||||
NET_ADJUST_PASSIVE_VALS = 16, // reformat passive component values (e.g. 1M -> 1Meg)
|
||||
NET_ADJUST_INCLUDE_PATHS = 8, // use full paths for included files (if they are in search path)
|
||||
NET_ADJUST_PASSIVE_VALS = 16, // reformat passive component values (e.g. 1M -> 1Meg)
|
||||
NET_ALL_FLAGS = 0xffff
|
||||
};
|
||||
|
||||
@ -48,7 +48,7 @@ enum SPICE_FIELD {
|
||||
SF_END // sentinel
|
||||
};
|
||||
|
||||
///> Basic Spice component primitives
|
||||
///< Basic Spice component primitives
|
||||
enum SPICE_PRIMITIVE {
|
||||
SP_UNKNOWN = ' ',
|
||||
SP_RESISTOR = 'R',
|
||||
@ -63,40 +63,40 @@ enum SPICE_PRIMITIVE {
|
||||
SP_ISOURCE = 'I'
|
||||
};
|
||||
|
||||
/// @todo add NET_ADJUST_INCLUDE_PATHS & NET_ADJUST_PASSIVE_VALS checkboxes in the netlist export dialog
|
||||
/// @todo add NET_ADJUST_INCLUDE_PATHS & NET_ADJUST_PASSIVE_VALS checkboxes in the netlist
|
||||
/// export dialog.
|
||||
|
||||
/**
|
||||
* @brief Structure to represent a schematic component in the Spice simulation.
|
||||
* Structure to represent a schematic component in the Spice simulation.
|
||||
*/
|
||||
struct SPICE_ITEM
|
||||
{
|
||||
///> Schematic component represented by this SPICE_ITEM.
|
||||
///< Schematic component represented by this SPICE_ITEM.
|
||||
SCH_COMPONENT* m_parent;
|
||||
|
||||
///> Spice primitive type (@see SPICE_PRIMITIVE).
|
||||
///< Spice primitive type (@see SPICE_PRIMITIVE).
|
||||
wxChar m_primitive;
|
||||
|
||||
///> Library model (for semiconductors and subcircuits), component value (for passive components)
|
||||
///> or voltage/current (for sources).
|
||||
///< Library model (for semiconductors and subcircuits), component value (for passive
|
||||
///< components) or voltage/current (for sources).
|
||||
wxString m_model;
|
||||
|
||||
///>
|
||||
///<
|
||||
wxString m_refName;
|
||||
|
||||
///> Flag to indicate whether the component should be used in simulation.
|
||||
///< Flag to indicate whether the component should be used in simulation.
|
||||
bool m_enabled;
|
||||
|
||||
///> Array containing Standard Pin Name
|
||||
///< Array containing Standard Pin Name
|
||||
std::vector<wxString> m_pins;
|
||||
|
||||
///> Numeric indices into m_SortedComponentPinList
|
||||
///< Numeric indices into m_SortedComponentPinList
|
||||
std::vector<int> m_pinSequence;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* NETLIST_EXPORTER_PSPICE
|
||||
* generates a PSPICE compatible netlist
|
||||
* Generate a PSPICE compatible netlist.
|
||||
*/
|
||||
class NETLIST_EXPORTER_PSPICE : public NETLIST_EXPORTER_BASE
|
||||
{
|
||||
@ -112,11 +112,11 @@ public:
|
||||
|
||||
typedef std::list<SPICE_ITEM> SPICE_ITEM_LIST;
|
||||
|
||||
///> Net name to circuit node number mapping
|
||||
///< Net name to circuit node number mapping
|
||||
typedef std::map<wxString, int> NET_INDEX_MAP;
|
||||
|
||||
/**
|
||||
* @brief Returns list of items representing schematic components in the Spice world.
|
||||
* Return list of items representing schematic components in the Spice world.
|
||||
*/
|
||||
const SPICE_ITEM_LIST& GetSpiceItems() const
|
||||
{
|
||||
@ -124,7 +124,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns name of Spice device corresponding to a schematic component.
|
||||
* Return name of Spice device corresponding to a schematic component.
|
||||
*
|
||||
* @param aComponent is the component reference.
|
||||
* @return Spice device name or empty string if there is no such component in the netlist. The
|
||||
@ -135,16 +135,15 @@ public:
|
||||
wxString GetSpiceDevice( const wxString& aComponent ) const;
|
||||
|
||||
/**
|
||||
* Function WriteNetlist
|
||||
* writes to specified output file
|
||||
* Write to specified output file
|
||||
*/
|
||||
bool WriteNetlist( const wxString& aOutFileName, unsigned aNetlistOptions ) override;
|
||||
|
||||
///> @copydoc NETLIST_EXPORTER_BASE::Format()
|
||||
///< @copydoc NETLIST_EXPORTER_BASE::Format()
|
||||
bool Format( OUTPUTFORMATTER* aFormatter, unsigned aCtl );
|
||||
|
||||
/**
|
||||
* @brief Processes the netlist to create net mapping and a list of SPICE_ITEMs.
|
||||
* Process the netlist to create net mapping and a list of SPICE_ITEMs.
|
||||
* It is automatically called by WriteNetlist(), but might be used separately,
|
||||
* if only net mapping and the list of SPICE_ITEMs are required.
|
||||
* @return True if successful.
|
||||
@ -153,15 +152,14 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
* @brief some chars are not accepted in netnames in spice netlists.
|
||||
* for instance '(' and ')'
|
||||
* ReplaceForbiddenChars replace these chars by an underscore.
|
||||
* @param aNetName = the netname to modify.
|
||||
* Replace illegal spice net name characters with an underscore.
|
||||
*
|
||||
* @param aNetName is the net name to modify.
|
||||
*/
|
||||
static void ReplaceForbiddenChars( wxString& aNetName );
|
||||
|
||||
/**
|
||||
* @brief Returns a map of circuit nodes to net names.
|
||||
* Return a map of circuit nodes to net names.
|
||||
*/
|
||||
const NET_INDEX_MAP& GetNetIndexMap() const
|
||||
{
|
||||
@ -169,7 +167,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns a vector of component field names related to Spice simulation.
|
||||
* Return a vector of component field names related to Spice simulation.
|
||||
*/
|
||||
static const std::vector<wxString>& GetSpiceFields()
|
||||
{
|
||||
@ -177,7 +175,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns a string used for a particular component field related to Spice simulation.
|
||||
* Return a string used for a particular component field related to Spice simulation.
|
||||
*/
|
||||
static const wxString& GetSpiceFieldName( SPICE_FIELD aField )
|
||||
{
|
||||
@ -185,22 +183,23 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Retrieves either the requested field value or the default value.
|
||||
* Retrieve either the requested field value or the default value.
|
||||
*/
|
||||
static wxString GetSpiceField( SPICE_FIELD aField, SCH_COMPONENT* aComponent, unsigned aCtl );
|
||||
|
||||
/**
|
||||
* @brief Retrieves the default value for a given field.
|
||||
* Retrieve the default value for a given field.
|
||||
*/
|
||||
static wxString GetSpiceFieldDefVal( SPICE_FIELD aField, SCH_COMPONENT* aComponent, unsigned aCtl );
|
||||
static wxString GetSpiceFieldDefVal( SPICE_FIELD aField, SCH_COMPONENT* aComponent,
|
||||
unsigned aCtl );
|
||||
|
||||
/**
|
||||
* Updates the vector of Spice directives placed in the schematics.
|
||||
* Update the vector of Spice directives placed in the schematics.
|
||||
*/
|
||||
void UpdateDirectives( unsigned aCtl );
|
||||
|
||||
/**
|
||||
* @brief Returnss a vector of Spice directives found in the schematics.
|
||||
* Return a vector of Spice directives found in the schematics.
|
||||
*/
|
||||
const std::vector<wxString> GetDirectives() const
|
||||
{
|
||||
@ -208,7 +207,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Convertes typical boolean string values (no/yes, true/false, 1/0) to a boolean value.
|
||||
* Convert typical boolean string values (no/yes, true/false, 1/0) to a boolean value.
|
||||
*/
|
||||
static bool StringToBool( const wxString& aStr )
|
||||
{
|
||||
@ -223,24 +222,24 @@ public:
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Saves the Spice directives.
|
||||
* Save the Spice directives.
|
||||
*/
|
||||
virtual void writeDirectives( OUTPUTFORMATTER* aFormatter, unsigned aCtl ) const;
|
||||
|
||||
private:
|
||||
///> Spice simulation title found in the processed schematic sheet
|
||||
///< Spice simulation title found in the processed schematic sheet
|
||||
wxString m_title;
|
||||
|
||||
///> Spice directives found in the processed schematic sheet
|
||||
///< Spice directives found in the processed schematic sheet
|
||||
std::vector<wxString> m_directives;
|
||||
|
||||
///> Libraries used by the simulated circuit
|
||||
///< Libraries used by the simulated circuit
|
||||
std::set<wxString> m_libraries;
|
||||
|
||||
///> Maps circuit nodes to net names
|
||||
///< Map circuit nodes to net names
|
||||
NET_INDEX_MAP m_netMap;
|
||||
|
||||
///> List of items representing schematic components in the Spice world
|
||||
///< List of items representing schematic components in the Spice world
|
||||
SPICE_ITEM_LIST m_spiceItems;
|
||||
|
||||
// Component fields that are processed during netlist export & simulation
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2021 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
|
||||
@ -54,11 +54,11 @@ public:
|
||||
protected:
|
||||
virtual void onPaint( wxPaintEvent& WXUNUSED( aEvent ) ) override;
|
||||
|
||||
///> @copydoc EDA_DRAW_PANEL_GAL::OnShow()
|
||||
///< @copydoc EDA_DRAW_PANEL_GAL::OnShow()
|
||||
void OnShow() override;
|
||||
|
||||
void setDefaultLayerOrder(); ///> Reassigns layer order to the initial settings.
|
||||
void setDefaultLayerDeps(); ///> Sets rendering targets & dependencies for layers.
|
||||
void setDefaultLayerOrder(); ///< Reassign layer order to the initial settings.
|
||||
void setDefaultLayerDeps(); ///< Set rendering targets & dependencies for layers.
|
||||
};
|
||||
|
||||
#endif // __SCH_DRAW_PANEL_H
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* Copyright (C) 2017-2020 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2021 Kicad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
@ -66,7 +66,7 @@
|
||||
|
||||
|
||||
// Eagle schematic axes are aligned with x increasing left to right and Y increasing bottom to top
|
||||
// Kicad schematic axes are aligned with x increasing left to right and Y increasing top to bottom.
|
||||
// KiCad schematic axes are aligned with x increasing left to right and Y increasing top to bottom.
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -87,7 +87,8 @@ static const std::map<wxString, ELECTRICAL_PINTYPE> pinDirectionsMap = {
|
||||
|
||||
|
||||
/**
|
||||
* Provides an easy access to the children of an XML node via their names.
|
||||
* Provide an easy access to the children of an XML node via their names.
|
||||
*
|
||||
* @param aCurrentNode is a pointer to a wxXmlNode, whose children will be mapped.
|
||||
* @param aName the name of the specific child names to be counted.
|
||||
* @return number of children with the give node name.
|
||||
@ -113,7 +114,7 @@ static int countChildren( wxXmlNode* aCurrentNode, const wxString& aName )
|
||||
}
|
||||
|
||||
|
||||
///> Computes a bounding box for all items in a schematic sheet
|
||||
///< Compute a bounding box for all items in a schematic sheet
|
||||
static EDA_RECT getSheetBbox( SCH_SHEET* aSheet )
|
||||
{
|
||||
EDA_RECT bbox;
|
||||
@ -125,7 +126,7 @@ static EDA_RECT getSheetBbox( SCH_SHEET* aSheet )
|
||||
}
|
||||
|
||||
|
||||
///> Extracts the net name part from a pin name (e.g. return 'GND' for pin named 'GND@2')
|
||||
///< Extract the net name part from a pin name (e.g. return 'GND' for pin named 'GND@2')
|
||||
static inline wxString extractNetName( const wxString& aPinName )
|
||||
{
|
||||
return aPinName.BeforeFirst( '@' );
|
||||
@ -183,8 +184,8 @@ void SCH_EAGLE_PLUGIN::loadLayerDefs( wxXmlNode* aLayers )
|
||||
for( const auto& elayer : eagleLayers )
|
||||
{
|
||||
/**
|
||||
* Layers in Kicad schematics are not actually layers, but abstract groups mainly used to
|
||||
* decide item colours.
|
||||
* Layers in KiCad schematics are not actually layers, but abstract groups mainly used to
|
||||
* decide item colors.
|
||||
*
|
||||
* <layers>
|
||||
* <layer number="90" name="Modules" color="5" fill="1" visible="yes" active="yes"/>
|
||||
@ -223,7 +224,7 @@ SCH_LAYER_ID SCH_EAGLE_PLUGIN::kiCadLayer( int aEagleLayer )
|
||||
}
|
||||
|
||||
|
||||
// Return the kicad component orientation based on eagle rotation degrees.
|
||||
// Return the KiCad component orientation based on eagle rotation degrees.
|
||||
static COMPONENT_ORIENTATION_T kiCadComponentRotation( float eagleDegrees )
|
||||
{
|
||||
int roti = int( eagleDegrees );
|
||||
@ -464,7 +465,7 @@ SCH_SHEET* SCH_EAGLE_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchema
|
||||
libTable->Format( &formatter, 0 );
|
||||
}
|
||||
|
||||
// Relaod the symbol library table.
|
||||
// Reload the symbol library table.
|
||||
m_schematic->Prj().SetElem( PROJECT::ELEM_SYMBOL_LIB_TABLE, NULL );
|
||||
m_schematic->Prj().SchSymbolLibTable();
|
||||
}
|
||||
@ -861,7 +862,7 @@ void SCH_EAGLE_PLUGIN::loadSegments(
|
||||
// wxCHECK( screen, [>void<] );
|
||||
while( currentSegment )
|
||||
{
|
||||
bool labelled = false; // has a label been added to this continously connected segment
|
||||
bool labelled = false; // has a label been added to this continuously connected segment
|
||||
NODE_MAP segmentChildren = MapChildren( currentSegment );
|
||||
SCH_LINE* firstWire = nullptr;
|
||||
m_segments.emplace_back();
|
||||
@ -941,7 +942,7 @@ void SCH_EAGLE_PLUGIN::loadSegments(
|
||||
segmentAttribute = segmentAttribute->GetNext();
|
||||
}
|
||||
|
||||
// Add a small label to the net segment if it hasn't been labelled already
|
||||
// Add a small label to the net segment if it hasn't been labeled already
|
||||
// this preserves the named net feature of Eagle schematics.
|
||||
if( !labelled && firstWire )
|
||||
{
|
||||
@ -1028,7 +1029,8 @@ SCH_TEXT* SCH_EAGLE_PLUGIN::loadLabel( wxXmlNode* aLabelNode, const wxString& aN
|
||||
|
||||
if( elabel.rot )
|
||||
{
|
||||
label->SetLabelSpinStyle( (LABEL_SPIN_STYLE::SPIN) ( KiROUND( elabel.rot->degrees / 90 ) % 4 ) );
|
||||
label->SetLabelSpinStyle(
|
||||
(LABEL_SPIN_STYLE::SPIN) ( KiROUND( elabel.rot->degrees / 90 ) % 4 ) );
|
||||
|
||||
if( elabel.rot->mirror )
|
||||
{
|
||||
@ -1095,7 +1097,7 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
|
||||
// Find the part in the list for the sheet.
|
||||
// Assign the component its value from the part entry
|
||||
// Calculate the unit number from the gate entry of the instance
|
||||
// Assign the the LIB_ID from deviceset and device names
|
||||
// Assign the the LIB_ID from device set and device names
|
||||
|
||||
auto part_it = m_partlist.find( einstance.part.Upper() );
|
||||
|
||||
@ -1319,7 +1321,7 @@ EAGLE_LIBRARY* SCH_EAGLE_PLUGIN::loadLibrary(
|
||||
symbolNode = symbolNode->GetNext();
|
||||
}
|
||||
|
||||
// Loop through the devicesets and load each of them
|
||||
// Loop through the device sets and load each of them
|
||||
wxXmlNode* devicesetNode = getChildrenNodes( libraryChildren, "devicesets" );
|
||||
|
||||
while( devicesetNode )
|
||||
@ -1989,7 +1991,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
||||
// Add bus entry symbols
|
||||
// TODO: Cleanup this function and break into pieces
|
||||
|
||||
// for each wire segment, compare each end with all busess.
|
||||
// for each wire segment, compare each end with all busses.
|
||||
// If the wire end is found to end on a bus segment, place a bus entry symbol.
|
||||
|
||||
for( auto it1 = m_currentSheet->GetScreen()->Items().OfType( SCH_LINE_T ).begin();
|
||||
@ -2190,7 +2192,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
||||
// If wire end is above the bus,
|
||||
if( lineend.y < busstart.y )
|
||||
{
|
||||
// Test for bus existance to the left of the wire
|
||||
// Test for bus existence to the left of the wire
|
||||
if( TestSegmentHit(
|
||||
linestart + wxPoint( -100, 0 ), busstart, busend, 0 ) )
|
||||
{
|
||||
@ -2222,7 +2224,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
||||
}
|
||||
else // wire end is below the bus.
|
||||
{
|
||||
// Test for bus existance to the left of the wire
|
||||
// Test for bus existence to the left of the wire
|
||||
if( TestSegmentHit(
|
||||
linestart + wxPoint( -100, 0 ), busstart, busend, 0 ) )
|
||||
{
|
||||
@ -2261,7 +2263,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
||||
|
||||
if( linestart.y < busstart.y )
|
||||
{
|
||||
// Test for bus existance to the left of the wire
|
||||
// Test for bus existence to the left of the wire
|
||||
if( TestSegmentHit(
|
||||
lineend + wxPoint( -100, 0 ), busstart, busend, 0 ) )
|
||||
{
|
||||
@ -2293,7 +2295,7 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
||||
}
|
||||
else // wire end is below the bus.
|
||||
{
|
||||
// Test for bus existance to the left of the wire
|
||||
// Test for bus existence to the left of the wire
|
||||
if( TestSegmentHit(
|
||||
lineend + wxPoint( -100, 0 ), busstart, busend, 0 ) )
|
||||
{
|
||||
@ -2520,7 +2522,8 @@ const SEG* SCH_EAGLE_PLUGIN::SEG_DESC::LabelAttached( const SCH_TEXT* aLabel ) c
|
||||
}
|
||||
|
||||
|
||||
// TODO could be used to place junctions, instead of IsJunctionNeeded() (see SCH_EDIT_FRAME::importFile())
|
||||
// TODO could be used to place junctions, instead of IsJunctionNeeded()
|
||||
// (see SCH_EDIT_FRAME::importFile())
|
||||
bool SCH_EAGLE_PLUGIN::checkConnections(
|
||||
const SCH_COMPONENT* aComponent, const LIB_PIN* aPin ) const
|
||||
{
|
||||
|
@ -1,24 +1,26 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
* @author Russell Oliver <roliver8143@gmail.com>
|
||||
*
|
||||
* 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 3
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Alejandro García Montoro <alejandro.garciamontoro@gmail.com>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
* @author Russell Oliver <roliver8143@gmail.com>
|
||||
*
|
||||
* 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 3
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _SCH_EAGLE_PLUGIN_H_
|
||||
#define _SCH_EAGLE_PLUGIN_H_
|
||||
@ -72,8 +74,7 @@ typedef boost::ptr_map<wxString, EPART> EPART_LIST;
|
||||
|
||||
|
||||
/**
|
||||
* SCH_EAGLE_PLUGIN
|
||||
* is a #SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files.
|
||||
* A #SCH_PLUGIN derivation for loading 6.x+ Eagle schematic files.
|
||||
*
|
||||
* As with all SCH_PLUGINs there is no UI dependencies i.e. windowing calls allowed.
|
||||
*/
|
||||
@ -98,37 +99,6 @@ public:
|
||||
bool CheckHeader( const wxString& aFileName ) override;
|
||||
|
||||
|
||||
// unimplemented functions. Will trigger a not_implemented IO error.
|
||||
//void SaveLibrary( const wxString& aFileName, const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
//void Save( const wxString& aFileName, SCH_SCREEN* aSchematic, KIWAY* aKiway,
|
||||
// const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
//void EnumerateSymbolLib( wxArrayString& aAliasNameList, const wxString& aLibraryPath,
|
||||
// const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
//LIB_PART* LoadSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
|
||||
// const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
//void SaveSymbol( const wxString& aLibraryPath, const LIB_PART* aSymbol,
|
||||
// const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
//void DeleteAlias( const wxString& aLibraryPath, const wxString& aAliasName,
|
||||
// const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
//void DeleteSymbol( const wxString& aLibraryPath, const wxString& aAliasName,
|
||||
// const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
//void CreateSymbolLib( const wxString& aLibraryPath,
|
||||
// const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
// bool DeleteSymbolLib( const wxString& aLibraryPath,
|
||||
// const PROPERTIES* aProperties = NULL ) override;
|
||||
|
||||
//bool IsSymbolLibWritable( const wxString& aLibraryPath ) override;
|
||||
|
||||
//void SymbolLibOptions( PROPERTIES* aListToAppendTo ) const override;
|
||||
|
||||
private:
|
||||
void loadDrawing( wxXmlNode* aDrawingNode );
|
||||
void loadLayerDefs( wxXmlNode* aLayers );
|
||||
@ -138,7 +108,7 @@ private:
|
||||
EAGLE_LIBRARY* loadLibrary( wxXmlNode* aLibraryNode, EAGLE_LIBRARY* aEagleLib );
|
||||
void countNets( wxXmlNode* aSchematicNode );
|
||||
|
||||
/// Moves any labels on the wire to the new end point of the wire.
|
||||
/// Move any labels on the wire to the new end point of the wire.
|
||||
void moveLabels( SCH_ITEM* aWire, const wxPoint& aNewEndPoint );
|
||||
|
||||
/// This function finds best way to place a bus entry symbol for when an Eagle wire segment
|
||||
@ -158,24 +128,33 @@ private:
|
||||
SCH_JUNCTION* loadJunction( wxXmlNode* aJunction );
|
||||
SCH_TEXT* loadPlainText( wxXmlNode* aSchText );
|
||||
|
||||
bool loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr<LIB_PART>& aPart, EDEVICE* aDevice, int aGateNumber, const wxString& aGateName );
|
||||
LIB_CIRCLE* loadSymbolCircle( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aCircleNode, int aGateNumber );
|
||||
LIB_RECTANGLE* loadSymbolRectangle( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aRectNode, int aGateNumber );
|
||||
LIB_POLYLINE* loadSymbolPolyLine( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aPolygonNode, int aGateNumber );
|
||||
LIB_ITEM* loadSymbolWire( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aWireNode, int aGateNumber );
|
||||
LIB_PIN* loadPin( std::unique_ptr<LIB_PART>& aPart, wxXmlNode*, EPIN* epin, int aGateNumber );
|
||||
LIB_TEXT* loadSymbolText( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aLibText, int aGateNumber );
|
||||
bool loadSymbol( wxXmlNode* aSymbolNode, std::unique_ptr<LIB_PART>& aPart,
|
||||
EDEVICE* aDevice, int aGateNumber, const wxString& aGateName );
|
||||
LIB_CIRCLE* loadSymbolCircle( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aCircleNode,
|
||||
int aGateNumber );
|
||||
LIB_RECTANGLE* loadSymbolRectangle( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aRectNode,
|
||||
int aGateNumber );
|
||||
LIB_POLYLINE* loadSymbolPolyLine( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aPolygonNode,
|
||||
int aGateNumber );
|
||||
LIB_ITEM* loadSymbolWire( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aWireNode,
|
||||
int aGateNumber );
|
||||
LIB_PIN* loadPin( std::unique_ptr<LIB_PART>& aPart, wxXmlNode*, EPIN* epin,
|
||||
int aGateNumber );
|
||||
LIB_TEXT* loadSymbolText( std::unique_ptr<LIB_PART>& aPart, wxXmlNode* aLibText,
|
||||
int aGateNumber );
|
||||
|
||||
void loadTextAttributes( EDA_TEXT* aText, const ETEXT& aAttribs ) const;
|
||||
void loadFieldAttributes( LIB_FIELD* aField, const LIB_TEXT* aText ) const;
|
||||
|
||||
///> Moves net labels that are detached from any wire to the nearest wire
|
||||
///< Move net labels that are detached from any wire to the nearest wire
|
||||
void adjustNetLabels();
|
||||
|
||||
/**
|
||||
* Translates an Eagle-style bus name into one that is KiCad-compatible.
|
||||
* For vector buses such as A[7..0] this has no impact.
|
||||
* For group buses, we translate from Eagle-style to KiCad-style.
|
||||
* Translate an Eagle-style bus name into one that is KiCad-compatible.
|
||||
*
|
||||
* For vector buses such as A[7..0] this has no impact. For group buses, we translate from
|
||||
* Eagle-style to KiCad-style.
|
||||
*
|
||||
* @param aEagleName is the name of the bus from the Eagle schematic
|
||||
*/
|
||||
wxString translateEagleBusName( const wxString& aEagleName ) const;
|
||||
@ -183,6 +162,55 @@ private:
|
||||
wxString getLibName();
|
||||
wxFileName getLibFileName();
|
||||
|
||||
///< Checks if there are other wires or pins at the position of the tested pin
|
||||
bool checkConnections( const SCH_COMPONENT* aComponent, const LIB_PIN* aPin ) const;
|
||||
|
||||
/**
|
||||
* Create net labels to emulate implicit connections in Eagle.
|
||||
*
|
||||
* Each named power input pin creates an implicit connection in Eagle. To emulate this behavior
|
||||
* one needs to attach global net labels to the mentioned pins. This is is also expected for the
|
||||
* units that are not instantiated in the schematics, therefore such units need to be stored
|
||||
* in order to create them at later stage.
|
||||
*
|
||||
* @param aComponent is the component to process.
|
||||
* @param aScreen is the screen where net labels should be added.
|
||||
* @param aUpdateSet decides whether the missing units data should be updated.
|
||||
*/
|
||||
void addImplicitConnections( SCH_COMPONENT* aComponent, SCH_SCREEN* aScreen, bool aUpdateSet );
|
||||
|
||||
/**
|
||||
* Fix invalid characters in Eagle symbol names.
|
||||
*
|
||||
* It changes invalid characters to underscores.
|
||||
*
|
||||
* @param aName is the symbol name to be fixed.
|
||||
* @return Fixed symbol name.
|
||||
*/
|
||||
static wxString fixSymbolName( const wxString& aName );
|
||||
|
||||
// Describe missing units containing pins creating implicit connections
|
||||
// (named power pins in Eagle).
|
||||
struct EAGLE_MISSING_CMP
|
||||
{
|
||||
EAGLE_MISSING_CMP( const SCH_COMPONENT* aComponent = nullptr )
|
||||
: cmp( aComponent )
|
||||
{
|
||||
}
|
||||
|
||||
///< Link to the parent component
|
||||
const SCH_COMPONENT* cmp;
|
||||
|
||||
/* Map of the component units: for each unit there is a flag saying
|
||||
* whether the unit needs to be instantiated with appropriate net labels to
|
||||
* emulate implicit connections as is done in Eagle.
|
||||
*/
|
||||
std::map<int, bool> units;
|
||||
};
|
||||
|
||||
///< Map references to missing component units data
|
||||
std::map<wxString, EAGLE_MISSING_CMP> m_missingCmps;
|
||||
|
||||
KIWAY* m_kiway; ///< For creating sub sheets.
|
||||
SCH_SHEET* m_rootSheet; ///< The root sheet of the schematic being loaded..
|
||||
SCH_SHEET* m_currentSheet; ///< The current sheet of the schematic being loaded..
|
||||
@ -200,72 +228,24 @@ private:
|
||||
std::map<wxString, int> m_netCounts;
|
||||
std::map<int, SCH_LAYER_ID> m_layerMap;
|
||||
|
||||
///> Wire intersection points, used for quick checks whether placing a net label in a particular
|
||||
///> place would short two nets.
|
||||
///< Wire intersection points, used for quick checks whether placing a net label in a particular
|
||||
///< place would short two nets.
|
||||
std::vector<VECTOR2I> m_wireIntersections;
|
||||
|
||||
///> Wires and labels of a single connection (segment in Eagle nomenclature)
|
||||
///< Wires and labels of a single connection (segment in Eagle nomenclature)
|
||||
typedef struct SEG_DESC_STRUCT {
|
||||
///> Tests if a particular label is attached to any of the stored segments
|
||||
///< Test if a particular label is attached to any of the stored segments
|
||||
const SEG* LabelAttached( const SCH_TEXT* aLabel ) const;
|
||||
|
||||
std::vector<SCH_TEXT*> labels;
|
||||
std::vector<SEG> segs;
|
||||
} SEG_DESC;
|
||||
|
||||
///> Segments representing wires for intersection checking
|
||||
///< Segments representing wires for intersection checking
|
||||
std::vector<SEG_DESC> m_segments;
|
||||
|
||||
///> Positions of pins and wire endings mapped to its parent
|
||||
///< Positions of pins and wire endings mapped to its parent
|
||||
std::map<wxPoint, std::set<const EDA_ITEM*>> m_connPoints;
|
||||
|
||||
///> Checks if there are other wires or pins at the position of the tested pin
|
||||
bool checkConnections( const SCH_COMPONENT* aComponent, const LIB_PIN* aPin ) const;
|
||||
|
||||
// Structure describing missing units containing pins creating implicit connections
|
||||
// (named power pins in Eagle).
|
||||
struct EAGLE_MISSING_CMP
|
||||
{
|
||||
EAGLE_MISSING_CMP( const SCH_COMPONENT* aComponent = nullptr )
|
||||
: cmp( aComponent )
|
||||
{
|
||||
}
|
||||
|
||||
///> Link to the parent component
|
||||
const SCH_COMPONENT* cmp;
|
||||
|
||||
/* Map of the component units: for each unit there is a flag saying
|
||||
* whether the unit needs to be instantiated with appropriate net labels to
|
||||
* emulate implicit connections as is done in Eagle.
|
||||
*/
|
||||
std::map<int, bool> units;
|
||||
};
|
||||
|
||||
///> Map references to missing component units data
|
||||
std::map<wxString, EAGLE_MISSING_CMP> m_missingCmps;
|
||||
|
||||
/**
|
||||
* Creates net labels to emulate implicit connections in Eagle.
|
||||
*
|
||||
* Each named power input pin creates an implicit connection in Eagle. To emulate this behavior
|
||||
* one needs to attach global net labels to the mentioned pins. This is is also expected for the
|
||||
* units that are not instantiated in the schematics, therefore such units need to be stored
|
||||
* in order to create them at later stage.
|
||||
*
|
||||
* @param aComponent is the component to process.
|
||||
* @param aScreen is the screen where net labels should be added.
|
||||
* @param aUpdateSet decides whether the missing units data should be updated.
|
||||
*/
|
||||
void addImplicitConnections( SCH_COMPONENT* aComponent, SCH_SCREEN* aScreen, bool aUpdateSet );
|
||||
|
||||
/**
|
||||
* Fixes invalid characters in Eagle symbol names. It changes invalid characters
|
||||
* to underscores.
|
||||
*
|
||||
* @param aName is the symbol name to be fixed.
|
||||
* @return Fixed symbol name.
|
||||
*/
|
||||
static wxString fixSymbolName( const wxString& aName );
|
||||
};
|
||||
|
||||
#endif // _SCH_EAGLE_PLUGIN_H_
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-2021 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
|
||||
@ -48,7 +48,7 @@ public:
|
||||
|
||||
~SCH_PREVIEW_PANEL() override;
|
||||
|
||||
///> @copydoc EDA_DRAW_PANEL_GAL::OnShow()
|
||||
///< @copydoc EDA_DRAW_PANEL_GAL::OnShow()
|
||||
void OnShow() override;
|
||||
|
||||
/// @copydoc wxWindow::Refresh()
|
||||
@ -61,10 +61,10 @@ protected:
|
||||
|
||||
KIGFX::SCH_VIEW* view() const;
|
||||
|
||||
///> Reassigns layer order to the initial settings.
|
||||
///< Reassign layer order to the initial settings.
|
||||
void setDefaultLayerOrder();
|
||||
|
||||
///> Sets rendering targets & dependencies for layers.
|
||||
///< Set rendering targets & dependencies for layers.
|
||||
void setDefaultLayerDeps();
|
||||
};
|
||||
|
||||
|
@ -38,11 +38,11 @@
|
||||
#include <map>
|
||||
|
||||
/**
|
||||
* SCH_REFERENCE
|
||||
* is used as a helper to define a symbol's reference designator in a schematic. This helper
|
||||
* is required in a complex hierarchy because a symbol can be used more than once and its
|
||||
* reference depends on the sheet path. This class is used to flatten the schematic hierarchy
|
||||
* for annotation, net list generation, and bill of material generation.
|
||||
* A helper to define a symbol's reference designator in a schematic.
|
||||
*
|
||||
* This helper is required in a complex hierarchy because a symbol can be used more than once
|
||||
* and its reference depends on the sheet path. This class is used to flatten the schematic
|
||||
* hierarchy for annotation, net list generation, and bill of material generation.
|
||||
*/
|
||||
class SCH_REFERENCE
|
||||
{
|
||||
@ -106,17 +106,16 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Function Annotate
|
||||
* updates the annotation of the symbol according the the current object state.
|
||||
* Update the annotation of the symbol according the the current object state.
|
||||
*/
|
||||
void Annotate();
|
||||
|
||||
/**
|
||||
* Function Split
|
||||
* attempts to split the reference designator into a name (U) and number (1). If the
|
||||
* last character is '?' or not a digit, the reference is tagged as not annotated. For
|
||||
* sybmols with multiple parts per package that are not already annotated, sets m_unit to
|
||||
* a max value (0x7FFFFFFF).
|
||||
* Attempt to split the reference designator into a name (U) and number (1).
|
||||
*
|
||||
* If the last character is '?' or not a digit, the reference is tagged as not annotated.
|
||||
* For symbols with multiple parts per package that are not already annotated, sets m_unit
|
||||
* to a max value (0x7FFFFFFF).
|
||||
*/
|
||||
void Split();
|
||||
|
||||
@ -126,7 +125,7 @@ public:
|
||||
void SetRefStr( const std::string& aReference ) { m_ref = aReference; }
|
||||
const char* GetRefStr() const { return m_ref.c_str(); }
|
||||
|
||||
///> Return reference name with unit altogether
|
||||
///< Return reference name with unit altogether
|
||||
wxString GetFullRef()
|
||||
{
|
||||
if( GetSymbol()->GetUnitCount() > 1 )
|
||||
@ -167,8 +166,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Function IsSameInstance
|
||||
* returns whether this reference refers to the same symbol instance (symbol and sheet) as
|
||||
* Return whether this reference refers to the same symbol instance (symbol and sheet) as
|
||||
* another.
|
||||
*/
|
||||
bool IsSameInstance( const SCH_REFERENCE& other ) const
|
||||
@ -186,15 +184,14 @@ public:
|
||||
|
||||
|
||||
/**
|
||||
* Defines a standard error handler for annotation errors.
|
||||
* Define a standard error handler for annotation errors.
|
||||
*/
|
||||
typedef std::function<void( ERCE_T aType, const wxString& aMsg, SCH_REFERENCE* aItemA,
|
||||
SCH_REFERENCE* aItemB )> ANNOTATION_ERROR_HANDLER;
|
||||
|
||||
|
||||
/**
|
||||
* SCH_REFERENCE_LIST
|
||||
* is used to create a flattened list of symbols because in a complex hierarchy, a symbol
|
||||
* Container to create a flattened list of symbols because in a complex hierarchy, a symbol
|
||||
* can be used more than once and its reference designator is dependent on the sheet path for
|
||||
* the same symbol. This flattened list is used for netlist generation, BOM generation, and
|
||||
* schematic annotation.
|
||||
@ -206,8 +203,6 @@ private:
|
||||
std::vector<SCH_REFERENCE> flatList;
|
||||
|
||||
public:
|
||||
/** Constructor
|
||||
*/
|
||||
SCH_REFERENCE_LIST()
|
||||
{
|
||||
}
|
||||
@ -229,8 +224,7 @@ public:
|
||||
void AddItem( SCH_REFERENCE& aItem ) { flatList.push_back( aItem ); }
|
||||
|
||||
/**
|
||||
* Function RemoveItem
|
||||
* removes an item from the list of references.
|
||||
* Remove an item from the list of references.
|
||||
*
|
||||
* @param aIndex is the index of the item to be removed.
|
||||
*/
|
||||
@ -241,13 +235,12 @@ public:
|
||||
* sorting depends on what we want to do, there are many sort functions.
|
||||
* Note:
|
||||
* When creating BOM, symbols are fully annotated. References are something like U3,
|
||||
* U5 or R4, R8. When annotating, some or all suymbols are not annotated, i.e. ref is
|
||||
* U5 or R4, R8. When annotating, some or all symbols are not annotated, i.e. ref is
|
||||
* only U or R, with no number.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function SplitReferences
|
||||
* attempts to split all reference designators into a name (U) and number (1). If the
|
||||
* Attempt to split all reference designators into a name (U) and number (1). If the
|
||||
* last character is '?' or not a digit, the reference is tagged as not annotated. For
|
||||
* symbols with multiple parts per package that are not already annotated, set m_unit to
|
||||
* a max value (0x7FFFFFFF).
|
||||
@ -260,10 +253,11 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* function UpdateAnnotation
|
||||
* Updates the symbol references for the schematic project (or the current sheet).
|
||||
* Note: this function does not calculate the reference numbers stored in m_numRef so it
|
||||
* must be called after calculation of new reference numbers
|
||||
* Update the symbol references for the schematic project (or the current sheet).
|
||||
*
|
||||
* @note This function does not calculate the reference numbers stored in m_numRef so it
|
||||
* must be called after calculation of new reference numbers.
|
||||
*
|
||||
* @see SCH_REFERENCE::Annotate()
|
||||
*/
|
||||
void UpdateAnnotation()
|
||||
@ -274,8 +268,8 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Function Annotate
|
||||
* set the reference designators in the list that have not been annotated.
|
||||
* Set the reference designators in the list that have not been annotated.
|
||||
*
|
||||
* @param aUseSheetNum Set to true to start annotation for each sheet at the sheet number
|
||||
* times \a aSheetIntervalId. Otherwise annotate incrementally.
|
||||
* @param aSheetIntervalId The per sheet reference designator multiplier.
|
||||
@ -294,8 +288,7 @@ public:
|
||||
SCH_MULTI_UNIT_REFERENCE_MAP aLockedUnitMap );
|
||||
|
||||
/**
|
||||
* Function CheckAnnotation
|
||||
* check for annotations errors.
|
||||
* Check for annotations errors.
|
||||
* <p>
|
||||
* The following annotation error conditions are tested:
|
||||
* <ul>
|
||||
@ -311,8 +304,7 @@ public:
|
||||
int CheckAnnotation( ANNOTATION_ERROR_HANDLER aErrorHandler );
|
||||
|
||||
/**
|
||||
* Function SortByXCoordinate
|
||||
* sorts the list of references by X position.
|
||||
* Sort the list of references by X position.
|
||||
* <p>
|
||||
* Symbols are sorted as follows:
|
||||
* <ul>
|
||||
@ -330,8 +322,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SortByYCoordinate
|
||||
* sorts the list of references by Y position.
|
||||
* Sort the list of references by Y position.
|
||||
* <p>
|
||||
* Symbols are sorted as follows:
|
||||
* <ul>
|
||||
@ -349,8 +340,8 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SortByTimeStamp
|
||||
* sort the flat list by Time Stamp (sheet path + timestamp).
|
||||
* Sort the flat list by Time Stamp (sheet path + timestamp).
|
||||
*
|
||||
* Useful to detect duplicate Time Stamps
|
||||
*/
|
||||
void SortByTimeStamp()
|
||||
@ -359,8 +350,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SortByRefAndValue
|
||||
* sorts the list of references by value.
|
||||
* Sort the list of references by value.
|
||||
* <p>
|
||||
* Symbols are sorted in the following order:
|
||||
* <ul>
|
||||
@ -379,8 +369,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Function SortByReferenceOnly
|
||||
* sorts the list of references by reference.
|
||||
* Sort the list of references by reference.
|
||||
* <p>
|
||||
* Symbols are sorted in the following order:
|
||||
* <ul>
|
||||
@ -395,15 +384,14 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* searches the list for a symbol with a given reference.
|
||||
* @param aPath
|
||||
* @return
|
||||
* Search the list for a symbol with a given reference.
|
||||
*/
|
||||
int FindRef( const wxString& aPath ) const;
|
||||
|
||||
/**
|
||||
* searches the sorted list of symbols for a another symbol with the same reference and a
|
||||
* Search the sorted list of symbols for a another symbol with the same reference and a
|
||||
* given part unit. Use this method to manage symbols with multiple parts per package.
|
||||
*
|
||||
* @param aIndex = index in aSymbolsList for of given SCH_REFERENCE item to test.
|
||||
* @param aUnit = the given unit number to search
|
||||
* @return index in aSymbolsList if found or -1 if not found
|
||||
@ -411,16 +399,17 @@ public:
|
||||
int FindUnit( size_t aIndex, int aUnit );
|
||||
|
||||
/**
|
||||
* searches the list for a symbol with the given KIID path
|
||||
* Search the list for a symbol with the given KIID path.
|
||||
*
|
||||
* @param aPath path to search
|
||||
* @return index in aSymbolsList if found or -1 if not found
|
||||
*/
|
||||
int FindRefByPath( const wxString& aPath ) const;
|
||||
|
||||
/**
|
||||
* Function GetRefsInUse
|
||||
* adds all the reference designator numbers greater than \a aMinRefId to \a aIdList
|
||||
* Add all the reference designator numbers greater than \a aMinRefId to \a aIdList
|
||||
* skipping the reference at \a aIndex.
|
||||
*
|
||||
* @param aIndex = the current symbol's index to use for reference prefix filtering.
|
||||
* @param aIdList = the buffer to fill
|
||||
* @param aMinRefId = the min id value to store. all values < aMinRefId are ignored
|
||||
@ -428,8 +417,7 @@ public:
|
||||
void GetRefsInUse( int aIndex, std::vector< int >& aIdList, int aMinRefId );
|
||||
|
||||
/**
|
||||
* Function GetLastReference
|
||||
* returns the last used (greatest) reference number in the reference list for the prefix
|
||||
* Return the last used (greatest) reference number in the reference list for the prefix
|
||||
* used by the symbol pointed to by \a aIndex. The symbol list must be sorted.
|
||||
*
|
||||
* @param aIndex The index of the reference item used for the search pattern.
|
||||
@ -456,19 +444,14 @@ public:
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Function Shorthand
|
||||
* Returns a shorthand string representing all the references in the list. For instance,
|
||||
* Return a shorthand string representing all the references in the list. For instance,
|
||||
* "R1, R2, R4 - R7, U1"
|
||||
* @param aList
|
||||
*/
|
||||
static wxString Shorthand( std::vector<SCH_REFERENCE> aList );
|
||||
|
||||
friend class BACK_ANNOTATION;
|
||||
|
||||
private:
|
||||
/* sort functions used to sort flatList
|
||||
*/
|
||||
|
||||
static bool sortByRefAndValue( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
|
||||
|
||||
static bool sortByXPosition( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
|
||||
@ -480,11 +463,12 @@ private:
|
||||
static bool sortByReferenceOnly( const SCH_REFERENCE& item1, const SCH_REFERENCE& item2 );
|
||||
|
||||
/**
|
||||
* Function CreateFirstFreeRefId
|
||||
* searches for the first free reference number in \a aListId of reference numbers in use.
|
||||
* Search for the first free reference number in \a aListId of reference numbers in use.
|
||||
*
|
||||
* This function just searches for a hole in a list of incremented numbers, this list must
|
||||
* be sorted by increasing values and each value can be stored only once. The new value
|
||||
* is added to the list.
|
||||
*
|
||||
* @see BuildRefIdInUseList to prepare this list
|
||||
* @param aIdList The buffer that contains the reference numbers in use.
|
||||
* @param aFirstValue The first expected free value
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 1992-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2021 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
|
||||
@ -25,7 +25,7 @@
|
||||
|
||||
/**
|
||||
* @file sch_sheet_path.h
|
||||
* @brief Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
|
||||
* Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
|
||||
*/
|
||||
|
||||
#ifndef CLASS_DRAWSHEET_PATH_H
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
|
||||
/**
|
||||
* A simple container for schematic symbol instance infromation.
|
||||
* A simple container for schematic symbol instance information.
|
||||
*/
|
||||
struct SYMBOL_INSTANCE_REFERENCE
|
||||
{
|
||||
@ -55,7 +55,7 @@ struct SYMBOL_INSTANCE_REFERENCE
|
||||
|
||||
|
||||
/**
|
||||
* A simple container for sheet instance infromation.
|
||||
* A simple container for sheet instance information.
|
||||
*/
|
||||
struct SCH_SHEET_INSTANCE
|
||||
{
|
||||
@ -236,7 +236,7 @@ public:
|
||||
SCH_SCREEN* LastScreen();
|
||||
|
||||
|
||||
///> @copydoc SCH_SHEET_PATH::LastScreen()
|
||||
///< @copydoc SCH_SHEET_PATH::LastScreen()
|
||||
SCH_SCREEN* LastScreen() const;
|
||||
|
||||
/**
|
||||
@ -263,7 +263,7 @@ public:
|
||||
KIID_PATH PathWithoutRootUuid() const;
|
||||
|
||||
/**
|
||||
* Return the sheet path in a human readable form made from thesheet names.
|
||||
* Return the sheet path in a human readable form made from the sheet names.
|
||||
*
|
||||
* The the "normal" path instead uses the #KIID objects in the path that do not change
|
||||
* even when editing sheet parameters.
|
||||
@ -438,10 +438,10 @@ public:
|
||||
* Build the list of sheets and their sheet path from \a aSheet.
|
||||
*
|
||||
* If \a aSheet is the root sheet, the full sheet path and sheet list are built.
|
||||
*
|
||||
*
|
||||
* The list will be ordered as per #SCH_SCREEN::GetSheets which results in sheets being ordered
|
||||
* in the legacy way of using the X and Y positions of the sheets.
|
||||
*
|
||||
*
|
||||
* @see #SortByPageNumbers to sort by page numbers
|
||||
*
|
||||
* @param aSheet is the starting sheet from which the list is built, or NULL
|
||||
@ -449,10 +449,10 @@ public:
|
||||
* @throw std::bad_alloc if the memory for the sheet path list could not be allocated.
|
||||
*/
|
||||
void BuildSheetList( SCH_SHEET* aSheet, bool aCheckIntegrity );
|
||||
|
||||
|
||||
/**
|
||||
* Sorts the list of sheets by page number. This should be called after #BuildSheetList
|
||||
*
|
||||
*
|
||||
* @param aUpdateVirtualPageNums If true, updates the virtual page numbers to match the new
|
||||
* ordering
|
||||
*/
|
||||
@ -506,7 +506,7 @@ public:
|
||||
* Set initial sheet page numbers.
|
||||
*
|
||||
* The number scheme is base on the old psuedo sheet numbering algorithm prior to
|
||||
* the implementation of user defineable sheet page numbers.
|
||||
* the implementation of user definable sheet page numbers.
|
||||
*/
|
||||
void SetInitialPageNumbers();
|
||||
};
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
@ -52,19 +52,21 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns name of Spice dataset for a specific plot.
|
||||
* Return name of Spice dataset for a specific plot.
|
||||
*
|
||||
* @param aName is name of the measured net or device
|
||||
* @param aType describes the type of expected plot
|
||||
* @param aParam is an optional parameter for devices, if absent it will return current (only
|
||||
* for passive devices).
|
||||
* for passive devices).
|
||||
* @return Empty string if query is invalid, otherwise a plot name that
|
||||
* can be requested from the simulator.
|
||||
* can be requested from the simulator.
|
||||
*/
|
||||
wxString ComponentToVector( const wxString& aName, SIM_PLOT_TYPE aType,
|
||||
const wxString& aParam = wxEmptyString ) const;
|
||||
|
||||
/**
|
||||
* @brief Returns name of Spice dataset for a specific plot.
|
||||
* Return name of Spice dataset for a specific plot.
|
||||
*
|
||||
* @param aVector is name of the vector produced by ngspice
|
||||
* @param [out] aSignal is output in form: V(R1), Ib(Q2), I(L8)
|
||||
* @return [SPT_VOLTAGE, SPT_CURRENT]. Otherwise SPT_UNKNOWN if vector is
|
||||
@ -73,12 +75,12 @@ public:
|
||||
SIM_PLOT_TYPE VectorToSignal( const std::string& aVector, wxString& aSignal ) const;
|
||||
|
||||
/**
|
||||
* @brief Returns a list of currents that can be probed in a Spice primitive.
|
||||
* Return a list of currents that can be probed in a Spice primitive.
|
||||
*/
|
||||
static const std::vector<wxString>& GetCurrents( SPICE_PRIMITIVE aPrimitive );
|
||||
|
||||
/**
|
||||
* @brief Overrides the simulation command directive.
|
||||
* Override the simulation command directive.
|
||||
*/
|
||||
void SetSimCommand( const wxString& aCmd )
|
||||
{
|
||||
@ -86,7 +88,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the simulation command directive.
|
||||
* Return the simulation command directive.
|
||||
*/
|
||||
const wxString& GetSimCommand() const
|
||||
{
|
||||
@ -94,7 +96,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clears the simulation command directive.
|
||||
* Clear the simulation command directive.
|
||||
*/
|
||||
void ClearSimCommand()
|
||||
{
|
||||
@ -102,25 +104,26 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the command directive that is in use (either from the sheet or from m_simCommand
|
||||
* Return the command directive that is in use (either from the sheet or from m_simCommand
|
||||
* @return
|
||||
*/
|
||||
wxString GetUsedSimCommand();
|
||||
|
||||
/**
|
||||
* @brief Returns simulation type basing on the simulation command directives.
|
||||
* Return simulation type basing on the simulation command directives.
|
||||
*
|
||||
* Simulation directives set using SetSimCommand() have priority over the ones placed in
|
||||
* schematic sheets.
|
||||
*/
|
||||
SIM_TYPE GetSimType();
|
||||
|
||||
/**
|
||||
* @brief Returns simulation command directives placed in schematic sheets (if any).
|
||||
* Return simulation command directives placed in schematic sheets (if any).
|
||||
*/
|
||||
wxString GetSheetSimCommand();
|
||||
|
||||
/**
|
||||
* Parses a two-source .dc command directive into its components
|
||||
* Parse a two-source .dc command directive into its components
|
||||
*
|
||||
* @param aCmd is the input command string
|
||||
* @return true if the command was parsed successfully
|
||||
@ -129,7 +132,7 @@ public:
|
||||
SPICE_DC_PARAMS* aSource2 );
|
||||
|
||||
/**
|
||||
* @brief Determines if a directive is a simulation command.
|
||||
* Determine if a directive is a simulation command.
|
||||
*/
|
||||
static bool IsSimCommand( const wxString& aCmd )
|
||||
{
|
||||
@ -137,7 +140,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns simulation type basing on a simulation command directive.
|
||||
* Return simulation type basing on a simulation command directive.
|
||||
*/
|
||||
static SIM_TYPE CommandToSimType( const wxString& aCmd );
|
||||
|
||||
@ -146,7 +149,7 @@ protected:
|
||||
|
||||
private:
|
||||
|
||||
///> Custom simulation command (has priority over the schematic sheet simulation commands)
|
||||
///< Custom simulation command (has priority over the schematic sheet simulation commands)
|
||||
wxString m_simCommand;
|
||||
};
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -38,46 +40,46 @@ public:
|
||||
NGSPICE();
|
||||
virtual ~NGSPICE();
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::Init()
|
||||
///< @copydoc SPICE_SIMULATOR::Init()
|
||||
void Init() override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::LoadNetlist()
|
||||
///< @copydoc SPICE_SIMULATOR::LoadNetlist()
|
||||
bool LoadNetlist( const std::string& aNetlist ) override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::Run()
|
||||
///< @copydoc SPICE_SIMULATOR::Run()
|
||||
bool Run() override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::Stop()
|
||||
///< @copydoc SPICE_SIMULATOR::Stop()
|
||||
bool Stop() override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::IsRunning()
|
||||
///< @copydoc SPICE_SIMULATOR::IsRunning()
|
||||
bool IsRunning() override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::Command()
|
||||
///< @copydoc SPICE_SIMULATOR::Command()
|
||||
bool Command( const std::string& aCmd ) override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::GetXAxis()
|
||||
///< @copydoc SPICE_SIMULATOR::GetXAxis()
|
||||
std::string GetXAxis( SIM_TYPE aType ) const override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::AllPlots()
|
||||
std::vector<std::string> AllPlots() const override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::GetPlot()
|
||||
///< @copydoc SPICE_SIMULATOR::GetPlot()
|
||||
std::vector<COMPLEX> GetPlot( const std::string& aName, int aMaxLen = -1 ) override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::GetRealPlot()
|
||||
///< @copydoc SPICE_SIMULATOR::GetRealPlot()
|
||||
std::vector<double> GetRealPlot( const std::string& aName, int aMaxLen = -1 ) override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::GetImagPlot()
|
||||
///< @copydoc SPICE_SIMULATOR::GetImagPlot()
|
||||
std::vector<double> GetImagPlot( const std::string& aName, int aMaxLen = -1 ) override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::GetMagPlot()
|
||||
///< @copydoc SPICE_SIMULATOR::GetMagPlot()
|
||||
std::vector<double> GetMagPlot( const std::string& aName, int aMaxLen = -1 ) override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::GetPhasePlot()
|
||||
///< @copydoc SPICE_SIMULATOR::GetPhasePlot()
|
||||
std::vector<double> GetPhasePlot( const std::string& aName, int aMaxLen = -1 ) override;
|
||||
|
||||
///> @copydoc SPICE_SIMULATOR::GetNetlist()
|
||||
///< @copydoc SPICE_SIMULATOR::GetNetlist()
|
||||
virtual const std::string GetNetlist() const override;
|
||||
|
||||
private:
|
||||
@ -97,7 +99,7 @@ private:
|
||||
typedef char** (*ngSpice_AllVecs)( char* plotname );
|
||||
typedef bool (*ngSpice_Running)( void );
|
||||
|
||||
///> Handles to DLL functions
|
||||
///< Handle to DLL functions
|
||||
ngSpice_Init m_ngSpice_Init;
|
||||
ngSpice_Circ m_ngSpice_Circ;
|
||||
ngSpice_Command m_ngSpice_Command;
|
||||
@ -109,32 +111,32 @@ private:
|
||||
|
||||
wxDynamicLibrary m_dll;
|
||||
|
||||
///> Executes commands from a file
|
||||
///< Execute commands from a file
|
||||
bool loadSpinit( const std::string& aFileName );
|
||||
|
||||
///> Checks a few different locations for codemodel files and returns one
|
||||
///> if it exists
|
||||
///< Check a few different locations for codemodel files and returns one if it exists.
|
||||
std::string findCmPath() const;
|
||||
|
||||
///> Loads codemodel files from a directory
|
||||
///< Load codemodel files from a directory.
|
||||
bool loadCodemodels( const std::string& aPath );
|
||||
|
||||
// Callback functions
|
||||
static int cbSendChar( char* what, int id, void* user );
|
||||
static int cbSendStat( char* what, int id, void* user );
|
||||
static int cbBGThreadRunning( bool is_running, int id, void* user );
|
||||
static int cbControlledExit( int status, bool immediate, bool exit_upon_quit, int id, void* user );
|
||||
static int cbControlledExit( int status, bool immediate, bool exit_upon_quit, int id,
|
||||
void* user );
|
||||
|
||||
// Assures ngspice is in a valid state and reinitializes it if need be
|
||||
// Assure ngspice is in a valid state and reinitializes it if need be
|
||||
void validate();
|
||||
|
||||
///> Error flag indicating that ngspice needs to be reloaded
|
||||
///< Error flag indicating that ngspice needs to be reloaded
|
||||
bool m_error;
|
||||
|
||||
///> NGspice should be initialized only once
|
||||
///< NGspice should be initialized only once
|
||||
static bool m_initialized;
|
||||
|
||||
///> current netlist
|
||||
///< current netlist
|
||||
std::string m_netlist;
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
@ -70,14 +70,14 @@ enum SIM_COLOR_SET
|
||||
};
|
||||
|
||||
|
||||
///> Trace descriptor class
|
||||
///< Trace descriptor class
|
||||
class TRACE_DESC
|
||||
{
|
||||
public:
|
||||
TRACE_DESC( const NETLIST_EXPORTER_PSPICE_SIM& aExporter, const wxString& aName,
|
||||
SIM_PLOT_TYPE aType, const wxString& aParam );
|
||||
|
||||
///> Modifies an existing TRACE_DESC simulation type
|
||||
///< Modifies an existing TRACE_DESC simulation type
|
||||
TRACE_DESC( const NETLIST_EXPORTER_PSPICE_SIM& aExporter,
|
||||
const TRACE_DESC& aDescription, SIM_PLOT_TYPE aNewType )
|
||||
: TRACE_DESC( aExporter, aDescription.GetName(), aNewType, aDescription.GetParam() )
|
||||
@ -106,17 +106,17 @@ public:
|
||||
|
||||
private:
|
||||
// Three basic parameters
|
||||
///> Name of the measured net/device
|
||||
///< Name of the measured net/device
|
||||
wxString m_name;
|
||||
|
||||
///> Type of the signal
|
||||
///< Type of the signal
|
||||
SIM_PLOT_TYPE m_type;
|
||||
|
||||
///> Name of the signal parameter
|
||||
///< Name of the signal parameter
|
||||
wxString m_param;
|
||||
|
||||
// Generated data
|
||||
///> Title displayed in the signal list/plot legend
|
||||
///< Title displayed in the signal list/plot legend
|
||||
wxString m_title;
|
||||
};
|
||||
|
||||
@ -134,33 +134,37 @@ public:
|
||||
bool IsSimulationRunning();
|
||||
|
||||
/**
|
||||
* @brief Creates a new plot panel for a given simulation type and adds it to the main
|
||||
* notebook.
|
||||
* @param aSimCommand is the SPICE command used for simulation.
|
||||
* Create a new plot panel for a given simulation type and adds it to the main notebook.
|
||||
*
|
||||
* @param aSimType is requested simulation type.
|
||||
* @return The new plot panel.
|
||||
*/
|
||||
SIM_PANEL_BASE* NewPlotPanel( wxString aSimCommand );
|
||||
|
||||
/**
|
||||
* @brief Adds a voltage plot for a given net name.
|
||||
* Add a voltage plot for a given net name.
|
||||
*
|
||||
* @param aNetName is the net name for which a voltage plot should be created.
|
||||
*/
|
||||
void AddVoltagePlot( const wxString& aNetName );
|
||||
|
||||
/**
|
||||
* @brief Adds a current plot for a particular device.
|
||||
* Add a current plot for a particular device.
|
||||
*
|
||||
* @param aDeviceName is the device name (e.g. R1, C1).
|
||||
* @param aParam is the current type (e.g. I, Ic, Id).
|
||||
*/
|
||||
void AddCurrentPlot( const wxString& aDeviceName, const wxString& aParam );
|
||||
|
||||
/**
|
||||
* @brief Adds a tuner for a component.
|
||||
* Add a tuner for a component.
|
||||
*
|
||||
*/
|
||||
void AddTuner( SCH_COMPONENT* aComponent );
|
||||
|
||||
/**
|
||||
* @brief Removes an existing tuner.
|
||||
* Remove an existing tuner.
|
||||
*
|
||||
* @param aTuner is the tuner to be removed.
|
||||
* @param aErase decides whether the tuner should be also removed from the tuners list.
|
||||
* Otherwise it is removed only from the SIM_PLOT_FRAME pane.
|
||||
@ -168,12 +172,12 @@ public:
|
||||
void RemoveTuner( TUNER_SLIDER* aTuner, bool aErase = true );
|
||||
|
||||
/**
|
||||
* @brief Returns the currently opened plot panel (or NULL if there is none).
|
||||
* Return the currently opened plot panel (or NULL if there is none).
|
||||
*/
|
||||
SIM_PLOT_PANEL* CurrentPlot() const;
|
||||
|
||||
/**
|
||||
* Returns the netlist exporter object used for simulations.
|
||||
* Return the netlist exporter object used for simulations.
|
||||
*/
|
||||
const NETLIST_EXPORTER_PSPICE_SIM* GetExporter() const;
|
||||
|
||||
@ -204,19 +208,20 @@ public:
|
||||
wxWindow* GetToolCanvas() const override { return nullptr; }
|
||||
|
||||
private:
|
||||
|
||||
/** Give icons to menuitems of the main menubar
|
||||
/**
|
||||
* Give icons to menuitems of the main menubar
|
||||
*/
|
||||
void setIconsForMenuItems();
|
||||
|
||||
/** Fills m_colorList by a default set of colors.
|
||||
* @param aWhiteBg = true to use a white (or clear) background
|
||||
* false to use a dark background
|
||||
/**
|
||||
* Fill m_colorList by a default set of colors.
|
||||
*
|
||||
* @param aWhiteBg true to use a white (or clear) background false to use a dark background.
|
||||
*/
|
||||
void fillDefaultColorList( bool aWhiteBg );
|
||||
|
||||
/**
|
||||
* @brief Returns the currently opened plot panel (or NULL if there is none).
|
||||
* Return the currently opened plot panel (or NULL if there is none).
|
||||
*/
|
||||
SIM_PANEL_BASE* currentPlotWindow() const
|
||||
{
|
||||
@ -224,7 +229,8 @@ private:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Adds a new plot to the current panel.
|
||||
* Add a new plot to the current panel.
|
||||
*
|
||||
* @param aName is the device/net name.
|
||||
* @param aType describes the type of plot.
|
||||
* @param aParam is the parameter for the device/net (e.g. I, Id, V).
|
||||
@ -232,20 +238,22 @@ private:
|
||||
void addPlot( const wxString& aName, SIM_PLOT_TYPE aType, const wxString& aParam );
|
||||
|
||||
/**
|
||||
* @brief Removes a plot with a specific title.
|
||||
* Remove a plot with a specific title.
|
||||
*
|
||||
* @param aPlotName is the full plot title (e.g. I(Net-C1-Pad1)).
|
||||
* @param aErase decides if plot should be removed from corresponding TRACE_MAP (see m_plots).
|
||||
*/
|
||||
void removePlot( const wxString& aPlotName, bool aErase = true );
|
||||
|
||||
/**
|
||||
* @brief Reloads the current schematic for the netlist exporter.
|
||||
* Reload the current schematic for the netlist exporter.
|
||||
*/
|
||||
void updateNetlistExporter();
|
||||
|
||||
/**
|
||||
* @brief Updates plot in a particular SIM_PLOT_PANEL. If the panel does not contain
|
||||
* Update plot in a particular SIM_PLOT_PANEL. If the panel does not contain
|
||||
* the plot, it will be added.
|
||||
*
|
||||
* @param aDescriptor contains the plot description.
|
||||
* @param aPanel is the panel that should receive the update.
|
||||
* @return True if a plot was successfully added/updated.
|
||||
@ -253,37 +261,39 @@ private:
|
||||
bool updatePlot( const TRACE_DESC& aDescriptor, SIM_PLOT_PANEL* aPanel );
|
||||
|
||||
/**
|
||||
* @brief Updates the list of currently plotted signals.
|
||||
* Update the list of currently plotted signals.
|
||||
*/
|
||||
void updateSignalList();
|
||||
|
||||
/**
|
||||
* @brief Filters out tuners for components that do not exist anymore.
|
||||
* Filter out tuners for components that do not exist anymore.
|
||||
* Decisions are based on the current NETLIST_EXPORTER_BASE data.
|
||||
*/
|
||||
void updateTuners();
|
||||
|
||||
/**
|
||||
* @brief Applies component values specified using tunder sliders to the current netlist.
|
||||
* Apply component values specified using tuner sliders to the current netlist.
|
||||
*/
|
||||
void applyTuners();
|
||||
|
||||
/**
|
||||
* @brief Loads plot settings from a file.
|
||||
* Load plot settings from a file.
|
||||
*
|
||||
* @param aPath is the file name.
|
||||
* @return True if successful.
|
||||
*/
|
||||
bool loadWorkbook( const wxString& aPath );
|
||||
|
||||
/**
|
||||
* @brief Saves plot settings to a file.
|
||||
* Save plot settings to a file.
|
||||
*
|
||||
* @param aPath is the file name.
|
||||
* @return True if successful.
|
||||
*/
|
||||
bool saveWorkbook( const wxString& aPath );
|
||||
|
||||
/**
|
||||
* @brief Returns X axis for a given simulation type.
|
||||
* Return X axis for a given simulation type.
|
||||
*/
|
||||
SIM_PLOT_TYPE GetXAxisType( SIM_TYPE aType ) const;
|
||||
|
||||
@ -358,17 +368,17 @@ private:
|
||||
|
||||
struct PLOT_INFO
|
||||
{
|
||||
///> Map of the traces displayed on the plot
|
||||
///< Map of the traces displayed on the plot
|
||||
TRACE_MAP m_traces;
|
||||
|
||||
///> Spice directive used to execute the simulation
|
||||
///< Spice directive used to execute the simulation
|
||||
wxString m_simCommand;
|
||||
};
|
||||
|
||||
///> Map of plot panels and associated data
|
||||
///< Map of plot panels and associated data
|
||||
std::map<SIM_PANEL_BASE*, PLOT_INFO> m_plots;
|
||||
|
||||
///> List of currently displayed tuners
|
||||
///< List of currently displayed tuners
|
||||
std::list<TUNER_SLIDER*> m_tuners;
|
||||
|
||||
// Trick to preserve settings between runs:
|
||||
@ -397,17 +407,17 @@ private:
|
||||
};
|
||||
};
|
||||
|
||||
///> Panel that was used as the most recent one for simulations
|
||||
///< Panel that was used as the most recent one for simulations
|
||||
SIM_PLOT_PANEL* m_lastSimPlot;
|
||||
|
||||
///> imagelists uset to add a small coloured icon to signal names
|
||||
///> and cursors name, the same color as the corresponding signal traces
|
||||
///< imagelists used to add a small colored icon to signal names
|
||||
///< and cursors name, the same color as the corresponding signal traces
|
||||
wxImageList* m_signalsIconColorList;
|
||||
|
||||
///> A string to store the path of saved workbooks during a session
|
||||
///< A string to store the path of saved workbooks during a session
|
||||
static wxString m_savedWorkbooksPath;
|
||||
|
||||
///> Info panel
|
||||
///< Info panel
|
||||
SIM_PANEL_BASE* m_welcomePanel;
|
||||
|
||||
// Variables for temporary storage:
|
||||
@ -418,7 +428,7 @@ private:
|
||||
bool m_plotUseWhiteBg;
|
||||
unsigned int m_plotNumber;
|
||||
|
||||
///> The color list to draw traces, bg, fg, axis...
|
||||
///< The color list to draw traces, bg, fg, axis...
|
||||
std::vector<wxColour> m_colorList;
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2016-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2016-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
@ -37,7 +38,7 @@ class SIM_PLOT_FRAME;
|
||||
class SIM_PLOT_PANEL;
|
||||
class TRACE;
|
||||
|
||||
///> Cursor attached to a trace to follow its values:
|
||||
///< Cursor attached to a trace to follow its values:
|
||||
class CURSOR : public mpInfoLayer
|
||||
{
|
||||
public:
|
||||
@ -101,7 +102,8 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Assigns new data set for the trace. aX and aY need to have the same length.
|
||||
* Assigns new data set for the trace. aX and aY need to have the same length.
|
||||
*
|
||||
* @param aX are the X axis values.
|
||||
* @param aY are the Y axis values.
|
||||
*/
|
||||
@ -174,7 +176,7 @@ public:
|
||||
|
||||
virtual ~SIM_PLOT_PANEL();
|
||||
|
||||
///> set the pointer to the sim plot frame
|
||||
///< set the pointer to the sim plot frame
|
||||
void SetMasterFrame( SIM_PLOT_FRAME* aFrame )
|
||||
{
|
||||
m_masterFrame = aFrame;
|
||||
@ -195,8 +197,8 @@ public:
|
||||
return m_axis_y2 ? m_axis_y2->GetName() : "";
|
||||
}
|
||||
|
||||
bool AddTrace( const wxString& aName, int aPoints,
|
||||
const double* aX, const double* aY, SIM_PLOT_TYPE aFlags );
|
||||
bool AddTrace( const wxString& aName, int aPoints, const double* aX,
|
||||
const double* aY, SIM_PLOT_TYPE aFlags );
|
||||
|
||||
bool DeleteTrace( const wxString& aName );
|
||||
|
||||
@ -264,16 +266,16 @@ public:
|
||||
return m_dotted_cp;
|
||||
}
|
||||
|
||||
///> Returns true if the trace has cursor shown.
|
||||
///< Returns true if the trace has cursor shown.
|
||||
bool HasCursorEnabled( const wxString& aName ) const;
|
||||
|
||||
///> Toggles cursor for a particular trace.
|
||||
///< Toggles cursor for a particular trace.
|
||||
void EnableCursor( const wxString& aName, bool aEnable );
|
||||
|
||||
///> Resets scale ranges to fit the current traces
|
||||
///< Resets scale ranges to fit the current traces
|
||||
void ResetScales();
|
||||
|
||||
///> Update trace line style
|
||||
///< Update trace line style
|
||||
void UpdateTraceStyle( TRACE* trace );
|
||||
|
||||
/**
|
||||
@ -283,17 +285,17 @@ public:
|
||||
*/
|
||||
wxColour GetPlotColor( int aIndex );
|
||||
|
||||
///> Update plot colors
|
||||
///< Update plot colors
|
||||
void UpdatePlotColors();
|
||||
|
||||
///> Getter for math plot window
|
||||
///< Getter for math plot window
|
||||
mpWindow* GetPlotWin() const
|
||||
{
|
||||
return m_plotWin;
|
||||
}
|
||||
|
||||
private:
|
||||
///> @return a new color from the palette
|
||||
///< @return a new color from the palette
|
||||
wxColour generateColor();
|
||||
|
||||
///> @brief Constructs the plot axes for DC simulation plot
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -25,7 +27,7 @@
|
||||
#ifndef SIM_TYPES_H
|
||||
#define SIM_TYPES_H
|
||||
|
||||
///> Possible simulation types
|
||||
///< Possible simulation types
|
||||
enum SIM_TYPE
|
||||
{
|
||||
ST_UNKNOWN,
|
||||
@ -40,7 +42,7 @@ enum SIM_TYPE
|
||||
ST_TRANSIENT
|
||||
};
|
||||
|
||||
///> Possible plot types
|
||||
///< Possible plot types
|
||||
enum SIM_PLOT_TYPE
|
||||
{
|
||||
// Y axis
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -45,61 +47,67 @@ public:
|
||||
SPICE_SIMULATOR() : m_reporter( NULL ) {}
|
||||
virtual ~SPICE_SIMULATOR() {}
|
||||
|
||||
///> Creates a simulator instance of particular type (currently only ngspice is handled)
|
||||
///< Create a simulator instance of particular type (currently only ngspice is handled)
|
||||
static std::shared_ptr<SPICE_SIMULATOR> CreateInstance( const std::string& aName );
|
||||
|
||||
///> Initializes the simulator
|
||||
///< Initialize the simulator
|
||||
virtual void Init() = 0;
|
||||
|
||||
/*
|
||||
* @brief Loads a netlist for the simulation.
|
||||
* Load a netlist for the simulation.
|
||||
*
|
||||
* @return True in case of success, false otherwise.
|
||||
*/
|
||||
virtual bool LoadNetlist( const std::string& aNetlist ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Executes the simulation with currently loaded netlist.
|
||||
* Execute the simulation with currently loaded netlist.
|
||||
*
|
||||
* @return True in case of success, false otherwise.
|
||||
*/
|
||||
virtual bool Run() = 0;
|
||||
|
||||
/**
|
||||
* @brief Halts the simulation.
|
||||
* Halt the simulation.
|
||||
*
|
||||
* @return True in case of success, false otherwise.
|
||||
*/
|
||||
virtual bool Stop() = 0;
|
||||
|
||||
/**
|
||||
* @brief Checks if simulation is running at the moment.
|
||||
* Check if simulation is running at the moment.
|
||||
*
|
||||
* @return True if simulation is currently executed.
|
||||
*/
|
||||
virtual bool IsRunning() = 0;
|
||||
|
||||
/**
|
||||
* @brief Executes a Spice command as if it was typed into console.
|
||||
* Execute a Spice command as if it was typed into console.
|
||||
*
|
||||
* @param aCmd is the command to be issued.
|
||||
*/
|
||||
virtual bool Command( const std::string& aCmd ) = 0;
|
||||
|
||||
///> Returns X axis name for a given simulation type
|
||||
///< Return X axis name for a given simulation type
|
||||
virtual std::string GetXAxis( SIM_TYPE aType ) const = 0;
|
||||
|
||||
///> Sets a SPICE_REPORTER object to receive the simulation log.
|
||||
///< Set a SPICE_REPORTER object to receive the simulation log.
|
||||
virtual void SetReporter( SPICE_REPORTER* aReporter )
|
||||
{
|
||||
m_reporter = aReporter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns a list with all vectors generated in current simulation.
|
||||
* Return a list with all vectors generated in current simulation.
|
||||
* @param none
|
||||
* @return List of vector names. ?May not match to the net name elements.
|
||||
*/
|
||||
virtual std::vector<std::string> AllPlots() const = 0;
|
||||
|
||||
/**
|
||||
* @brief Returns a requested vector with complex values. If the vector is real, then
|
||||
* Return a requested vector with complex values. If the vector is real, then
|
||||
* the imaginary part is set to 0 in all values.
|
||||
*
|
||||
* @param aName is the vector named in Spice convention (e.g. V(3), I(R1)).
|
||||
* @param aMaxLen is max count of returned values.
|
||||
* if -1 (default) all available values are returned.
|
||||
@ -108,8 +116,9 @@ public:
|
||||
virtual std::vector<COMPLEX> GetPlot( const std::string& aName, int aMaxLen = -1 ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Returns a requested vector with real values. If the vector is complex, then
|
||||
* Return a requested vector with real values. If the vector is complex, then
|
||||
* the real part is returned.
|
||||
*
|
||||
* @param aName is the vector named in Spice convention (e.g. V(3), I(R1)).
|
||||
* @param aMaxLen is max count of returned values.
|
||||
* if -1 (default) all available values are returned.
|
||||
@ -118,8 +127,9 @@ public:
|
||||
virtual std::vector<double> GetRealPlot( const std::string& aName, int aMaxLen = -1 ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Returns a requested vector with imaginary values. If the vector is complex, then
|
||||
* Return a requested vector with imaginary values. If the vector is complex, then
|
||||
* the imaginary part is returned. If the vector is reql, then only zeroes are returned.
|
||||
*
|
||||
* @param aName is the vector named in Spice convention (e.g. V(3), I(R1)).
|
||||
* @param aMaxLen is max count of returned values.
|
||||
* if -1 (default) all available values are returned.
|
||||
@ -128,7 +138,8 @@ public:
|
||||
virtual std::vector<double> GetImagPlot( const std::string& aName, int aMaxLen = -1 ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Returns a requested vector with magnitude values.
|
||||
* Return a requested vector with magnitude values.
|
||||
*
|
||||
* @param aName is the vector named in Spice convention (e.g. V(3), I(R1)).
|
||||
* @param aMaxLen is max count of returned values.
|
||||
* if -1 (default) all available values are returned.
|
||||
@ -137,7 +148,8 @@ public:
|
||||
virtual std::vector<double> GetMagPlot( const std::string& aName, int aMaxLen = -1 ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Returns a requested vector with phase values.
|
||||
* Return a requested vector with phase values.
|
||||
*
|
||||
* @param aName is the vector named in Spice convention (e.g. V(3), I(R1)).
|
||||
* @param aMaxLen is max count of returned values.
|
||||
* if -1 (default) all available values are returned.
|
||||
@ -146,13 +158,15 @@ public:
|
||||
virtual std::vector<double> GetPhasePlot( const std::string& aName, int aMaxLen = -1 ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Returns current SPICE netlist used by the simulator.
|
||||
* Return current SPICE netlist used by the simulator.
|
||||
*
|
||||
* @return The netlist.
|
||||
*/
|
||||
virtual const std::string GetNetlist() const = 0;
|
||||
|
||||
/**
|
||||
* @brief Returns a string with simulation name based on enum.
|
||||
* Return a string with simulation name based on enum.
|
||||
*
|
||||
* @param aType is the enum describing simulation type
|
||||
* @param aShortName if true - return is in format "TRAN", "OP".
|
||||
* if false - return is in format "Transient", "Operating Point".
|
||||
@ -161,7 +175,7 @@ public:
|
||||
static wxString TypeToName( SIM_TYPE aType, bool aShortName );
|
||||
|
||||
protected:
|
||||
///> Reporter object to receive simulation log
|
||||
///< Reporter object to receive simulation log.
|
||||
SPICE_REPORTER* m_reporter;
|
||||
};
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2016 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -28,7 +30,7 @@
|
||||
#include <wx/string.h>
|
||||
#include <wx/valtext.h>
|
||||
|
||||
///> Helper class to handle Spice way of expressing values (e.g. 10.5 Meg)
|
||||
///< Helper class to handle Spice way of expressing values (e.g. 10.5 Meg)
|
||||
class SPICE_VALUE
|
||||
{
|
||||
public:
|
||||
@ -51,7 +53,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
///> Parses the string to create a Spice value (e.g. 100n)
|
||||
///< Parses the string to create a Spice value (e.g. 100n)
|
||||
SPICE_VALUE( const wxString& aString );
|
||||
|
||||
SPICE_VALUE( int aInt, UNIT_PREFIX aPrefix = PFX_NONE )
|
||||
@ -67,24 +69,24 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Normalizes the value. The unit prefix is picked so the base is (0.001 <= base < 1000).
|
||||
* Normalize the value. The unit prefix is picked so the base is (0.001 <= base < 1000).
|
||||
*/
|
||||
void Normalize();
|
||||
|
||||
double ToDouble() const;
|
||||
|
||||
/**
|
||||
* @brief Returns string value as when converting double to string (e.g. 123456.789).
|
||||
* Return string value as when converting double to string (e.g. 123456.789).
|
||||
*/
|
||||
wxString ToString() const;
|
||||
|
||||
/**
|
||||
* @brief Returns string value in Spice format (e.g. 123.3456789k).
|
||||
* Return string value in Spice format (e.g. 123.3456789k).
|
||||
*/
|
||||
wxString ToSpiceString() const;
|
||||
|
||||
/**
|
||||
* @brief Returns either a normal string or Spice format string, depending on the original
|
||||
* Return either a normal string or Spice format string, depending on the original
|
||||
* value format.
|
||||
*/
|
||||
wxString ToOrigString() const
|
||||
@ -93,7 +95,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the object was initiated with a Spice formatted string value.
|
||||
* Return true if the object was initiated with a Spice formatted string value.
|
||||
*/
|
||||
bool IsSpiceString() const
|
||||
{
|
||||
@ -131,18 +133,18 @@ public:
|
||||
SPICE_VALUE operator/( const SPICE_VALUE& aOther ) const;
|
||||
|
||||
private:
|
||||
///< Remove redundant zeros from the end of a string.
|
||||
static void stripZeros( wxString& aString );
|
||||
|
||||
double m_base;
|
||||
UNIT_PREFIX m_prefix;
|
||||
|
||||
///> Was the value defined using the Spice notation?
|
||||
///< Was the value defined using the Spice notation?
|
||||
bool m_spiceStr;
|
||||
|
||||
///> Removes redundant zeros from the end of a string.
|
||||
static void stripZeros( wxString& aString );
|
||||
};
|
||||
|
||||
|
||||
///> Helper class to recognize Spice formatted values
|
||||
///< Helper class to recognize Spice formatted values
|
||||
class SPICE_VALIDATOR : public wxTextValidator
|
||||
{
|
||||
public:
|
||||
@ -159,7 +161,7 @@ public:
|
||||
bool Validate( wxWindow* aParent ) override;
|
||||
|
||||
private:
|
||||
///> Is it valid to get an empty value?
|
||||
///< Is it valid to get an empty value?
|
||||
bool m_emptyAllowed;
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -102,7 +103,7 @@ public:
|
||||
SYMBOL_LIBRARY_MANAGER( SYMBOL_EDIT_FRAME& aFrame );
|
||||
|
||||
/**
|
||||
* Updates the SYMBOL_LIBRARY_MANAGER data to synchronize with Symbol Library Table.
|
||||
* Updates the #SYMBOL_LIBRARY_MANAGER data to synchronize with Symbol Library Table.
|
||||
*/
|
||||
void Sync( bool aForce = false,
|
||||
std::function<void( int, int, const wxString& )> aProgressCallback
|
||||
@ -115,7 +116,7 @@ public:
|
||||
bool HasModifications() const;
|
||||
|
||||
/**
|
||||
* Returns a library hash value to determine if it has changed.
|
||||
* Return a library hash value to determine if it has changed.
|
||||
*
|
||||
* For buffered libraries, it returns a number corresponding to the number of modifications.
|
||||
* For original libraries, hash is computed basing on the library URI. Returns -1 when the
|
||||
@ -124,19 +125,19 @@ public:
|
||||
int GetLibraryHash( const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Returns the array of library names.
|
||||
* Return the array of library names.
|
||||
*/
|
||||
wxArrayString GetLibraryNames() const;
|
||||
|
||||
/**
|
||||
* Finds a single library within the (aggregate) library table.
|
||||
* Find a single library within the (aggregate) library table.
|
||||
*/
|
||||
SYMBOL_LIB_TABLE_ROW* GetLibrary( const wxString& aLibrary ) const;
|
||||
|
||||
std::list<LIB_PART*> GetAliases( const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Creates an empty library and adds it to the library table. The library file is created.
|
||||
* Create an empty library and adds it to the library table. The library file is created.
|
||||
*/
|
||||
bool CreateLibrary( const wxString& aFilePath, SYMBOL_LIB_TABLE* aTable )
|
||||
{
|
||||
@ -144,7 +145,7 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an existing library. The library is added to the library table as well.
|
||||
* Add an existing library. The library is added to the library table as well.
|
||||
*/
|
||||
bool AddLibrary( const wxString& aFilePath, SYMBOL_LIB_TABLE* aTable )
|
||||
{
|
||||
@ -152,94 +153,98 @@ public:
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates the part buffer with a new version of the part.
|
||||
* Update the part buffer with a new version of the part.
|
||||
* The library buffer creates a copy of the part.
|
||||
* It is required to save the library to use the updated part in the schematic editor.
|
||||
*/
|
||||
bool UpdatePart( LIB_PART* aPart, const wxString& aLibrary );
|
||||
|
||||
/**
|
||||
* Updates the part buffer with a new version of the part when the name has changed.
|
||||
* Update the part buffer with a new version of the part when the name has changed.
|
||||
* The old library buffer will be deleted and a new one created with the new name.
|
||||
*/
|
||||
bool UpdatePartAfterRename( LIB_PART* aPart, const wxString& oldAlias,
|
||||
const wxString& aLibrary );
|
||||
|
||||
/**
|
||||
* Removes the part from the part buffer.
|
||||
* Remove the part from the part buffer.
|
||||
* It is required to save the library to have the part removed in the schematic editor.
|
||||
*/
|
||||
bool RemovePart( const wxString& aName, const wxString& aLibrary );
|
||||
|
||||
/**
|
||||
* Returns either an alias of a working LIB_PART copy, or alias of the original part if there
|
||||
* Return either an alias of a working LIB_PART copy, or alias of the original part if there
|
||||
* is no working copy.
|
||||
*/
|
||||
LIB_PART* GetAlias( const wxString& aAlias, const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Returns the part copy from the buffer. In case it does not exist yet, the copy is created.
|
||||
* SYMBOL_LIBRARY_MANAGER retains the ownership.
|
||||
* Return the part copy from the buffer. In case it does not exist yet, the copy is created.
|
||||
* #SYMBOL_LIBRARY_MANAGER retains the ownership.
|
||||
*/
|
||||
LIB_PART* GetBufferedPart( const wxString& aAlias, const wxString& aLibrary );
|
||||
|
||||
/**
|
||||
* Returns the screen used to edit a specific part. SYMBOL_LIBRARY_MANAGER retains the ownership.
|
||||
* Return the screen used to edit a specific part. #SYMBOL_LIBRARY_MANAGER retains the
|
||||
* ownership.
|
||||
*/
|
||||
SCH_SCREEN* GetScreen( const wxString& aAlias, const wxString& aLibrary );
|
||||
|
||||
/**
|
||||
* Returns true if part with a specific alias exists in library (either original one or
|
||||
* Return true if part with a specific alias exists in library (either original one or
|
||||
* buffered).
|
||||
*/
|
||||
bool PartExists( const wxString& aAlias, const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Returns true if library exists. If \a aCheckEnabled is set, then the library must
|
||||
* Return true if library exists. If \a aCheckEnabled is set, then the library must
|
||||
* also be enabled in the library table.
|
||||
*/
|
||||
bool LibraryExists( const wxString& aLibrary, bool aCheckEnabled = false ) const;
|
||||
|
||||
/**
|
||||
* Returns true if the library was successfully loaded
|
||||
* Return true if the library was successfully loaded.
|
||||
*/
|
||||
bool IsLibraryLoaded( const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Returns true if library has unsaved modifications.
|
||||
* Return true if library has unsaved modifications.
|
||||
*/
|
||||
bool IsLibraryModified( const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Returns true if part has unsaved modifications.
|
||||
* Return true if part has unsaved modifications.
|
||||
*/
|
||||
bool IsPartModified( const wxString& aAlias, const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Clears the modified flag for all parts in a library.
|
||||
* Clear the modified flag for all parts in a library.
|
||||
*/
|
||||
bool ClearLibraryModified( const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Clears the modified flag for a part.
|
||||
* Clear the modified flag for a part.
|
||||
*/
|
||||
bool ClearPartModified( const wxString& aAlias, const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Returns true if the library is stored in a read-only file.
|
||||
* Return true if the library is stored in a read-only file.
|
||||
*
|
||||
* @return True on success, false otherwise.
|
||||
*/
|
||||
bool IsLibraryReadOnly( const wxString& aLibrary ) const;
|
||||
|
||||
/**
|
||||
* Saves part changes to the library copy used by the schematic editor. Not it is not
|
||||
* Save part changes to the library copy used by the schematic editor. Not it is not
|
||||
* necessarily saved to the file.
|
||||
*
|
||||
* @return True on success, false otherwise.
|
||||
*/
|
||||
bool FlushPart( const wxString& aAlias, const wxString& aLibrary );
|
||||
|
||||
/**
|
||||
* Saves library to a file, including unsaved changes.
|
||||
* Save library to a file, including unsaved changes.
|
||||
*
|
||||
* @param aLibrary is the library name.
|
||||
* @param aFileName is the target file name.
|
||||
* @return True on success, false otherwise.
|
||||
@ -248,14 +253,16 @@ public:
|
||||
SCH_IO_MGR::SCH_FILE_T aFileType = SCH_IO_MGR::SCH_FILE_T::SCH_LEGACY );
|
||||
|
||||
/**
|
||||
* Reverts unsaved changes for a particular part.
|
||||
* Revert unsaved changes for a particular part.
|
||||
*
|
||||
* @return The LIB_ID of the reverted part (which may be different in the case
|
||||
* of a rename)
|
||||
*/
|
||||
LIB_ID RevertPart( const wxString& aAlias, const wxString& aLibrary );
|
||||
|
||||
/**
|
||||
* Reverts unsaved changes for a particular library.
|
||||
* Revert unsaved changes for a particular library.
|
||||
*
|
||||
* @return True on success, false otherwise.
|
||||
*/
|
||||
bool RevertLibrary( const wxString& aLibrary );
|
||||
@ -268,13 +275,13 @@ public:
|
||||
bool RevertAll();
|
||||
|
||||
/**
|
||||
* Returns a library name that is not currently in use.
|
||||
* Return a library name that is not currently in use.
|
||||
* Used for generating names for new libraries.
|
||||
*/
|
||||
wxString GetUniqueLibraryName() const;
|
||||
|
||||
/**
|
||||
* Returns the adapter object that provides the stored data.
|
||||
* Return the adapter object that provides the stored data.
|
||||
*/
|
||||
wxObjectDataPtr<LIB_TREE_MODEL_ADAPTER>& GetAdapter() { return m_adapter; }
|
||||
|
||||
@ -289,13 +296,13 @@ public:
|
||||
bool HasDerivedSymbols( const wxString& aSymbolName, const wxString& aLibraryName );
|
||||
|
||||
private:
|
||||
///> Extracts library name basing on the file name
|
||||
///< Extract library name basing on the file name.
|
||||
static wxString getLibraryName( const wxString& aFilePath );
|
||||
|
||||
///> Helper function to add either existing or create new library
|
||||
///< Helper function to add either existing or create new library
|
||||
bool addLibrary( const wxString& aFilePath, bool aCreate, SYMBOL_LIB_TABLE* aTable );
|
||||
|
||||
///> Returns the current Symbol Library Table
|
||||
///< Return the current Symbol Library Table.
|
||||
SYMBOL_LIB_TABLE* symTable() const;
|
||||
|
||||
SYMBOL_TREE_SYNCHRONIZING_ADAPTER* getAdapter()
|
||||
@ -303,7 +310,7 @@ private:
|
||||
return static_cast<SYMBOL_TREE_SYNCHRONIZING_ADAPTER*>( m_adapter.get() );
|
||||
}
|
||||
|
||||
///> Class to store a working copy of a LIB_PART object and editor context.
|
||||
///< Class to store a working copy of a LIB_PART object and editor context.
|
||||
class PART_BUFFER
|
||||
{
|
||||
public:
|
||||
@ -319,7 +326,7 @@ private:
|
||||
bool IsModified() const;
|
||||
SCH_SCREEN* GetScreen() const { return m_screen.get(); }
|
||||
|
||||
///> Transfer the screen ownership
|
||||
///< Transfer the screen ownership
|
||||
std::unique_ptr<SCH_SCREEN> RemoveScreen()
|
||||
{
|
||||
return std::move( m_screen );
|
||||
@ -343,7 +350,7 @@ private:
|
||||
};
|
||||
|
||||
|
||||
///> Class to store a working copy of a library
|
||||
///< Store a working copy of a library.
|
||||
class LIB_BUFFER
|
||||
{
|
||||
public:
|
||||
@ -368,13 +375,13 @@ private:
|
||||
|
||||
int GetHash() const { return m_hash; }
|
||||
|
||||
///> Returns the working copy of a LIB_PART root object with specified alias.
|
||||
///< Return the working copy of a LIB_PART root object with specified alias.
|
||||
LIB_PART* GetPart( const wxString& aAlias ) const;
|
||||
|
||||
///> Creates a new buffer to store a part. LIB_BUFFER takes ownership of aCopy.
|
||||
///< Create a new buffer to store a part. LIB_BUFFER takes ownership of aCopy.
|
||||
bool CreateBuffer( LIB_PART* aCopy, SCH_SCREEN* aScreen );
|
||||
|
||||
///> Updates the buffered part with the contents of \a aCopy.
|
||||
///< Update the buffered part with the contents of \a aCopy.
|
||||
bool UpdateBuffer( PART_BUFFER::PTR aPartBuf, LIB_PART* aCopy );
|
||||
|
||||
bool DeleteBuffer( PART_BUFFER::PTR aPartBuf );
|
||||
@ -384,32 +391,31 @@ private:
|
||||
m_deleted.clear();
|
||||
}
|
||||
|
||||
///> Saves stored modifications to Symbol Lib Table. It may result in saving the symbol
|
||||
///> to disk as well, depending on the row properties.
|
||||
///< Save stored modifications to Symbol Lib Table. It may result in saving the symbol
|
||||
///< to disk as well, depending on the row properties.
|
||||
bool SaveBuffer( PART_BUFFER::PTR aPartBuf, SYMBOL_LIB_TABLE* aLibTable );
|
||||
|
||||
///> Saves stored modifications using a plugin. aBuffer decides whether the changes
|
||||
///> should be cached or stored directly to the disk (for SCH_LEGACY_PLUGIN).
|
||||
///< Save stored modifications using a plugin. aBuffer decides whether the changes
|
||||
///< should be cached or stored directly to the disk (for SCH_LEGACY_PLUGIN).
|
||||
bool SaveBuffer( PART_BUFFER::PTR aPartBuf, SCH_PLUGIN* aPlugin, bool aBuffer );
|
||||
|
||||
///> Returns a part buffer with LIB_PART holding a particular alias
|
||||
///< Return a part buffer with LIB_PART holding a particular alias
|
||||
PART_BUFFER::PTR GetBuffer( const wxString& aAlias ) const;
|
||||
|
||||
///> Returns all buffered parts
|
||||
///< Return all buffered parts
|
||||
const std::deque<PART_BUFFER::PTR>& GetBuffers() const { return m_parts; }
|
||||
|
||||
/**
|
||||
* Checks to see any parts in the buffer are derived from a parent named \a aParentName.
|
||||
* Check to see any parts in the buffer are derived from a parent named \a aParentName.
|
||||
*
|
||||
* @param aParentName is the name of the parent to test.
|
||||
*
|
||||
* @return true if any symbols are found derived from a symbol named \a aParent, otherwise
|
||||
* false.
|
||||
*/
|
||||
bool HasDerivedSymbols( const wxString& aParentName ) const;
|
||||
|
||||
/**
|
||||
* Fetchs a list of root symbols names from the library buffer.
|
||||
* Fetch a list of root symbols names from the library buffer.
|
||||
*
|
||||
* @param aRootSymbolNames is a reference to a list to populate with root symbol names.
|
||||
*/
|
||||
@ -421,7 +427,6 @@ private:
|
||||
* @param aSymbolName is the name of the symbol to search for derived parts in this
|
||||
* buffer.
|
||||
* @param aList is the list of symbols names derived from \a aSymbolName.
|
||||
*
|
||||
* @return a size_t count of the number of symbols derived from \a aSymbolName.
|
||||
*/
|
||||
size_t GetDerivedSymbolNames( const wxString& aSymbolName, wxArrayString& aList );
|
||||
@ -431,7 +436,6 @@ private:
|
||||
* Remove all symbols derived from \a aParent from the library buffer.
|
||||
*
|
||||
* @param aParent is the #PART_BUFFER to check against.
|
||||
*
|
||||
* @return the count of #PART_BUFFER objects removed from the library.
|
||||
*/
|
||||
int removeChildSymbols( PART_BUFFER::PTR aPartBuf );
|
||||
@ -443,17 +447,17 @@ private:
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a set of LIB_PART objects belonging to the original library
|
||||
* Return a set of #LIB_PART objects belonging to the original library.
|
||||
*/
|
||||
std::set<LIB_PART*> getOriginalParts( const wxString& aLibrary );
|
||||
|
||||
/**
|
||||
* Returns an existing library buffer or creates one to using Symbol Library Table to get
|
||||
* Return an existing library buffer or creates one to using Symbol Library Table to get
|
||||
* the original data.
|
||||
*/
|
||||
LIB_BUFFER& getLibraryBuffer( const wxString& aLibrary );
|
||||
|
||||
///> The library buffers
|
||||
///< The library buffers
|
||||
std::map<wxString, LIB_BUFFER> m_libs;
|
||||
|
||||
SYMBOL_EDIT_FRAME& m_frame; ///< Parent frame
|
||||
|
@ -2,6 +2,8 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 CERN
|
||||
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@ -40,10 +42,10 @@ public:
|
||||
bool IsContainer( const wxDataViewItem& aItem ) const override;
|
||||
|
||||
void Sync( bool aForce = false,
|
||||
std::function<void(int, int, const wxString&)> aProgressCallback = [](int, int, const wxString&){} );
|
||||
std::function<void( int, int, const wxString&)> aProgressCallback = [](int, int, const wxString&){} );
|
||||
|
||||
int GetLibrariesCount() const override;
|
||||
|
||||
|
||||
TOOL_INTERACTIVE* GetContextMenuTool() override;
|
||||
|
||||
protected:
|
||||
@ -56,16 +58,17 @@ protected:
|
||||
bool GetAttr( wxDataViewItem const& aItem, unsigned int aCol,
|
||||
wxDataViewItemAttr& aAttr ) const override;
|
||||
|
||||
SYMBOL_TREE_SYNCHRONIZING_ADAPTER( SYMBOL_EDIT_FRAME* aParent, SYMBOL_LIBRARY_MANAGER* aLibMgr );
|
||||
SYMBOL_TREE_SYNCHRONIZING_ADAPTER( SYMBOL_EDIT_FRAME* aParent,
|
||||
SYMBOL_LIBRARY_MANAGER* aLibMgr );
|
||||
|
||||
protected:
|
||||
SYMBOL_EDIT_FRAME* m_frame;
|
||||
SYMBOL_LIBRARY_MANAGER* m_libMgr;
|
||||
|
||||
///> Hashes to decide whether a library needs an update
|
||||
///< Hashes to decide whether a library needs an update.
|
||||
std::map<wxString, int> m_libHashes;
|
||||
|
||||
///> SYMBOL_LIBRARY_MANAGER hash value returned in the last synchronization
|
||||
///< SYMBOL_LIBRARY_MANAGER hash value returned in the last synchronization.
|
||||
int m_lastSyncHash;
|
||||
};
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 Alexander Shuklin <Jasuramme@gmail.com>
|
||||
* Copyright (C) 2004-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2021 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
|
||||
@ -40,23 +40,23 @@ class SCH_EDIT_FRAME;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Back annotation algorithm class used to recieve, check, and apply a \ref NETLIST from
|
||||
* PCBNEW.
|
||||
* Back annotation algorithm class used to receive, check, and apply a \ref NETLIST from
|
||||
* Pcbnew.
|
||||
*
|
||||
* The following checks are made:
|
||||
* - Schematic symbol exists, but linked PCBnew footprint missing
|
||||
* - PCBnew footprint exists but no schematic symbol connected to
|
||||
* - PCBnew footprint is standalone
|
||||
* - Schematic symbol exists, but linked Pcbnew footprint missing.
|
||||
* - Pcbnew footprint exists but no schematic symbol connected to.
|
||||
* - Pcbnew footprint is standalone.
|
||||
* - Schematic sheet is reused one or more times and user trying to change footprint or value
|
||||
* only for few of them.
|
||||
* - Schematic symbols share same path
|
||||
* - More than one PCBnew footprint linked to same path
|
||||
|
||||
* only for few of them.
|
||||
* - Schematic symbols share same path.
|
||||
* - More than one Pcbnew footprint linked to same path.
|
||||
*/
|
||||
class BACK_ANNOTATE
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Struct to hold PCBnew footprint data
|
||||
* Struct to hold Pcbnew footprint data.
|
||||
*/
|
||||
struct PCB_FP_DATA
|
||||
{
|
||||
@ -74,7 +74,7 @@ public:
|
||||
std::map<wxString, wxString> m_pinMap;
|
||||
};
|
||||
|
||||
///> Map to hold NETLIST footprints data
|
||||
///< Map to hold NETLIST footprints data
|
||||
using PCB_FOOTPRINTS_MAP = std::map<wxString, std::shared_ptr<PCB_FP_DATA>>;
|
||||
|
||||
using CHANGELIST_ITEM = std::pair<SCH_REFERENCE, std::shared_ptr<PCB_FP_DATA>>;
|
||||
@ -85,7 +85,8 @@ public:
|
||||
~BACK_ANNOTATE();
|
||||
|
||||
/**
|
||||
* @brief Get netlist from the PCBnew.
|
||||
* Get netlist from the Pcbnew.
|
||||
*
|
||||
* @param aNetlist reference to where netlist will be stored
|
||||
* @return true if success
|
||||
*/
|
||||
@ -94,14 +95,40 @@ public:
|
||||
void PushNewLinksToPCB();
|
||||
|
||||
/**
|
||||
* @brief Run back annotation algorithm. If any errors, back annotation doesn't run.
|
||||
* only report
|
||||
* Run back annotation algorithm. If any errors, back annotation doesn't run.
|
||||
*
|
||||
* @param aNetlist netlist to run back annotation from
|
||||
* @return true if success
|
||||
*/
|
||||
bool BackAnnotateSymbols( const std::string& aNetlist );
|
||||
|
||||
private:
|
||||
/**
|
||||
* Parse netlist sent over KiWay express mail interface and fill \ref m_pcbModules.
|
||||
*
|
||||
* @param aPayload - netlist from Pcbnew
|
||||
* @return number of errors during parsing
|
||||
*/
|
||||
void getPcbModulesFromString( const std::string& aPayload );
|
||||
|
||||
///< Create changelist
|
||||
void getChangeList();
|
||||
|
||||
/**
|
||||
* Check if some symbols are not represented in PCB footprints and vice versa.
|
||||
* \ref m_refs must be sorted by path
|
||||
*/
|
||||
void checkForUnusedSymbols();
|
||||
|
||||
/**
|
||||
* Apply changelist to the schematic
|
||||
*/
|
||||
void applyChangelist();
|
||||
|
||||
void processNetNameChange( const wxString& aRef, SCH_PIN* aPin,
|
||||
const SCH_CONNECTION* aConnection, const wxString& aOldName,
|
||||
const wxString& aNewName );
|
||||
|
||||
REPORTER& m_reporter;
|
||||
|
||||
bool m_matchByReference;
|
||||
@ -119,31 +146,6 @@ private:
|
||||
|
||||
int m_changesCount; // Number of user-level changes
|
||||
bool m_appendUndo;
|
||||
|
||||
/**
|
||||
* @brief Parse netlist sent over KiWay epress mail interface and fill \ref m_pcbModules
|
||||
* @param aPayload - netlist from PCBnew
|
||||
* @return number of errors during parsing
|
||||
*/
|
||||
void getPcbModulesFromString( const std::string& aPayload );
|
||||
|
||||
///> Create changelist
|
||||
void getChangeList();
|
||||
|
||||
/**
|
||||
* @brief Check if some symbols are not represented in PCB footprints and vice versa.
|
||||
* \ref m_refs must be sorted by path
|
||||
*/
|
||||
void checkForUnusedSymbols();
|
||||
|
||||
/**
|
||||
* @brief Apply changelist to the schematic
|
||||
*/
|
||||
void applyChangelist();
|
||||
|
||||
void processNetNameChange( const wxString& aRef, SCH_PIN* aPin,
|
||||
const SCH_CONNECTION* aConnection, const wxString& aOldName,
|
||||
const wxString& aNewName );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2021 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
|
||||
@ -33,9 +33,7 @@ class TOOL_EVENT;
|
||||
class TOOL_MANAGER;
|
||||
|
||||
/**
|
||||
* EESCHEMA_ACTIONS
|
||||
*
|
||||
* Gathers all the actions that are shared by tools. The instance of SCH_ACTIONS is created
|
||||
* Gather all the actions that are shared by tools. The instance of SCH_ACTIONS is created
|
||||
* inside of ACTION_MANAGER object that registers the actions.
|
||||
*/
|
||||
class EE_ACTIONS : public ACTIONS
|
||||
@ -219,7 +217,7 @@ public:
|
||||
static TOOL_ACTION updateNetHighlighting;
|
||||
static TOOL_ACTION highlightNetTool;
|
||||
|
||||
///> @copydoc COMMON_ACTIONS::TranslateLegacyId()
|
||||
///< @copydoc COMMON_ACTIONS::TranslateLegacyId()
|
||||
virtual OPT<TOOL_EVENT> TranslateLegacyId( int aId ) override
|
||||
{
|
||||
return OPT<TOOL_EVENT>();
|
||||
|
@ -2,7 +2,7 @@
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2021 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
|
||||
@ -63,7 +63,7 @@ public:
|
||||
int UpdateMessagePanel( const TOOL_EVENT& aEvent );
|
||||
|
||||
private:
|
||||
///> @copydoc TOOL_INTERACTIVE::setTransitions();
|
||||
///< @copydoc TOOL_INTERACTIVE::setTransitions();
|
||||
void setTransitions() override;
|
||||
|
||||
private:
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user