33 aAr.SetBooleanIsByte( aItem.Format > 7999 );
41 serializeFormat( aAr, *
this );
154 for( int32_t i = aAr.
I32(); i > 0; --i )
164 static const std::vector<OBJECT*>
empty;
180 for( uint32_t i = aAr.
Count(); i > 0; --i )
195 for( int32_t i = aAr.
I32(); i > 0; --i )
219 serializeFormat( aAr, *
this );
224 const int32_t product = aAr.
Product();
264 serializeFormat( aAr, *
this );
296 if( aPcbSymbolPin.Contains( wxS(
"," ) ) || aPcbSymbolPin.Contains( wxS(
"+" ) )
297 || aPcbSymbolPin.Contains( wxS(
"=" ) ) )
303 return aPcbSymbolPin.Find(
'-' ) > 0;
310 constexpr uint64_t MAX_PIN_RANGE = 100000;
312 std::vector<wxString> out;
313 wxString list = aList;
314 int eq = list.Find(
'=' );
316 if( eq != wxNOT_FOUND )
319 *aDisplay = list.Left( eq );
321 list = list.Mid( eq + 1 );
330 int dash = item.Find(
'-' );
332 if( dash > 0 && item.Left( dash ).ToLong( &first ) && item.Mid( dash + 1 ).ToLong( &last ) && first <= last
333 && uint64_t( last ) - uint64_t( first ) < MAX_PIN_RANGE )
336 for(
long n = first;; ++n )
338 out.push_back( wxString::Format( wxS(
"%ld" ), n ) );
344 else if( !item.IsEmpty() )
346 out.push_back( item );
352 for( wxUniChar ch : list )
354 if( ch ==
',' || ch ==
'+' )
One archive load stream; it owns every object it creates.
void MapObject(OBJECT *aObject)
A load-array slot for an object not read through a tag.
EMBEDDED_AWAITER Embedded(OBJECT &aObject, const char *aClass)
static std::unique_ptr< OBJECT > Create(const char *aClass)
An object of a registered class, not yet loaded.
wxString ReadString()
ANSI (windows-1252) or the 0xFF 0xFFFE UTF-16 form.
TYPED_AWAITER< T > ObjectAs()
bool InBool()
one or four bytes, depending on the active format
uint32_t Count()
a 16-bit count, 0xFFFF escaping to 32 bits
A loader coroutine. Awaiting one queues it on its archive's frame stack instead of nesting the call.
static bool empty(const wxTextEntryBase *aCtrl)
Symbols, components and gates, embedded in designs or the single object of a library item stream.
std::vector< wxString > ExpandPinNumberList(const wxString &aList, wxString *aDisplay)
Expand a gate pin's component pin list by Easy-PC's pin list syntax: items separated by ,...
std::map< std::string, std::function< std::unique_ptr< OBJECT >()>, std::less<> > REGISTRY
LOAD_TASK SkipMember(ARCHIVE &aAr, const char *aClass, bool aDesignOwned)
Load and drop an embedded member of a registered class; aDesignOwned marks its design as owner.
constexpr int NEWEST_ITEM_FORMAT
The newest item format a file can carry (30001)
void RegisterLibraryClasses(REGISTRY &aReg)
@ PRODUCT_DESIGNSPARK_CREATOR
@ PRODUCT_DESIGNSPARK_PRO
bool IsPadList(const wxString &aPcbSymbolPin)
Whether a gate pin's pad reference names several pads ("-1", the unmapped marker, does not)
const std::vector< OBJECT * > & ListItems(const OBJECT *aList)
The items of a design list or array, empty for anything else.
void Register(REGISTRY &aReg, std::initializer_list< const char * > aNames)
Register the class names whose objects load as a T.
Root of every deserialized object.
The item's own format, returned by the self-versioned classes' ItemFormat.
SOURCE_SCM_COMPONENT * Schematic
SOURCE_PCB_COMPONENT * Board
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
An array: owner tag, then a counted list of objects.
std::vector< OBJECT * > Items
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
int ItemFormat(const ARCHIVE &aAr) const override
The version this object gates on; the base is the archive's current read format.
void LoadOldFormat(ARCHIVE &aAr, int &aFormat) const
An older item format, stored only while the format is still 0.
static void LoadFormatted(ARCHIVE &aAr, int &aFormat)
An item format, stored only from object schema 2, which governs what follows.
A list: owner tag, then the items.
OBJECT * Pins
gate pin array, format above 8999
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
std::vector< int32_t > PcbSymbolPins
older formats: pad number per terminal, -1 unmapped
wxString NetName
default net, or a net class in parentheses
wxString PcbSymbolPin
pad number, "-1", or a pad list
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
std::vector< wxString > PinNames
terminal t is the symbol pad numbered t + 1
Also placement and symbol name origins.
The package half of a component.
OBJECT * GateMaps
one per schematic gate in order
wxString Symbol
footprint name
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
OBJECT * Definition
the pin name or number instantiated
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
uint32_t SuppressionFlags
wxString DefaultReference
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
LOAD_TASK Load(ARCHIVE &aAr) override
Read this object's fields.
std::unique_ptr< SOURCE_DESIGN_LIST > DerivedValuePositions
OBJECT * Shapes
free copper list
OBJECT * Texts
free text list
std::unique_ptr< OBJECT > NameOrigin
The symbol name origin of formats below 10003, which becomes the only value position.
std::unique_ptr< SOURCE_VALUE_POSITION > DerivedNamePosition
OBJECT * Pads
free pad list
LOAD_TASK LoadRemainder(ARCHIVE &aAr)
The text position fields that follow the item fields.