KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pns_log_player.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 (C) 2020-2021 KiCad Developers.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23#ifndef __PNS_LOG_PLAYER_H
24#define __PNS_LOG_PLAYER_H
25
26#include <map>
27#include <pcbnew/board.h>
28
31#include <router/pns_router.h>
32
33
35class PNS_LOG_FILE;
36class PNS_LOG_PLAYER;
37class REPORTER;
38
40{
41public:
42 struct ENTRY
43 {
46 };
47
48 typedef std::vector<ENTRY> VIEW_ENTRIES;
49
52
53 void SetStage( int aStage );
54 VIEW_ENTRIES& GetEntriesForStage( int aStage ) { return m_vitems[aStage]; }
55
56 void HideItem( PNS::ITEM* aItem );
57 void DisplayItem( const PNS::ITEM* aItem );
58
59
60private:
62 std::map<int, VIEW_ENTRIES> m_vitems;
63};
64
66{
67public:
70
71 void HideItem( PNS::ITEM* aItem ) override;
72 void DisplayItem( const PNS::ITEM* aItem, int aClearance, bool aEdit = false, bool aIsHeadTrace = false ) override;
73
74 int GetNetCode( PNS::NET_HANDLE aNet ) const override;
75 wxString GetNetName( PNS::NET_HANDLE aNet ) const override;
76
77private:
79};
80
81
83{
84public:
87
88 void ReplayLog( PNS_LOG_FILE* aLog, int aStartEventIndex = 0, int aFrom = 0, int aTo = -1 );
89
90 void SetReporter( REPORTER* aReporter ) { m_reporter = aReporter; }
91
93 std::shared_ptr<PNS_LOG_VIEW_TRACKER> GetViewTracker() { return m_viewTracker; }
94
95 void SetTimeLimit( uint64_t microseconds ) { m_timeLimitUs = microseconds; }
96
97 bool CompareResults( PNS_LOG_FILE* aLog );
99
100private:
101 void createRouter();
102
103 std::shared_ptr<PNS_LOG_VIEW_TRACKER> m_viewTracker;
105 std::shared_ptr<BOARD> m_board;
106 std::unique_ptr<PNS_LOG_PLAYER_KICAD_IFACE> m_iface;
107 std::unique_ptr<PNS::ROUTER> m_router;
110};
111
112#endif
Base class for PNS router board items.
Definition: pns_item.h:97
void DisplayItem(const PNS::ITEM *aItem, int aClearance, bool aEdit=false, bool aIsHeadTrace=false) override
int GetNetCode(PNS::NET_HANDLE aNet) const override
PNS_LOG_VIEW_TRACKER * m_viewTracker
void HideItem(PNS::ITEM *aItem) override
wxString GetNetName(PNS::NET_HANDLE aNet) const override
PNS_TEST_DEBUG_DECORATOR * m_debugDecorator
void SetTimeLimit(uint64_t microseconds)
std::shared_ptr< PNS_LOG_VIEW_TRACKER > GetViewTracker()
std::shared_ptr< BOARD > m_board
const PNS_LOG_FILE::COMMIT_STATE GetRouterUpdatedItems()
REPORTER * m_reporter
uint64_t m_timeLimitUs
PNS_TEST_DEBUG_DECORATOR * GetDebugDecorator()
bool CompareResults(PNS_LOG_FILE *aLog)
std::unique_ptr< PNS::ROUTER > m_router
std::shared_ptr< PNS_LOG_VIEW_TRACKER > m_viewTracker
std::unique_ptr< PNS_LOG_PLAYER_KICAD_IFACE > m_iface
void ReplayLog(PNS_LOG_FILE *aLog, int aStartEventIndex=0, int aFrom=0, int aTo=-1)
void SetReporter(REPORTER *aReporter)
std::map< int, VIEW_ENTRIES > m_vitems
VIEW_ENTRIES & GetEntriesForStage(int aStage)
void DisplayItem(const PNS::ITEM *aItem)
void HideItem(PNS::ITEM *aItem)
std::vector< ENTRY > VIEW_ENTRIES
void SetStage(int aStage)
A pure virtual class used to derive REPORTER objects from.
Definition: reporter.h:71
void * NET_HANDLE
Definition: pns_item.h:54