KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DIPTRACE_SCH_IMPORT_FIXTURE Struct Reference

#include <test_diptrace_sch_import_fixture.h>

Classes

struct  DCH_XML_COUNTS
 

Public Member Functions

 DIPTRACE_SCH_IMPORT_FIXTURE ()
 
std::string GetTestDataDir ()
 
std::string GetViewerExamplesDir ()
 
int CountItemsOfType (KICAD_T aType)
 
int CountImportedScreens ()
 
int MaxPinCountForRefdes (const wxString &aRefdes)
 
wxString GetFootprintForRefdes (const wxString &aRefdes)
 
wxString GetSheetNameForRefdes (const wxString &aRefdes)
 Return the DipTrace sheet name carrying the symbol with the given reference, or empty.
 
void PinOrientationCounts (const wxString &aRefdes, int &aLeft, int &aRight, int &aUp, int &aDown)
 Count the pin orientations of the first symbol matching the reference designator, read from its embedded library symbol so the placed orientation is what is inspected.
 
bool HasLabelOnSheet (const wxString &aText, const wxString &aSheetName)
 True when a global label whose text matches exists on the sheet with the given name.
 
bool HasLabelStartingWithOnSheet (const wxString &aPrefix, const wxString &aSheetName)
 True when any global label on the named sheet has text beginning with the given prefix.
 
int CountLinesOnSheet (const wxString &aSheetName)
 Count SCH_LINE items on the DipTrace sheet with the given name.
 
int RefValueFieldSeparation (const wxString &aRefdes)
 Distance between the reference and value field positions of the first symbol matching the reference designator, or -1 when the symbol or a field is missing.
 
wxString GetFieldValueForRefdes (const wxString &aRefdes, const wxString &aFieldName)
 The text of a named field on the first symbol matching the reference designator, or an empty string when the symbol or field is absent.
 
double ValueFieldAngleDegrees (const wxString &aRefdes)
 The value-field text angle in degrees for the first symbol matching the reference designator, or -1 when the symbol is absent.
 
int ShowsPinNames (const wxString &aRefdes)
 Whether the embedded library symbol of the first matching reference shows its pin names.
 
int CountSymbolShapes (const wxString &aRefdes, SHAPE_T aShapeType)
 Count the library-symbol graphic shapes of a given type for the first matching reference.
 
int CountSymbolsForRefdesOnSheet (const wxString &aRefdes, const wxString &aSheetName)
 
int CountSheetGraphicLines (const wxString &aSheetName, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth)
 
int CountFilledPolysForRefdes (const wxString &aRefdes)
 
int CountOpenPolysWithPointCountForRefdes (const wxString &aRefdes, int aPointCount)
 
std::vector< int > UnitsForRefdesOnSheet (const wxString &aRefdes, const wxString &aSheetName)
 Return the units of all symbols matching the resolved reference on the named sheet.
 
int UnitCountForRefdes (const wxString &aRefdes)
 Return the unit count of the first library symbol matching the resolved reference.
 
int LibPinCountForRefdesUnitOnSheet (const wxString &aRefdes, const wxString &aSheetName, int aUnit)
 Return the placed symbol's resolved library pin count for a specific unit on a sheet.
 
std::set< wxString > LibPinNamesForRefdesUnitOnSheet (const wxString &aRefdes, const wxString &aSheetName, int aUnit)
 Return the library pin names for a specific placed unit on a sheet.
 
int CountJunctionsOnSheet (const wxString &aSheetName)
 Count junctions on the sheet with the given name.
 
VECTOR2I FieldPosForRefdes (const wxString &aRefdes, FIELD_T aFieldType)
 The position of a field (by type) of the first symbol matching the reference, or a sentinel far-away point when absent.
 
int FieldHorizJustify (const wxString &aRefdes, FIELD_T aFieldType)
 The horizontal justification of a field (by type) of the first matching reference, as the raw enum int, or 99 when absent.
 
int CountLabelsOnSheet (const wxString &aText, const wxString &aSheetName)
 Count global labels whose text matches exactly on the sheet with the given name.
 
bool LabelConnectsToWireOnSheet (const wxString &aPrefix, const wxString &aSheetName)
 True when a global label whose text starts with the prefix sits on a wire endpoint on the named sheet.
 
bool LoadDchXmlCounts (const std::string &aXmlPath, DCH_XML_COUNTS &aCounts)
 
SCH_SHEETLoadDipTraceSchematic (const std::string &aFilePath)
 
void RemoveGeneratedLibrary (const std::string &aFilePath)
 

Static Public Member Functions

static int DipTraceMmToSchIU (double aMm)
 
static VECTOR2I DipTraceXmlSheetPointToKiCad (double aXmm, double aYmm)
 
static bool XmlSubtreeContains (wxXmlNode *aNode, const wxString &aNeedle)
 

Public Attributes

SCH_IO_DIPTRACE m_plugin
 
std::unique_ptr< SCHEMATICm_schematic
 
SETTINGS_MANAGER m_manager
 
SCH_SHEETm_loadedRoot = nullptr
 
DIPTRACE_COUNTING_REPORTER m_reporter
 

Detailed Description

Definition at line 116 of file test_diptrace_sch_import_fixture.h.

Constructor & Destructor Documentation

◆ DIPTRACE_SCH_IMPORT_FIXTURE()

DIPTRACE_SCH_IMPORT_FIXTURE::DIPTRACE_SCH_IMPORT_FIXTURE ( )
inline

Definition at line 118 of file test_diptrace_sch_import_fixture.h.

References m_manager, and m_schematic.

Member Function Documentation

◆ CountFilledPolysForRefdes()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountFilledPolysForRefdes ( const wxString & aRefdes)
inline

◆ CountImportedScreens()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountImportedScreens ( )
inline

Definition at line 164 of file test_diptrace_sch_import_fixture.h.

References m_schematic.

◆ CountItemsOfType()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountItemsOfType ( KICAD_T aType)
inline

Definition at line 142 of file test_diptrace_sch_import_fixture.h.

References SCH_SCREEN::Items(), and m_schematic.

◆ CountJunctionsOnSheet()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountJunctionsOnSheet ( const wxString & aSheetName)
inline

Count junctions on the sheet with the given name.

Definition at line 765 of file test_diptrace_sch_import_fixture.h.

References SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_JUNCTION_T.

◆ CountLabelsOnSheet()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountLabelsOnSheet ( const wxString & aText,
const wxString & aSheetName )
inline

Count global labels whose text matches exactly on the sheet with the given name.

Definition at line 842 of file test_diptrace_sch_import_fixture.h.

References SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_GLOBAL_LABEL_T.

◆ CountLinesOnSheet()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountLinesOnSheet ( const wxString & aSheetName)
inline

Count SCH_LINE items on the DipTrace sheet with the given name.

Definition at line 342 of file test_diptrace_sch_import_fixture.h.

References SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_LINE_T.

◆ CountOpenPolysWithPointCountForRefdes()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountOpenPolysWithPointCountForRefdes ( const wxString & aRefdes,
int aPointCount )
inline

◆ CountSheetGraphicLines()

◆ CountSymbolsForRefdesOnSheet()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountSymbolsForRefdesOnSheet ( const wxString & aRefdes,
const wxString & aSheetName )
inline

◆ CountSymbolShapes()

int DIPTRACE_SCH_IMPORT_FIXTURE::CountSymbolShapes ( const wxString & aRefdes,
SHAPE_T aShapeType )
inline

Count the library-symbol graphic shapes of a given type for the first matching reference.

Definition at line 476 of file test_diptrace_sch_import_fixture.h.

References LIB_SYMBOL::GetDrawItems(), SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetRef(), EDA_SHAPE::GetShape(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), SCH_SHAPE_T, and SCH_SYMBOL_T.

◆ DipTraceMmToSchIU()

static int DIPTRACE_SCH_IMPORT_FIXTURE::DipTraceMmToSchIU ( double aMm)
inlinestatic

Definition at line 535 of file test_diptrace_sch_import_fixture.h.

Referenced by DipTraceXmlSheetPointToKiCad().

◆ DipTraceXmlSheetPointToKiCad()

static VECTOR2I DIPTRACE_SCH_IMPORT_FIXTURE::DipTraceXmlSheetPointToKiCad ( double aXmm,
double aYmm )
inlinestatic

Definition at line 537 of file test_diptrace_sch_import_fixture.h.

References DipTraceMmToSchIU().

◆ FieldHorizJustify()

int DIPTRACE_SCH_IMPORT_FIXTURE::FieldHorizJustify ( const wxString & aRefdes,
FIELD_T aFieldType )
inline

The horizontal justification of a field (by type) of the first matching reference, as the raw enum int, or 99 when absent.

Definition at line 817 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetField(), SCH_SYMBOL::GetRef(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_SYMBOL_T.

◆ FieldPosForRefdes()

VECTOR2I DIPTRACE_SCH_IMPORT_FIXTURE::FieldPosForRefdes ( const wxString & aRefdes,
FIELD_T aFieldType )
inline

The position of a field (by type) of the first symbol matching the reference, or a sentinel far-away point when absent.

Definition at line 791 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetField(), SCH_SYMBOL::GetPosition(), SCH_SYMBOL::GetRef(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_SYMBOL_T.

◆ GetFieldValueForRefdes()

wxString DIPTRACE_SCH_IMPORT_FIXTURE::GetFieldValueForRefdes ( const wxString & aRefdes,
const wxString & aFieldName )
inline

The text of a named field on the first symbol matching the reference designator, or an empty string when the symbol or field is absent.

Definition at line 400 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetField(), SCH_SYMBOL::GetRef(), SCH_FIELD::GetText(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_SYMBOL_T.

◆ GetFootprintForRefdes()

wxString DIPTRACE_SCH_IMPORT_FIXTURE::GetFootprintForRefdes ( const wxString & aRefdes)
inline

◆ GetSheetNameForRefdes()

wxString DIPTRACE_SCH_IMPORT_FIXTURE::GetSheetNameForRefdes ( const wxString & aRefdes)
inline

Return the DipTrace sheet name carrying the symbol with the given reference, or empty.

Definition at line 229 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetRef(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_SYMBOL_T.

◆ GetTestDataDir()

std::string DIPTRACE_SCH_IMPORT_FIXTURE::GetTestDataDir ( )
inline

◆ GetViewerExamplesDir()

std::string DIPTRACE_SCH_IMPORT_FIXTURE::GetViewerExamplesDir ( )
inline

Definition at line 135 of file test_diptrace_sch_import_fixture.h.

◆ HasLabelOnSheet()

bool DIPTRACE_SCH_IMPORT_FIXTURE::HasLabelOnSheet ( const wxString & aText,
const wxString & aSheetName )
inline

True when a global label whose text matches exists on the sheet with the given name.

A net can have a port on several sheets, so membership is tested per sheet rather than returning a single owning sheet.

Definition at line 290 of file test_diptrace_sch_import_fixture.h.

References EDA_TEXT::GetText(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_GLOBAL_LABEL_T.

◆ HasLabelStartingWithOnSheet()

bool DIPTRACE_SCH_IMPORT_FIXTURE::HasLabelStartingWithOnSheet ( const wxString & aPrefix,
const wxString & aSheetName )
inline

True when any global label on the named sheet has text beginning with the given prefix.

Used to assert the importer no longer fabricates internal-net labels ("Net 36" and the like) that DipTrace itself never draws.

Definition at line 317 of file test_diptrace_sch_import_fixture.h.

References EDA_TEXT::GetText(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_GLOBAL_LABEL_T.

◆ LabelConnectsToWireOnSheet()

bool DIPTRACE_SCH_IMPORT_FIXTURE::LabelConnectsToWireOnSheet ( const wxString & aPrefix,
const wxString & aSheetName )
inline

True when a global label whose text starts with the prefix sits on a wire endpoint on the named sheet.

A net-port label must connect to its net, so its anchor coincides with a wire end rather than floating at the symbol body.

Definition at line 869 of file test_diptrace_sch_import_fixture.h.

References anchor, SCH_LINE::GetEndPoint(), SCH_TEXT::GetPosition(), SCH_LINE::GetStartPoint(), EDA_TEXT::GetText(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), SCH_GLOBAL_LABEL_T, and SCH_LINE_T.

◆ LibPinCountForRefdesUnitOnSheet()

int DIPTRACE_SCH_IMPORT_FIXTURE::LibPinCountForRefdesUnitOnSheet ( const wxString & aRefdes,
const wxString & aSheetName,
int aUnit )
inline

Return the placed symbol's resolved library pin count for a specific unit on a sheet.

Definition at line 708 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetLibPins(), SCH_SYMBOL::GetRef(), SCH_ITEM::GetUnit(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_SYMBOL_T.

◆ LibPinNamesForRefdesUnitOnSheet()

std::set< wxString > DIPTRACE_SCH_IMPORT_FIXTURE::LibPinNamesForRefdesUnitOnSheet ( const wxString & aRefdes,
const wxString & aSheetName,
int aUnit )
inline

Return the library pin names for a specific placed unit on a sheet.

Definition at line 733 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetLibPins(), SCH_SYMBOL::GetRef(), SCH_ITEM::GetUnit(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), pin, and SCH_SYMBOL_T.

◆ LoadDchXmlCounts()

bool DIPTRACE_SCH_IMPORT_FIXTURE::LoadDchXmlCounts ( const std::string & aXmlPath,
DCH_XML_COUNTS & aCounts )
inline

◆ LoadDipTraceSchematic()

SCH_SHEET * DIPTRACE_SCH_IMPORT_FIXTURE::LoadDipTraceSchematic ( const std::string & aFilePath)
inline

◆ MaxPinCountForRefdes()

int DIPTRACE_SCH_IMPORT_FIXTURE::MaxPinCountForRefdes ( const wxString & aRefdes)
inline

◆ PinOrientationCounts()

void DIPTRACE_SCH_IMPORT_FIXTURE::PinOrientationCounts ( const wxString & aRefdes,
int & aLeft,
int & aRight,
int & aUp,
int & aDown )
inline

Count the pin orientations of the first symbol matching the reference designator, read from its embedded library symbol so the placed orientation is what is inspected.

Definition at line 252 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetLibSymbolRef(), LIB_SYMBOL::GetPins(), SCH_SYMBOL::GetRef(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), pin, PIN_DOWN, PIN_LEFT, PIN_RIGHT, PIN_UP, and SCH_SYMBOL_T.

◆ RefValueFieldSeparation()

int DIPTRACE_SCH_IMPORT_FIXTURE::RefValueFieldSeparation ( const wxString & aRefdes)
inline

Distance between the reference and value field positions of the first symbol matching the reference designator, or -1 when the symbol or a field is missing.

Used to confirm the two fields are not stacked on the symbol origin.

Definition at line 369 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetField(), SCH_FIELD::GetPosition(), SCH_SYMBOL::GetRef(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), REFERENCE, SCH_SYMBOL_T, and VALUE.

◆ RemoveGeneratedLibrary()

void DIPTRACE_SCH_IMPORT_FIXTURE::RemoveGeneratedLibrary ( const std::string & aFilePath)
inline

Definition at line 1006 of file test_diptrace_sch_import_fixture.h.

◆ ShowsPinNames()

int DIPTRACE_SCH_IMPORT_FIXTURE::ShowsPinNames ( const wxString & aRefdes)
inline

Whether the embedded library symbol of the first matching reference shows its pin names.

Returns -1 when the symbol is absent, otherwise 0 or 1.

Definition at line 452 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetLibSymbolRef(), SCH_SYMBOL::GetRef(), SYMBOL::GetShowPinNames(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_SYMBOL_T.

◆ UnitCountForRefdes()

int DIPTRACE_SCH_IMPORT_FIXTURE::UnitCountForRefdes ( const wxString & aRefdes)
inline

Return the unit count of the first library symbol matching the resolved reference.

Definition at line 686 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetRef(), SCH_SYMBOL::GetUnitCount(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_SYMBOL_T.

◆ UnitsForRefdesOnSheet()

std::vector< int > DIPTRACE_SCH_IMPORT_FIXTURE::UnitsForRefdesOnSheet ( const wxString & aRefdes,
const wxString & aSheetName )
inline

Return the units of all symbols matching the resolved reference on the named sheet.

Definition at line 658 of file test_diptrace_sch_import_fixture.h.

References SCH_SYMBOL::GetRef(), SCH_ITEM::GetUnit(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), and SCH_SYMBOL_T.

◆ ValueFieldAngleDegrees()

double DIPTRACE_SCH_IMPORT_FIXTURE::ValueFieldAngleDegrees ( const wxString & aRefdes)
inline

The value-field text angle in degrees for the first symbol matching the reference designator, or -1 when the symbol is absent.

Definition at line 426 of file test_diptrace_sch_import_fixture.h.

References EDA_ANGLE::AsDegrees(), SCH_SYMBOL::GetField(), SCH_SYMBOL::GetRef(), EDA_TEXT::GetTextAngle(), SCH_SCREEN::Items(), m_schematic, EE_RTREE::OfType(), SCH_SYMBOL_T, and VALUE.

◆ XmlSubtreeContains()

static bool DIPTRACE_SCH_IMPORT_FIXTURE::XmlSubtreeContains ( wxXmlNode * aNode,
const wxString & aNeedle )
inlinestatic

Definition at line 910 of file test_diptrace_sch_import_fixture.h.

References XmlSubtreeContains().

Referenced by LoadDchXmlCounts(), and XmlSubtreeContains().

Member Data Documentation

◆ m_loadedRoot

SCH_SHEET* DIPTRACE_SCH_IMPORT_FIXTURE::m_loadedRoot = nullptr

Definition at line 130 of file test_diptrace_sch_import_fixture.h.

Referenced by LoadDipTraceSchematic().

◆ m_manager

SETTINGS_MANAGER DIPTRACE_SCH_IMPORT_FIXTURE::m_manager

◆ m_plugin

SCH_IO_DIPTRACE DIPTRACE_SCH_IMPORT_FIXTURE::m_plugin

Definition at line 127 of file test_diptrace_sch_import_fixture.h.

Referenced by LoadDipTraceSchematic().

◆ m_reporter

DIPTRACE_COUNTING_REPORTER DIPTRACE_SCH_IMPORT_FIXTURE::m_reporter

Definition at line 131 of file test_diptrace_sch_import_fixture.h.

Referenced by LoadDipTraceSchematic().

◆ m_schematic


The documentation for this struct was generated from the following file: