60 for(
auto& item : items )
62 if( item && item->Parent() )
63 ent.
uuids.push_back( item->Parent()->m_Uuid );
73 std::vector<ITEM*> items;
74 items.push_back(
const_cast<ITEM*
>( item ) );
75 LogM( evt, pos, items, sizes, aLayer );
80 const std::vector<ITEM*>& aAddedItems,
81 const std::set<KIID>& aRemovedItems,
82 const std::vector<ITEM*>& aHeads,
83 const std::vector<LOGGER::EVENT_ENTRY>& aEvents )
85 wxString result = wxString::Format(
"mode %d\n", aMode );
90 for(
const KIID& uuid : aRemovedItems )
91 result += wxString::Format(
"removed %s\n", uuid.AsString().c_str() );
93 for(
ITEM* item : aAddedItems )
94 result += wxString::Format(
"added %s\n", item->Format().c_str() );
96 for(
ITEM* item : aHeads )
97 result += wxString::Format(
"head %s\n", item->Format().c_str() );
105 wxString str = wxString::Format(
"event %d %d %d %d %d ", aEvent.
p.
x, aEvent.
p.
y, aEvent.
type, aEvent.
layer, (
int)aEvent.
uuids.size() );
107 for(
int i = 0; i < aEvent.
uuids.size(); i++ )
109 str.Append( aEvent.
uuids[i].AsString() );
110 str.Append( wxT(
" ") );
113 str.Append( wxString::Format(
"%d %d %d %d %d %d %d",
122 str.Append( wxT(
"\n") );
130 wxStringTokenizer tokens( aLine );
131 wxString cmd = tokens.GetNextToken();
135 wxCHECK_MSG( cmd == wxT(
"event" ),
EVENT_ENTRY(),
"Line doesn't contain an event!" );
138 evt.
p.
x = wxAtoi( tokens.GetNextToken() );
139 evt.
p.
y = wxAtoi( tokens.GetNextToken() );
141 evt.
layer = wxAtoi( tokens.GetNextToken() );
142 n_uuids = wxAtoi( tokens.GetNextToken() );
144 for(
int i = 0; i < n_uuids; i++)
145 evt.
uuids.push_back(
KIID( tokens.GetNextToken() ) );
Base class for PNS router board items.
void Log(EVENT_TYPE evt, const VECTOR2I &pos=VECTOR2I(), const ITEM *item=nullptr, const SIZES_SETTINGS *sizes=nullptr, int aLayer=0)
static wxString FormatLogFileAsString(int aMode, const std::vector< ITEM * > &aAddedItems, const std::set< KIID > &aRemovedItems, const std::vector< ITEM * > &aHeads, const std::vector< EVENT_ENTRY > &aEvents)
void LogM(EVENT_TYPE evt, const VECTOR2I &pos=VECTOR2I(), std::vector< ITEM * > items={}, const SIZES_SETTINGS *sizes=nullptr, int aLayer=0)
static wxString FormatEvent(const EVENT_ENTRY &aEvent)
std::vector< EVENT_ENTRY > m_events
static EVENT_ENTRY ParseEvent(const wxString &aLine)
int GetLayerBottom() const
bool TrackWidthIsExplicit() const
Push and Shove diff pair dimensions (gap) settings dialog.
std::vector< KIID > uuids