![]() |
KiCad PCB EDA Suite
|
NETLIST_EXPORTER_CADSTAR generates a netlist compatible with CADSTAR. More...
#include <netlist_exporter_cadstar.h>
Public Member Functions | |
NETLIST_EXPORTER_CADSTAR (SCHEMATIC *aSchematic) | |
bool | WriteNetlist (const wxString &aOutFileName, unsigned aNetlistOptions) override |
Function WriteList writes to specified output file. More... | |
Static Public Member Functions | |
static wxString | MakeCommandLine (const wxString &aFormatString, const wxString &aNetlistFile, const wxString &aFinalFile, const wxString &aProjectDirectory) |
Function MakeCommandLine builds up a string that describes a command line for executing a child process. More... | |
Protected Member Functions | |
void | CreatePinList (SCH_COMPONENT *aSymbol, SCH_SHEET_PATH *aSheetPath) |
Function findNextSymbolAndCreatePinList finds a symbol from the DrawList and builds its pin list in m_sortedSymbolPinList. More... | |
SCH_COMPONENT * | findNextSymbol (EDA_ITEM *aItem, SCH_SHEET_PATH *aSheetPath) |
Checks if the given symbol should be processed for netlisting. More... | |
void | eraseDuplicatePins () |
Function eraseDuplicatePins erase duplicate Pins from m_sortedSymbolPinList (i.e. More... | |
void | findAllUnitsOfSymbol (SCH_COMPONENT *aSymbol, LIB_PART *aPart, SCH_SHEET_PATH *aSheetPath) |
Function findAllUnitsOfSymbol is used for "multiple parts per package" symbols. More... | |
Protected Attributes | |
std::vector< PIN_INFO > | m_sortedSymbolPinList |
Used to temporarily store and filter the list of pins of a schematic symbol when generating schematic symbol data in netlist (comp section). More... | |
UNIQUE_STRINGS | m_referencesAlreadyFound |
Used for "multiple parts per package" symbols to avoid processing a lib part more than once. More... | |
std::set< LIB_PART *, LIB_PART_LESS_THAN > | m_libParts |
unique library parts used. LIB_PART items are sorted by names More... | |
SCHEMATIC_IFACE * | m_schematic |
The schematic we're generating a netlist for. More... | |
SCH_SHEET_PATH | m_savedCurrentSheet |
The schematic's CurrentSheet when we entered. Restore on exiting. More... | |
Private Member Functions | |
bool | writeListOfNets (FILE *f) |
Function writeListOfNetsCADSTAR writes a net list (ranked by Netcode), and pins connected to it. More... | |
NETLIST_EXPORTER_CADSTAR generates a netlist compatible with CADSTAR.
Definition at line 36 of file netlist_exporter_cadstar.h.
|
inline |
Definition at line 51 of file netlist_exporter_cadstar.h.
|
protectedinherited |
Function findNextSymbolAndCreatePinList finds a symbol from the DrawList and builds its pin list in m_sortedSymbolPinList.
This list is sorted by pin num. The symbol is the next actual symbol after aSymbol.
Power symbols and virtual symbols that have their reference designators starting with '#' are skipped.
Definition at line 122 of file netlist_exporter_base.cpp.
References SCHEMATIC_IFACE::ConnectionGraph(), NETLIST_EXPORTER_BASE::eraseDuplicatePins(), NETLIST_EXPORTER_BASE::findAllUnitsOfSymbol(), CONNECTION_GRAPH::FindSubgraphByName(), SCH_COMPONENT::GetPartRef(), SCH_COMPONENT::GetPins(), SCH_COMPONENT::GetRef(), CONNECTION_SUBGRAPH::m_items, NETLIST_EXPORTER_BASE::m_libParts, CONNECTION_SUBGRAPH::m_no_connect, NETLIST_EXPORTER_BASE::m_schematic, NETLIST_EXPORTER_BASE::m_sortedSymbolPinList, and sortPinsByNum().
Referenced by NETLIST_EXPORTER_PSPICE::ProcessNetlist(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().
|
protectedinherited |
Function eraseDuplicatePins erase duplicate Pins from m_sortedSymbolPinList (i.e.
set pointer in this list to NULL). (This is a list of pins found in the whole schematic, for a single symbol.) These duplicate pins were put in list because some pins (power pins...) are found more than once when in "multiple parts per package" symbols. For instance, a 74ls00 has 4 parts, and therefore the VCC pin and GND pin appears 4 times in the list. Note: this list MUST be sorted by pin number (.m_PinNum member value) Also set the m_Flag member of "removed" NETLIST_OBJECT pin item to 1
Definition at line 183 of file netlist_exporter_base.cpp.
References NETLIST_EXPORTER_BASE::m_sortedSymbolPinList.
Referenced by NETLIST_EXPORTER_BASE::CreatePinList().
|
protectedinherited |
Function findAllUnitsOfSymbol is used for "multiple parts per package" symbols.
Search the entire design for all units of aSymbol based on matching reference designator, and for each unit, add all its pins to the temporary sorted pin list, m_sortedSymbolPinList.
Definition at line 216 of file netlist_exporter_base.cpp.
References SCHEMATIC_IFACE::ConnectionGraph(), CONNECTION_GRAPH::FindSubgraphByName(), SCH_COMPONENT::GetPins(), SCH_COMPONENT::GetRef(), SCHEMATIC_IFACE::GetSheets(), CONNECTION_SUBGRAPH::m_items, CONNECTION_SUBGRAPH::m_no_connect, NETLIST_EXPORTER_BASE::m_schematic, NETLIST_EXPORTER_BASE::m_sortedSymbolPinList, and SCH_COMPONENT_T.
Referenced by NETLIST_EXPORTER_BASE::CreatePinList().
|
protectedinherited |
Checks if the given symbol should be processed for netlisting.
Prevents processing multi-unit symbols more than once, etc.
aItem | is a symbol to check |
aSheetPath | is the sheet to check the symbol for |
Definition at line 74 of file netlist_exporter_base.cpp.
References SCH_COMPONENT::GetPartRef(), SCH_COMPONENT::GetRef(), UNIQUE_STRINGS::Lookup(), NETLIST_EXPORTER_BASE::m_libParts, NETLIST_EXPORTER_BASE::m_referencesAlreadyFound, SCH_COMPONENT_T, and EDA_ITEM::Type().
Referenced by NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), and WriteNetlist().
|
staticinherited |
Function MakeCommandLine builds up a string that describes a command line for executing a child process.
The input and output file names along with any options to the executable are all possibly in the returned string.
aFormatString | holds:
|
aNetlistFile | is the name of the input file for the external program, that is a intermediate netlist file in xml format. |
aFinalFile | is the name of the output file that the user expects. |
aProjectDirectory | is used for P replacement, it should omit the trailing '/'. |
Supported formatting sequences and their meaning:
Definition at line 38 of file netlist_exporter_base.cpp.
Referenced by SCH_EDIT_FRAME::WriteNetListFile().
|
private |
Function writeListOfNetsCADSTAR writes a net list (ranked by Netcode), and pins connected to it.
Format:
Definition at line 109 of file netlist_exporter_cadstar.cpp.
References SCHEMATIC_IFACE::ConnectionGraph(), CONNECTION_GRAPH::GetNetMap(), SCH_PIN::GetNumber(), SCH_PIN::GetParentSymbol(), SCH_COMPONENT::GetRef(), NETLIST_EXPORTER_BASE::m_schematic, SCH_PIN_T, StartLine(), TO_UTF8, and EDA_ITEM::Type().
Referenced by WriteNetlist().
|
overridevirtual |
Function WriteList writes to specified output file.
Reimplemented from NETLIST_EXPORTER_BASE.
Definition at line 39 of file netlist_exporter_cadstar.cpp.
References _, UNIQUE_STRINGS::Clear(), DateAndTime(), DisplayError(), NETLIST_EXPORTER_BASE::findNextSymbol(), FOOTPRINT_FIELD, GetBuildVersion(), SCH_COMPONENT::GetField(), SCH_COMPONENT::GetRef(), SCHEMATIC_IFACE::GetSheets(), SCH_FIELD::GetShownText(), SCH_COMPONENT::GetValue(), SCH_FIELD::IsVoid(), NETLIST_EXPORTER_BASE::m_referencesAlreadyFound, NETLIST_EXPORTER_BASE::m_schematic, NULL, SCH_COMPONENT_T, StartLine(), TO_UTF8, and writeListOfNets().
|
protectedinherited |
unique library parts used. LIB_PART items are sorted by names
Definition at line 108 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_BASE::CreatePinList(), NETLIST_EXPORTER_BASE::findNextSymbol(), NETLIST_EXPORTER_XML::makeLibParts(), NETLIST_EXPORTER_XML::makeSymbols(), and NETLIST_EXPORTER_PSPICE::ProcessNetlist().
|
protectedinherited |
Used for "multiple parts per package" symbols to avoid processing a lib part more than once.
Definition at line 105 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_BASE::findNextSymbol(), NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), and WriteNetlist().
|
protectedinherited |
The schematic's CurrentSheet when we entered. Restore on exiting.
Definition at line 114 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_BASE::NETLIST_EXPORTER_BASE(), and NETLIST_EXPORTER_BASE::~NETLIST_EXPORTER_BASE().
|
protectedinherited |
The schematic we're generating a netlist for.
Definition at line 111 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_XML::addSymbolFields(), NETLIST_EXPORTER_BASE::CreatePinList(), NETLIST_EXPORTER_BASE::findAllUnitsOfSymbol(), NETLIST_EXPORTER_PSPICE::Format(), NETLIST_EXPORTER_XML::makeDesignHeader(), NETLIST_EXPORTER_XML::makeLibraries(), NETLIST_EXPORTER_XML::makeListOfNets(), NETLIST_EXPORTER_XML::makeSymbols(), NETLIST_EXPORTER_BASE::NETLIST_EXPORTER_BASE(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), NETLIST_EXPORTER_PSPICE::UpdateDirectives(), writeListOfNets(), NETLIST_EXPORTER_ORCADPCB2::WriteNetlist(), WriteNetlist(), and NETLIST_EXPORTER_BASE::~NETLIST_EXPORTER_BASE().
|
protectedinherited |
Used to temporarily store and filter the list of pins of a schematic symbol when generating schematic symbol data in netlist (comp section).
No ownership of members. TODO(snh): Descope this object
Definition at line 101 of file netlist_exporter_base.h.
Referenced by NETLIST_EXPORTER_BASE::CreatePinList(), NETLIST_EXPORTER_BASE::eraseDuplicatePins(), NETLIST_EXPORTER_BASE::findAllUnitsOfSymbol(), NETLIST_EXPORTER_PSPICE::ProcessNetlist(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().