KiCad PCB EDA Suite
|
#include <base_units.h>
#include <macros.h>
#include <schematic_lexer.h>
#include "sch_io_kicad_sexpr_common.h"
#include <string_utils.h>
Go to the source code of this file.
Functions | |
void | formatFill (OUTPUTFORMATTER *aFormatter, FILL_T aFillMode, const COLOR4D &aFillColor) |
Fill token formatting helper. | |
const char * | getPinElectricalTypeToken (ELECTRICAL_PINTYPE aType) |
const char * | getPinShapeToken (GRAPHIC_PINSHAPE aShape) |
EDA_ANGLE | getPinAngle (PIN_ORIENTATION aOrientation) |
const char * | getSheetPinShapeToken (LABEL_FLAG_SHAPE aShape) |
EDA_ANGLE | getSheetPinAngle (SHEET_SIDE aSide) |
const char * | getTextTypeToken (KICAD_T aType) |
std::string | formatIU (const int &aValue) |
std::string | formatIU (const VECTOR2I &aPt, bool aInvertY) |
void | formatArc (OUTPUTFORMATTER *aFormatter, EDA_SHAPE *aArc, bool aIsPrivate, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, bool aInvertY, const KIID &aUuid) |
void | formatCircle (OUTPUTFORMATTER *aFormatter, EDA_SHAPE *aCircle, bool aIsPrivate, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, bool aInvertY, const KIID &aUuid) |
void | formatRect (OUTPUTFORMATTER *aFormatter, EDA_SHAPE *aRect, bool aIsPrivate, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, bool aInvertY, const KIID &aUuid) |
void | formatBezier (OUTPUTFORMATTER *aFormatter, EDA_SHAPE *aBezier, bool aIsPrivate, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, bool aInvertY, const KIID &aUuid) |
void | formatPoly (OUTPUTFORMATTER *aFormatter, EDA_SHAPE *aPolyLine, bool aIsPrivate, const STROKE_PARAMS &aStroke, FILL_T aFillMode, const COLOR4D &aFillColor, bool aInvertY, const KIID &aUuid) |
Variables | |
static const char * | emptyString = "" |
void formatArc | ( | OUTPUTFORMATTER * | aFormatter, |
EDA_SHAPE * | aArc, | ||
bool | aIsPrivate, | ||
const STROKE_PARAMS & | aStroke, | ||
FILL_T | aFillMode, | ||
const COLOR4D & | aFillColor, | ||
bool | aInvertY, | ||
const KIID & | aUuid | ||
) |
Definition at line 222 of file sch_io_kicad_sexpr_common.cpp.
References KIID::AsString(), STROKE_PARAMS::Format(), formatFill(), formatIU(), EDA_SHAPE::GetArcMid(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetStart(), niluuid, OUTPUTFORMATTER::Print(), schIUScale, and TO_UTF8.
Referenced by SCH_IO_KICAD_SEXPR::saveShape(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveSymbolDrawItem().
void formatBezier | ( | OUTPUTFORMATTER * | aFormatter, |
EDA_SHAPE * | aBezier, | ||
bool | aIsPrivate, | ||
const STROKE_PARAMS & | aStroke, | ||
FILL_T | aFillMode, | ||
const COLOR4D & | aFillColor, | ||
bool | aInvertY, | ||
const KIID & | aUuid | ||
) |
Definition at line 279 of file sch_io_kicad_sexpr_common.cpp.
References KIID::AsString(), STROKE_PARAMS::Format(), formatFill(), formatIU(), EDA_SHAPE::GetBezierC1(), EDA_SHAPE::GetBezierC2(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetStart(), niluuid, OUTPUTFORMATTER::Print(), schIUScale, and TO_UTF8.
Referenced by SCH_IO_KICAD_SEXPR::saveShape(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveSymbolDrawItem().
void formatCircle | ( | OUTPUTFORMATTER * | aFormatter, |
EDA_SHAPE * | aCircle, | ||
bool | aIsPrivate, | ||
const STROKE_PARAMS & | aStroke, | ||
FILL_T | aFillMode, | ||
const COLOR4D & | aFillColor, | ||
bool | aInvertY, | ||
const KIID & | aUuid | ||
) |
Definition at line 242 of file sch_io_kicad_sexpr_common.cpp.
References KIID::AsString(), STROKE_PARAMS::Format(), formatFill(), formatIU(), EDA_SHAPE::GetRadius(), EDA_SHAPE::GetStart(), niluuid, OUTPUTFORMATTER::Print(), schIUScale, and TO_UTF8.
Referenced by SCH_IO_KICAD_SEXPR::saveShape(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveSymbolDrawItem().
void formatFill | ( | OUTPUTFORMATTER * | aFormatter, |
FILL_T | aFillMode, | ||
const COLOR4D & | aFillColor | ||
) |
Fill token formatting helper.
Definition at line 33 of file sch_io_kicad_sexpr_common.cpp.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, FILLED_SHAPE, FILLED_WITH_BG_BODYCOLOR, FILLED_WITH_COLOR, FormatDouble2Str(), KIGFX::COLOR4D::g, KiROUND(), NO_FILL, OUTPUTFORMATTER::Print(), and KIGFX::COLOR4D::r.
Referenced by formatArc(), formatBezier(), formatCircle(), formatPoly(), formatRect(), SCH_IO_KICAD_SEXPR::saveTextBox(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveTextBox().
std::string formatIU | ( | const int & | aValue | ) |
Definition at line 209 of file sch_io_kicad_sexpr_common.cpp.
References EDA_UNIT_UTILS::FormatInternalUnits(), and schIUScale.
Referenced by formatArc(), formatBezier(), formatCircle(), formatPoly(), and formatRect().
std::string formatIU | ( | const VECTOR2I & | aPt, |
bool | aInvertY | ||
) |
Definition at line 215 of file sch_io_kicad_sexpr_common.cpp.
References EDA_UNIT_UTILS::FormatInternalUnits(), schIUScale, VECTOR2< T >::x, and VECTOR2< T >::y.
void formatPoly | ( | OUTPUTFORMATTER * | aFormatter, |
EDA_SHAPE * | aPolyLine, | ||
bool | aIsPrivate, | ||
const STROKE_PARAMS & | aStroke, | ||
FILL_T | aFillMode, | ||
const COLOR4D & | aFillColor, | ||
bool | aInvertY, | ||
const KIID & | aUuid | ||
) |
Definition at line 304 of file sch_io_kicad_sexpr_common.cpp.
References KIID::AsString(), SHAPE_LINE_CHAIN::CPoints(), STROKE_PARAMS::Format(), formatFill(), formatIU(), EDA_SHAPE::GetPolyShape(), niluuid, SHAPE_POLY_SET::Outline(), OUTPUTFORMATTER::Print(), schIUScale, and TO_UTF8.
Referenced by SCH_IO_KICAD_SEXPR::saveShape(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveSymbolDrawItem().
void formatRect | ( | OUTPUTFORMATTER * | aFormatter, |
EDA_SHAPE * | aRect, | ||
bool | aIsPrivate, | ||
const STROKE_PARAMS & | aStroke, | ||
FILL_T | aFillMode, | ||
const COLOR4D & | aFillColor, | ||
bool | aInvertY, | ||
const KIID & | aUuid | ||
) |
Definition at line 261 of file sch_io_kicad_sexpr_common.cpp.
References KIID::AsString(), STROKE_PARAMS::Format(), formatFill(), formatIU(), EDA_SHAPE::GetEnd(), EDA_SHAPE::GetStart(), niluuid, OUTPUTFORMATTER::Print(), schIUScale, and TO_UTF8.
Referenced by SCH_IO_KICAD_SEXPR::saveShape(), and SCH_IO_KICAD_SEXPR_LIB_CACHE::saveSymbolDrawItem().
EDA_ANGLE getPinAngle | ( | PIN_ORIENTATION | aOrientation | ) |
const char * getPinElectricalTypeToken | ( | ELECTRICAL_PINTYPE | aType | ) |
Definition at line 63 of file sch_io_kicad_sexpr_common.cpp.
References emptyString, PT_BIDI, PT_INPUT, PT_NC, PT_NIC, PT_OPENCOLLECTOR, PT_OPENEMITTER, PT_OUTPUT, PT_PASSIVE, PT_POWER_IN, PT_POWER_OUT, PT_TRISTATE, and PT_UNSPECIFIED.
Referenced by SCH_IO_KICAD_SEXPR_LIB_CACHE::savePin().
const char * getPinShapeToken | ( | GRAPHIC_PINSHAPE | aShape | ) |
Definition at line 111 of file sch_io_kicad_sexpr_common.cpp.
References CLOCK, CLOCK_LOW, emptyString, FALLING_EDGE_CLOCK, INPUT_LOW, INVERTED, INVERTED_CLOCK, LINE, NONLOGIC, and OUTPUT_LOW.
Referenced by SCH_IO_KICAD_SEXPR_LIB_CACHE::savePin().
EDA_ANGLE getSheetPinAngle | ( | SHEET_SIDE | aSide | ) |
const char * getSheetPinShapeToken | ( | LABEL_FLAG_SHAPE | aShape | ) |
Definition at line 163 of file sch_io_kicad_sexpr_common.cpp.
References F_DIAMOND, F_DOT, F_RECTANGLE, F_ROUND, L_BIDI, L_INPUT, L_OUTPUT, L_TRISTATE, and L_UNSPECIFIED.
Referenced by SCH_IO_KICAD_SEXPR::saveSheet(), and SCH_IO_KICAD_SEXPR::saveText().
const char * getTextTypeToken | ( | KICAD_T | aType | ) |
Definition at line 195 of file sch_io_kicad_sexpr_common.cpp.
References SCH_DIRECTIVE_LABEL_T, SCH_GLOBAL_LABEL_T, SCH_HIER_LABEL_T, SCH_LABEL_T, and SCH_TEXT_T.
Referenced by SCH_IO_KICAD_SEXPR::saveText().
|
static |
Definition at line 30 of file sch_io_kicad_sexpr_common.cpp.
Referenced by BOARD_CONNECTED_ITEM::GetDisplayNetname(), getPinElectricalTypeToken(), getPinShapeToken(), BOARD_CONNECTED_ITEM::GetShortNetname(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().