30#include <wx/filename.h>
31#include <wx/strconv.h>
44constexpr int32_t V_SETTINGS_A = 0x232a;
45constexpr int32_t V_SETTINGS_B = 0x232b;
46constexpr int32_t V_TRACK_WIDTH = 0x232c;
47constexpr int32_t V_LOGBOOK = 0x232d;
48constexpr int32_t V_SETTINGS_C = 0x232e;
49constexpr int32_t V_SETTINGS_D = 0x232f;
50constexpr int32_t V_SETTINGS_E = 0x2330;
51constexpr int32_t V_COMPONENT_EXTRA = 0x2711;
52constexpr int32_t V_SETTINGS_F = 0x2712;
53constexpr int32_t V_SAVE_TIME = 0x271b;
54constexpr int32_t V_SETTINGS_G = 0x271c;
55constexpr int32_t V_SETTINGS_H = 0x271d;
56constexpr int32_t V_SETTINGS_I = 0x271e;
57constexpr int32_t V_SETTINGS_J = 0x271f;
58constexpr int32_t V_SETTINGS_K = 0x2720;
59constexpr int32_t V_BLOBS = 0x272e;
60constexpr int32_t V_SETTINGS_L = 0x272f;
61constexpr int32_t V_CHECKSUM = 0x2739;
62constexpr int32_t V_SETTINGS_M = 0x2743;
64constexpr int MAX_DEPTH = 32;
67constexpr uint16_t LINKED_SIGNAL = 65503;
71void resolveLinkedSignals(
COMPONENT& aComponent, uint16_t aOwner )
73 std::map<uint16_t, uint16_t> padSignals;
75 for(
const ELEMENT& e : aComponent.packageItems )
81 auto resolve = [&](
ELEMENT& aElem )
83 if( aElem.base.signal != LINKED_SIGNAL )
86 auto it = padSignals.find( aElem.base.component );
87 aElem.base.signal = ( it != padSignals.end() && it->second != LINKED_SIGNAL ) ? it->second : 0;
88 aElem.base.component = aOwner;
91 for(
ELEMENT& e : aComponent.packageItems )
94 for(
ELEMENT& sym : aComponent.symbols )
105std::vector<std::string> splitFields(
const std::string& aText,
char aSeparator )
107 std::vector<std::string> fields;
112 size_t end = aText.find( aSeparator, start );
113 fields.push_back( aText.substr( start,
end - start ) );
115 if(
end == std::string::npos )
124bool toInt(
const std::string& aText,
T& aOut )
126 const char*
end = aText.data() + aText.size();
127 auto [ptr, ec] = std::from_chars( aText.data(),
end, aOut );
128 return ec == std::errc() && ptr ==
end;
133std::optional<POLYGON_POUR> parsePolygonPour(
const std::string& aValue )
135 size_t star = aValue.find(
'*' );
137 if( star == std::string::npos )
140 std::vector<std::string> head = splitFields( aValue.substr( 0, star ),
',' );
141 std::vector<std::string> tail = splitFields( aValue.substr( star + 1 ),
',' );
147 if( head.size() < 9 || !
toInt( head[0], poly.layer ) || !
toInt( head[1], poly.id ) || !
toInt( head[2], poly.width )
148 || !
toInt( head[3], hatch ) || !
toInt( head[4], poly.rank ) || !
toInt( head[5], thermals )
149 || !
toInt( head[6], islands ) )
155 poly.removeIslands = islands != 0;
158 std::string vertices = head[7];
160 for(
size_t i = 8; i < head.size(); i++ )
161 vertices +=
',' + head[i];
163 for(
const std::string& pair : splitFields( vertices,
';' ) )
165 size_t comma = pair.find(
',' );
169 if( comma == std::string::npos || !
toInt( pair.substr( 0, comma ), x )
170 || !
toInt( pair.substr( comma + 1 ), y ) )
175 poly.outline.emplace_back( x, y );
178 if( !tail.empty() && !tail[0].empty() && !
toInt( tail[0], poly.edgeClearance ) )
183 for(
size_t i = 1; i < tail.size(); i++ )
185 for(
const std::string& entry : splitFields( tail[i],
'\n' ) )
187 size_t split = entry.find(
'\x1d' );
189 if(
split != std::string::npos && entry.substr( 0,
split ) ==
"AURA" )
191 std::string value = entry.substr(
split + 1 );
193 if( !value.empty() && value.back() ==
'\r' )
196 toInt( value, poly.aura );
205const std::string PASSWORD_MARKER_A =
"$%&\xa7";
206const std::string PASSWORD_MARKER_B =
"$%&\xa7!";
212 explicit READER(
const std::vector<uint8_t>& aData ) :
218 size_t Pos()
const {
return m_pos; }
219 size_t Remaining()
const {
return m_data.size() - m_pos; }
220 bool AtEnd()
const {
return m_pos >= m_data.size(); }
222 void Require(
size_t aBytes )
const
224 if( aBytes > Remaining() )
226 THROW_IO_ERROR( wxString::Format(
_(
"Unexpected end of TARGET 3001! file at offset %zu." ),
234 return m_data[m_pos++];
240 uint16_t v = m_data[m_pos] | ( m_data[m_pos + 1] << 8 );
248 uint32_t v = uint32_t( m_data[m_pos] ) | ( uint32_t( m_data[m_pos + 1] ) << 8 )
249 | ( uint32_t( m_data[m_pos + 2] ) << 16 ) | ( uint32_t( m_data[m_pos + 3] ) << 24 );
254 int32_t S32() {
return static_cast<int32_t
>( U32() ); }
258 uint32_t bits = U32();
260 std::memcpy( &v, &bits,
sizeof( v ) );
264 void Skip(
size_t aBytes )
270 std::vector<uint8_t> Bytes(
size_t aBytes )
273 std::vector<uint8_t> out( m_data.begin() + m_pos, m_data.begin() + m_pos + aBytes );
279 size_t Count(
size_t aMinItemSize )
284 Fail(
"negative count" );
286 if( aMinItemSize &&
size_t( n ) > Remaining() / aMinItemSize )
287 Fail(
"count exceeds file size" );
294 size_t len = Count( 1 );
295 std::string s(
reinterpret_cast<const char*
>( m_data.data() + m_pos ), len );
300 [[noreturn]]
void Fail(
const char* aWhat )
const
302 THROW_IO_ERROR( wxString::Format(
_(
"Invalid TARGET 3001! file at offset %zu (%s)." ), m_pos,
307 const std::vector<uint8_t>& m_data;
315 explicit PARSER(
const std::vector<uint8_t>& aData ) :
324 p.version = m_r.S32();
325 m_version = p.version;
329 p.signals = parseTopList(
nullptr );
330 p.components = parseTopList( &m_componentSlots );
334 std::swap( p.signals, p.components );
336 appendFlattened( p.schematicItems, 0 );
337 appendFlattened( p.boardItems, 0 );
340 parseSettings( p.settings );
342 p.ApplyTextLanguage();
348 void parseHeader(
PROJECT& aProject )
350 aProject.schematicTextFont = m_r.LStr();
352 if( aProject.schematicTextFont == PASSWORD_MARKER_A || aProject.schematicTextFont == PASSWORD_MARKER_B )
353 THROW_IO_ERROR(
_(
"Password-protected TARGET 3001! projects are not supported." ) );
355 aProject.boardTextFont = m_r.LStr();
356 aProject.signalNameFont = m_r.LStr();
364 std::copy( functions.begin(), functions.end(), aProject.layerFunctions.begin() );
365 std::copy( associations.begin(), associations.end(), aProject.layerAssociations.begin() );
368 uint8_t prefixCount = m_r.U8();
370 for(
int i = 0; i < prefixCount; i++ )
383 static bool holdsOnly(
const std::vector<ELEMENT>& aList,
ELEMENT_TYPE aType )
387 for(
const ELEMENT& e : aList )
392 if( e.
type != aType )
401 std::vector<ELEMENT> parseTopList(
size_t* aSlots )
404 m_r.Fail(
"element list expected" );
406 size_t n = m_r.Count( 1 );
407 std::vector<ELEMENT> out;
410 for(
size_t i = 0; i < n; i++ )
412 size_t before = out.size();
413 appendFlattened( out, 1 );
415 if( out.size() == before )
425 size_t parseListBody( std::vector<ELEMENT>& aOut,
int aDepth )
427 size_t n = m_r.Count( 1 );
428 aOut.reserve( aOut.size() + n );
430 for(
size_t i = 0; i < n; i++ )
431 appendFlattened( aOut, aDepth + 1 );
437 void appendFlattened( std::vector<ELEMENT>& aOut,
int aDepth )
439 if( aDepth > MAX_DEPTH )
440 m_r.Fail(
"element nesting too deep" );
442 uint8_t tag = m_r.U8();
450 parseListBody( aOut, aDepth );
455 size_t n = m_r.Count( 4 );
457 for(
size_t i = 0; i < n; i++ )
468 m_r.Fail(
"unknown element class" );
470 ELEMENT& e = aOut.emplace_back();
473 parseBody( e, aDepth );
476 std::vector<ELEMENT> parseChild(
int aDepth )
478 std::vector<ELEMENT> out;
479 appendFlattened( out, aDepth + 1 );
483 void parseBase( ELEMENT_BASE& aBase )
489 aBase.
flags = m_r.U8();
491 aBase.
layer = m_r.U8();
494 if( ( aBase.
flags & 0xfe ) == 2 )
495 aBase.
extra = m_r.U32();
497 size_t n = m_r.Count( 4 );
500 m_r.Fail(
"odd property count" );
502 aBase.
props.reserve( n / 2 );
504 for(
size_t i = 0; i < n; i += 2 )
506 std::string key = m_r.LStr();
507 std::string value = m_r.LStr();
508 aBase.
props.emplace_back( std::move( key ), std::move( value ) );
512 void parseBody( ELEMENT& aElem,
int aDepth )
522 l.clearance = m_r.S32();
523 l.dashStyle = m_r.U8();
524 l.roundEnds = m_r.U8();
531 p.direction = m_r.F32();
532 p.length = m_r.S32();
534 p.electricalType = m_r.U8();
535 p.swapLevel = m_r.U16();
536 p.inverted = m_r.U8();
538 p.showNumber = m_r.U8();
539 p.supplyPin = m_r.U8();
540 p.pinNumber = m_r.U16();
541 aElem.
children = parseChild( aDepth );
548 p.direction = m_r.F32();
551 p.height = m_r.S32();
552 p.clearance = m_r.S32();
554 p.reserved = m_r.S32();
555 p.number = m_r.U16();
587 a.clearance = m_r.S32();
588 a.startAngle = m_r.F32();
589 a.endAngle = m_r.F32();
591 if( !std::isfinite( a.startAngle ) || !std::isfinite( a.endAngle ) )
592 m_r.Fail(
"arc angle is not a number" );
598 aElem.
disc.radius = m_r.S32();
609 t.noAutoUpright = m_r.U8();
611 t.function = m_r.U8();
628 auto c = std::make_shared<COMPONENT>();
629 c->name = m_r.LStr();
630 c->value = m_r.LStr();
631 c->prefix = m_r.LStr();
632 c->library = m_r.LStr();
633 c->package = m_r.LStr();
634 c->packageSource = m_r.LStr();
635 c->referenceNumber = m_r.U16();
637 if( c->referenceNumber >= 65000 && c->referenceNumber < 65535 )
638 c->referenceExtension = m_r.U16();
640 c->connectionCount = m_r.U16();
641 c->gateState = m_r.U8();
642 c->packageItems = parseChild( aDepth );
643 c->symbols = parseChild( aDepth );
645 for( uint8_t& b : c->setBitmap )
656 auto s = std::make_shared<SYMBOL>();
657 s->name = m_r.LStr();
658 s->suffix = m_r.LStr();
659 s->gateOrdinal = m_r.U16();
660 s->insertRequired = m_r.U8();
661 s->swapLevel = m_r.U16();
662 s->children = parseChild( aDepth );
663 aElem.
symbol = std::move( s );
669 auto p = std::make_shared<PACKAGE>();
670 p->package = m_r.LStr();
671 p->library = m_r.LStr();
672 p->padCount = m_r.U16();
673 p->bottomSide = m_r.U8();
674 p->direction = m_r.F32();
675 aElem.
package = std::move( p );
681 auto s = std::make_shared<SIGNAL>();
682 s->name = m_r.LStr();
683 s->connections = parseChild( aDepth );
684 s->tracks = parseChild( aDepth );
685 s->minWidth = m_r.S32();
686 s->minSpacing = m_r.S32();
687 s->string3 = m_r.LStr();
688 s->string4 = m_r.LStr();
689 s->record = m_r.Bytes( 48 );
690 s->string5 = m_r.LStr();
692 for(
const auto& [key, value] : aElem.
base.
props )
694 if( key !=
"$%&POLY" )
697 if( std::optional<POLYGON_POUR> poly = parsePolygonPour( value ) )
698 s->polygons.push_back( std::move( *poly ) );
701 aElem.
signal = std::move( s );
719 aElem.
marker.radius = m_r.S32();
720 aElem.
marker.text = m_r.LStr();
724 m_r.Fail(
"unknown element class" );
728 void skipStrings(
size_t aCount )
730 for(
size_t i = 0; i < aCount; i++ )
734 void skipCountedStrings() { skipStrings( m_r.Count( 4 ) ); }
736 void parseSettings( PROJECT_SETTINGS& aSettings )
738 m_r.Skip( 16 + 16 + 52 );
744 size_t records = m_r.Count( 16 );
745 m_r.Skip( records * 16 );
747 skipCountedStrings();
751 uint16_t routeLayers = m_r.U16();
752 m_r.Skip(
size_t( routeLayers ) * 4 );
754 size_t propertyStrings = m_r.Count( 4 );
756 for(
size_t i = 0; i + 1 < propertyStrings; i += 2 )
758 std::string key = m_r.LStr();
759 aSettings.properties.emplace_back( std::move( key ), m_r.LStr() );
762 if( propertyStrings % 2 )
765 size_t padstacks = m_r.Count( 4 + 5 + 500 );
767 for(
size_t i = 0; i < padstacks; i++ )
769 PADSTACK_DEF& def = aSettings.padstacks.emplace_back();
770 def.name = m_r.LStr();
773 for(
bool& on : def.onLayer )
776 for( int32_t& grow : def.oversize )
777 grow = int32_t( m_r.U32() );
780 m_r.Skip(
size_t( routeLayers ) * 5 );
781 m_r.Skip( padstacks * 8 );
784 skipCountedStrings();
785 m_r.Skip( 100 + 13 + 208 );
793 aSettings.savedBy = m_r.LStr();
795 size_t records9 = m_r.Count( 4 + 9 );
797 for(
size_t i = 0; i < records9; i++ )
805 aSettings.sheetNames.reserve( 100 );
807 for(
int i = 0; i < 100; i++ )
808 aSettings.sheetNames.push_back( m_r.LStr() );
813 if( m_version >= V_SETTINGS_A )
820 if( m_version >= V_SETTINGS_B )
823 if( m_version >= V_TRACK_WIDTH )
826 if( m_version >= V_LOGBOOK )
829 if( m_version >= V_SETTINGS_C )
832 if( m_version >= V_SETTINGS_D )
835 if( m_version >= V_SETTINGS_E )
839 if( m_version >= V_SETTINGS_E && !m_r.AtEnd() )
841 for(
int i = 0; i < 12; i++ )
847 for(
int i = 0; i < 12; i++ )
854 if( m_version >= V_COMPONENT_EXTRA )
856 for(
size_t i = 0; i < m_componentSlots; i++ )
865 if( m_version >= V_SETTINGS_F )
868 if( m_version >= V_SAVE_TIME )
871 if( m_version >= V_SETTINGS_G )
874 if( m_version >= V_SETTINGS_H )
877 if( m_version >= V_SETTINGS_I )
885 if( m_version >= V_SETTINGS_J )
888 if( m_version >= V_SETTINGS_K )
891 if( m_version >= V_BLOBS )
893 size_t blobs = m_r.Count( 8 );
895 for(
size_t i = 0; i < blobs; i++ )
898 m_r.Skip( m_r.Count( 1 ) );
902 if( m_version >= V_SETTINGS_L )
905 if( m_version >= V_CHECKSUM )
908 if( m_version >= V_SETTINGS_M )
913 int32_t m_version = 0;
914 size_t m_componentSlots = 0;
922 for(
const auto& [key, value] :
props )
934 std::vector<uint8_t> data;
935 const std::string* encoded =
FindProp(
"JPEG_PICTURE" );
941 std::vector<uint8_t>
text( encoded->begin(), encoded->end() );
942 std::replace(
text.begin(),
text.end(), uint8_t(
'_' ), uint8_t(
'+' ) );
950 const std::string* value =
FindProp(
"POLYGONID" );
953 if( !value || !
toInt( *value,
id ) )
962 const std::string* value =
FindProp( aKey );
967 wxString word =
ToWx( *value ).Trim().Trim(
false ).Upper();
969 return word == wxS(
"TRUE" ) || word == wxS(
"YES" ) || word == wxS(
"1" ) || word == wxS(
"JA" )
970 || word == wxS(
"OUI" ) || word == wxS(
"OK" );
976 const std::string* arxy =
FindProp(
"ARXY" );
981 wxString value( *arxy );
985 if( !value.Contains( wxS(
"|" ) ) || !value.BeforeFirst(
'|' ).ToLong( &endX )
986 || !value.AfterFirst(
'|' ).ToLong( &endY ) )
991 return std::make_pair( int32_t( endX ), int32_t( endY ) );
997 for(
const auto& [key, value] :
settings.properties )
999 if(
ToWx( key ).Trim().Trim(
false ).IsSameAs(
ToWx( aKey ),
false ) )
1010 auto changed = [&]()
1015 if(
const std::string* saved =
FindProperty(
"1218" ) )
1017 wxString value =
ToWx( *saved );
1018 value.Replace( wxS(
"," ), wxS(
"." ) );
1021 if( value.ToCDouble( &days ) && days > 0.0 )
1023 wxDateTime previous( days + 2415018.5 );
1025 if( !when.IsValid() || previous.IsLaterThan( when ) )
1037 wxDateTime when = changed();
1038 return when.IsValid() ? when.Format( wxS(
"%d.%m.%Y" ) ) : wxString();
1055 return aSchematic ? std::optional<wxString>( wxS(
"${#}" ) ) : std::nullopt;
1058 return aSchematic ? std::optional<wxString>( wxS(
"${SHEETNAME}" ) ) : std::nullopt;
1060 default:
return std::nullopt;
1095template <
typename LIST,
typename FN>
1096void forEachText(
LIST& aList, FN&& aFn )
1098 for(
auto& e : aList )
1106 forEachText( e.
symbol->children, aFn );
1110 forEachText( e.
component->packageItems, aFn );
1111 forEachText( e.
component->symbols, aFn );
1116 forEachText( e.
signal->connections, aFn );
1117 forEachText( e.
signal->tracks, aFn );
1123template <
typename PROJ,
typename FN>
1124void forEachProjectText( PROJ& aProject, FN&& aFn )
1126 forEachText( aProject.signals, aFn );
1127 forEachText( aProject.components, aFn );
1128 forEachText( aProject.schematicItems, aFn );
1129 forEachText( aProject.boardItems, aFn );
1134std::optional<std::string> variant(
const ELEMENT& aText,
const LANGUAGE_INFO& aLanguage )
1137 return std::nullopt;
1139 const std::string* value = aText.
base.
FindProp( aLanguage.key );
1141 if( !value || value->empty() )
1142 return std::nullopt;
1145 std::string
text = *value;
1146 std::replace(
text.begin(),
text.end(),
'\x7f',
' ' );
1155 bool automatic =
false;
1157 forEachProjectText( *
this,
1161 automatic |=
text == wxS(
"AUTOLANGUAGE=TRUE" );
1165 if( !automatic || !
settings.textLanguage )
1168 for(
const LANGUAGE_INFO& lang : LANGUAGES )
1170 if( lang.language != *
settings.textLanguage )
1173 forEachProjectText( *
this,
1176 if( std::optional<std::string>
text = variant( aText, lang ) )
1189 return wxString::Format( wxS(
"%u" ), aPad.
pad.
number );
1191 return wxEmptyString;
1197 PARSER parser( aData );
1198 return parser.Parse();
1204 wxFFile file( aFileName, wxS(
"rb" ) );
1206 if( !file.IsOpened() )
1207 THROW_IO_ERROR( wxString::Format(
_(
"Cannot open file '%s'." ), aFileName ) );
1209 std::vector<uint8_t> data( file.Length() );
1211 if( !data.empty() && file.Read( data.data(), data.size() ) != data.size() )
1212 THROW_IO_ERROR( wxString::Format(
_(
"Cannot read file '%s'." ), aFileName ) );
1215 wxFileName fn( aFileName );
1217 project.fileName = fn.GetFullName();
1218 project.fileModified = fn.GetModificationTime();
1225 wxFileName fn( aFileName );
1227 if( fn.GetExt().CmpNoCase( wxS(
"T3001" ) ) != 0 )
1230 wxFFile file( aFileName, wxS(
"rb" ) );
1232 if( !file.IsOpened() )
1237 if( file.Read( head,
sizeof( head ) ) !=
sizeof( head ) )
1240 int32_t version = int32_t( head[0] | ( head[1] << 8 ) | ( head[2] << 16 ) | ( uint32_t( head[3] ) << 24 ) );
1241 int32_t fontLen = int32_t( head[4] | ( head[5] << 8 ) | ( head[6] << 16 ) | ( uint32_t( head[7] ) << 24 ) );
1243 return version > 0 && version < 0x10000 && fontLen >= 0 && fontLen < 256;
1247wxString
ToWx(
const std::string& aRaw )
1249 static wxCSConv conv( wxFONTENCODING_CP1252 );
1250 return wxString( aRaw.data(), conv, aRaw.size() );
static int toInt(const wxString &aToken)
Parse a token as an integer using the C locale, returning 0 on failure.
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
PARSE_RESULT Parse(const std::string &aString, NOTATION aNotation=NOTATION::SI, SIM_VALUE::TYPE aValueType=SIM_VALUE::TYPE_FLOAT)
wxString PadNumber(const ELEMENT &aPad)
Number of a pad element in KiCad, its PADNAME when present, else its stored number.
PROJECT ParseBuffer(const std::vector< uint8_t > &aData)
Parse a project held in memory.
PROJECT ParseFile(const wxString &aFileName)
Parse a complete .T3001 file.
bool LooksLikeProject(const wxString &aFileName)
Cheap check used by the plugin managers: the extension matches and the header is plausible.
wxString ToWx(const std::string &aRaw)
Convert a stored ANSI string to a wxString.
ELEMENT_TYPE
Element class tags as stored in the file.
constexpr int BOARD_LAYER_COUNT
Board layers 0..99 carry a per-project function; 100 and above have fixed meanings.
void decode(const std::vector< uint8_t > &aInput, std::vector< uint8_t > &aOutput)
static std::vector< std::string > split(const std::string &aStr, const std::string &aDelim)
Split the input string into a vector of output strings.
std::optional< uint32_t > extra
uint16_t component
ID of the owning component (a component stores its own), 0 for none.
uint16_t signal
ID of the owning signal (a signal stores its own), 0 for none.
std::vector< std::pair< std::string, std::string > > props
Free-form key/value properties in file order.
uint8_t classTag
repeats the element's class tag
std::shared_ptr< COMPONENT > component
std::shared_ptr< SYMBOL > symbol
std::shared_ptr< SIGNAL > signal
std::shared_ptr< PACKAGE > package
std::vector< ELEMENT > children
Children of a pin (its number text).
uint8_t kind
FIDUCIAL_KIND.
std::vector< uint8_t > Picture() const
Encoded image a rectangle shows stretched over its area instead of its fill, empty for none.
std::optional< int64_t > PolygonId() const
ID of the signal polygon whose stored fill this element is part of, if any.
bool FlagProp(const std::string &aKey) const
True when property aKey holds one of the format's boolean true words.
uint16_t signal
ID of the owning signal (a signal stores its own), 0 for none.
std::vector< std::pair< std::string, std::string > > props
Free-form key/value properties in file order.
std::optional< std::pair< int32_t, int32_t > > TextRightEnd() const
Right end of right-aligned text from its ARXY property, in file coordinates.
const std::string * FindProp(const std::string &aKey) const
Return the value of the first property named aKey, if any.
One element of any class.
Copper polygon of a signal, stored in a "$%&POLY" signal property.
bool thermals
own pads join by spokes rather than solidly
void ApplyTextLanguage()
Replace literal texts by their variant in the project's stored language when a text reads AUTOLANGUAG...
const std::string * FindProperty(const std::string &aKey) const
Value of project property aKey, compared case-insensitively.
wxString fileName
source file name without directory, empty for a buffer
const ELEMENT * FindSignal(uint16_t aId) const
Signal element whose ID is aId, or nullptr.
std::vector< ELEMENT > signals
PROJECT_SETTINGS settings
wxDateTime fileModified
source file modification time, invalid for a buffer
std::optional< wxString > FunctionText(const TEXT &aText, bool aSchematic) const
Text that a computed text function shows, where KiCad has an equivalent.
int direction
0..3, multiplied by 90 degrees counterclockwise