KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH::IFACE Struct Reference
Inheritance diagram for SCH::IFACE:
KIFACE_BASE UNITS_PROVIDER KIFACE

Public Member Functions

 IFACE (const char *aName, KIWAY::FACE_T aType)
 
bool OnKifaceStart (PGM_BASE *aProgram, int aCtlBits, KIWAY *aKiway) override
 Typically start_common() is called from here.
 
void Reset () override
 Reloads global state.
 
void OnKifaceEnd () override
 Called just once just before the DSO is to be unloaded.
 
wxWindow * CreateKiWindow (wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
 Create a wxWindow for the current project.
 
void * IfaceOrAddress (int aDataId) override
 Return a pointer to the requested object.
 
EESCHEMA_JOBS_HANDLER * JobHandler () const
 Accessor for the non-job diff/merge exports (eeschemaMergeExport etc.).
 
void SaveFileAs (const wxString &aProjectBasePath, const wxString &aProjectName, const wxString &aNewProjectBasePath, const wxString &aNewProjectName, const wxString &aSrcFilePath, wxString &aErrors) override
 Saving a file under a different name is delegated to the various KIFACEs because the project doesn't know the internal format of the various files (which may have paths in them that need updating).
 
int HandleJob (JOB *aJob, REPORTER *aReporter, PROGRESS_REPORTER *aProgressReporter) override
 
bool HandleJobConfig (JOB *aJob, wxWindow *aParent) override
 
bool HandleApiOpenDocument (const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError) override
 
bool handleCreateSchematic (const wxString &aPath, KICAD_API_SERVER *aServer, wxString *aError)
 
bool handleOpenSymbol (const wxString &aProjectPath, const wxString &aLibIdStr, KICAD_API_SERVER *aServer, wxString *aError)
 
bool HandleApiCloseDocument (const DOCUMENT_SPEC &aSpec, KICAD_API_SERVER *aServer, wxString *aError) override
 Close the document identified by aSpec.
 
void PreloadLibraries (KIWAY *aKiway) override
 
void CancelPreload (bool aBlock=true) override
 
void ProjectChanged () override
 
void RegisterLibraryHandlers (KICAD_API_SERVER *aServer) override
 Register this face's library API handlers on the given server.
 
bool LoadAllLibraries () override
 Starts a background load of all libraries of the type owned by this face.
 
const wxString Name ()
 
APP_SETTINGS_BASE * KifaceSettings () const
 
void InitSettings (APP_SETTINGS_BASE *aSettings)
 
int StartFlags () const
 Return whatever was passed as aCtlBits to OnKifaceStart().
 
bool IsSingle () const
 Is this KIFACE running under single_top?
 
const wxString & GetHelpFileName () const
 Return just the basename portion of the current help file.
 
SEARCH_STACK & KifaceSearch ()
 Only for DSO specific 'non-library' files.
 
void GetActions (std::vector< TOOL_ACTION * > &aActions) const override
 Append this Kiface's registered actions to the given list.
 
EDA_UNITS GetUserUnits () const
 
void SetUserUnits (EDA_UNITS aUnits)
 
virtual void GetUnitPair (EDA_UNITS &aPrimaryUnit, EDA_UNITS &aSecondaryUnits)
 
const EDA_IU_SCALE & GetIuScale () const
 
virtual ORIGIN_TRANSFORMS & GetOriginTransforms ()
 
wxString StringFromValue (double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
 Converts aValue in internal units into a united string.
 
wxString StringFromValue (const EDA_ANGLE &aValue, bool aAddUnitLabel=false) const
 
wxString StringFromOptionalValue (std::optional< int > aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
 Converts an optional aValue in internal units into a united string.
 
wxString MessageTextFromValue (double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
 A lower-precision version of StringFromValue().
 
wxString MessageTextFromValue (const EDA_ANGLE &aValue, bool aAddUnitLabel=true) const
 
wxString MessageTextFromUnscaledValue (double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
 
wxString MessageTextFromMinOptMax (const MINOPTMAX< int > &aValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
 
int ValueFromString (const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
 Converts aTextValue in aUnits to internal units used by the frame.
 
std::optional< int > OptionalValueFromString (const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
 Converts aTextValue in aUnits to internal units used by the frame.
 
EDA_ANGLE AngleValueFromString (const wxString &aTextValue) const
 
EDA_UNITS GetUnitsFromType (EDA_DATA_TYPE aType) const
 Gets the units to use in the conversion based on the underlying user units.
 

Static Public Member Functions

static EDA_DATA_TYPE GetTypeFromUnits (const EDA_UNITS aUnits)
 Gets the inferred type from the given units.
 

Static Public Attributes

static const wxString NullUiString = ""
 The string that is used in the UI to represent a null value.
 

Protected Member Functions

bool start_common (int aCtlBits)
 Common things to do for a top program module, during OnKifaceStart().
 
void end_common ()
 Common things to do for a top program module, during OnKifaceEnd();.
 

Protected Attributes

int m_start_flags
 flags provided in OnKifaceStart()
 

Private Member Functions

void closeSchematic (KICAD_API_SERVER *aServer)
 
void closeSymbol (KICAD_API_SERVER *aServer)
 

Private Attributes

std::unique_ptr< EESCHEMA_JOBS_HANDLER > m_jobHandler
 
std::shared_ptr< BACKGROUND_JOB > m_libraryPreloadBackgroundJob
 
std::future< void > m_libraryPreloadReturn
 
std::atomic_bool m_libraryPreloadInProgress
 
std::atomic_bool m_libraryPreloadAbort
 
KIWAY * m_kiway = nullptr
 
SCHEMATIC * m_openSchematic = nullptr
 
std::shared_ptr< HEADLESS_SCH_CONTEXT > m_openContext
 
std::shared_ptr< HEADLESS_SYMBOL_EDITOR_CONTEXT > m_openSymbolContext
 
std::unique_ptr< API_HANDLER_SYMBOL > m_openSymbolHandler
 
std::unique_ptr< API_HANDLER_SCH > m_openHandler
 
std::unique_ptr< API_HANDLER_SCH_LIBRARIES > m_apiHandlerSchLibs
 
KIWAY::FACE_T m_id
 
BIN_MOD m_bm
 
const EDA_IU_SCALE & m_iuScale
 
EDA_UNITS m_userUnits
 

Detailed Description

Definition at line 203 of file eeschema.cpp.

Constructor & Destructor Documentation

◆ IFACE()

SCH::IFACE::IFACE ( const char * aName,
KIWAY::FACE_T aType )
inline

Member Function Documentation

◆ AngleValueFromString()

EDA_ANGLE UNITS_PROVIDER::AngleValueFromString ( const wxString & aTextValue) const
inlineinherited

◆ CancelPreload()

void IFACE::CancelPreload ( bool aBlock = true)
overridevirtual

Reimplemented from KIFACE.

Definition at line 706 of file eeschema.cpp.

References m_libraryPreloadAbort, m_libraryPreloadInProgress, and m_libraryPreloadReturn.

◆ closeSchematic()

◆ closeSymbol()

void IFACE::closeSymbol ( KICAD_API_SERVER * aServer)
private

◆ CreateKiWindow()

wxWindow * SCH::IFACE::CreateKiWindow ( wxWindow * aParent,
int aClassId,
KIWAY * aKIWAY,
int aCtlBits = 0 )
inlineoverridevirtual

Create a wxWindow for the current project.

The caller must cast the return value into the known type.

Parameters
aParentmay be NULL or is otherwise the parent to connect under. If NULL then caller may want to connect the returned wxWindow into some hierarchy after this function returns.
aClassIdidentifies which wxFrame or wxDialog to retrieve, using a value known to the implementing KIFACE.
aKIWAYtells the window which KIWAY (and PROJECT) it is a participant in.
aCtlBitsconsists of bit flags from the set of KFCTL_* #defines above.
Returns
the window created and if not NULL, should be cast into the known type using and old school cast. dynamic_cast is problematic since it needs typeinfo probably not contained in the caller's link image.

Implements KIFACE_BASE.

Definition at line 219 of file eeschema.cpp.

References FRAME_SCH, CROSS_PROBE_CLIENT::IsOnStandardSocketPath(), KIFACE_BASE::IsSingle(), Kiface(), and EESCHEMA_HELPERS::SetSchEditFrame().

◆ end_common()

void KIFACE_BASE::end_common ( )
protectedinherited

◆ GetActions()

void KIFACE_BASE::GetActions ( std::vector< TOOL_ACTION * > & aActions) const
inlineoverridevirtualinherited

Append this Kiface's registered actions to the given list.

Implements KIFACE.

Definition at line 115 of file kiface_base.h.

References ACTION_MANAGER::GetActionList().

◆ GetHelpFileName()

const wxString & KIFACE_BASE::GetHelpFileName ( ) const
inlineinherited

Return just the basename portion of the current help file.

Definition at line 109 of file kiface_base.h.

References m_bm.

Referenced by EDA_BASE_FRAME::help_name().

◆ GetIuScale()

◆ GetOriginTransforms()

virtual ORIGIN_TRANSFORMS & UNITS_PROVIDER::GetOriginTransforms ( )
inlinevirtualinherited

Reimplemented in EDA_BASE_FRAME, and PCB_BASE_FRAME.

Definition at line 54 of file units_provider.h.

◆ GetTypeFromUnits()

static EDA_DATA_TYPE UNITS_PROVIDER::GetTypeFromUnits ( const EDA_UNITS aUnits)
inlinestaticinherited

Gets the inferred type from the given units.

Note: will always return the most simple type (e.g. a DISTANCE rather than AREA or VOLUME for a measurement unit).

Definition at line 224 of file units_provider.h.

References CM, DEGREES, DISTANCE, FS, INCH, LENGTH_DELAY, MILS, MM, PERCENT, PS, PS_PER_CM, PS_PER_INCH, PS_PER_MM, TIME, UM, UNITLESS, and UNSCALED.

Referenced by DRC_RULES_PARSER::parseConstraint(), and WX_GRID::SetAutoEvalColUnits().

◆ GetUnitPair()

virtual void UNITS_PROVIDER::GetUnitPair ( EDA_UNITS & aPrimaryUnit,
EDA_UNITS & aSecondaryUnits )
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 44 of file units_provider.h.

References GetUserUnits(), EDA_UNIT_UTILS::IsImperialUnit(), MILS, and MM.

◆ GetUnitsFromType()

EDA_UNITS UNITS_PROVIDER::GetUnitsFromType ( EDA_DATA_TYPE aType) const
inlineinherited

◆ GetUserUnits()

◆ HandleApiCloseDocument()

bool IFACE::HandleApiCloseDocument ( const DOCUMENT_SPEC & aSpec,
KICAD_API_SERVER * aServer,
wxString * aError )
overridevirtual

Close the document identified by aSpec.

KIND::FILE_KIND and KIND::CREATE_KIND address the KIFACE's file-backed document (board or schematic); KIND::LIBID_KIND addresses a library item (footprint or symbol). For LIBID_KIND the spec's libId must match the open library item; for the file kinds, an empty path means "whatever document is open".

Reimplemented from KIFACE.

Definition at line 1186 of file eeschema.cpp.

References closeSchematic(), closeSymbol(), LIB_ID::IsValid(), KIFACE::DOCUMENT_SPEC::kind, KIFACE::DOCUMENT_SPEC::libId, m_openContext, m_openSymbolContext, and KIFACE::DOCUMENT_SPEC::path.

◆ HandleApiOpenDocument()

◆ handleCreateSchematic()

◆ HandleJob()

int IFACE::HandleJob ( JOB * aJob,
REPORTER * aReporter,
PROGRESS_REPORTER * aProgressReporter )
overridevirtual

Reimplemented from KIFACE.

Definition at line 884 of file eeschema.cpp.

References m_jobHandler.

◆ HandleJobConfig()

bool IFACE::HandleJobConfig ( JOB * aJob,
wxWindow * aParent )
overridevirtual

Reimplemented from KIFACE.

Definition at line 890 of file eeschema.cpp.

References m_jobHandler.

◆ handleOpenSymbol()

◆ IfaceOrAddress()

void * SCH::IFACE::IfaceOrAddress ( int aDataId)
inlineoverridevirtual

Return a pointer to the requested object.

The safest way to use this is to retrieve a pointer to a static instance of an interface, similar to how the KIFACE interface is exported. But if you know what you are doing use it to retrieve anything you want.

Parameters
aDataIdidentifies which object you want the address of.
Returns
the object requested and must be cast into the know type.

Implements KIFACE_BASE.

Definition at line 438 of file eeschema.cpp.

References SCH::eeschemaMergeExport(), SCH::eeschemaOpenDiffDialogExport(), SCH::generateSchematicNetlist(), KIFACE_MERGE_DOCUMENT, KIFACE_NETLIST_SCHEMATIC, and KIFACE_OPEN_DIFF_DIALOG.

◆ InitSettings()

◆ IsSingle()

bool KIFACE_BASE::IsSingle ( ) const
inlineinherited

◆ JobHandler()

EESCHEMA_JOBS_HANDLER * SCH::IFACE::JobHandler ( ) const
inline

Accessor for the non-job diff/merge exports (eeschemaMergeExport etc.).

Definition at line 456 of file eeschema.cpp.

References m_jobHandler.

◆ KifaceSearch()

SEARCH_STACK & KIFACE_BASE::KifaceSearch ( )
inlineinherited

Only for DSO specific 'non-library' files.

(The library search path is in the PROJECT class.)

Definition at line 113 of file kiface_base.h.

References m_bm.

Referenced by CVPCB_MAINFRAME::buildEquivalenceList(), and EDA_BASE_FRAME::sys_search().

◆ KifaceSettings()

◆ LoadAllLibraries()

bool IFACE::LoadAllLibraries ( )
overridevirtual

Starts a background load of all libraries of the type owned by this face.

Called by the API server's LoadAllLibraries handler after ensuring this kiface is loaded. Returns true if a load was started.

Reimplemented from KIFACE.

Definition at line 1250 of file eeschema.cpp.

References LIBRARY_MANAGER_ADAPTER::AsyncLoad(), m_kiway, and PROJECT_SCH::SymbolLibAdapter().

◆ MessageTextFromMinOptMax()

wxString UNITS_PROVIDER::MessageTextFromMinOptMax ( const MINOPTMAX< int > & aValue,
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE ) const
inlineinherited

◆ MessageTextFromUnscaledValue()

wxString UNITS_PROVIDER::MessageTextFromUnscaledValue ( double aValue,
bool aAddUnitLabel = true,
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE ) const
inlineinherited

◆ MessageTextFromValue() [1/2]

wxString UNITS_PROVIDER::MessageTextFromValue ( const EDA_ANGLE & aValue,
bool aAddUnitLabel = true ) const
inlineinherited

◆ MessageTextFromValue() [2/2]

wxString UNITS_PROVIDER::MessageTextFromValue ( double aValue,
bool aAddUnitLabel = true,
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE ) const
inlineinherited

A lower-precision version of StringFromValue().

Should ONLY be used for status text and messages. Not suitable for dialogs, files, etc. where the loss of precision matters.

Definition at line 123 of file units_provider.h.

References DISTANCE, GetIuScale(), GetUnitsFromType(), and EDA_UNIT_UTILS::UI::MessageTextFromValue().

Referenced by BOOST_FIXTURE_TEST_CASE(), Build_Board_Characteristics_Table(), CheckDuplicatePins(), CheckLibSymbol(), CheckLibSymbolGraphics(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkStubLengths(), GERBVIEW_FRAME::DisplayGridMsg(), GERBER_FILE_IMAGE::DisplayImageInfo(), DRC_ENGINE::EvalRules(), FormatBoardStatisticsJson(), FormatBoardStatisticsMinimum(), FormatBoardStatisticsReport(), DRC_TEST_PROVIDER::formatMsg(), DRC_TEST_PROVIDER::formatMsg(), DRC_TEST_PROVIDER::formatMsg(), DS_DRAW_ITEM_LINE::GetItemDescription(), DS_DRAW_ITEM_RECT::GetItemDescription(), PCB_TRACK::GetItemDescription(), SCH_LINE::GetItemDescription(), SCH_SHAPE::GetItemDescription(), DS_DRAW_ITEM_BASE::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), PAD::GetMsgPanelInfo(), PCB_BARCODE::GetMsgPanelInfo(), PCB_DIM_ALIGNED::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_POINT::GetMsgPanelInfo(), PCB_REFERENCE_IMAGE::GetMsgPanelInfo(), PCB_TABLECELL::GetMsgPanelInfo(), PCB_TARGET::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), PCB_TEXTBOX::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), PCB_TUNING_PATTERN::GetMsgPanelInfo(), PCB_VIA::GetMsgPanelInfo(), SCH_BITMAP::GetMsgPanelInfo(), SCH_FIELD::GetMsgPanelInfo(), SCH_JUNCTION::GetMsgPanelInfo(), SCH_LABEL_BASE::GetMsgPanelInfo(), SCH_PIN::GetMsgPanelInfo(), SCH_TABLECELL::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_TEXTBOX::GetMsgPanelInfo(), STROKE_PARAMS::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), GetNetNavigatorItemText(), PCB_TUNING_PATTERN::GetPreviewItems(), PCB_BASE_FRAME::MessageTextFromCoord(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), EDA_SHAPE::ShapeGetMsgPanelInfo(), showCoord(), DRC_TEST_PROVIDER_MISC::testOutline(), VIA_SIZE_MENU::update(), PL_EDITOR_FRAME::UpdateMsgPanelInfo(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), and SCH_BASE_FRAME::UpdateStatusBar().

◆ Name()

const wxString KIFACE_BASE::Name ( )
inlineinherited

Definition at line 87 of file kiface_base.h.

References m_bm.

◆ OnKifaceEnd()

void IFACE::OnKifaceEnd ( )
overridevirtual

Called just once just before the DSO is to be unloaded.

It is called before static C++ destructors are called. A default implementation is supplied.

Reimplemented from KIFACE_BASE.

Definition at line 725 of file eeschema.cpp.

References KICAD_API_SERVER::DeregisterHandler(), KIFACE_BASE::end_common(), PGM_BASE::GetApiServer(), m_apiHandlerSchLibs, m_jobHandler, and Pgm().

◆ OnKifaceStart()

◆ OptionalValueFromString()

std::optional< int > UNITS_PROVIDER::OptionalValueFromString ( const wxString & aTextValue,
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE ) const
inlineinherited

Converts aTextValue in aUnits to internal units used by the frame.

Allows the return of an empty optional if the string represents a null value (currently empty string)

Warning
This utilizes the current locale and will break if decimal formats differ
Parameters
aTypeis the type of this value, and controls the way the string is converted to a value
aTextValueA reference to a wxString object containing the string to convert.
Returns
internal units value

Definition at line 178 of file units_provider.h.

References DISTANCE, EDA_UNIT_UTILS::UI::DoubleValueFromString(), GetIuScale(), GetUnitsFromType(), KiROUND(), and NullUiString.

Referenced by WX_GRID::GetOptionalUnitValue(), and WX_GRID::onCellEditorHidden().

◆ PreloadLibraries()

◆ ProjectChanged()

void IFACE::ProjectChanged ( )
overridevirtual

Reimplemented from KIFACE.

Definition at line 718 of file eeschema.cpp.

References m_libraryPreloadAbort, and m_libraryPreloadInProgress.

◆ RegisterLibraryHandlers()

void IFACE::RegisterLibraryHandlers ( KICAD_API_SERVER * aServer)
overridevirtual

Register this face's library API handlers on the given server.

Called by the API server's library command handler after loading the kiface, so that library commands are available before any document is opened. The kiface retains ownership.

Reimplemented from KIFACE.

Definition at line 1238 of file eeschema.cpp.

References m_apiHandlerSchLibs, and KICAD_API_SERVER::RegisterHandler().

◆ Reset()

void IFACE::Reset ( )
overridevirtual

Reloads global state.

Reimplemented from KIFACE_BASE.

Definition at line 590 of file eeschema.cpp.

References closeSchematic(), closeSymbol(), and m_jobHandler.

◆ SaveFileAs()

void IFACE::SaveFileAs ( const wxString & aProjectBasePath,
const wxString & aProjectName,
const wxString & aNewProjectBasePath,
const wxString & aNewProjectName,
const wxString & aSrcFilePath,
wxString & aErrors )
overridevirtual

Saving a file under a different name is delegated to the various KIFACEs because the project doesn't know the internal format of the various files (which may have paths in them that need updating).

Reimplemented from KIFACE.

Definition at line 744 of file eeschema.cpp.

References _, FILEEXT::BackupFileSuffix, CopySexprFile(), FILEEXT::KiCadSchematicFileExtension, and FILEEXT::LegacySchematicFileExtension.

◆ SetUserUnits()

◆ start_common()

bool KIFACE_BASE::start_common ( int aCtlBits)
protectedinherited

◆ StartFlags()

int KIFACE_BASE::StartFlags ( ) const
inlineinherited

Return whatever was passed as aCtlBits to OnKifaceStart().

Definition at line 99 of file kiface_base.h.

References m_start_flags.

◆ StringFromOptionalValue()

wxString UNITS_PROVIDER::StringFromOptionalValue ( std::optional< int > aValue,
bool aAddUnitLabel = false,
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE ) const
inlineinherited

Converts an optional aValue in internal units into a united string.

For readability, trailing 0s are removed if the mantissa has 3 or more digits. This function should be used to display values in dialogs because a value entered in mm (for instance 2.0 mm) could need up to 8 digits mantissa if displayed in inch to avoid truncation or rounding made just by the printf function.

Parameters
aValue= optional value in internal units
aAddUnitLabel= true to add symbol unit to the string value
aTypeis the type of this value, and controls the way the value is converted to a string, and the suitable unit
Returns
A wxString object containing value and optionally the symbol unit (like 2.000 mm)

Definition at line 96 of file units_provider.h.

References DISTANCE, GetIuScale(), GetUnitsFromType(), NullUiString, and EDA_UNIT_UTILS::UI::StringFromValue().

Referenced by WX_GRID::onCellEditorHidden().

◆ StringFromValue() [1/2]

wxString UNITS_PROVIDER::StringFromValue ( const EDA_ANGLE & aValue,
bool aAddUnitLabel = false ) const
inlineinherited

◆ StringFromValue() [2/2]

wxString UNITS_PROVIDER::StringFromValue ( double aValue,
bool aAddUnitLabel = false,
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE ) const
inlineinherited

Converts aValue in internal units into a united string.

For readability, trailing 0s are removed if the mantissa has 3 or more digits. This function should be used to display values in dialogs because a value entered in mm (for instance 2.0 mm) could need up to 8 digits mantissa if displayed in inch to avoid truncation or rounding made just by the printf function.

Parameters
aValue= value in internal units
aAddUnitLabel= true to add symbol unit to the string value
aTypeis the type of this value, and controls the way the value is converted to a string, and the suitable unit
Returns
A wxString object containing value and optionally the symbol unit (like 2.000 mm)

Definition at line 75 of file units_provider.h.

References DISTANCE, GetIuScale(), GetUnitsFromType(), and EDA_UNIT_UTILS::UI::StringFromValue().

Referenced by Build_Board_Stackup_Table(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), PAD::doCheckPad(), VALIDATION_ERROR_TOO_LARGE< T >::Format(), VALIDATION_ERROR_TOO_SMALL< T >::Format(), formatBBox(), DRC_TEST_PROVIDER::formatMsg(), DRC_TEST_PROVIDER::formatMsg(), DRC_TEST_PROVIDER::formatMsg(), WX_GRID::onCellEditorHidden(), reportMax(), reportMin(), reportOpt(), PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow(), and UpdateDrillCells().

◆ ValueFromString()

int UNITS_PROVIDER::ValueFromString ( const wxString & aTextValue,
EDA_DATA_TYPE aType = EDA_DATA_TYPE::DISTANCE ) const
inlineinherited

Converts aTextValue in aUnits to internal units used by the frame.

Warning
This utilizes the current locale and will break if decimal formats differ
Parameters
aTypeis the type of this value, and controls the way the string is converted to a value
aTextValueA reference to a wxString object containing the string to convert.
Returns
internal units value

Definition at line 159 of file units_provider.h.

References DISTANCE, EDA_UNIT_UTILS::UI::DoubleValueFromString(), GetIuScale(), GetUnitsFromType(), and KiROUND().

Referenced by PIN_TABLE_DATA_MODEL::compare(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), WX_GRID::GetUnitValue(), and WX_GRID::onCellEditorHidden().

Member Data Documentation

◆ m_apiHandlerSchLibs

std::unique_ptr<API_HANDLER_SCH_LIBRARIES> SCH::IFACE::m_apiHandlerSchLibs
private

◆ m_bm

BIN_MOD KIFACE_BASE::m_bm
privateinherited

◆ m_id

KIWAY::FACE_T KIFACE_BASE::m_id
privateinherited

Definition at line 125 of file kiface_base.h.

Referenced by KIFACE_BASE(), and start_common().

◆ m_iuScale

const EDA_IU_SCALE& UNITS_PROVIDER::m_iuScale
privateinherited

Definition at line 256 of file units_provider.h.

Referenced by GetIuScale(), and UNITS_PROVIDER().

◆ m_jobHandler

std::unique_ptr<EESCHEMA_JOBS_HANDLER> SCH::IFACE::m_jobHandler
private

◆ m_kiway

KIWAY* SCH::IFACE::m_kiway = nullptr
private

◆ m_libraryPreloadAbort

std::atomic_bool SCH::IFACE::m_libraryPreloadAbort
private

Definition at line 495 of file eeschema.cpp.

Referenced by CancelPreload(), PreloadLibraries(), and ProjectChanged().

◆ m_libraryPreloadBackgroundJob

std::shared_ptr<BACKGROUND_JOB> SCH::IFACE::m_libraryPreloadBackgroundJob
private

Definition at line 492 of file eeschema.cpp.

Referenced by PreloadLibraries().

◆ m_libraryPreloadInProgress

std::atomic_bool SCH::IFACE::m_libraryPreloadInProgress
private

Definition at line 494 of file eeschema.cpp.

Referenced by CancelPreload(), IFACE(), PreloadLibraries(), and ProjectChanged().

◆ m_libraryPreloadReturn

std::future<void> SCH::IFACE::m_libraryPreloadReturn
private

Definition at line 493 of file eeschema.cpp.

Referenced by CancelPreload(), and PreloadLibraries().

◆ m_openContext

std::shared_ptr<HEADLESS_SCH_CONTEXT> SCH::IFACE::m_openContext
private

◆ m_openHandler

std::unique_ptr<API_HANDLER_SCH> SCH::IFACE::m_openHandler
private

Definition at line 505 of file eeschema.cpp.

Referenced by closeSchematic(), HandleApiOpenDocument(), and handleCreateSchematic().

◆ m_openSchematic

SCHEMATIC* SCH::IFACE::m_openSchematic = nullptr
private

Definition at line 501 of file eeschema.cpp.

Referenced by closeSchematic(), HandleApiOpenDocument(), and handleCreateSchematic().

◆ m_openSymbolContext

std::shared_ptr<HEADLESS_SYMBOL_EDITOR_CONTEXT> SCH::IFACE::m_openSymbolContext
private

Definition at line 503 of file eeschema.cpp.

Referenced by closeSymbol(), HandleApiCloseDocument(), and handleOpenSymbol().

◆ m_openSymbolHandler

std::unique_ptr<API_HANDLER_SYMBOL> SCH::IFACE::m_openSymbolHandler
private

Definition at line 504 of file eeschema.cpp.

Referenced by closeSymbol(), and handleOpenSymbol().

◆ m_start_flags

int KIFACE_BASE::m_start_flags
protectedinherited

◆ m_userUnits

EDA_UNITS UNITS_PROVIDER::m_userUnits
privateinherited

Definition at line 257 of file units_provider.h.

Referenced by GetUserUnits(), SetUserUnits(), and UNITS_PROVIDER().

◆ NullUiString

const wxString UNITS_PROVIDER::NullUiString = ""
inlinestaticinherited

The string that is used in the UI to represent a null value.

Definition at line 253 of file units_provider.h.

Referenced by WX_GRID::GetOptionalUnitValue(), WX_GRID::onCellEditorHidden(), OptionalValueFromString(), and StringFromOptionalValue().


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