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 Protected 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)
 
static SIZES_SETTINGS parseSizesFromJSON (const nlohmann::json &aJSON)
 

Protected 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 59 of file pns_logger.cpp.

◆ ~LOGGER()

PNS::LOGGER::~LOGGER ( )

Definition at line 64 of file pns_logger.cpp.

Member Function Documentation

◆ Clear()

void PNS::LOGGER::Clear ( )

Definition at line 69 of file pns_logger.cpp.

References m_events.

◆ FormatEventAsJSON()

◆ FormatLogFileAsJSON()

◆ formatRouterItemAsJSON()

◆ formatShapeAsJSON()

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

Definition at line 248 of file pns_logger.cpp.

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

Referenced by formatRouterItemAsJSON().

◆ formatSizesAsJSON()

◆ GetEvents()

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

Definition at line 120 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 99 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()

◆ parseSizesFromJSON()

Member Data Documentation

◆ m_events

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

Definition at line 139 of file pns_logger.h.

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

◆ m_testCaseType

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

Definition at line 140 of file pns_logger.h.


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