KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS_LOG_FILE Class Reference

#include <pns_log_file.h>

Classes

struct  COMMIT_STATE
 

Public Member Functions

 PNS_LOG_FILE ()
 
 ~PNS_LOG_FILE ()
 
bool SaveLog (const wxFileName &logFileName, REPORTER *aRpt)
 
bool Load (const wxFileName &logFileName, REPORTER *aRpt, const wxString boardFileName=wxT(""))
 
const std::optional< wxString > GetLogBoardHash (const wxString &logFileName)
 
std::vector< BOARD_CONNECTED_ITEM * > ItemsById (const PNS::LOGGER::EVENT_ENTRY &evt)
 
BOARD_CONNECTED_ITEMItemById (const PNS::LOGGER::EVENT_ENTRY &evt)
 
std::vector< PNS::LOGGER::EVENT_ENTRY > & Events ()
 
void SetBoard (std::shared_ptr< BOARD > brd)
 
std::shared_ptr< BOARDGetBoard () const
 
PNS::ROUTING_SETTINGSGetRoutingSettings () const
 
const COMMIT_STATEGetExpectedResult () const
 
void SetExpectedResult (const COMMIT_STATE &aCommitState, std::vector< std::unique_ptr< PNS::ITEM > > aParsedItems)
 
PNS::ROUTER_MODE GetMode () const
 
void SetMode (PNS::ROUTER_MODE aMode)
 
void SetTestCaseType (PNS::LOGGER::TEST_CASE_TYPE aType)
 
std::optional< PNS::LOGGER::TEST_CASE_TYPEGetTestCaseType () const
 

Private Member Functions

bool parseLegacyCommonPnsProps (PNS::ITEM *aItem, const wxString &cmd, wxStringTokenizer &aTokens)
 
std::unique_ptr< PNS::SEGMENTparseLegacyPnsSegmentFromString (wxStringTokenizer &aTokens)
 
std::unique_ptr< PNS::VIAparseLegacyPnsViaFromString (wxStringTokenizer &aTokens)
 
std::unique_ptr< PNS::ITEMparseLegacyItemFromString (wxStringTokenizer &aTokens)
 
std::shared_ptr< SHAPEparseLegacyShape (SHAPE_TYPE expectedType, wxStringTokenizer &aTokens)
 
std::shared_ptr< SHAPEparseShape (const nlohmann::json &aJSON)
 
bool parseCommonPnsProps (const nlohmann::json &aJSON, PNS::ITEM *aItem)
 
std::unique_ptr< PNS::ITEMparseItem (const nlohmann::json &aJSON)
 
bool loadJsonLog (const wxString &aFilename, REPORTER *aRpt, bool aHashOnly=false)
 
bool loadLegacyLog (const wxString &aFilename, REPORTER *aRpt)
 

Private Attributes

std::optional< wxString > m_boardHash
 
std::shared_ptr< SETTINGS_MANAGERm_settingsMgr
 
std::unique_ptr< PNS::ROUTING_SETTINGSm_routerSettings
 
std::vector< PNS::LOGGER::EVENT_ENTRYm_events
 
std::shared_ptr< BOARDm_board
 
COMMIT_STATE m_commitState
 
std::vector< std::unique_ptr< PNS::ITEM > > m_parsed_items
 
PNS::ROUTER_MODE m_mode
 
std::optional< PNS::LOGGER::TEST_CASE_TYPEm_testCaseType
 

Detailed Description

Definition at line 50 of file pns_log_file.h.

Constructor & Destructor Documentation

◆ PNS_LOG_FILE()

PNS_LOG_FILE::PNS_LOG_FILE ( )

Definition at line 87 of file pns_log_file.cpp.

References m_mode, and m_routerSettings.

◆ ~PNS_LOG_FILE()

PNS_LOG_FILE::~PNS_LOG_FILE ( )
inline

Definition at line 54 of file pns_log_file.h.

Member Function Documentation

◆ Events()

std::vector< PNS::LOGGER::EVENT_ENTRY > & PNS_LOG_FILE::Events ( )
inline

Definition at line 82 of file pns_log_file.h.

References m_events.

Referenced by PNS_LOG_PLAYER::ReplayLog().

◆ GetBoard()

std::shared_ptr< BOARD > PNS_LOG_FILE::GetBoard ( ) const
inline

Definition at line 85 of file pns_log_file.h.

References m_board.

Referenced by PNS_LOG_PLAYER::ReplayLog().

◆ GetExpectedResult()

const COMMIT_STATE & PNS_LOG_FILE::GetExpectedResult ( ) const
inline

Definition at line 89 of file pns_log_file.h.

References m_commitState.

Referenced by PNS_LOG_PLAYER::CompareResults(), and PNS_TEST_FIXTURE::RunTest().

◆ GetLogBoardHash()

const std::optional< wxString > PNS_LOG_FILE::GetLogBoardHash ( const wxString & logFileName)

Definition at line 659 of file pns_log_file.cpp.

References loadJsonLog(), and m_boardHash.

Referenced by PNS_TEST_FIXTURE::RunTest().

◆ GetMode()

PNS::ROUTER_MODE PNS_LOG_FILE::GetMode ( ) const
inline

Definition at line 98 of file pns_log_file.h.

References m_mode.

Referenced by PNS_LOG_PLAYER::ReplayLog().

◆ GetRoutingSettings()

PNS::ROUTING_SETTINGS * PNS_LOG_FILE::GetRoutingSettings ( ) const
inline

Definition at line 87 of file pns_log_file.h.

References m_routerSettings.

Referenced by PNS_LOG_PLAYER::ReplayLog().

◆ GetTestCaseType()

std::optional< PNS::LOGGER::TEST_CASE_TYPE > PNS_LOG_FILE::GetTestCaseType ( ) const
inline

Definition at line 102 of file pns_log_file.h.

References m_testCaseType.

◆ ItemById()

BOARD_CONNECTED_ITEM * PNS_LOG_FILE::ItemById ( const PNS::LOGGER::EVENT_ENTRY & evt)

Definition at line 69 of file pns_log_file.cpp.

References ItemsById().

◆ ItemsById()

std::vector< BOARD_CONNECTED_ITEM * > PNS_LOG_FILE::ItemsById ( const PNS::LOGGER::EVENT_ENTRY & evt)

Definition at line 48 of file pns_log_file.cpp.

References m_board, and PNS::LOGGER::EVENT_ENTRY::uuids.

Referenced by ItemById(), and PNS_LOG_PLAYER::ReplayLog().

◆ Load()

◆ loadJsonLog()

bool PNS_LOG_FILE::loadJsonLog ( const wxString & aFilename,
REPORTER * aRpt,
bool aHashOnly = false )
private

◆ loadLegacyLog()

bool PNS_LOG_FILE::loadLegacyLog ( const wxString & aFilename,
REPORTER * aRpt )
private

◆ parseCommonPnsProps()

bool PNS_LOG_FILE::parseCommonPnsProps ( const nlohmann::json & aJSON,
PNS::ITEM * aItem )
private

Definition at line 178 of file pns_log_file.cpp.

References m_board, PNS::ITEM::SetLayers(), and PNS::ITEM::SetNet().

Referenced by parseItem().

◆ parseItem()

std::unique_ptr< PNS::ITEM > PNS_LOG_FILE::parseItem ( const nlohmann::json & aJSON)
private

Definition at line 245 of file pns_log_file.cpp.

References parseCommonPnsProps(), parseShape(), and via.

Referenced by loadJsonLog().

◆ parseLegacyCommonPnsProps()

bool PNS_LOG_FILE::parseLegacyCommonPnsProps ( PNS::ITEM * aItem,
const wxString & cmd,
wxStringTokenizer & aTokens )
private

◆ parseLegacyItemFromString()

std::unique_ptr< PNS::ITEM > PNS_LOG_FILE::parseLegacyItemFromString ( wxStringTokenizer & aTokens)
private

Definition at line 293 of file pns_log_file.cpp.

References parseLegacyPnsSegmentFromString(), and parseLegacyPnsViaFromString().

Referenced by loadLegacyLog().

◆ parseLegacyPnsSegmentFromString()

std::unique_ptr< PNS::SEGMENT > PNS_LOG_FILE::parseLegacyPnsSegmentFromString ( wxStringTokenizer & aTokens)
private

Definition at line 187 of file pns_log_file.cpp.

References parseLegacyCommonPnsProps(), parseLegacyShape(), and SH_SEGMENT.

Referenced by parseLegacyItemFromString().

◆ parseLegacyPnsViaFromString()

std::unique_ptr< PNS::VIA > PNS_LOG_FILE::parseLegacyPnsViaFromString ( wxStringTokenizer & aTokens)
private

◆ parseLegacyShape()

std::shared_ptr< SHAPE > PNS_LOG_FILE::parseLegacyShape ( SHAPE_TYPE expectedType,
wxStringTokenizer & aTokens )
private

◆ parseShape()

std::shared_ptr< SHAPE > PNS_LOG_FILE::parseShape ( const nlohmann::json & aJSON)
private

Definition at line 94 of file pns_log_file.cpp.

References end.

Referenced by parseItem().

◆ SaveLog()

◆ SetBoard()

void PNS_LOG_FILE::SetBoard ( std::shared_ptr< BOARD > brd)
inline

Definition at line 84 of file pns_log_file.h.

References m_board.

◆ SetExpectedResult()

void PNS_LOG_FILE::SetExpectedResult ( const COMMIT_STATE & aCommitState,
std::vector< std::unique_ptr< PNS::ITEM > > aParsedItems )
inline

Definition at line 91 of file pns_log_file.h.

References m_commitState, and m_parsed_items.

Referenced by PNS_LOG_PLAYER::ReplayLog().

◆ SetMode()

void PNS_LOG_FILE::SetMode ( PNS::ROUTER_MODE aMode)
inline

Definition at line 100 of file pns_log_file.h.

References m_mode.

◆ SetTestCaseType()

void PNS_LOG_FILE::SetTestCaseType ( PNS::LOGGER::TEST_CASE_TYPE aType)
inline

Definition at line 101 of file pns_log_file.h.

References m_testCaseType.

Member Data Documentation

◆ m_board

std::shared_ptr<BOARD> PNS_LOG_FILE::m_board
private

◆ m_boardHash

std::optional<wxString> PNS_LOG_FILE::m_boardHash
private

Definition at line 118 of file pns_log_file.h.

Referenced by GetLogBoardHash(), loadJsonLog(), and SaveLog().

◆ m_commitState

COMMIT_STATE PNS_LOG_FILE::m_commitState
private

◆ m_events

std::vector<PNS::LOGGER::EVENT_ENTRY> PNS_LOG_FILE::m_events
private

Definition at line 121 of file pns_log_file.h.

Referenced by Events(), loadJsonLog(), loadLegacyLog(), and SaveLog().

◆ m_mode

PNS::ROUTER_MODE PNS_LOG_FILE::m_mode
private

Definition at line 125 of file pns_log_file.h.

Referenced by GetMode(), loadJsonLog(), loadLegacyLog(), PNS_LOG_FILE(), SaveLog(), and SetMode().

◆ m_parsed_items

std::vector<std::unique_ptr<PNS::ITEM> > PNS_LOG_FILE::m_parsed_items
private

Definition at line 124 of file pns_log_file.h.

Referenced by loadJsonLog(), loadLegacyLog(), and SetExpectedResult().

◆ m_routerSettings

std::unique_ptr<PNS::ROUTING_SETTINGS> PNS_LOG_FILE::m_routerSettings
private

Definition at line 120 of file pns_log_file.h.

Referenced by GetRoutingSettings(), Load(), and PNS_LOG_FILE().

◆ m_settingsMgr

std::shared_ptr<SETTINGS_MANAGER> PNS_LOG_FILE::m_settingsMgr
private

Definition at line 119 of file pns_log_file.h.

Referenced by Load().

◆ m_testCaseType

std::optional<PNS::LOGGER::TEST_CASE_TYPE> PNS_LOG_FILE::m_testCaseType
private

Definition at line 126 of file pns_log_file.h.

Referenced by GetTestCaseType(), loadJsonLog(), SaveLog(), and SetTestCaseType().


The documentation for this class was generated from the following files: