KiCad PCB EDA Suite
Loading...
Searching...
No Matches
import_fabmaster.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 The KiCad Developers, see AUTHORS.txt for contributors.
5 * Author: Seth Hillbrand <[email protected]>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21
22#ifndef PCBNEW_IMPORTERS_IMPORT_FABMASTER_H_
23#define PCBNEW_IMPORTERS_IMPORT_FABMASTER_H_
24
25#include <eda_text.h>
26#include <geometry/shape_arc.h>
27#include <padstack.h>
28#include <reporter.h>
29
30#include <deque>
31#include <functional>
32#include <iostream>
33#include <map>
34#include <memory>
35#include <set>
36#include <unordered_map>
37#include <string>
38#include <vector>
39
40#include <wx/filename.h>
41
42enum PCB_LAYER_ID : int;
43class BOARD;
44class BOARD_ITEM;
45class PCB_TEXT;
47
49{
50public:
51
52 using single_row = std::vector<std::string>;
54 has_pads( false ),
55 has_comps( false ),
56 has_graphic( false ),
57 has_nets( false ),
58 has_pins( false ),
59 m_reporter( nullptr ),
60 m_progressReporter( nullptr ),
61 m_doneCount( 0 ),
63 m_totalCount( 0 )
64
65 {}
66
67 bool Read( const std::string& aFile );
68
69 bool Process();
70
75 void SetReporter( REPORTER* aReporter ) { m_reporter = aReporter; }
76
77 bool LoadBoard( BOARD* aBoard, PROGRESS_REPORTER* aProgressReporter );
78
79private:
80
81 wxFileName m_filename;
82
98
99 std::deque<single_row> rows;
100
106
107
110 {
112 std::string custom_name;
113 bool is_octogon = false;
114 int width = 0;
115 int height = 0;
116 int x_offset = 0;
117 int y_offset = 0;
118 };
119
120 struct FM_PAD
121 {
122 std::string name;
123 bool fixed;
124 bool via;
126 std::string custom_name;
127 bool top;
128 bool bottom;
129 bool paste;
130 bool mask;
131 bool drill;
132 bool plated;
136 int width;
145 std::set<std::string> copper_layers;
146 std::map<std::string, FM_PAD_LAYER> layer_shapes;
147
148 struct HASH
149 {
150 std::size_t operator()( const FM_PAD& aPad ) const
151 {
152 return std::hash<std::string>{}( aPad.name );
153 }
154 };
155 };
156
157 std::unordered_map<std::string, FM_PAD> pads;
158
166
175
176 // A!NET_NAME!REFDES!PIN_NUMBER!PIN_NAME!PIN_GROUND!PIN_POWER!
177 struct NETNAME
178 {
179 std::string name;
180 std::string refdes;
181 std::string pin_num;
182 std::string pin_name;
183 bool pin_gnd;
184 bool pin_pwr;
185
186 struct LESS
187 {
188 bool operator()(const NETNAME& lhs, const NETNAME& rhs) const
189 {
190 if( lhs.refdes == rhs.refdes )
191 return lhs.pin_num < rhs.pin_num;
192
193 return lhs.refdes < rhs.refdes;
194 }
195 };
196 };
197
198 std::map<std::pair<std::string, std::string>, NETNAME> pin_nets;
199 std::set<std::string> netnames;
200
201 struct CLASS
202 {
203 std::string name;
204 std::string subclass;
205 };
206
207
219
229
231 {
232 virtual ~GRAPHIC_ITEM() = default;
233
236 int width;
237 std::string layer;
238 std::string symbol;
239 std::string refdes;
240 int seq;
241 int subseq;
244
245
246 struct SEQ_CMP
247 {
248 bool operator()(const std::unique_ptr<GRAPHIC_ITEM>& lhs,
249 const std::unique_ptr<GRAPHIC_ITEM>& rhs) const
250 {
251 if( lhs->refdes != rhs->refdes )
252 return lhs->refdes < rhs->refdes;
253
254 if( lhs->layer != rhs->layer )
255 return lhs->layer < rhs->layer;
256
257 return lhs->seq < rhs->seq;
258 }
259 };
260 };
261
263 {
264 int end_x;
265 int end_y;
267 };
268
269 struct GRAPHIC_ARC : public GRAPHIC_ITEM
270 {
271 int end_x;
272 int end_y;
275 int radius;
278
280 };
281
283 {
284 int end_x;
285 int end_y;
286 bool fill;
287 };
288
290 {
291 bool oblong_x;
292 int size_x;
293 int size_y;
294 // width is GRAPHIC_DATA5 (or is it fill?)
295 };
296
298 {
299 bool oblong_x;
300 int size_x;
301 int size_y;
302 // width is GRAPHIC_DATA5
303 };
304
305 // Handles hexagons, triangles, octagons
307 {
308 std::vector<VECTOR2I> m_pts;
309 };
310
312 {
313 double rotation;
314 bool mirror;
316 // GRAPHIC_DATA_6 is
317 // SIZE FONT HEIGHT WIDTH ITAL LINESPACE THICKNESS
318 int height;
320 bool ital;
321
322 std::string text;
323 };
324
325 using graphic_element = std::set<std::unique_ptr<GRAPHIC_ITEM>, GRAPHIC_ITEM::SEQ_CMP>;
326
330 {
331 int id;
332 std::string name;
333 bool positive;
334 std::string use;
336 double er;
338 std::string material;
339 bool shield;
341 double thickness;
343 bool disable;
344
345 struct BY_ID
346 {
347 bool operator()(const FABMASTER_LAYER* lhs, const FABMASTER_LAYER* rhs) const
348 {
349 return lhs->id < rhs->id;
350 }
351 };
352 };
353
354 std::map<std::string, FABMASTER_LAYER> layers;
355
362 {
363 std::string name;
364 std::string padstack;
365 std::string refdes;
366 std::string pinnum;
367 std::map<int, graphic_element> elements;
368
369 struct HASH
370 {
371 std::size_t operator()( const std::unique_ptr<FABMASTER_PAD_SHAPE>& aPad ) const
372 {
373 return std::hash<std::string>{}( aPad->name );
374 }
375 };
376 };
377
378 std::unordered_map<std::string, FABMASTER_PAD_SHAPE> pad_shapes;
379
380 // * A!SYM_TYPE!SYM_NAME!REFDES!SYM_X!SYM_Y!SYM_ROTATE!SYM_MIRROR!NET_NAME!CLASS!SUBCLASS!RECORD_TAG!
381 // * GRAPHIC_DATA_NAME!GRAPHIC_DATA_NUMBER!GRAPHIC_DATA_1!GRAPHIC_DATA_2!GRAPHIC_DATA_3!GRAPHIC_DATA_4!
382 // * GRAPHIC_DATA_5!GRAPHIC_DATA_6!GRAPHIC_DATA_7!GRAPHIC_DATA_8!GRAPHIC_DATA_9!GRAPHIC_DATA_10!COMP_DEVICE_TYPE!
383 // * COMP_PACKAGE!COMP_PART_NUMBER!COMP_VALUE!CLIP_DRAWING!
384 struct SYMBOL
385 {
386 int sym_id;
387 int seq_id;
389 std::string name;
390 std::string refdes;
391 int x;
392 int y;
393 std::map<int, graphic_element> elements;
394
395 struct HASH
396 {
397 std::size_t operator()( const FABMASTER::SYMBOL& aSym ) const
398 {
399 return std::hash<std::string>{}( aSym.name );
400 }
401 };
402 };
403
404 // Temporary data structure to pass graphic data from file for processing
406 {
407 std::string graphic_dataname;
408 std::string graphic_datanum;
409 std::string graphic_data1;
410 std::string graphic_data2;
411 std::string graphic_data3;
412 std::string graphic_data4;
413 std::string graphic_data5;
414 std::string graphic_data6;
415 std::string graphic_data7;
416 std::string graphic_data8;
417 std::string graphic_data9;
418 std::string graphic_data10;
419 };
420
421 std::unordered_map<std::string, SYMBOL> symbols;
422
423
424 // * A!GRAPHIC_DATA_NAME!GRAPHIC_DATA_NUMBER!RECORD_TAG!GRAPHIC_DATA_1!GRAPHIC_DATA_2!GRAPHIC_DATA_3!
425 // * GRAPHIC_DATA_4!GRAPHIC_DATA_5!GRAPHIC_DATA_6!GRAPHIC_DATA_7!GRAPHIC_DATA_8!GRAPHIC_DATA_9!
426 // * SUBCLASS!SYM_NAME!REFDES!
427
429 {
430 std::string subclass;
431 std::string name;
432 std::string refdes;
433 int id;
434
435 std::unique_ptr<graphic_element> elements;
436
437 struct BY_ID
438 {
439 bool operator()(const GEOM_GRAPHIC& lhs, const GEOM_GRAPHIC& rhs) const
440 {
441 return lhs.id < rhs.id;
442 }
443 };
444 };
445
446 std::vector<GEOM_GRAPHIC> board_graphics;
447 std::map<std::string, std::map<int, GEOM_GRAPHIC>> comp_graphics;
448
449
450 // A!VIA_X!VIA_Y!PAD_STACK_NAME!NET_NAME!TEST_POINT!
451 struct FM_VIA
452 {
453 int x;
454 int y;
455 std::string padstack;
456 std::string net;
458 bool mirror;
459 };
460
461 std::vector<std::unique_ptr<FM_VIA>> vias;
462
463 // A!CLASS!SUBCLASS!GRAPHIC_DATA_NAME!GRAPHIC_DATA_NUMBER!RECORD_TAG!GRAPHIC_DATA_1!
464 // GRAPHIC_DATA_2!GRAPHIC_DATA_3!GRAPHIC_DATA_4!GRAPHIC_DATA_5!GRAPHIC_DATA_6!GRAPHIC_DATA_7!
465 // GRAPHIC_DATA_8!GRAPHIC_DATA_9!NET_NAME!
466 struct TRACE
467 {
468 std::string lclass;
469 std::string layer;
470 std::string netname;
471 int id;
472
474
475 struct BY_ID
476 {
477 bool operator()(const std::unique_ptr<TRACE>& lhs, const std::unique_ptr<TRACE>& rhs) const
478 {
479 return lhs->id < rhs->id;
480 }
481 };
482 };
483
484 std::set<std::unique_ptr<TRACE>, TRACE::BY_ID> traces;
485
486 std::set<std::unique_ptr<TRACE>, TRACE::BY_ID> zones;
487
488 std::set<std::unique_ptr<TRACE>, TRACE::BY_ID> polygons;
489
490 std::set<std::unique_ptr<TRACE>, TRACE::BY_ID> refdes;
491
492
493 // A!REFDES!COMP_CLASS!COMP_PART_NUMBER!COMP_HEIGHT!COMP_DEVICE_LABEL!COMP_INSERTION_CODE!SYM_TYPE!
494 // SYM_NAME!SYM_MIRROR!SYM_ROTATE!SYM_X!SYM_Y!COMP_VALUE!COMP_TOL!COMP_VOLTAGE!
496 {
497 std::string refdes;
499 std::string pn;
500 std::string height;
501 std::string dev_label;
502 std::string insert_code;
504 std::string name;
505 bool mirror;
506 double rotate;
507 int x;
508 int y;
509 std::string value;
510 std::string tol;
511 std::string voltage;
512
513 struct HASH
514 {
515 std::size_t operator()( const FABMASTER::COMPONENT& aCmp ) const
516 {
517 return std::hash<std::string>{}( aCmp.refdes );
518 }
519 };
520
521 };
522
523 std::map<std::string, std::vector<std::unique_ptr<COMPONENT>>> components;
524
525
526 // A!SYM_NAME!SYM_MIRROR!PIN_NAME!PIN_NUMBER!PIN_X!PIN_Y!PAD_STACK_NAME!REFDES!PIN_ROTATION!TEST_POINT!
527
528 struct PIN
529 {
530 std::string name;
531 bool mirror;
532 std::string pin_name;
533 std::string pin_number;
534 int pin_x;
535 int pin_y;
536 std::string padstack;
537 std::string refdes;
538 double rotation;
539
540 struct BY_NUM
541 {
542 bool operator()(const std::unique_ptr<PIN>& lhs,
543 const std::unique_ptr<PIN>& rhs) const
544 {
545 return lhs->pin_number < rhs->pin_number;
546 }
547 };
548 };
549
550 std::map<std::string, std::set<std::unique_ptr<PIN>, PIN::BY_NUM>> pins;
551
552 std::map<std::string, PCB_LAYER_ID> layer_map;
553
554 section_type detectType( size_t aOffset );
555
556 void checkpoint();
557
558 int execute_recordbuffer( int filetype );
559 int getColFromName( size_t aRow, const std::string& aStr );
560 SYMTYPE parseSymType( const std::string& aSymType );
561 COMPCLASS parseCompClass( const std::string& aCompClass );
562
569 double processScaleFactor( size_t aRow );
570 size_t processPadStacks( size_t aRow );
571 size_t processCustomPads( size_t aRow );
572 size_t processGeometry( size_t aRow );
573 size_t processVias( size_t aRow );
574 size_t processTraces( size_t aRow );
575 size_t processFootprints( size_t aRow );
576 size_t processNets( size_t aRow );
577 size_t processLayers( size_t aRow );
578 size_t processSimpleLayers( size_t aRow );
579 size_t processPadStackLayers( size_t aRow );
580 size_t processSymbols( size_t aRow );
581 size_t processPins( size_t aRow );
582
590 GRAPHIC_ITEM* processGraphic( const GRAPHIC_DATA& aData, double aScale );
591
592 GRAPHIC_ARC* processArc( const GRAPHIC_DATA& aData, double aScale );
593 GRAPHIC_ARC* processCircle( const GRAPHIC_DATA& aData, double aScale );
594 GRAPHIC_LINE* processLine( const GRAPHIC_DATA& aData, double aScale );
595 GRAPHIC_TEXT* processText( const GRAPHIC_DATA& aData, double aScale );
596 GRAPHIC_RECTANGLE* processRectangle( const GRAPHIC_DATA& aData, double aScale );
597 GRAPHIC_RECTANGLE* processFigRectangle( const GRAPHIC_DATA& aData, double aScale );
598 GRAPHIC_RECTANGLE* processSquare( const GRAPHIC_DATA& aData, double aScale );
599 GRAPHIC_OBLONG* processOblong( const GRAPHIC_DATA& aData, double aScale );
600 GRAPHIC_CROSS* processCross( const GRAPHIC_DATA& aData, double aScale );
601 GRAPHIC_POLYGON* processPolygon( const GRAPHIC_DATA& aData, double aScale );
602
603 PCB_LAYER_ID getLayer( const std::string& aLayerName );
604 bool assignLayers();
605
611 double readDouble( const std::string& aStr ) const;
612 int readInt( const std::string& aStr ) const;
613
620 bool orderZones( BOARD* aBoard );
621
627 bool loadZones( BOARD* aBoard );
628 bool loadOutline( BOARD* aBoard, const std::unique_ptr<TRACE>& aLine);
629 bool loadNets( BOARD* aBoard );
630 bool loadLayers( BOARD* aBoard );
631 bool loadGraphics( BOARD* aBoard );
632 bool loadVias( BOARD* aBoard );
633 bool loadEtch( BOARD* aBoard, const std::unique_ptr<TRACE>& aLine);
634 bool loadZone( BOARD* aBoard, const std::unique_ptr<FABMASTER::TRACE>& aLine);
635 bool loadPolygon( BOARD* aBoard, const std::unique_ptr<FABMASTER::TRACE>& aLine);
636 bool loadFootprints( BOARD* aBoard );
637
643
645
646 static bool traceIsOpen( const FABMASTER::TRACE& aLine );
647
651 static void setupText( const FABMASTER::GRAPHIC_TEXT& aGraphicText, PCB_LAYER_ID aLayer,
652 PCB_TEXT& aText, const BOARD& aBoard, const OPT_VECTOR2I& aMirrorPoint );
653
657 static std::vector<std::unique_ptr<BOARD_ITEM>>
658 createBoardItems( BOARD& aBoard, PCB_LAYER_ID aLayer, FABMASTER::GRAPHIC_ITEM& aGraphic );
659
664 void reportError( const wxString& aMsg ) const
665 {
666 if( m_reporter )
667 m_reporter->Report( aMsg, RPT_SEVERITY_ERROR );
668 }
669
670 template <typename... Args>
671 void reportError( const wxString& aFormat, Args&&... aArgs ) const
672 {
673 if( m_reporter )
674 m_reporter->Report( wxString::Format( aFormat, aArgs... ), RPT_SEVERITY_ERROR );
675 }
676
677 template <typename... Args>
678 void reportWarning( const wxString& aFormat, Args&&... aArgs ) const
679 {
680 if( m_reporter )
681 m_reporter->Report( wxString::Format( aFormat, aArgs... ), RPT_SEVERITY_WARNING );
682 }
683
684 template <typename... Args>
685 void reportInfo( const wxString& aFormat, Args&&... aArgs ) const
686 {
687 if( m_reporter )
688 m_reporter->Report( wxString::Format( aFormat, aArgs... ), RPT_SEVERITY_INFO );
689 }
690
693 unsigned m_doneCount;
695 unsigned m_totalCount;
696};
697
698
699
700
701#endif /* PCBNEW_IMPORTERS_IMPORT_FABMASTER_H_ */
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition board_item.h:83
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:373
size_t processFootprints(size_t aRow)
A!REFDES!COMP_CLASS!COMP_PART_NUMBER!COMP_HEIGHT!COMP_DEVICE_LABEL!COMP_INSERTION_CODE!...
unsigned m_doneCount
size_t processPins(size_t aRow)
A!SYM_NAME!SYM_MIRROR!PIN_NAME!PIN_NUMBER!PIN_X!PIN_Y!PAD_STACK_NAME!REFDES!PIN_ROTATION!
int readInt(const std::string &aStr) const
wxFileName m_filename
GRAPHIC_OBLONG * processOblong(const GRAPHIC_DATA &aData, double aScale)
size_t processGeometry(size_t aRow)
A!GRAPHIC_DATA_NAME!GRAPHIC_DATA_NUMBER!RECORD_TAG!GRAPHIC_DATA_1!GRAPHIC_DATA_2!GRAPHIC_DATA_3!
std::map< std::string, PCB_LAYER_ID > layer_map
static std::vector< std::unique_ptr< BOARD_ITEM > > createBoardItems(BOARD &aBoard, PCB_LAYER_ID aLayer, FABMASTER::GRAPHIC_ITEM &aGraphic)
Convert one Fabmaster graphic item to one or more PCB items.
bool Read(const std::string &aFile)
bool loadNets(BOARD *aBoard)
std::map< std::string, std::map< int, GEOM_GRAPHIC > > comp_graphics
GRAPHIC_CROSS * processCross(const GRAPHIC_DATA &aData, double aScale)
unsigned m_lastProgressCount
SYMTYPE parseSymType(const std::string &aSymType)
GRAPHIC_TEXT * processText(const GRAPHIC_DATA &aData, double aScale)
bool loadLayers(BOARD *aBoard)
static void setupText(const FABMASTER::GRAPHIC_TEXT &aGraphicText, PCB_LAYER_ID aLayer, PCB_TEXT &aText, const BOARD &aBoard, const OPT_VECTOR2I &aMirrorPoint)
Set parameters for graphic text.
PCB_LAYER_ID getLayer(const std::string &aLayerName)
GRAPHIC_RECTANGLE * processSquare(const GRAPHIC_DATA &aData, double aScale)
int execute_recordbuffer(int filetype)
static bool traceIsOpen(const FABMASTER::TRACE &aLine)
bool loadZones(BOARD *aBoard)
Loads sections of the database into the board.
GRAPHIC_RECTANGLE * processRectangle(const GRAPHIC_DATA &aData, double aScale)
std::vector< std::string > single_row
size_t processSimpleLayers(size_t aRow)
PROGRESS_REPORTER * m_progressReporter
optional; may be nullptr
bool loadFootprints(BOARD *aBoard)
std::set< std::unique_ptr< TRACE >, TRACE::BY_ID > polygons
GRAPHIC_ARC * processCircle(const GRAPHIC_DATA &aData, double aScale)
std::unordered_map< std::string, FM_PAD > pads
int getColFromName(size_t aRow, const std::string &aStr)
bool loadVias(BOARD *aBoard)
size_t processLayers(size_t aRow)
A!LAYER_SORT!LAYER_SUBCLASS!LAYER_ARTWORK!LAYER_USE!LAYER_CONDUCTOR!LAYER_DIELECTRIC_CONSTANT!
void reportError(const wxString &aMsg) const
Report a malformed-input issue the user can act on.
size_t processSymbols(size_t aRow)
std::map< std::string, FABMASTER_LAYER > layers
COMPCLASS parseCompClass(const std::string &aCompClass)
bool loadEtch(BOARD *aBoard, const std::unique_ptr< TRACE > &aLine)
GRAPHIC_RECTANGLE * processFigRectangle(const GRAPHIC_DATA &aData, double aScale)
std::map< std::string, std::set< std::unique_ptr< PIN >, PIN::BY_NUM > > pins
std::set< std::unique_ptr< GRAPHIC_ITEM >, GRAPHIC_ITEM::SEQ_CMP > graphic_element
std::map< std::pair< std::string, std::string >, NETNAME > pin_nets
void reportInfo(const wxString &aFormat, Args &&... aArgs) const
GRAPHIC_ITEM * processGraphic(const GRAPHIC_DATA &aData, double aScale)
Specialty functions for processing graphical data rows into the internal database.
std::deque< single_row > rows
GRAPHIC_POLYGON * processPolygon(const GRAPHIC_DATA &aData, double aScale)
void SetReporter(REPORTER *aReporter)
Set the reporter used for import diagnostics.
void createComponentsFromOrphanPins()
Creates synthetic COMPONENT entries from pins that have no matching component.
bool loadOutline(BOARD *aBoard, const std::unique_ptr< TRACE > &aLine)
size_t processPadStacks(size_t aRow)
A!PADNAME!RECNUMBER!LAYER!FIXFLAG!VIAFLAG!PADSHAPE1!PADWIDTH!PADHGHT!
std::vector< GEOM_GRAPHIC > board_graphics
section_type detectType(size_t aOffset)
double readDouble(const std::string &aStr) const
Reads the double/integer value from a std string independent of the user locale.
bool loadZone(BOARD *aBoard, const std::unique_ptr< FABMASTER::TRACE > &aLine)
GRAPHIC_ARC * processArc(const GRAPHIC_DATA &aData, double aScale)
std::unordered_map< std::string, SYMBOL > symbols
SHAPE_POLY_SET loadShapePolySet(const graphic_element &aLine)
bool loadGraphics(BOARD *aBoard)
std::unordered_map< std::string, FABMASTER_PAD_SHAPE > pad_shapes
bool LoadBoard(BOARD *aBoard, PROGRESS_REPORTER *aProgressReporter)
std::vector< std::unique_ptr< FM_VIA > > vias
std::set< std::unique_ptr< TRACE >, TRACE::BY_ID > traces
std::set< std::unique_ptr< TRACE >, TRACE::BY_ID > zones
std::map< std::string, std::vector< std::unique_ptr< COMPONENT > > > components
bool loadPolygon(BOARD *aBoard, const std::unique_ptr< FABMASTER::TRACE > &aLine)
std::set< std::unique_ptr< TRACE >, TRACE::BY_ID > refdes
void reportError(const wxString &aFormat, Args &&... aArgs) const
@ GR_SHAPE_OBLONG
!< Actually 360° arcs (for both arcs where start==end and real circles)
@ GR_SHAPE_CROSS
!< X/Y oblongs
REPORTER * m_reporter
optional; may be nullptr
size_t processPadStackLayers(size_t aRow)
void reportWarning(const wxString &aFormat, Args &&... aArgs) const
std::set< std::string > netnames
size_t processTraces(size_t aRow)
A!CLASS!SUBCLASS!GRAPHIC_DATA_NAME!GRAPHIC_DATA_NUMBER!RECORD_TAG!GRAPHIC_DATA_1!GRAPHIC_DATA_2!
size_t processNets(size_t aRow)
A!NET_NAME!REFDES!PIN_NUMBER!PIN_NAME!PIN_GROUND!PIN_POWER!
bool orderZones(BOARD *aBoard)
Sets zone priorities based on zone BB size.
double processScaleFactor(size_t aRow)
Processes data from text vectors into internal database for further ordering.
size_t processVias(size_t aRow)
A!VIA_X!VIA_Y!PAD_STACK_NAME!NET_NAME!TEST_POINT!
unsigned m_totalCount
for progress reporting
size_t processCustomPads(size_t aRow)
A!SUBCLASS!PAD_SHAPE_NAME!GRAPHIC_DATA_NAME!GRAPHIC_DATA_NUMBER!RECORD_TAG!GRAPHIC_DATA_1!
GRAPHIC_LINE * processLine(const GRAPHIC_DATA &aData, double aScale)
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:72
Represent a set of closed polygons.
PCB_LAYER_ID
A quick note on layer IDs:
Definition layer_ids.h:56
PAD_SHAPE
The set of pad shapes, used with PAD::{Set,Get}Shape()
Definition padstack.h:52
@ RPT_SEVERITY_WARNING
@ RPT_SEVERITY_ERROR
@ RPT_SEVERITY_INFO
std::optional< VECTOR2I > OPT_VECTOR2I
Definition seg.h:35
std::string subclass
!< CLASS
std::size_t operator()(const FABMASTER::COMPONENT &aCmp) const
std::string dev_label
! COMP_DEVICE_LABEL
double rotate
! SYM_ROTATE (degrees)
std::string name
! SYM_NAME
SYMTYPE type
! SYM_TYPE
std::string pn
! COMP_PART_NUMBER
std::string value
! COMP_VALUE
std::string insert_code
! COMP_INSERTION_CODE
std::string voltage
! COMP_VOLTAGE
bool mirror
! SYM_MIRROR
std::string height
! COMP_HEIGHT
COMPCLASS cclass
! COMP_CLASS
std::string tol
! COMP_TOL
std::string refdes
! REFDES
bool operator()(const FABMASTER_LAYER *lhs, const FABMASTER_LAYER *rhs) const
A!LAYER_SORT!LAYER_SUBCLASS!LAYER_ARTWORK!LAYER_USE!LAYER_CONDUCTOR!LAYER_DIELECTRIC_CONSTANT !...
bool disable
! if true, prevent the layer elements from being used
std::string name
! LAYER_SUBCLASS
double thickness
! LAYER_THICKNESS
bool shield
! LAYER_SHIELD_LAYER
std::string material
! LAYER_MATERIAL
int layerid
! pcbnew layer (assigned)
bool conductive
! LAYER_CONDUCTOR
bool positive
! LAYER_ARTWORK (either POSITIVE or NEGATIVE)
double conductivity
! LAYER_ELECTRICAL_CONDUCTIVITY
std::string use
! LAYER_USE
double thermal_cond
! LAYER_THERMAL_CONDUCTIVITY
double er
! LAYER_DIELECTRIC_CONSTANT
std::size_t operator()(const std::unique_ptr< FABMASTER_PAD_SHAPE > &aPad) const
A!SUBCLASS!PAD_SHAPE_NAME!GRAPHIC_DATA_NAME!GRAPHIC_DATA_NUMBER!RECORD_TAG!GRAPHIC_DATA_1!
std::map< int, graphic_element > elements
std::string name
! PAD_SHAPE_NAME
std::string padstack
! PAD_STACK_NAME
std::string pinnum
! PIN_NUMBER
std::size_t operator()(const FM_PAD &aPad) const
Per-layer pad geometry within a pad stack.
std::map< std::string, FM_PAD_LAYER > layer_shapes
Per-layer shape overrides.
std::set< std::string > copper_layers
Copper layers with non-zero annular ring.
std::string padstack
! PAD_STACK_NAME
bool mirror
! VIA_MIRROR (VIA_MIRROR is an optional component)
bool test_point
! TEST_POINT
std::string net
! NET_NAME
bool operator()(const GEOM_GRAPHIC &lhs, const GEOM_GRAPHIC &rhs) const
std::string name
! SYM_NAME
std::string refdes
! REFDES
std::string subclass
! SUBCLASS
std::unique_ptr< graphic_element > elements
int end_x
! GRAPHIC_DATA_3
SHAPE_ARC result
! KiCad-style arc representation
int center_x
! GRAPHIC_DATA_5
bool clockwise
! GRAPHIC_DATA_9
int center_y
! GRAPHIC_DATA_6
int end_y
! GRAPHIC_DATA_4
int size_y
! GRAPHIC_DATA_4
int size_x
! GRAPHIC_DATA_3
bool oblong_x
! OBLONG_X (as opposed to OBLONG_Y)
bool operator()(const std::unique_ptr< GRAPHIC_ITEM > &lhs, const std::unique_ptr< GRAPHIC_ITEM > &rhs) const
std::string layer
! SUBCLASS
int subseq
! RECORD_TAG[1]
int width
! Various sections depending on type
GRAPHIC_SHAPE shape
! Shape of the graphic_item
std::string symbol
! SYMBOL
int start_y
! GRAPHIC_DATA_2
virtual ~GRAPHIC_ITEM()=default
int start_x
! GRAPHIC_DATA_1
GRAPHIC_TYPE type
! Type of graphic item
std::string refdes
! REFDES
int end_x
! GRAPHIC_DATA_3
bool oblong_x
! OBLONG_X (as opposed to OBLONG_Y)
int size_x
! GRAPHIC_DATA_3
int size_y
! GRAPHIC_DATA_4
std::vector< VECTOR2I > m_pts
double rotation
! GRAPHIC_DATA_3
std::string text
! GRAPHIC_DATA_7
int height
! GRAPHIC_DATA_6[2]
int thickness
! GRAPHIC_DATA_6[6]
GR_TEXT_H_ALIGN_T orient
! GRAPHIC_DATA_5
bool ital
! GRAPHIC_DATA_6[4] != 0.0
bool mirror
! GRAPHIC_DATA_4
bool operator()(const NETNAME &lhs, const NETNAME &rhs) const
std::string refdes
!< NET_NAME
bool pin_pwr
!< PIN_GND
std::string pin_num
!< REFDES
std::string pin_name
!< PIN_NUMBER
bool pin_gnd
!< PIN_NAME
bool operator()(const std::unique_ptr< PIN > &lhs, const std::unique_ptr< PIN > &rhs) const
int pin_x
! PIN_X - Absolute board units
int pin_y
! PIN_Y - Absolute board units
double rotation
! PIN_ROTATION
bool mirror
! SYM_MIRROR
std::string padstack
! PAD_STACK
std::string name
! SYM_NAME
std::string pin_name
! PIN_NAME
std::string refdes
! REFDES
std::string pin_number
! PIN_NUMBER
std::size_t operator()(const FABMASTER::SYMBOL &aSym) const
std::string refdes
! REFDES
std::map< int, graphic_element > elements
std::string name
! SYM_NAME
int subseq_id
! RECORD_TAG[2] (RECORD_TAG is of the form "x y z")
int seq_id
! RECORD_TAG[1] (RECORD_TAG is of the form "x y z")
int sym_id
! RECORD_TAG[0]
bool operator()(const std::unique_ptr< TRACE > &lhs, const std::unique_ptr< TRACE > &rhs) const
std::string layer
! SUBCLASS
std::string lclass
! CLASS
std::string netname
! NET_NAME
int id
! RECORD_TAG[0]
graphic_element segment
! GRAPHIC_DATA (can be either LINE or ARC)
GR_TEXT_H_ALIGN_T
This is API surface mapped to common.types.HorizontalAlignment.