KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PNS::LOGGER Class Reference

#include <pns_logger.h>

Classes

struct  EVENT_ENTRY
 
struct  LOG_DATA
 

Public Types

enum  TEST_CASE_TYPE { TCT_STRICT_GEOMETRY = 0 , TCT_CONNECTIVITY_ONLY , TCT_EXPECTED_FAIL , TCT_KNOWN_BUG }
 
enum  EVENT_TYPE {
  EVT_START_ROUTE = 0 , EVT_START_DRAG , EVT_FIX , EVT_MOVE ,
  EVT_ABORT , EVT_TOGGLE_VIA , EVT_UNFIX , EVT_START_MULTIDRAG
}
 

Public Member Functions

 LOGGER ()
 
 ~LOGGER ()
 
void Clear ()
 
void LogM (EVENT_TYPE evt, const VECTOR2I &pos=VECTOR2I(), std::vector< ITEM * > items={}, const SIZES_SETTINGS *sizes=nullptr, int aLayer=0)
 
void Log (EVENT_TYPE evt, const VECTOR2I &pos=VECTOR2I(), const ITEM *item=nullptr, const SIZES_SETTINGS *sizes=nullptr, int aLayer=0)
 
const std::vector< EVENT_ENTRY > & GetEvents ()
 

Static Public Member Functions

static nlohmann::json FormatEventAsJSON (const EVENT_ENTRY &aEvent)
 
static EVENT_ENTRY ParseEvent (const wxString &aLine)
 
static EVENT_ENTRY ParseEventFromJSON (const nlohmann::json &aJSON)
 
static wxString FormatLogFileAsJSON (const LOG_DATA &aLogData)
 

Static Private Member Functions

static nlohmann::json formatSizesAsJSON (const SIZES_SETTINGS &aEvent)
 
static nlohmann::json formatRouterItemAsJSON (const PNS::ITEM *aItem)
 
static nlohmann::json formatShapeAsJSON (const SHAPE *aShape)
 

Private Attributes

std::vector< EVENT_ENTRYm_events
 
std::optional< TEST_CASE_TYPEm_testCaseType
 

Detailed Description

Definition at line 48 of file pns_logger.h.

Member Enumeration Documentation

◆ EVENT_TYPE

Enumerator
EVT_START_ROUTE 
EVT_START_DRAG 
EVT_FIX 
EVT_MOVE 
EVT_ABORT 
EVT_TOGGLE_VIA 
EVT_UNFIX 
EVT_START_MULTIDRAG 

Definition at line 60 of file pns_logger.h.

◆ TEST_CASE_TYPE

Enumerator
TCT_STRICT_GEOMETRY 
TCT_CONNECTIVITY_ONLY 
TCT_EXPECTED_FAIL 
TCT_KNOWN_BUG 

Definition at line 52 of file pns_logger.h.

Constructor & Destructor Documentation

◆ LOGGER()

PNS::LOGGER::LOGGER ( )

Definition at line 58 of file pns_logger.cpp.

◆ ~LOGGER()

PNS::LOGGER::~LOGGER ( )

Definition at line 63 of file pns_logger.cpp.

Member Function Documentation

◆ Clear()

void PNS::LOGGER::Clear ( )

Definition at line 68 of file pns_logger.cpp.

References m_events.

◆ FormatEventAsJSON()

nlohmann::json PNS::LOGGER::FormatEventAsJSON ( const EVENT_ENTRY & aEvent)
static

◆ FormatLogFileAsJSON()

◆ formatRouterItemAsJSON()

◆ formatShapeAsJSON()

nlohmann::json PNS::LOGGER::formatShapeAsJSON ( const SHAPE * aShape)
staticprivate

Definition at line 224 of file pns_logger.cpp.

References circle(), SH_ARC, SH_CIRCLE, SH_SEGMENT, and SHAPE_BASE::Type().

Referenced by formatRouterItemAsJSON().

◆ formatSizesAsJSON()

◆ GetEvents()

const std::vector< EVENT_ENTRY > & PNS::LOGGER::GetEvents ( )
inline

Definition at line 118 of file pns_logger.h.

References m_events.

◆ Log()

void PNS::LOGGER::Log ( LOGGER::EVENT_TYPE evt,
const VECTOR2I & pos = VECTOR2I(),
const ITEM * item = nullptr,
const SIZES_SETTINGS * sizes = nullptr,
int aLayer = 0 )

Definition at line 98 of file pns_logger.cpp.

References LogM().

◆ LogM()

void PNS::LOGGER::LogM ( LOGGER::EVENT_TYPE evt,
const VECTOR2I & pos = VECTOR2I(),
std::vector< ITEM * > items = {},
const SIZES_SETTINGS * sizes = nullptr,
int aLayer = 0 )

◆ ParseEvent()

◆ ParseEventFromJSON()

LOGGER::EVENT_ENTRY PNS::LOGGER::ParseEventFromJSON ( const nlohmann::json & aJSON)
static

Member Data Documentation

◆ m_events

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

Definition at line 135 of file pns_logger.h.

Referenced by Clear(), GetEvents(), and LogM().

◆ m_testCaseType

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

Definition at line 136 of file pns_logger.h.


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