KiCad PCB EDA Suite
Loading...
Searching...
No Matches
cadstar_sch_archive_loader.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2020-2021 Roberto Fernandez Bautista <[email protected]>
5 * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
26#ifndef CADSTAR_SCH_ARCHIVE_LOADER_H_
27#define CADSTAR_SCH_ARCHIVE_LOADER_H_
28
30
31#include <layer_ids.h> // SCH_LAYER_ID
32#include <plotters/plotter.h> // LINE_STYLE
33#include <pin_type.h> // ELECTRICAL_PINTYPE
34
35#include <memory>
36#include <map>
37
38#include <wx/filename.h>
39#include <wx/string.h>
40
42class BUS_ALIAS;
43class EDA_TEXT;
44class SPIN_STYLE;
45class LIB_SYMBOL;
46class REPORTER;
47class SCH_SYMBOL;
48class SCH_ITEM;
49class SCH_FIELD;
50class SCH_GLOBALLABEL;
51class SCH_HIERLABEL;
52class SCH_SHEET;
53class SCH_SHEET_PATH;
54class SCH_TEXT;
55class SCHEMATIC;
56
58{
59public:
60 // Size of tiny net labels when none present in original design
61 const int SMALL_LABEL_SIZE = KiROUND( (double) SCH_IU_PER_MM * 0.4 );
62 const double ARC_ACCURACY = SCH_IU_PER_MM * 0.01; // 0.01mm
63
64 explicit CADSTAR_SCH_ARCHIVE_LOADER( const wxString& aFilename, REPORTER* aReporter,
65 PROGRESS_REPORTER* aProgressReporter ) :
67 {
68 m_schematic = nullptr;
69 m_rootSheet = nullptr;
70 m_designCenter.x = 0;
71 m_designCenter.y = 0;
72 m_reporter = aReporter;
73 m_progressReporter = aProgressReporter;
74 m_fileName = aFilename;
75
76 // Assume that the PCB footprint library name will be the same as the schematic filename
77 wxFileName schFilename( Filename );
78 m_footprintLibName = schFilename.GetName();
79 }
80
81
83 {
84 }
85
86 std::vector<LIB_SYMBOL*> LoadPartsLib( const wxString& aFilename );
87
88 const std::vector<LIB_SYMBOL*>& GetLoadedSymbols() const { return m_loadedSymbols; }
89
90 void SetFpLibName( const wxString& aLibName ) { m_footprintLibName = aLibName; };
91
92
98 void Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSheet );
99
100 static wxString CreateLibName( const wxFileName& aFileName, const SCH_SHEET* aRootSheet );
101
102private:
103 typedef std::pair<BLOCK_ID, TERMINAL_ID> BLOCK_PIN_ID;
104 typedef std::pair<PART_ID, GATE_ID> PART_GATE_ID;
105
110 typedef std::map<TERMINAL_ID, wxString> TERMINAL_TO_PINNUM_MAP;
111
112 typedef std::map<wxString, TERMINAL_ID> PINNUM_TO_TERMINAL_MAP;
113
117 wxFileName m_fileName;
119
125
126 std::map<LAYER_ID, SCH_SHEET*> m_sheetMap;
127 std::map<BLOCK_PIN_ID, SCH_HIERLABEL*> m_sheetPinMap;
128 std::map<PART_ID, LIB_SYMBOL*> m_partMap;
129 std::map<SYMBOL_ID, SCH_SYMBOL*> m_powerSymMap;
130 std::map<wxString, LIB_SYMBOL*> m_powerSymLibMap;
131 std::map<SYMBOL_ID, SCH_GLOBALLABEL*> m_globalLabelsMap;
132 std::map<BUS_ID, std::shared_ptr<BUS_ALIAS>> m_busesMap;
133 std::map<PART_ID, TERMINAL_TO_PINNUM_MAP> m_pinNumsMap;
134 std::map<SYMDEF_ID, PINNUM_TO_TERMINAL_MAP> m_symDefTerminalsMap;
135
139 std::map<std::pair<wxString, wxString>, SYMDEF_ID> m_SymDefNamesCache;
140
144 std::map<wxString, SYMDEF_ID> m_DefaultSymDefNamesCache;
145
151 std::map<SYMDEF_ID, std::unique_ptr<const LIB_SYMBOL>> m_symDefMap;
152
153 std::vector<LIB_SYMBOL*> m_loadedSymbols;
154 std::map<PART_GATE_ID, SYMDEF_ID> m_partSymbolsMap;
156
157 void loadSheets();
159 void loadPartsLibrary();
161 void loadBusses();
162 void loadNets();
163 void loadFigures();
164 void loadTexts();
166 void loadTextVariables();
167
168 std::unique_ptr<LIB_SYMBOL> loadLibPart( const CADSTAR_PART_ENTRY& aPart );
169
170 void copySymbolItems( std::unique_ptr<LIB_SYMBOL>& aSourceSym,
171 std::unique_ptr<LIB_SYMBOL>& aDestSym, int aDestUnit,
172 bool aOverrideFields = true );
173
174 //Helper Functions for loading sheets
175 void loadSheetAndChildSheets( const LAYER_ID& aCadstarSheetID, const VECTOR2I& aPosition,
176 const VECTOR2I& aSheetSize, const SCH_SHEET_PATH& aParentSheet );
177
178 void loadChildSheets( const LAYER_ID& aCadstarSheetID, const SCH_SHEET_PATH& aSheet );
179
180 std::vector<LAYER_ID> findOrphanSheets();
181
182 int getSheetNumber( const LAYER_ID& aCadstarSheetID );
183
184 void loadItemOntoKiCadSheet( const LAYER_ID& aCadstarSheetID, SCH_ITEM* aItem );
185
186 //Helper Functions for loading library items
187 const LIB_SYMBOL* loadSymdef( const SYMDEF_ID& aSymdefID );
188
189 void loadSymbolGateAndPartFields( const SYMDEF_ID& aSymdefID, const PART& aCadstarPart,
190 const GATE_ID& aGateID, LIB_SYMBOL* aSymbol );
191
192 void setFootprintOnSymbol( std::unique_ptr<LIB_SYMBOL>& aKiCadSymbol,
193 const wxString& aFootprintName,
194 const wxString& aFootprintAlternate );
195
196 void loadLibrarySymbolShapeVertices( const std::vector<VERTEX>& aCadstarVertices,
197 const VECTOR2I& aSymbolOrigin, LIB_SYMBOL* aSymbol,
198 int aGateNumber, int aLineThickness );
199
200 void applyToLibraryFieldAttribute( const ATTRIBUTE_LOCATION& aCadstarAttrLoc,
201 const VECTOR2I& aSymbolOrigin, SCH_FIELD* aKiCadField );
202
203 //Helper Functions for loading symbols in schematic
204 SCH_SYMBOL* loadSchematicSymbol( const SYMBOL& aCadstarSymbol, const LIB_SYMBOL& aKiCadPart,
205 EDA_ANGLE& aComponentOrientation );
206
207
208 void loadSymbolFieldAttribute( const ATTRIBUTE_LOCATION& aCadstarAttrLoc,
209 const EDA_ANGLE& aComponentOrientation, bool aIsMirrored,
210 SCH_FIELD* aKiCadField );
211
212 int getComponentOrientation( const EDA_ANGLE& aOrientAngle, EDA_ANGLE& aReturnedOrientation );
213
214 //Helper functions for loading nets
215 POINT getLocationOfNetElement( const NET_SCH& aNet, const NETELEMENT_ID& aNetElementID );
216
217 wxString getNetName( const NET_SCH& aNet );
218
219 //Helper functions for loading figures / graphical items
220 void loadShapeVertices( const std::vector<VERTEX>& aCadstarVertices,
221 LINECODE_ID aCadstarLineCodeID, LAYER_ID aCadstarSheetID,
222 SCH_LAYER_ID aKiCadSchLayerID, const VECTOR2I& aMoveVector = { 0, 0 },
223 const EDA_ANGLE& aRotation = ANGLE_0,
224 const double& aScalingFactor = 1.0,
225 const VECTOR2I& aTransformCentre = { 0, 0 },
226 const bool& aMirrorInvert = false );
227
228 void loadFigure( const FIGURE& aCadstarFigure, const LAYER_ID& aCadstarSheetIDOverride,
229 SCH_LAYER_ID aKiCadSchLayerID, const VECTOR2I& aMoveVector = { 0, 0 },
230 const EDA_ANGLE& aRotation = ANGLE_0, const double& aScalingFactor = 1.0,
231 const VECTOR2I& aTransformCentre = { 0, 0 },
232 const bool& aMirrorInvert = false );
233
234 //Helper functions for loading text elements
235 void applyTextCodeIfExists( EDA_TEXT* aKiCadTextItem, const TEXTCODE_ID& aCadstarTextCodeID );
236
237 void applyTextSettings( EDA_TEXT* aKiCadTextItem,
238 const TEXTCODE_ID& aCadstarTextCodeID,
239 const ALIGNMENT& aCadstarAlignment,
240 const JUSTIFICATION& aCadstarJustification,
241 const long long aCadstarOrientAngle = 0,
242 bool aMirrored = false );
243
244 SCH_TEXT* getKiCadSchText( const TEXT& aCadstarTextElement );
245
246
247 //Helper Functions for obtaining CADSTAR elements from the parsed structures
248 SYMDEF_ID getSymDefFromName( const wxString& aSymdefName, const wxString& aSymDefAlternate );
249 bool isAttributeVisible( const ATTRIBUTE_ID& aCadstarAttributeID );
250
251 int getLineThickness( const LINECODE_ID& aCadstarLineCodeID );
252 LINE_STYLE getLineStyle( const LINECODE_ID& aCadstarLineCodeID );
253 PART getPart( const PART_ID& aCadstarPartID );
254 ROUTECODE getRouteCode( const ROUTECODE_ID& aCadstarRouteCodeID );
255 TEXTCODE getTextCode( const TEXTCODE_ID& aCadstarTextCodeID );
256 int getTextHeightFromTextCode( const TEXTCODE_ID& aCadstarTextCodeID );
257 wxString getAttributeName( const ATTRIBUTE_ID& aCadstarAttributeID );
258
259 PART::DEFINITION::PIN getPartDefinitionPin( const PART& aCadstarPart, const GATE_ID& aGateID,
260 const TERMINAL_ID& aTerminalID );
261
262 //Helper Functions for obtaining individual elements as KiCad elements:
264
265 int getKiCadUnitNumberFromGate( const GATE_ID& aCadstarGateID );
266 SPIN_STYLE getSpinStyle( const long long& aCadstarOrientation, bool aMirror );
267 SPIN_STYLE getSpinStyle( const EDA_ANGLE& aOrientation );
268 ALIGNMENT mirrorX( const ALIGNMENT& aCadstarAlignment );
269 ALIGNMENT rotate180( const ALIGNMENT& aCadstarAlignment );
270
271 //General Graphical manipulation functions
272
273 LIB_SYMBOL* getScaledLibPart( const LIB_SYMBOL* aSymbol, long long aScalingFactorNumerator,
274 long long aScalingFactorDenominator );
275
276 void fixUpLibraryPins( LIB_SYMBOL* aSymbolToFix, int aGateNumber );
277
278 std::pair<VECTOR2I, VECTOR2I> getFigureExtentsKiCad( const FIGURE& aCadstarFigure );
279
280 VECTOR2I getKiCadPoint( const VECTOR2I& aCadstarPoint );
281
282 VECTOR2I getKiCadLibraryPoint( const VECTOR2I& aCadstarPoint, const VECTOR2I& aCadstarCentre );
283
284 VECTOR2I applyTransform( const VECTOR2I& aPoint, const VECTOR2I& aMoveVector = { 0, 0 },
285 const EDA_ANGLE& aRotation = ANGLE_0,
286 const double& aScalingFactor = 1.0,
287 const VECTOR2I& aTransformCentre = { 0, 0 },
288 const bool& aMirrorInvert = false );
289
290 void checkDesignLimits();
291
292 int getKiCadLength( long long aCadstarLength )
293 {
294 int mod = aCadstarLength % KiCadUnitDivider;
295 int absmod = sign( mod ) * mod;
296 int offset = 0;
297
298 // Round half-way cases away from zero
299 if( absmod >= KiCadUnitDivider / 2 )
300 offset = sign( aCadstarLength );
301
302 return ( aCadstarLength / KiCadUnitDivider ) + offset;
303 }
304
305 EDA_ANGLE getAngle( const long long& aCadstarAngle )
306 {
307 // CADSTAR v6 (which outputted Schematic Format Version 8) and earlier used 1/10 degree
308 // as the unit for angles/orientations. It is assumed that CADSTAR version 7 (i.e. Schematic
309 // Format Version 9 and later) is the version that introduced 1/1000 degree for angles.
310 if( Header.Format.Version > 8 )
311 {
312 return EDA_ANGLE( (double) aCadstarAngle / 1000.0, DEGREES_T );
313 }
314 else
315 {
316 return EDA_ANGLE( (double) aCadstarAngle, TENTHS_OF_A_DEGREE_T );
317 }
318 }
319
320 long long getCadstarAngle( const EDA_ANGLE& aAngle )
321 {
322 // CADSTAR v6 (which outputted Schematic Format Version 8) and earlier used 1/10 degree
323 // as the unit for angles/orientations. It is assumed that CADSTAR version 7 (i.e. Schematic
324 // Format Version 9 and later) is the version that introduced 1/1000 degree for angles.
325 if( Header.Format.Version > 8 )
326 {
327 return KiROUND( aAngle.AsDegrees() * 1000.0 );
328 }
329 else
330 {
331 return aAngle.AsTenthsOfADegree();
332 }
333 }
334
340 double getPolarRadius( const VECTOR2I& aPoint );
341
342
343 static SCH_FIELD* addNewFieldToSymbol( const wxString& aFieldName,
344 std::unique_ptr<LIB_SYMBOL>& aKiCadSymbol );
345
346}; // CADSTAR_SCH_ARCHIVE_LOADER
347
348
349#endif // CADSTAR_SCH_ARCHIVE_LOADER_H_
constexpr double SCH_IU_PER_MM
Definition: base_units.h:72
CADSTAR_PIN_TYPE
file: cadstar_archive_objects.h Contains common object definitions
long TERMINAL_ID
Terminal is the pin identifier in the schematic.
ALIGNMENT
From CADSTAR Help: "Text Alignment enables you to define the position of an alignment origin for all ...
wxString LAYER_ID
ID of a Sheet (if schematic) or board Layer (if PCB)
JUSTIFICATION
From CADSTAR Help: "Multi Line Text can also be justified as Left, Centre or Right.
PROGRESS_REPORTER * m_progressReporter
static SCH_FIELD * addNewFieldToSymbol(const wxString &aFieldName, std::unique_ptr< LIB_SYMBOL > &aKiCadSymbol)
void loadItemOntoKiCadSheet(const LAYER_ID &aCadstarSheetID, SCH_ITEM *aItem)
const std::vector< LIB_SYMBOL * > & GetLoadedSymbols() const
void Load(SCHEMATIC *aSchematic, SCH_SHEET *aRootSheet)
Loads a CADSTAR Schematic Archive file into the KiCad SCHEMATIC object given.
ROUTECODE getRouteCode(const ROUTECODE_ID &aCadstarRouteCodeID)
static wxString CreateLibName(const wxFileName &aFileName, const SCH_SHEET *aRootSheet)
std::map< BLOCK_PIN_ID, SCH_HIERLABEL * > m_sheetPinMap
Cadstar->KiCad Sheet Pins.
VECTOR2I applyTransform(const VECTOR2I &aPoint, const VECTOR2I &aMoveVector={ 0, 0 }, const EDA_ANGLE &aRotation=ANGLE_0, const double &aScalingFactor=1.0, const VECTOR2I &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
std::map< SYMBOL_ID, SCH_GLOBALLABEL * > m_globalLabelsMap
Cadstar->KiCad Global Labels.
SCH_SYMBOL * loadSchematicSymbol(const SYMBOL &aCadstarSymbol, const LIB_SYMBOL &aKiCadPart, EDA_ANGLE &aComponentOrientation)
void applyTextSettings(EDA_TEXT *aKiCadTextItem, const TEXTCODE_ID &aCadstarTextCodeID, const ALIGNMENT &aCadstarAlignment, const JUSTIFICATION &aCadstarJustification, const long long aCadstarOrientAngle=0, bool aMirrored=false)
CADSTAR_SCH_ARCHIVE_LOADER(const wxString &aFilename, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter)
void loadSheetAndChildSheets(const LAYER_ID &aCadstarSheetID, const VECTOR2I &aPosition, const VECTOR2I &aSheetSize, const SCH_SHEET_PATH &aParentSheet)
wxString getAttributeName(const ATTRIBUTE_ID &aCadstarAttributeID)
std::vector< LIB_SYMBOL * > m_loadedSymbols
Loaded symbols so far.
PART getPart(const PART_ID &aCadstarPartID)
std::vector< LAYER_ID > findOrphanSheets()
std::map< BUS_ID, std::shared_ptr< BUS_ALIAS > > m_busesMap
Cadstar->KiCad Buses.
SCH_TEXT * getKiCadSchText(const TEXT &aCadstarTextElement)
std::map< TERMINAL_ID, wxString > TERMINAL_TO_PINNUM_MAP
Map between a terminal ID in a symbol definition to the pin number that should be imported into KiCad...
wxString getNetName(const NET_SCH &aNet)
std::pair< BLOCK_ID, TERMINAL_ID > BLOCK_PIN_ID
std::map< SYMBOL_ID, SCH_SYMBOL * > m_powerSymMap
Cadstar->KiCad Power Symbols.
std::pair< PART_ID, GATE_ID > PART_GATE_ID
VECTOR2I getKiCadLibraryPoint(const VECTOR2I &aCadstarPoint, const VECTOR2I &aCadstarCentre)
PART::DEFINITION::PIN getPartDefinitionPin(const PART &aCadstarPart, const GATE_ID &aGateID, const TERMINAL_ID &aTerminalID)
std::map< wxString, TERMINAL_ID > PINNUM_TO_TERMINAL_MAP
std::map< SYMDEF_ID, PINNUM_TO_TERMINAL_MAP > m_symDefTerminalsMap
int getTextHeightFromTextCode(const TEXTCODE_ID &aCadstarTextCodeID)
void loadChildSheets(const LAYER_ID &aCadstarSheetID, const SCH_SHEET_PATH &aSheet)
void applyToLibraryFieldAttribute(const ATTRIBUTE_LOCATION &aCadstarAttrLoc, const VECTOR2I &aSymbolOrigin, SCH_FIELD *aKiCadField)
double getPolarRadius(const VECTOR2I &aPoint)
void setFootprintOnSymbol(std::unique_ptr< LIB_SYMBOL > &aKiCadSymbol, const wxString &aFootprintName, const wxString &aFootprintAlternate)
void applyTextCodeIfExists(EDA_TEXT *aKiCadTextItem, const TEXTCODE_ID &aCadstarTextCodeID)
int getSheetNumber(const LAYER_ID &aCadstarSheetID)
void copySymbolItems(std::unique_ptr< LIB_SYMBOL > &aSourceSym, std::unique_ptr< LIB_SYMBOL > &aDestSym, int aDestUnit, bool aOverrideFields=true)
int getLineThickness(const LINECODE_ID &aCadstarLineCodeID)
TEXTCODE getTextCode(const TEXTCODE_ID &aCadstarTextCodeID)
SPIN_STYLE getSpinStyle(const long long &aCadstarOrientation, bool aMirror)
std::map< wxString, LIB_SYMBOL * > m_powerSymLibMap
NetName->KiCad Power Lib Symbol.
std::map< std::pair< wxString, wxString >, SYMDEF_ID > m_SymDefNamesCache
Cache storing symbol names and alternates to symdef IDs.
std::map< PART_ID, TERMINAL_TO_PINNUM_MAP > m_pinNumsMap
Cadstar Part->KiCad Pin number map.
std::vector< LIB_SYMBOL * > LoadPartsLib(const wxString &aFilename)
ELECTRICAL_PINTYPE getKiCadPinType(const CADSTAR_PIN_TYPE &aPinType)
wxString m_footprintLibName
Name of the footprint library to prepend all footprints with.
int getKiCadLength(long long aCadstarLength)
std::map< PART_ID, LIB_SYMBOL * > m_partMap
Cadstar->KiCad Parts.
bool isAttributeVisible(const ATTRIBUTE_ID &aCadstarAttributeID)
VECTOR2I getKiCadPoint(const VECTOR2I &aCadstarPoint)
EDA_ANGLE getAngle(const long long &aCadstarAngle)
std::map< wxString, SYMDEF_ID > m_DefaultSymDefNamesCache
Cache storing symbol names (default alternate) to symdef IDs.
void loadSymbolGateAndPartFields(const SYMDEF_ID &aSymdefID, const PART &aCadstarPart, const GATE_ID &aGateID, LIB_SYMBOL *aSymbol)
void loadFigure(const FIGURE &aCadstarFigure, const LAYER_ID &aCadstarSheetIDOverride, SCH_LAYER_ID aKiCadSchLayerID, const VECTOR2I &aMoveVector={ 0, 0 }, const EDA_ANGLE &aRotation=ANGLE_0, const double &aScalingFactor=1.0, const VECTOR2I &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
std::map< PART_GATE_ID, SYMDEF_ID > m_partSymbolsMap
Map holding the symbols loaded so far for a particular PART_ID and GATE_ID.
LIB_SYMBOL * getScaledLibPart(const LIB_SYMBOL *aSymbol, long long aScalingFactorNumerator, long long aScalingFactorDenominator)
SYMDEF_ID getSymDefFromName(const wxString &aSymdefName, const wxString &aSymDefAlternate)
std::pair< VECTOR2I, VECTOR2I > getFigureExtentsKiCad(const FIGURE &aCadstarFigure)
std::map< LAYER_ID, SCH_SHEET * > m_sheetMap
Cadstar->KiCad Sheets.
POINT getLocationOfNetElement(const NET_SCH &aNet, const NETELEMENT_ID &aNetElementID)
void fixUpLibraryPins(LIB_SYMBOL *aSymbolToFix, int aGateNumber)
std::map< SYMDEF_ID, std::unique_ptr< const LIB_SYMBOL > > m_symDefMap
Cadstar->KiCad Lib Symbols loaded so far.
std::unique_ptr< LIB_SYMBOL > loadLibPart(const CADSTAR_PART_ENTRY &aPart)
ALIGNMENT rotate180(const ALIGNMENT &aCadstarAlignment)
void SetFpLibName(const wxString &aLibName)
long long getCadstarAngle(const EDA_ANGLE &aAngle)
void loadLibrarySymbolShapeVertices(const std::vector< VERTEX > &aCadstarVertices, const VECTOR2I &aSymbolOrigin, LIB_SYMBOL *aSymbol, int aGateNumber, int aLineThickness)
LINE_STYLE getLineStyle(const LINECODE_ID &aCadstarLineCodeID)
VECTOR2I m_designCenter
Required for calculating the offset to apply to the Cadstar design so that it fits in the KiCad canva...
ALIGNMENT mirrorX(const ALIGNMENT &aCadstarAlignment)
int getComponentOrientation(const EDA_ANGLE &aOrientAngle, EDA_ANGLE &aReturnedOrientation)
void loadShapeVertices(const std::vector< VERTEX > &aCadstarVertices, LINECODE_ID aCadstarLineCodeID, LAYER_ID aCadstarSheetID, SCH_LAYER_ID aKiCadSchLayerID, const VECTOR2I &aMoveVector={ 0, 0 }, const EDA_ANGLE &aRotation=ANGLE_0, const double &aScalingFactor=1.0, const VECTOR2I &aTransformCentre={ 0, 0 }, const bool &aMirrorInvert=false)
const LIB_SYMBOL * loadSymdef(const SYMDEF_ID &aSymdefID)
int getKiCadUnitNumberFromGate(const GATE_ID &aCadstarGateID)
void loadSymbolFieldAttribute(const ATTRIBUTE_LOCATION &aCadstarAttrLoc, const EDA_ANGLE &aComponentOrientation, bool aIsMirrored, SCH_FIELD *aKiCadField)
Represents a CADSTAR Schematic Archive (*.csa) file.
int KiCadUnitDivider
Use this value to convert units in this CSA file to KiCad units.
int AsTenthsOfADegree() const
Definition: eda_angle.h:115
double AsDegrees() const
Definition: eda_angle.h:113
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Definition: eda_text.h:79
Define a library symbol object.
Definition: lib_symbol.h:78
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
Holds all the data relating to one schematic.
Definition: schematic.h:76
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Definition: sch_field.h:51
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition: sch_item.h:166
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition: sch_sheet.h:57
Schematic symbol object.
Definition: sch_symbol.h:106
static constexpr EDA_ANGLE ANGLE_0
Definition: eda_angle.h:401
@ TENTHS_OF_A_DEGREE_T
Definition: eda_angle.h:30
@ DEGREES_T
Definition: eda_angle.h:31
SCH_LAYER_ID
Eeschema drawing layers.
Definition: layer_ids.h:354
ELECTRICAL_PINTYPE
The symbol library pin object electrical types used in ERC tests.
Definition: pin_type.h:36
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:48
long Version
Archive version number (e.g.
Represents a point in x,y coordinates.
int sign(T val)
Definition: util.h:171
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:121