KiCad PCB EDA Suite
PCB_CALCULATOR_FRAME Class Reference

#include <pcb_calculator_frame.h>

Inheritance diagram for PCB_CALCULATOR_FRAME:
PCB_CALCULATOR_FRAME_BASE KIWAY_PLAYER EDA_BASE_FRAME TOOLS_HOLDER KIWAY_HOLDER

Public Types

enum  UNDO_REDO_LIST { UNDO_LIST, REDO_LIST }
 Remove the aItemCount of old commands from aList and delete commands, pickers and picked items if needed. More...
 
enum  HOLDER_TYPE { DIALOG, FRAME, PANEL }
 

Public Member Functions

 PCB_CALCULATOR_FRAME (KIWAY *aKiway, wxWindow *aParent)
 
 ~PCB_CALCULATOR_FRAME ()
 
void SetPrmValue (enum PRMS_ID aPrmId, double aValue)
 Function SetPrmValue Read/write params values and results. More...
 
void SetResult (int aLineNumber, const wxString &aText)
 Function SetResult Puts the text into the given result line. More...
 
void SetPrmBgColor (enum PRMS_ID aPrmId, const KIGFX::COLOR4D *aCol)
 Function SetPrgmBgColor Set the background color of a parameter. More...
 
double GetPrmValue (enum PRMS_ID aPrmId) const
 Function GetPrmValue Returns a param value. More...
 
bool IsPrmSelected (enum PRMS_ID aPrmId) const
 Function IsPrmSelected. More...
 
void OnBoardClassesUnitsSelection (wxCommandEvent &event) override
 
void BoardClassesUpdateData (double aUnitScale)
 
wxWindow * GetToolCanvas () const override
 Canvas access. More...
 
virtual bool OpenProjectFiles (const std::vector< wxString > &aFileList, int aCtl=0)
 Open a project or set of files given by aFileList. More...
 
virtual void ParseArgs (wxCmdLineParser &aParser)
 Handle command-line arguments in a frame-specific way. More...
 
virtual bool ShowModal (wxString *aResult=nullptr, wxWindow *aResultantFocusWindow=nullptr)
 Show this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal(). More...
 
virtual void KiwayMailIn (KIWAY_EXPRESS &aEvent)
 Receive KIWAY_EXPRESS messages from other players. More...
 
bool Destroy () override
 Our version of Destroy() which is virtual from wxWidgets. More...
 
bool IsModal () const override
 Return true if the frame is shown in our modal mode and false if the frame is shown as an usual frame. More...
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
EDA_UNITS GetUserUnits () const
 Return the user units currently in use. More...
 
void SetUserUnits (EDA_UNITS aUnits)
 
void ChangeUserUnits (EDA_UNITS aUnits)
 
virtual void ToggleUserUnits ()
 
SETTINGS_MANAGERGetSettingsManager () const
 
virtual SEVERITY GetSeverity (int aErrorCode) const
 
bool ProcessEvent (wxEvent &aEvent) override
 Override the default process event handler to implement the auto save feature. More...
 
virtual void OnCharHook (wxKeyEvent &aKeyEvent)
 Capture the key event before it is sent to the GUI. More...
 
void OnMenuEvent (wxMenuEvent &event)
 The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't captured by the menus themselves. More...
 
virtual void RegisterUIUpdateHandler (int aID, const ACTION_CONDITIONS &aConditions) override
 Register a UI update handler for the control with ID aID. More...
 
virtual void RegisterUIUpdateHandler (const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
 Register an action's update conditions with the UI layer to allow the UI to appropriately display the state of its controls. More...
 
virtual void UnregisterUIUpdateHandler (int aID) override
 Unregister a UI handler for a given ID that was registered using RegisterUIUpdateHandler. More...
 
virtual void UnregisterUIUpdateHandler (const TOOL_ACTION &aAction)
 Unregister a UI handler for an action that was registered using RegisterUIUpdateHandler. More...
 
virtual void OnMove (wxMoveEvent &aEvent)
 
void OnMaximize (wxMaximizeEvent &aEvent)
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
FRAME_T GetFrameType () const
 
virtual const SEARCH_STACKsys_search ()
 Return a SEARCH_STACK pertaining to entire program. More...
 
virtual wxString help_name ()
 
void OnKicadAbout (wxCommandEvent &event)
 
void OnPreferences (wxCommandEvent &event)
 
void PrintMsg (const wxString &text)
 
void CreateInfoBar ()
 
void FinishAUIInitialization ()
 
WX_INFOBARGetInfoBar ()
 
void ShowInfoBarError (const wxString &aErrorMsg, bool aShowCloseButton=false)
 Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left of the infobar, and an optional closebox to the right. More...
 
void ShowInfoBarError (const wxString &aErrorMsg, bool aShowCloseButton, std::function< void(void)> aCallback)
 Show the WX_INFOBAR displayed on the top of the canvas with a message and an error icon on the left of the infobar, and an optional closebox to the right. More...
 
void ShowInfoBarWarning (const wxString &aWarningMsg, bool aShowCloseButton=false)
 Show the WX_INFOBAR displayed on the top of the canvas with a message and a warning icon on the left of the infobar. More...
 
void ShowInfoBarMsg (const wxString &aMsg, bool aShowCloseButton=false)
 Show the WX_INFOBAR displayed on the top of the canvas with a message and an info icon on the left of the infobar. More...
 
virtual APP_SETTINGS_BASEconfig () const
 Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME. More...
 
virtual void InstallPreferences (PAGED_DIALOG *, PANEL_HOTKEYS_EDITOR *)
 Allow a frame to load its preference panels (if any) into the preferences dialog. More...
 
void LoadWindowState (const wxString &aFileName)
 
virtual void LoadWindowState (const WINDOW_STATE &aState)
 Load frame state info from a configuration file. More...
 
void LoadWindowSettings (const WINDOW_SETTINGS *aCfg)
 Load window settings from the given settings object. More...
 
void SaveWindowSettings (WINDOW_SETTINGS *aCfg)
 Save window settings to the given settings object. More...
 
virtual WINDOW_SETTINGSGetWindowSettings (APP_SETTINGS_BASE *aCfg)
 Return a pointer to the window settings for this frame. More...
 
wxString ConfigBaseName () override
 Get the configuration base name. More...
 
virtual void SaveProjectSettings ()
 Save changes to the project settings to the project (.pro) file. More...
 
void ImportHotkeyConfigFromFile (std::map< std::string, TOOL_ACTION * > aActionMap, const wxString &aDefaultShortname)
 Prompt the user for a hotkey file to read, and read it. More...
 
wxString GetFileFromHistory (int cmdId, const wxString &type, FILE_HISTORY *aFileHistory=nullptr)
 Fetches the file name from the file history list. More...
 
void ClearFileHistory (FILE_HISTORY *aFileHistory=nullptr)
 Removes all files from the file history. More...
 
void UpdateFileHistory (const wxString &FullFileName, FILE_HISTORY *aFileHistory=nullptr)
 Update the list of recently opened files. More...
 
FILE_HISTORYGetFileHistory ()
 Get the frame's main file history. More...
 
void SetMruPath (const wxString &aPath)
 
wxString GetMruPath () const
 
virtual wxString GetCurrentFileName () const
 Get the full filename + path of the currently opened file in the frame. More...
 
virtual void ReCreateMenuBar ()
 Recreates the menu bar. More...
 
void AddStandardHelpMenu (wxMenuBar *aMenuBar)
 Adds the standard KiCad help menu to the menubar. More...
 
bool IsWritable (const wxFileName &aFileName)
 Checks if aFileName can be written. More...
 
void CheckForAutoSaveFile (const wxFileName &aFileName)
 Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input. More...
 
virtual void UpdateStatusBar ()
 Update the status bar information. More...
 
virtual void ShowChangedLanguage ()
 Redraw the menus and what not in current language. More...
 
void CommonSettingsChanged (bool aEnvVarsChanged, bool aTextVarsChanged) override
 Notification event that some of the common (suite-wide) settings have changed. More...
 
virtual void ThemeChanged ()
 Process light/dark theme change. More...
 
virtual void ProjectChanged ()
 Notification event that the project has changed. More...
 
const wxString & GetAboutTitle () const
 
virtual bool IsContentModified ()
 Get if the contents of the frame have been modified since the last save. More...
 
wxSize GetWindowSize ()
 Get the undecorated window size that can be used for restoring the window size. More...
 
virtual void ClearUndoORRedoList (UNDO_REDO_LIST aList, int aItemCount=-1)
 
virtual void ClearUndoRedoList ()
 Clear the undo and redo list using ClearUndoORRedoList() More...
 
virtual void PushCommandToUndoList (PICKED_ITEMS_LIST *aItem)
 Add a command to undo in the undo list. More...
 
virtual void PushCommandToRedoList (PICKED_ITEMS_LIST *aItem)
 Add a command to redo in the redo list. More...
 
virtual PICKED_ITEMS_LISTPopCommandFromUndoList ()
 Return the last command to undo and remove it from list, nothing is deleted. More...
 
virtual PICKED_ITEMS_LISTPopCommandFromRedoList ()
 Return the last command to undo and remove it from list, nothing is deleted. More...
 
virtual int GetUndoCommandCount () const
 
virtual int GetRedoCommandCount () const
 
int GetMaxUndoItems () const
 
bool NonUserClose (bool aForce)
 
virtual void HandleSystemColorChange ()
 Update the UI in response to a change in the system colors. More...
 
TOOL_MANAGERGetToolManager () const
 Return the MVC controller. More...
 
virtual SELECTIONGetCurrentSelection ()
 Get the current selection from the canvas area. More...
 
virtual void PushTool (const std::string &actionName)
 NB: the definition of "tool" is different at the user level. More...
 
virtual void PopTool (const std::string &actionName)
 
bool ToolStackIsEmpty ()
 
std::string CurrentToolName () const
 
bool IsCurrentTool (const TOOL_ACTION &aAction) const
 
virtual void DisplayToolMsg (const wxString &msg)
 
bool GetDoImmediateActions () const
 Indicate that hotkeys should perform an immediate action even if another tool is currently active. More...
 
MOUSE_DRAG_ACTION GetDragAction () const
 Indicates whether a drag should draw a selection rectangle or drag selected (or unselected) objects. More...
 
bool GetMoveWarpsCursor () const
 Indicate that a move operation should warp the mouse pointer to the origin of the move object. More...
 
virtual void RefreshCanvas ()
 
HOLDER_TYPE GetType () const
 
KIWAYKiway () const
 Return a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Return a reference to the PROJECT associated with this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 It is only used for debugging, since "this" is not a wxWindow*. More...
 

Static Public Member Functions

static void HandleUpdateUIEvent (wxUpdateUIEvent &aEvent, EDA_BASE_FRAME *aFrame, ACTION_CONDITIONS aCond)
 Handle events generated when the UI is trying to figure out the current state of the UI controls related to TOOL_ACTIONS (e.g. More...
 

Public Attributes

REGULATOR_LIST m_RegulatorList
 

Protected Member Functions

void kiway_express (KIWAY_EXPRESS &aEvent)
 event handler, routes to derivative specific virtual KiwayMailIn() More...
 
void language_change (wxCommandEvent &event)
 An event handler called on a language menu selection. More...
 
void onAutoSaveTimer (wxTimerEvent &aEvent)
 Handle the auto save timer event. More...
 
virtual bool isAutoSaveRequired () const
 Return the auto save status of the application. More...
 
virtual bool doAutoSave ()
 This should be overridden by the derived class to handle the auto save feature. More...
 
virtual bool canCloseWindow (wxCloseEvent &aCloseEvent)
 
virtual void doCloseWindow ()
 
void onSystemColorChange (wxSysColourChangedEvent &aEvent)
 
virtual void unitsChangeRefresh ()
 Called when when the units setting has changed to allow for any derived classes to handle refreshing and controls that have units based measurements in them. More...
 
virtual void setupUIConditions ()
 Setup the UI conditions for the various actions and their controls in this frame. More...
 
void initExitKey ()
 Sets the common key-pair for exiting the application (Ctrl-Q) and ties it to the wxID_EXIT event id. More...
 

Static Protected Member Functions

static wxString GetAutoSaveFilePrefix ()
 

Protected Attributes

wxMenuBar * m_menubar
 
wxNotebook * m_Notebook
 
wxPanel * m_panelRegulators
 
wxStaticText * m_staticTextRegType
 
wxChoice * m_choiceRegType
 
wxStaticBitmap * m_bitmapRegul4pins
 
wxStaticBitmap * m_bitmapRegul3pins
 
wxStaticText * m_RegulFormula
 
wxRadioButton * m_rbRegulR1
 
wxStaticText * m_labelRegultR1
 
wxTextCtrl * m_RegulR1Value
 
wxStaticText * m_r1Units
 
wxRadioButton * m_rbRegulR2
 
wxStaticText * m_labelRegultR2
 
wxTextCtrl * m_RegulR2Value
 
wxStaticText * m_r2Units
 
wxRadioButton * m_rbRegulVout
 
wxStaticText * m_labelVout
 
wxTextCtrl * m_RegulVoutValue
 
wxStaticText * m_unitsVout
 
wxStaticText * m_labelVRef
 
wxTextCtrl * m_RegulVrefValue
 
wxStaticText * m_unitsVref
 
wxStaticText * m_RegulIadjTitle
 
wxTextCtrl * m_RegulIadjValue
 
wxStaticText * m_IadjUnitLabel
 
wxButton * m_buttonCalculate
 
wxButton * m_buttonRegulReset
 
wxStaticText * m_RegulMessage
 
wxChoice * m_choiceRegulatorSelector
 
wxStaticText * m_staticTextRegFile
 
wxTextCtrl * m_regulators_fileNameCtrl
 
wxButton * m_buttonDataFile
 
wxButton * m_buttonEditItem
 
wxButton * m_buttonAddItem
 
wxButton * m_buttonRemoveItem
 
wxPanel * m_panelAttenuators
 
wxRadioBox * m_AttenuatorsSelection
 
wxStaticBitmap * m_attenuatorBitmap
 
wxStaticText * m_attenuationLabel
 
wxTextCtrl * m_AttValueCtrl
 
wxStaticText * m_attUnit
 
wxStaticText * m_attenuationZinLabel
 
wxTextCtrl * m_ZinValueCtrl
 
wxStaticText * m_attZinUnit
 
wxStaticText * m_ZoutLabel
 
wxTextCtrl * m_ZoutValueCtrl
 
wxStaticText * m_attZoutUnit
 
wxButton * m_buttonAlcAtt
 
wxBitmapButton * m_bpButtonCalcAtt
 
wxStaticText * m_attenuatorR1Label
 
wxTextCtrl * m_Att_R1_Value
 
wxStaticText * m_attR1Unit
 
wxStaticText * m_attenuatorR2Label
 
wxTextCtrl * m_Att_R2_Value
 
wxStaticText * m_attR2Unit
 
wxStaticText * m_attenuatorR3Label
 
wxTextCtrl * m_Att_R3_Value
 
wxStaticText * m_attR3Unit
 
wxStaticText * m_staticTextAttMsg
 
wxHtmlWindow * m_Attenuator_Messages
 
wxHtmlWindow * m_panelAttFormula
 
wxPanel * m_panelESeries
 
wxStaticText * m_ESrequired
 
wxTextCtrl * m_ResRequired
 
wxStaticText * m_reqResUnits
 
wxStaticText * m_ESrequired1
 
wxTextCtrl * m_ResExclude1
 
wxStaticText * m_exclude1Units
 
wxStaticText * m_ESrequired11
 
wxTextCtrl * m_ResExclude2
 
wxStaticText * m_exclude2Units
 
wxStaticLine * m_staticline6
 
wxRadioButton * m_e1
 
wxRadioButton * m_e3
 
wxRadioButton * m_e6
 
wxRadioButton * m_e12
 
wxStaticText * m_ESerieSimpleSolution
 
wxTextCtrl * m_ESeries_Sol2R
 
wxStaticText * m_ESeriesSimpleErr
 
wxTextCtrl * m_ESeriesError2R
 
wxStaticText * m_ESeriesSimplePercent
 
wxStaticText * m_ESerie3RSolution1
 
wxTextCtrl * m_ESeries_Sol3R
 
wxStaticText * m_ESeriesAltErr
 
wxTextCtrl * m_ESeriesError3R
 
wxStaticText * m_ESeriesAltPercent
 
wxStaticText * m_ESeries4RSolution
 
wxTextCtrl * m_ESeries_Sol4R
 
wxStaticText * m_ESeriesAltErr1
 
wxTextCtrl * m_ESeriesError4R
 
wxStaticText * m_ESeriesAltPercent1
 
wxStaticLine * m_staticline7
 
wxButton * m_buttonEScalculate
 
wxHtmlWindow * m_panelESeriesHelp
 
wxPanel * m_panelColorCode
 
wxRadioBox * m_rbToleranceSelection
 
wxStaticText * m_staticText31
 
wxStaticText * m_staticText34
 
wxStaticText * m_staticText35
 
wxStaticText * m_Band4Label
 
wxStaticText * m_staticText37
 
wxStaticText * m_staticText38
 
wxStaticBitmap * m_Band1bitmap
 
wxStaticBitmap * m_Band2bitmap
 
wxStaticBitmap * m_Band3bitmap
 
wxStaticBitmap * m_Band4bitmap
 
wxStaticBitmap * m_Band_mult_bitmap
 
wxStaticBitmap * m_Band_tol_bitmap
 
wxPanel * m_panelTransline
 
wxRadioBox * m_TranslineSelection
 
wxStaticBitmap * m_translineBitmap
 
wxStaticText * m_EpsilonR_label
 
wxTextCtrl * m_Value_EpsilonR
 
wxButton * m_button_EpsilonR
 
wxStaticText * m_TanD_label
 
wxTextCtrl * m_Value_TanD
 
wxButton * m_button_TanD
 
wxStaticText * m_Rho_label
 
wxTextCtrl * m_Value_Rho
 
wxButton * m_button_Rho
 
wxStaticText * m_substrate_prm4_label
 
wxTextCtrl * m_Substrate_prm4_Value
 
UNIT_SELECTOR_LENm_SubsPrm4_choiceUnit
 
wxStaticText * m_substrate_prm5_label
 
wxTextCtrl * m_Substrate_prm5_Value
 
UNIT_SELECTOR_LENm_SubsPrm5_choiceUnit
 
wxStaticText * m_substrate_prm6_label
 
wxTextCtrl * m_Substrate_prm6_Value
 
UNIT_SELECTOR_LENm_SubsPrm6_choiceUnit
 
wxStaticText * m_substrate_prm7_label
 
wxTextCtrl * m_Substrate_prm7_Value
 
UNIT_SELECTOR_LENm_SubsPrm7_choiceUnit
 
wxStaticText * m_substrate_prm8_label
 
wxTextCtrl * m_Substrate_prm8_Value
 
UNIT_SELECTOR_LENm_SubsPrm8_choiceUnit
 
wxStaticText * m_substrate_prm9_label
 
wxTextCtrl * m_Substrate_prm9_Value
 
UNIT_SELECTOR_LENm_SubsPrm9_choiceUnit
 
wxStaticText * m_Frequency_label
 
wxTextCtrl * m_Value_Frequency_Ctrl
 
UNIT_SELECTOR_FREQUENCYm_choiceUnit_Frequency
 
wxStaticBitmap * m_bmCMicrostripZoddZeven
 
wxFlexGridSizer * m_fgSizerZcomment
 
wxStaticText * m_staticTextZdiff
 
wxStaticText * m_staticTextZcommon
 
wxStaticText * m_phys_prm1_label
 
wxTextCtrl * m_Phys_prm1_Value
 
UNIT_SELECTOR_LENm_choiceUnit_Param1
 
wxRadioButton * m_radioBtnPrm1
 
wxStaticText * m_phys_prm2_label
 
wxTextCtrl * m_Phys_prm2_Value
 
UNIT_SELECTOR_LENm_choiceUnit_Param2
 
wxRadioButton * m_radioBtnPrm2
 
wxStaticText * m_phys_prm3_label
 
wxTextCtrl * m_Phys_prm3_Value
 
UNIT_SELECTOR_LENm_choiceUnit_Param3
 
wxBitmapButton * m_bpButtonAnalyze
 
wxButton * m_AnalyseButton
 
wxButton * m_SynthetizeButton
 
wxBitmapButton * m_bpButtonSynthetize
 
wxStaticText * m_elec_prm1_label
 
wxTextCtrl * m_Elec_prm1_Value
 
UNIT_SELECTOR_RESISTORm_choiceUnit_ElecPrm1
 
wxStaticText * m_elec_prm2_label
 
wxTextCtrl * m_Elec_prm2_Value
 
UNIT_SELECTOR_RESISTORm_choiceUnit_ElecPrm2
 
wxStaticText * m_elec_prm3_label
 
wxTextCtrl * m_Elec_prm3_Value
 
UNIT_SELECTOR_ANGLEm_choiceUnit_ElecPrm3
 
wxStaticText * m_left_message1
 
wxStaticText * m_Message1
 
wxStaticText * m_left_message2
 
wxStaticText * m_Message2
 
wxStaticText * m_left_message3
 
wxStaticText * m_Message3
 
wxStaticText * m_left_message4
 
wxStaticText * m_Message4
 
wxStaticText * m_left_message5
 
wxStaticText * m_Message5
 
wxStaticText * m_left_message6
 
wxStaticText * m_Message6
 
wxStaticText * m_left_message7
 
wxStaticText * m_Message7
 
wxButton * m_buttonTransLineReset
 
wxPanel * m_panelViaSize
 
wxStaticText * m_staticTextHoleDia
 
wxTextCtrl * m_textCtrlHoleDia
 
UNIT_SELECTOR_LENm_choiceHoleDia
 
wxStaticText * m_staticTextPlatingThickness
 
wxTextCtrl * m_textCtrlPlatingThickness
 
UNIT_SELECTOR_LENm_choicePlatingThickness
 
wxStaticText * m_staticTextViaLength
 
wxTextCtrl * m_textCtrlViaLength
 
UNIT_SELECTOR_LENm_choiceViaLength
 
wxStaticText * m_staticTextViaPadDia
 
wxTextCtrl * m_textCtrlViaPadDia
 
UNIT_SELECTOR_LENm_choiceViaPadDia
 
wxStaticText * m_staticTextClearanceDia
 
wxTextCtrl * m_textCtrlClearanceDia
 
UNIT_SELECTOR_LENm_choiceClearanceDia
 
wxStaticText * m_staticTextImpedance
 
wxTextCtrl * m_textCtrlImpedance
 
UNIT_SELECTOR_RESISTORm_choiceImpedance
 
wxStaticText * m_staticAppliedCurrent
 
wxTextCtrl * m_textCtrlAppliedCurrent
 
wxStaticText * m_staticTextAppliedCurrentUnits
 
wxStaticText * m_staticTextResistivity
 
wxTextCtrl * m_textCtrlPlatingResistivity
 
wxButton * m_button_ResistivityVia
 
wxStaticText * m_viaResistivityUnits
 
wxStaticText * m_staticTextPermittivity
 
wxTextCtrl * m_textCtrlPlatingPermittivity
 
wxButton * m_button_Permittivity
 
wxStaticText * m_staticTextTemperatureDiff
 
wxTextCtrl * m_textCtrlTemperatureDiff
 
wxStaticText * m_viaTempUnits
 
wxStaticText * m_staticTextRiseTime
 
wxTextCtrl * m_textCtrlRiseTime
 
wxStaticText * m_staticTextRiseTimeUnits
 
wxStaticText * m_staticTextWarning
 
wxStaticText * m_staticTextArea11
 
wxStaticText * m_ViaResistance
 
wxStaticText * m_viaResUnits
 
wxStaticText * m_staticText65111
 
wxStaticText * m_ViaVoltageDrop
 
wxStaticText * m_staticText8411
 
wxStaticText * m_staticText66111
 
wxStaticText * m_ViaPowerLoss
 
wxStaticText * m_staticText8311
 
wxStaticText * m_staticText79211
 
wxStaticText * m_ViaThermalResistance
 
wxStaticText * m_viaThermalResUnits
 
wxStaticText * m_staticTextAmpacity
 
wxStaticText * m_ViaAmpacity
 
wxStaticText * m_staticTextAmpacityUnits
 
wxStaticText * m_staticTextCapacitance
 
wxStaticText * m_ViaCapacitance
 
wxStaticText * m_staticTextCapacitanceUnits
 
wxStaticText * m_staticTextRiseTimeOutput
 
wxStaticText * m_RiseTimeOutput
 
wxStaticText * m_staticTextRiseTimeOutputUnits
 
wxStaticText * m_staticTextInductance
 
wxStaticText * m_Inductance
 
wxStaticText * m_staticTextInductanceUnits
 
wxStaticText * m_staticTextReactance
 
wxStaticText * m_Reactance
 
wxStaticText * m_viaReactanceUnits
 
wxStaticBitmap * m_viaBitmap
 
wxButton * m_buttonViaReset
 
wxPanel * m_panelTrackWidth
 
wxStaticText * m_staticTextCurrent
 
wxTextCtrl * m_TrackCurrentValue
 
wxStaticText * m_staticText62
 
wxStaticText * m_staticText63
 
wxTextCtrl * m_TrackDeltaTValue
 
wxStaticText * m_trackTempUnits
 
wxStaticText * m_staticText66
 
wxTextCtrl * m_TrackLengthValue
 
UNIT_SELECTOR_LENm_TW_CuLength_choiceUnit
 
wxStaticText * m_staticText103
 
wxTextCtrl * m_TWResistivity
 
wxStaticText * m_resistivityUnits
 
wxHtmlWindow * m_htmlWinFormulas
 
wxStaticText * m_staticTextExtWidth
 
wxTextCtrl * m_ExtTrackWidthValue
 
UNIT_SELECTOR_LENm_TW_ExtTrackWidth_choiceUnit
 
wxStaticText * m_staticText65
 
wxTextCtrl * m_ExtTrackThicknessValue
 
UNIT_SELECTOR_THICKNESSm_ExtTrackThicknessUnit
 
wxStaticLine * m_staticline3
 
wxStaticLine * m_staticline4
 
wxStaticLine * m_staticline5
 
wxStaticText * m_staticTextArea
 
wxStaticText * m_ExtTrackAreaValue
 
wxStaticText * m_extTrackAreaUnitLabel
 
wxStaticText * m_staticText651
 
wxStaticText * m_ExtTrackResistValue
 
wxStaticText * m_extTrackResUnits
 
wxStaticText * m_staticText661
 
wxStaticText * m_ExtTrackVDropValue
 
wxStaticText * m_staticText83
 
wxStaticText * m_staticText79
 
wxStaticText * m_ExtTrackLossValue
 
wxStaticText * m_staticText791
 
wxStaticText * m_staticTextIntWidth
 
wxTextCtrl * m_IntTrackWidthValue
 
UNIT_SELECTOR_LENm_TW_IntTrackWidth_choiceUnit
 
wxStaticText * m_staticText652
 
wxTextCtrl * m_IntTrackThicknessValue
 
UNIT_SELECTOR_THICKNESSm_IntTrackThicknessUnit
 
wxStaticLine * m_staticline8
 
wxStaticLine * m_staticline9
 
wxStaticLine * m_staticline10
 
wxStaticText * m_staticTextArea1
 
wxStaticText * m_IntTrackAreaValue
 
wxStaticText * m_intTrackAreaUnitLabel
 
wxStaticText * m_staticText6511
 
wxStaticText * m_IntTrackResistValue
 
wxStaticText * m_intTrackResUnits
 
wxStaticText * m_staticText6611
 
wxStaticText * m_IntTrackVDropValue
 
wxStaticText * m_staticText831
 
wxStaticText * m_staticText792
 
wxStaticText * m_IntTrackLossValue
 
wxStaticText * m_staticText7911
 
wxButton * m_buttonTrackWidthReset
 
wxPanel * m_panelElectricalSpacing
 
UNIT_SELECTOR_LENm_ElectricalSpacingUnitsSelector
 
wxStaticLine * m_staticline2
 
wxStaticText * m_staticText891
 
wxTextCtrl * m_ElectricalSpacingVoltage
 
wxButton * m_buttonElectSpacingRefresh
 
wxBoxSizer * m_electricalSpacingSizer
 
wxStaticText * m_staticTextElectricalSpacing
 
wxGrid * m_gridElectricalSpacingValues
 
wxStaticText * m_staticText88
 
wxPanel * m_panelBoardClass
 
UNIT_SELECTOR_LENm_BoardClassesUnitsSelector
 
wxStaticText * m_staticTextBrdClass
 
wxGrid * m_gridClassesValuesDisplay
 
wxPanel * m_panelShowClassPrms
 
bool m_modal
 
WX_EVENT_LOOPm_modal_loop
 < Points to nested event_loop. NULL means not modal and dismissed. More...
 
wxWindow * m_modal_resultant_parent
 
wxString m_modal_string
 
bool m_modal_ret_val
 
FRAME_T m_ident
 
wxPoint m_framePos
 
wxSize m_frameSize
 
bool m_maximizeByDefault
 
wxPoint m_normalFramePos
 
wxSize m_normalFrameSize
 
wxString m_aboutTitle
 
wxAuiManager m_auimgr
 
wxString m_perspective
 
WX_INFOBARm_infoBar
 
wxString m_configName
 
SETTINGS_MANAGERm_settingsManager
 
FILE_HISTORYm_fileHistory
 
bool m_hasAutoSave
 
bool m_autoSaveState
 
int m_autoSaveInterval
 
wxTimer * m_autoSaveTimer
 
int m_undoRedoCountMax
 
UNDO_REDO_CONTAINER m_undoList
 
UNDO_REDO_CONTAINER m_redoList
 
wxString m_mruPath
 
EDA_UNITS m_userUnits
 Map containing the UI update handlers registered with wx for each action. More...
 
std::map< int, UIUpdateHandlerm_uiUpdateMap
 Set by the close window event handler after frames are asked if they can close. More...
 
bool m_isClosing
 Set by NonUserClose() to indicate that the user did not request the current close. More...
 
bool m_isNonUserClose
 
TOOL_MANAGERm_toolManager
 
ACTIONSm_actions
 
TOOL_DISPATCHERm_toolDispatcher
 
SELECTION m_dummySelection
 
std::vector< std::string > m_toolStack
 
bool m_immediateActions
 
MOUSE_DRAG_ACTION m_dragAction
 
bool m_moveWarpsCursor
 

Static Protected Attributes

static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND
 < Default style flags used for wxAUI toolbars. More...
 

Private Types

enum  { TW_MASTER_CURRENT, TW_MASTER_EXT_WIDTH, TW_MASTER_INT_WIDTH }
 

Private Member Functions

void OnClosePcbCalc (wxCloseEvent &event) override
 
void OnUpdateUI (wxUpdateUIEvent &event) override
 
void LoadSettings (APP_SETTINGS_BASE *aCfg) override
 Load common frame parameters from a configuration file. More...
 
void SaveSettings (APP_SETTINGS_BASE *aCfg) override
 Save common frame parameters to a configuration data file. More...
 
bool ReadDataFile ()
 
bool WriteDataFile ()
 
const wxString GetDataFilename ()
 
void SetDataFilename (const wxString &aFilename)
 Initialize the full filename of the selected pcb_calculator data file force the standard extension of the file (.pcbcalc) More...
 
void initTrackWidthPanel ()
 Panel-specific initializers. More...
 
void initESeriesPanel ()
 
void initColorCodePanel ()
 
void initViaSizePanel ()
 
void OnCalculateESeries (wxCommandEvent &event) override
 Called on calculate button and executes all E-series calculations. More...
 
void OnESeriesSelection (wxCommandEvent &event) override
 Radio Buttons to select the E-serie for the resistor calculator. More...
 
void writeTrackWidthConfig ()
 Function writeTrackWidthConfig Write Track width parameters in config. More...
 
void OnTWParametersChanged (wxCommandEvent &event) override
 Function OnTWParametersChanged Called when the user changes the general parameters (i.e., anything that is not one of the controlling values). More...
 
void OnTWCalculateFromCurrent (wxCommandEvent &event) override
 Function OnTWCalculateFromCurrent Called when the user changes the desired maximum current. More...
 
void OnTWCalculateFromExtWidth (wxCommandEvent &event) override
 Function OnTWCalculateFromExtWidth Called when the user changes the desired external trace width. More...
 
void OnTWCalculateFromIntWidth (wxCommandEvent &event) override
 Function OnTWCalculateFromIntWidth Called when the user changes the desired internal trace width. More...
 
void OnTWResetButtonClick (wxCommandEvent &event) override
 Function OnTWResetButtonClick Called when the user clicks the reset button. More...
 
double TWCalculateWidth (double aCurrent, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
 Function TWCalculateWidth Calculate track width required based on given current and temperature rise. More...
 
double TWCalculateCurrent (double aWidth, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
 Function TWCalculateCurrent Calculate maximum current based on given width and temperature rise. More...
 
void TWDisplayValues (double aCurrent, double aExtWidth, double aIntWidth, double aExtThickness, double aIntThickness)
 Function TWDisplayValues Displays the results of a calculation (including resulting values such as the resistance and power loss). More...
 
void TWUpdateModeDisplay ()
 Function TWUpdateModeDisplay Updates the fields to show whether the maximum current, external trace width, or internal trace width is currently the controlling parameter. More...
 
void writeViaSizeConfig ()
 Function writeViaSizeConfig Write Via Size parameters in config. More...
 
void OnViaCalculate (wxCommandEvent &event) override
 Function OnViaCalculate Called when the user changes any value in the via calcultor. More...
 
void OnViaEpsilonR_Button (wxCommandEvent &event) override
 Function OnViaEpsilonR_Button. More...
 
void OnViaRho_Button (wxCommandEvent &event) override
 Function OnViaRho_Button. More...
 
void onUpdateViaCalcErrorText (wxUpdateUIEvent &event) override
 Update the Error message in Via calculation panel. More...
 
void OnViaResetButtonClick (wxCommandEvent &event) override
 Function OnViaResetButtonClick Called when the user clicks the reset button; sets the parameters to their default values. More...
 
void VSDisplayValues (double aViaResistance, double aVoltageDrop, double aPowerLoss, double aEstimatedAmpacity, double aThermalResistance, double aCapacitance, double aTimeDegradation, double aInductance, double aReactance)
 Function VSDisplayValues Displays the results of the calculation. More...
 
void OnElectricalSpacingUnitsSelection (wxCommandEvent &event) override
 
void OnElectricalSpacingRefresh (wxCommandEvent &event) override
 
void ElectricalSpacingUpdateData (double aUnitScale)
 
void OnTranslineSelection (wxCommandEvent &event) override
 Function OnTranslineSelection Called on new transmission line selection. More...
 
void OnTransLineResetButtonClick (wxCommandEvent &event) override
 Function OnTransLineResetButtonClick Called when the user clicks the reset button; sets the parameters to their default values. More...
 
void OnTranslineAnalyse (wxCommandEvent &event) override
 Function OnTranslineAnalyse Run a new analyse for the current transline with current parameters and displays the electrical parameters. More...
 
void OnTranslineSynthetize (wxCommandEvent &event) override
 Function OnTranslineSynthetize Run a new synthezis for the current transline with current parameters and displays the geometrical parameters. More...
 
void OnTranslineEpsilonR_Button (wxCommandEvent &event) override
 Function OnTranslineEpsilonR_Button Shows a list of current relative dielectric constant(Er) and set the selected value in main dialog frame. More...
 
void OnTranslineTanD_Button (wxCommandEvent &event) override
 Function OnTranslineTanD_Button Shows a list of current dielectric loss factor (tangent delta) and set the selected value in main dialog frame. More...
 
void OnTranslineRho_Button (wxCommandEvent &event) override
 Function OnTranslineRho_Button Shows a list of current Specific resistance list (rho) and set the selected value in main dialog frame. More...
 
void TranslineTypeSelection (enum TRANSLINE_TYPE_ID aType)
 Function TranslineTypeSelection Must be called after selection of a new transline. More...
 
void TransfDlgDataToTranslineParams ()
 Function TransfDlgDataToTranslineParams Read values entered in dialog frame, and transfert these values in current transline parameters, converted in normalized units. More...
 
void OnToleranceSelection (wxCommandEvent &event) override
 
void ToleranceSelection (int aSelection)
 
void OnAttenuatorSelection (wxCommandEvent &event) override
 
void SetAttenuator (unsigned aIdx)
 
void OnCalculateAttenuator (wxCommandEvent &event) override
 
void TransfPanelDataToAttenuator ()
 
void TransfAttenuatorDataToPanel ()
 
void TransfAttenuatorResultsToPanel ()
 
void OnRegulatorCalcButtonClick (wxCommandEvent &event) override
 
void OnRegulatorResetButtonClick (wxCommandEvent &event) override
 
void OnRegulTypeSelection (wxCommandEvent &event) override
 
void OnRegulatorSelection (wxCommandEvent &event) override
 
void OnDataFileSelection (wxCommandEvent &event) override
 
void OnAddRegulator (wxCommandEvent &event) override
 
void OnEditRegulator (wxCommandEvent &event) override
 
void OnRemoveRegulator (wxCommandEvent &event) override
 
void RegulatorPageUpdate ()
 Function RegulatorPageUpdate: Update the regulator page dialog display: enable the current regulator drawings and the formula used for calculations. More...
 
void SelectLastSelectedRegulator ()
 Function SelectLastSelectedRegulator If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate() More...
 
void RegulatorsSolve ()
 
void Regulators_WriteConfig (PCB_CALCULATOR_SETTINGS *aCfg)
 Write regulators parameters in config. More...
 

Private Attributes

bool m_RegulatorListChanged
 
enum PCB_CALCULATOR_FRAME:: { ... }  m_TWMode
 
bool m_TWNested
 
enum TRANSLINE_TYPE_ID m_currTransLineType
 
TRANSLINEm_currTransLine
 
std::vector< TRANSLINE_IDENT * > m_transline_list
 
ATTENUATORm_currAttenuator
 
std::vector< ATTENUATOR * > m_attenuator_list
 
wxString m_lastSelectedRegulatorName
 
wxBitmap * m_ccValueNamesBitmap
 
wxBitmap * m_ccValuesBitmap
 
wxBitmap * m_ccMultipliersBitmap
 
wxBitmap * m_ccTolerancesBitmap
 
int m_lastNotebookPage
 
bool m_macHack
 

Detailed Description

Definition at line 41 of file pcb_calculator_frame.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
TW_MASTER_CURRENT 
TW_MASTER_EXT_WIDTH 
TW_MASTER_INT_WIDTH 

Definition at line 370 of file pcb_calculator_frame.h.

371  { // calculations:
372  TW_MASTER_CURRENT, // the maximum current,
373  TW_MASTER_EXT_WIDTH, // the external trace width,
374  TW_MASTER_INT_WIDTH // or the internal trace width?
375  } m_TWMode;
enum PCB_CALCULATOR_FRAME::@39 m_TWMode

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 

Definition at line 42 of file kiway_holder.h.

◆ UNDO_REDO_LIST

Remove the aItemCount of old commands from aList and delete commands, pickers and picked items if needed.

Because picked items must be deleted only if they are not in use, this is a virtual pure function that must be created for SCH_SCREEN and PCB_SCREEN. Commands are deleted from the older to the last.

Parameters
aList= the UNDO_REDO_CONTAINER of commands.
aItemCountnumber of old commands to delete. -1 to remove all old commands this will empty the list of commands.
Enumerator
UNDO_LIST 
REDO_LIST 

Definition at line 525 of file eda_base_frame.h.

Constructor & Destructor Documentation

◆ PCB_CALCULATOR_FRAME()

PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME ( KIWAY aKiway,
wxWindow *  aParent 
)

Definition at line 34 of file pcb_calculator_frame.cpp.

34  :
35  PCB_CALCULATOR_FRAME_BASE( aParent ),
36  m_lastNotebookPage( -1 ),
37  m_macHack( true )
38 {
42 
43  SetKiway( this, aKiway );
47  m_RegulatorListChanged = false;
49  m_TWNested = false;
50 
51  SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include
52  // some methods in code and avoid link errors
53 
54  // Populate transline list ordered like in dialog menu list
55  const static TRANSLINE_TYPE_ID tltype_list[8] =
56  {
58  CPW_TYPE,
61  COAX_TYPE,
65  };
66 
67  for( int ii = 0; ii < 8; ii++ )
68  m_transline_list.push_back( new TRANSLINE_IDENT( tltype_list[ii] ) );
69 
70  // Populate attenuator list ordered like in dialog menu list
71  m_attenuator_list.push_back( new ATTENUATOR_PI() );
72  m_attenuator_list.push_back( new ATTENUATOR_TEE() );
73  m_attenuator_list.push_back( new ATTENUATOR_BRIDGE() );
74  m_attenuator_list.push_back( new ATTENUATOR_SPLITTER() );
76 
77  wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
78  infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
79  m_staticTextAttMsg->SetFont( infoFont );
80 
81  m_IadjUnitLabel->SetLabel( wxT( "µA" ) );
82 
83  m_attZinUnit->SetLabel( wxT( "Ω" ) );
84  m_attZoutUnit->SetLabel( wxT( "Ω" ) );
85  m_attR1Unit->SetLabel( wxT( "Ω" ) );
86  m_attR2Unit->SetLabel( wxT( "Ω" ) );
87  m_attR3Unit->SetLabel( wxT( "Ω" ) );
88 
89  m_r1Units->SetLabel( wxT( "kΩ" ) );
90  m_r2Units->SetLabel( wxT( "kΩ" ) );
91 
92  m_reqResUnits->SetLabel( wxT( "kΩ" ) );
93  m_exclude1Units->SetLabel( wxT( "kΩ" ) );
94  m_exclude2Units->SetLabel( wxT( "kΩ" ) );
95 
96  m_EpsilonR_label->SetLabel( wxT( "εr" ) );
97 
98  m_trackTempUnits->SetLabel( wxT( "°C" ) );
99  m_resistivityUnits->SetLabel( wxT( "Ω•m" ) );
100 
101  m_viaResistivityUnits->SetLabel( wxT( "Ω•m" ) );
102 
103  m_viaTempUnits->SetLabel( wxT( "°C" ) );
104  m_viaResUnits->SetLabel( wxT( "Ω" ) );
105  m_viaThermalResUnits->SetLabel( wxT( "°C/W" ) );
106  m_viaReactanceUnits->SetLabel( wxT( "Ω" ) );
107 
108  m_extTrackResUnits->SetLabel( wxT( "Ω" ) );
109  m_intTrackResUnits->SetLabel( wxT( "Ω" ) );
110 
111  LoadSettings( config() );
112 
113  ReadDataFile();
114 
116  m_TranslineSelection->SetSelection( m_currTransLineType );
117 
122 
123  SetAttenuator( m_AttenuatorsSelection->GetSelection() );
124 
125  ToleranceSelection( m_rbToleranceSelection->GetSelection() );
126 
128 
130 
133 
134  // Give an icon
135  wxIcon icon;
136  wxIconBundle icon_bundle;
137 
138  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbcalculator ) );
139  icon_bundle.AddIcon( icon );
140  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbcalculator_32 ) );
141  icon_bundle.AddIcon( icon );
142  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbcalculator_16 ) );
143  icon_bundle.AddIcon( icon );
144 
145  SetIcons( icon_bundle );
146 
147  // Autosize the the row label column to be sure label are not truncated
148  m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
149  m_gridElectricalSpacingValues->SetRowLabelSize( wxGRID_AUTOSIZE );
150 
151  GetSizer()->SetSizeHints( this );
152 
153  // Set previous size and position
154  SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
155 
156  if( m_framePos == wxDefaultPosition )
157  Centre();
158 }
void ToleranceSelection(int aSelection)
Definition: colorcode.cpp:42
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
It is only used for debugging, since "this" is not a wxWindow*.
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void initViaSizePanel()
Definition: via.cpp:127
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
Definition: sch_symbol.cpp:69
enum PCB_CALCULATOR_FRAME::@39 m_TWMode
wxArrayString GetRegList() const
PCB_CALCULATOR_FRAME_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("PCB Calculator"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL, const wxString &name=wxT("pcb_calculator"))
#define NULL
void initESeriesPanel()
Definition: eserie.cpp:394
void initTrackWidthPanel()
Panel-specific initializers.
Represent a set of closed polygons.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
enum TRANSLINE_TYPE_ID m_currTransLineType
TRANSLINE_TYPE_ID
void TranslineTypeSelection(enum TRANSLINE_TYPE_ID aType)
Function TranslineTypeSelection Must be called after selection of a new transline.
void LoadSettings(APP_SETTINGS_BASE *aCfg) override
Load common frame parameters from a configuration file.
void ElectricalSpacingUpdateData(double aUnitScale)
REGULATOR_LIST m_RegulatorList
virtual double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_LEN * m_BoardClassesUnitsSelector
void SetAttenuator(unsigned aIdx)
Definition: attenuators.cpp:44
std::vector< TRANSLINE_IDENT * > m_transline_list
UNIT_SELECTOR_LEN * m_ElectricalSpacingUnitsSelector
void SelectLastSelectedRegulator()
Function SelectLastSelectedRegulator If m_lastSelectedRegulatorName is empty, just calls RegulatorPag...
void BoardClassesUpdateData(double aUnitScale)
std::vector< ATTENUATOR * > m_attenuator_list

References BoardClassesUpdateData(), C_MICROSTRIP_TYPE, COAX_TYPE, EDA_BASE_FRAME::config(), CPW_TYPE, DEFAULT_TYPE, dummy(), ElectricalSpacingUpdateData(), REGULATOR_LIST::GetRegList(), UNIT_SELECTOR_LEN::GetUnitScale(), GROUNDED_CPW_TYPE, icon_pcbcalculator, icon_pcbcalculator_16, icon_pcbcalculator_32, initColorCodePanel(), initESeriesPanel(), initTrackWidthPanel(), initViaSizePanel(), KiBitmap(), LoadSettings(), m_attenuator_list, PCB_CALCULATOR_FRAME_BASE::m_AttenuatorsSelection, PCB_CALCULATOR_FRAME_BASE::m_attR1Unit, PCB_CALCULATOR_FRAME_BASE::m_attR2Unit, PCB_CALCULATOR_FRAME_BASE::m_attR3Unit, PCB_CALCULATOR_FRAME_BASE::m_attZinUnit, PCB_CALCULATOR_FRAME_BASE::m_attZoutUnit, PCB_CALCULATOR_FRAME_BASE::m_BoardClassesUnitsSelector, PCB_CALCULATOR_FRAME_BASE::m_bpButtonAnalyze, PCB_CALCULATOR_FRAME_BASE::m_bpButtonCalcAtt, PCB_CALCULATOR_FRAME_BASE::m_bpButtonSynthetize, PCB_CALCULATOR_FRAME_BASE::m_choiceRegulatorSelector, m_currAttenuator, m_currTransLine, m_currTransLineType, PCB_CALCULATOR_FRAME_BASE::m_ElectricalSpacingUnitsSelector, PCB_CALCULATOR_FRAME_BASE::m_EpsilonR_label, PCB_CALCULATOR_FRAME_BASE::m_exclude1Units, PCB_CALCULATOR_FRAME_BASE::m_exclude2Units, PCB_CALCULATOR_FRAME_BASE::m_extTrackResUnits, EDA_BASE_FRAME::m_framePos, EDA_BASE_FRAME::m_frameSize, PCB_CALCULATOR_FRAME_BASE::m_gridClassesValuesDisplay, PCB_CALCULATOR_FRAME_BASE::m_gridElectricalSpacingValues, PCB_CALCULATOR_FRAME_BASE::m_IadjUnitLabel, PCB_CALCULATOR_FRAME_BASE::m_intTrackResUnits, PCB_CALCULATOR_FRAME_BASE::m_r1Units, PCB_CALCULATOR_FRAME_BASE::m_r2Units, PCB_CALCULATOR_FRAME_BASE::m_rbToleranceSelection, m_RegulatorList, m_RegulatorListChanged, PCB_CALCULATOR_FRAME_BASE::m_reqResUnits, PCB_CALCULATOR_FRAME_BASE::m_resistivityUnits, PCB_CALCULATOR_FRAME_BASE::m_staticTextAttMsg, PCB_CALCULATOR_FRAME_BASE::m_trackTempUnits, m_transline_list, PCB_CALCULATOR_FRAME_BASE::m_TranslineSelection, m_TWMode, m_TWNested, PCB_CALCULATOR_FRAME_BASE::m_viaReactanceUnits, PCB_CALCULATOR_FRAME_BASE::m_viaResistivityUnits, PCB_CALCULATOR_FRAME_BASE::m_viaResUnits, PCB_CALCULATOR_FRAME_BASE::m_viaTempUnits, PCB_CALCULATOR_FRAME_BASE::m_viaThermalResUnits, MICROSTRIP_TYPE, NULL, ReadDataFile(), RECTWAVEGUIDE_TYPE, SelectLastSelectedRegulator(), SetAttenuator(), KIWAY_HOLDER::SetKiway(), small_down, small_up, STRIPLINE_TYPE, ToleranceSelection(), TranslineTypeSelection(), TW_MASTER_CURRENT, and TWISTEDPAIR_TYPE.

◆ ~PCB_CALCULATOR_FRAME()

PCB_CALCULATOR_FRAME::~PCB_CALCULATOR_FRAME ( )

Definition at line 161 of file pcb_calculator_frame.cpp.

162 {
163  for( unsigned ii = 0; ii < m_transline_list.size(); ii++ )
164  delete m_transline_list[ii];
165 
166  for( unsigned ii = 0; ii < m_attenuator_list.size(); ii++ )
167  delete m_attenuator_list[ii];
168 
169  delete m_ccValueNamesBitmap;
170  delete m_ccValuesBitmap;
171  delete m_ccMultipliersBitmap;
172  delete m_ccTolerancesBitmap;
173 
174  // This needed for OSX: avoids furter OnDraw processing after this destructor and before
175  // the native window is destroyed
176  this->Freeze();
177 }
std::vector< TRANSLINE_IDENT * > m_transline_list
std::vector< ATTENUATOR * > m_attenuator_list

References m_attenuator_list, m_ccMultipliersBitmap, m_ccTolerancesBitmap, m_ccValueNamesBitmap, m_ccValuesBitmap, and m_transline_list.

Member Function Documentation

◆ AddStandardHelpMenu()

void EDA_BASE_FRAME::AddStandardHelpMenu ( wxMenuBar *  aMenuBar)
inherited

Adds the standard KiCad help menu to the menubar.

Definition at line 418 of file eda_base_frame.cpp.

419 {
420  COMMON_CONTROL* commonControl = m_toolManager->GetTool<COMMON_CONTROL>();
421  ACTION_MENU* helpMenu = new ACTION_MENU( false, commonControl );
422 
423  helpMenu->Add( ACTIONS::help );
424  helpMenu->Add( ACTIONS::gettingStarted );
425  helpMenu->Add( ACTIONS::listHotKeys );
426  helpMenu->Add( ACTIONS::getInvolved );
427  helpMenu->Add( ACTIONS::donate );
428  helpMenu->Add( ACTIONS::reportBug );
429 
430  helpMenu->AppendSeparator();
431  helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, BITMAPS::about );
432 
433  aMenuBar->Append( helpMenu, _( "&Help" ) );
434 }
static TOOL_ACTION listHotKeys
Definition: actions.h:180
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:47
static TOOL_ACTION reportBug
Cursor control event types.
Definition: actions.h:183
static TOOL_ACTION donate
Definition: actions.h:181
Handle actions that are shared between different applications.
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:157
#define _(s)
Definition: 3d_actions.cpp:33
static TOOL_ACTION help
Definition: actions.h:179
static TOOL_ACTION getInvolved
Definition: actions.h:182
static TOOL_ACTION gettingStarted
Definition: actions.h:178

References _, about, ACTIONS::donate, ACTIONS::getInvolved, ACTIONS::gettingStarted, TOOL_MANAGER::GetTool(), ACTIONS::help, ACTIONS::listHotKeys, TOOLS_HOLDER::m_toolManager, and ACTIONS::reportBug.

Referenced by EDA_3D_VIEWER::CreateMenuBar(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SYMBOL_VIEWER_FRAME::ReCreateMenuBar(), SYMBOL_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), CVPCB_MAINFRAME::ReCreateMenuBar(), and PCB_EDIT_FRAME::ReCreateMenuBar().

◆ BoardClassesUpdateData()

void PCB_CALCULATOR_FRAME::BoardClassesUpdateData ( double  aUnitScale)

Definition at line 91 of file board_classes_values.cpp.

92 {
93  wxString txt;
94  #define FMT wxT("%g")
95  #define NOVAL wxT("--")
96  for( int ii = 0; ii < BRDCLASS_COUNT; ii ++ )
97  {
98  // Display min tracks width
99  if( clist[ii].m_Lines > -1.0 )
100  txt.Printf( FMT, clist[ii].m_Lines / aUnitScale);
101  else
102  txt = NOVAL;
103  m_gridClassesValuesDisplay->SetCellValue(0, ii, txt );
104 
105  // Display min clearance
106  if( clist[ii].m_Clearance > -1.0 )
107  txt.Printf( FMT, clist[ii].m_Clearance / aUnitScale);
108  else
109  txt = NOVAL;
110  m_gridClassesValuesDisplay->SetCellValue(1, ii, txt );
111 
112  // Display min Via diam diff
113  if( clist[ii].m_ViaDiamDiff > -1.0 )
114  txt.Printf( FMT, clist[ii].m_ViaDiamDiff / aUnitScale);
115  else
116  txt = NOVAL;
117  m_gridClassesValuesDisplay->SetCellValue(2, ii, txt );
118 
119  // Display min Pad diam diff (plated)
120  if( clist[ii].m_PadDiamDiffPlated > -1.0 )
121  txt.Printf( FMT, clist[ii].m_PadDiamDiffPlated / aUnitScale);
122  else
123  txt = NOVAL;
124  m_gridClassesValuesDisplay->SetCellValue(3, ii, txt );
125 
126  // Display min Pad diam diff (non plated)
127  if( clist[ii].m_PadDiamDiffNotPlated > -1.0 )
128  txt.Printf( FMT, clist[ii].m_PadDiamDiffNotPlated / aUnitScale);
129  else
130  txt = NOVAL;
131  m_gridClassesValuesDisplay->SetCellValue(4, ii, txt );
132  }
133 }
#define FMT
#define BRDCLASS_COUNT
static BOARD_MIN_SIZE_VALUES clist[BRDCLASS_COUNT]
#define NOVAL

References BRDCLASS_COUNT, clist, FMT, PCB_CALCULATOR_FRAME_BASE::m_gridClassesValuesDisplay, and NOVAL.

Referenced by OnBoardClassesUnitsSelection(), and PCB_CALCULATOR_FRAME().

◆ canCloseWindow()

virtual bool EDA_BASE_FRAME::canCloseWindow ( wxCloseEvent &  aCloseEvent)
inlineprotectedvirtualinherited

◆ ChangeUserUnits()

void EDA_BASE_FRAME::ChangeUserUnits ( EDA_UNITS  aUnits)
inherited

Definition at line 1093 of file eda_base_frame.cpp.

1094 {
1095  SetUserUnits( aUnits );
1097 
1098  wxCommandEvent e( UNITS_CHANGED );
1099  ProcessEventLocally( e );
1100 }
virtual void unitsChangeRefresh()
Called when when the units setting has changed to allow for any derived classes to handle refreshing ...
void SetUserUnits(EDA_UNITS aUnits)

References EDA_BASE_FRAME::SetUserUnits(), and EDA_BASE_FRAME::unitsChangeRefresh().

Referenced by COMMON_TOOLS::SwitchUnits(), and COMMON_TOOLS::ToggleUnits().

◆ CheckForAutoSaveFile()

void EDA_BASE_FRAME::CheckForAutoSaveFile ( const wxFileName &  aFileName)
inherited

Check if an auto save file exists for aFileName and takes the appropriate action depending on the user input.

If an auto save file exists for aFileName, the user is prompted if they wish to replace file aFileName with the auto saved file. If the user chooses to replace the file, the backup file of aFileName is removed, aFileName is renamed to the backup file name, and the auto save file is renamed to aFileName. If user chooses to keep the existing version of aFileName, the auto save file is removed.

Parameters
aFileNameA wxFileName object containing the file name to check.

Definition at line 981 of file eda_base_frame.cpp.

982 {
983  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
984 
985  wxFileName autoSaveFileName = aFileName;
986 
987  // Check for auto save file.
988  autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
989 
990  wxLogTrace( traceAutoSave,
991  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
992 
993  if( !autoSaveFileName.FileExists() )
994  return;
995 
996  wxString msg = wxString::Format( _(
997  "Well this is potentially embarrassing!\n"
998  "It appears that the last time you were editing the file\n"
999  "\"%s\"\n"
1000  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
1001  aFileName.GetFullName()
1002  );
1003 
1004  int response = wxMessageBox( msg, Pgm().App().GetAppDisplayName(), wxYES_NO | wxICON_QUESTION,
1005  this );
1006 
1007  // Make a backup of the current file, delete the file, and rename the auto save file to
1008  // the file name.
1009  if( response == wxYES )
1010  {
1011  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
1012  {
1013  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
1014  Pgm().App().GetAppDisplayName(), wxOK | wxICON_EXCLAMATION, this );
1015  }
1016  }
1017  else
1018  {
1019  wxLogTrace( traceAutoSave,
1020  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
1021 
1022  // Remove the auto save file when using the previous file as is.
1023  wxRemoveFile( autoSaveFileName.GetFullPath() );
1024  }
1025 }
const wxChar *const traceAutoSave
Flag to enable auto save feature debug tracing.
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
static wxString GetAutoSaveFilePrefix()
#define _(s)
Definition: 3d_actions.cpp:33

References _, Format(), EDA_BASE_FRAME::GetAutoSaveFilePrefix(), Pgm(), and traceAutoSave.

Referenced by PCB_EDIT_FRAME::OpenProjectFiles(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ ClearFileHistory()

void EDA_BASE_FRAME::ClearFileHistory ( FILE_HISTORY aFileHistory = nullptr)
inherited

Removes all files from the file history.

Parameters
aFileHistoryThe FILE_HISTORY in use. If null, the main application file history is used

Definition at line 878 of file eda_base_frame.cpp.

879 {
880  if( !aFileHistory )
881  aFileHistory = m_fileHistory;
882 
883  wxASSERT( aFileHistory );
884 
885  aFileHistory->ClearFileHistory();
886 
887  // Update the menubar to update the file history menu
888  if( GetMenuBar() )
889  {
890  ReCreateMenuBar();
891  GetMenuBar()->Refresh();
892  }
893 }
void ClearFileHistory()
Clear all entries from the file history.
FILE_HISTORY * m_fileHistory
virtual void ReCreateMenuBar()
Recreates the menu bar.

References FILE_HISTORY::ClearFileHistory(), EDA_BASE_FRAME::m_fileHistory, and EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by GERBVIEW_FRAME::OnClearDrlFileHistory(), KICAD_MANAGER_FRAME::OnClearFileHistory(), PL_EDITOR_FRAME::OnClearFileHistory(), PCB_EDIT_FRAME::OnClearFileHistory(), SCH_EDIT_FRAME::OnClearFileHistory(), GERBVIEW_FRAME::OnClearGbrFileHistory(), GERBVIEW_FRAME::OnClearJobFileHistory(), and GERBVIEW_FRAME::OnClearZipFileHistory().

◆ ClearUndoORRedoList()

virtual void EDA_BASE_FRAME::ClearUndoORRedoList ( UNDO_REDO_LIST  aList,
int  aItemCount = -1 
)
inlinevirtualinherited

◆ ClearUndoRedoList()

◆ CommonSettingsChanged()

void EDA_BASE_FRAME::CommonSettingsChanged ( bool  aEnvVarsChanged,
bool  aTextVarsChanged 
)
overridevirtualinherited

Notification event that some of the common (suite-wide) settings have changed.

Update menus, toolbars, local variables, etc.

Reimplemented from TOOLS_HOLDER.

Reimplemented in PCB_EDIT_FRAME, PCB_BASE_FRAME, FOOTPRINT_EDIT_FRAME, EDA_DRAW_FRAME, PL_EDITOR_FRAME, FOOTPRINT_VIEWER_FRAME, and KICAD_MANAGER_FRAME.

Definition at line 447 of file eda_base_frame.cpp.

448 {
449  TOOLS_HOLDER::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
450 
451  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
452 
453  if( m_fileHistory )
454  {
455  int historySize = settings->m_System.file_history_size;
456  m_fileHistory->SetMaxFiles( (unsigned) std::max( 0, historySize ) );
457  }
458 
459  if( GetBitmapStore()->ThemeChanged() )
460  {
461  ThemeChanged();
462  }
463 
464  if( GetMenuBar() )
465  {
466  // For icons in menus, icon scaling & hotkeys
467  ReCreateMenuBar();
468  GetMenuBar()->Refresh();
469  }
470 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
void SetMaxFiles(size_t aMaxFiles)
Update the number of files that will be contained inside the file history.
Definition: filehistory.cpp:85
virtual void ThemeChanged()
Process light/dark theme change.
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Notification event that some of the common (suite-wide) settings have changed.
FILE_HISTORY * m_fileHistory
virtual void ReCreateMenuBar()
Recreates the menu bar.
BITMAP_STORE * GetBitmapStore()
Definition: bitmap.cpp:92

References TOOLS_HOLDER::CommonSettingsChanged(), COMMON_SETTINGS::SYSTEM::file_history_size, GetBitmapStore(), EDA_BASE_FRAME::m_fileHistory, COMMON_SETTINGS::m_System, Pgm(), EDA_BASE_FRAME::ReCreateMenuBar(), FILE_HISTORY::SetMaxFiles(), and EDA_BASE_FRAME::ThemeChanged().

Referenced by KICAD_MANAGER_FRAME::CommonSettingsChanged(), EDA_3D_VIEWER::CommonSettingsChanged(), EDA_DRAW_FRAME::CommonSettingsChanged(), and KIWAY::CommonSettingsChanged().

◆ config()

APP_SETTINGS_BASE * EDA_BASE_FRAME::config ( ) const
virtualinherited

Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.

Reimplemented in SYMBOL_EDIT_FRAME, KICAD_MANAGER_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 719 of file eda_base_frame.cpp.

720 {
721  // KICAD_MANAGER_FRAME overrides this
722  return Kiface().KifaceSettings();
723 }
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_i.h:92
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.

References Kiface(), and KIFACE_I::KifaceSettings().

Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), PCB_BASE_FRAME::ActivateGalCanvas(), BM2CMP_FRAME::BM2CMP_FRAME(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), FOOTPRINT_WIZARD_FRAME::doCloseWindow(), SIM_PLOT_FRAME::doCloseWindow(), SCH_BASE_FRAME::eeconfig(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), GERBVIEW_FRAME::GERBVIEW_FRAME(), DISPLAY_FOOTPRINTS_FRAME::GetAutoZoom(), GRID_MENU::GRID_MENU(), COMMON_TOOLS::GridFast1(), COMMON_TOOLS::GridFast2(), EDA_DRAW_FRAME::IsGridVisible(), SCH_BASE_FRAME::libeditconfig(), EDA_DRAW_FRAME::OnUpdateSelectGrid(), EDA_DRAW_FRAME::OnUpdateSelectZoom(), PCB_CALCULATOR_FRAME(), DIALOG_GRID_SETTINGS::RebuildGridSizes(), EDA_DRAW_FRAME::resolveCanvasType(), DISPLAY_FOOTPRINTS_FRAME::SetAutoZoom(), PCB_BASE_EDIT_FRAME::SetBoard(), EDA_DRAW_FRAME::SetGridVisibility(), PL_EDITOR_FRAME::setupTools(), SYMBOL_VIEWER_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), GERBVIEW_FRAME::setupTools(), SCH_EDIT_FRAME::setupTools(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DIALOG_GRID_SETTINGS::TransferDataToWindow(), ZOOM_MENU::update(), GRID_MENU::update(), EDA_DRAW_FRAME::UpdateGridSelectBox(), EDA_DRAW_FRAME::UpdateZoomSelectBox(), EDA_BASE_FRAME::windowClosing(), ZOOM_MENU::ZOOM_MENU(), and BM2CMP_FRAME::~BM2CMP_FRAME().

◆ ConfigBaseName()

wxString EDA_BASE_FRAME::ConfigBaseName ( )
inlineoverridevirtualinherited

Get the configuration base name.

This is usually the name of the frame set by CTOR, except for frames shown in multiple modes in which case the m_configName must be set to the base name so that a single configuration can be used.

Returns
a base name prefix used in Load/Save settings to build the full name of keys used in configuration.

Reimplemented from TOOLS_HOLDER.

Definition at line 339 of file eda_base_frame.h.

340  {
341  wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
342  return baseCfgName;
343  }
wxString m_configName

References EDA_BASE_FRAME::m_configName.

Referenced by EDA_BASE_FRAME::SaveWindowSettings().

◆ CreateInfoBar()

void EDA_BASE_FRAME::CreateInfoBar ( )
inherited

Definition at line 744 of file eda_base_frame.cpp.

745 {
746 #if defined( __WXOSX_MAC__ )
748 #else
749  m_infoBar = new WX_INFOBAR( this, &m_auimgr );
750 
751  m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
752 #endif
753 }
wxAuiManager m_auimgr
virtual wxWindow * GetToolCanvas() const =0
Canvas access.
Specialization of the wxAuiPaneInfo class for KiCad panels.
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:73
WX_INFOBAR * m_infoBar

References TOOLS_HOLDER::GetToolCanvas(), EDA_BASE_FRAME::m_auimgr, and EDA_BASE_FRAME::m_infoBar.

◆ CurrentToolName()

std::string TOOLS_HOLDER::CurrentToolName ( ) const
inherited

Definition at line 99 of file tools_holder.cpp.

100 {
101  if( m_toolStack.empty() )
102  return ACTIONS::selectionTool.GetName();
103  else
104  return m_toolStack.back();
105 }
std::vector< std::string > m_toolStack
Definition: tools_holder.h:163
static TOOL_ACTION selectionTool
Definition: actions.h:156

References TOOLS_HOLDER::m_toolStack, and ACTIONS::selectionTool.

Referenced by TOOL_MANAGER::processEvent().

◆ Destroy()

◆ DismissModal()

void KIWAY_PLAYER::DismissModal ( bool  aRetVal,
const wxString &  aResult = wxEmptyString 
)
inherited

Definition at line 161 of file kiway_player.cpp.

162 {
163  m_modal_ret_val = aRetVal;
164  m_modal_string = aResult;
165 
166  if( m_modal_loop )
167  {
168  m_modal_loop->Exit();
169  m_modal_loop = nullptr; // this marks it as dismissed.
170  }
171 
172  Show( false );
173 }
bool m_modal_ret_val
Definition: kiway_player.h:199
wxString m_modal_string
Definition: kiway_player.h:198
WX_EVENT_LOOP * m_modal_loop
< Points to nested event_loop. NULL means not modal and dismissed.
Definition: kiway_player.h:196

References KIWAY_PLAYER::m_modal_loop, KIWAY_PLAYER::m_modal_ret_val, and KIWAY_PLAYER::m_modal_string.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SYMBOL_VIEWER_FRAME::doCloseWindow(), FOOTPRINT_VIEWER_FRAME::doCloseWindow(), FOOTPRINT_WIZARD_FRAME::doCloseWindow(), FOOTPRINT_WIZARD_FRAME::ExportSelectedFootprint(), and SYMBOL_VIEWER_FRAME::FinishModal().

◆ DisplayToolMsg()

virtual void TOOLS_HOLDER::DisplayToolMsg ( const wxString &  msg)
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 122 of file tools_holder.h.

122 {};

Referenced by TOOLS_HOLDER::PopTool(), and TOOLS_HOLDER::PushTool().

◆ doAutoSave()

bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

This should be overridden by the derived class to handle the auto save feature.

Returns
true if the auto save was successful otherwise false.

Reimplemented in SCH_EDIT_FRAME, and PCB_EDIT_FRAME.

Definition at line 301 of file eda_base_frame.cpp.

302 {
303  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
304 }

Referenced by EDA_BASE_FRAME::onAutoSaveTimer().

◆ doCloseWindow()

◆ ElectricalSpacingUpdateData()

void PCB_CALCULATOR_FRAME::ElectricalSpacingUpdateData ( double  aUnitScale)
private

Definition at line 116 of file electrical_spacing_values.cpp.

117 {
118  wxString txt;
119  double voltage = 500.0; // to calculate values at V > 500V
120  txt = m_ElectricalSpacingVoltage->GetValue();
121 
122  if( ! txt.IsEmpty() )
123  voltage = DoubleFromString(txt);
124 
125  if( voltage < 500.0 )
126  voltage = 500.0;
127 
128  txt.Printf( wxT( "%g" ), voltage );
129  m_ElectricalSpacingVoltage->SetValue( txt );
130 
131  for( int ii = 0; ii < CLASS_COUNT-1; ii++ )
132  {
133  for( int jj = 0; jj < VALUE_COUNT; jj++ )
134  {
135  txt.Printf( wxT( "%g" ), clist[ii][jj] / aUnitScale );
136  m_gridElectricalSpacingValues->SetCellValue( ii, jj, txt );
137  }
138  }
139 
140  for( int jj = 0; jj < VALUE_COUNT; jj++ )
141  {
142  double spacing = clist[CLASS_COUNT-2][jj];
143  double spacing_extra = clist[CLASS_COUNT-1][jj];
144  spacing += spacing_extra * ( voltage - 500.0 );
145  txt.Printf( wxT( "%g" ), spacing / aUnitScale );
146  m_gridElectricalSpacingValues->SetCellValue( CLASS_COUNT-1, jj, txt );
147  }
148 
149  m_gridElectricalSpacingValues->SetRowLabelSize( wxGRID_AUTOSIZE );
150 }
double DoubleFromString(const wxString &TextValue)
#define CLASS_COUNT
#define VALUE_COUNT
static double clist[CLASS_COUNT][VALUE_COUNT]

References CLASS_COUNT, clist, DoubleFromString(), PCB_CALCULATOR_FRAME_BASE::m_ElectricalSpacingVoltage, PCB_CALCULATOR_FRAME_BASE::m_gridElectricalSpacingValues, and VALUE_COUNT.

Referenced by OnElectricalSpacingRefresh(), OnElectricalSpacingUnitsSelection(), and PCB_CALCULATOR_FRAME().

◆ FinishAUIInitialization()

void EDA_BASE_FRAME::FinishAUIInitialization ( )
inherited

Definition at line 756 of file eda_base_frame.cpp.

757 {
758 #if defined( __WXOSX_MAC__ )
759  m_auimgr.Update();
760 #else
761  // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
762  // hiding it.
763  m_auimgr.Update();
764 
765  // We don't want the infobar displayed right away
766  m_auimgr.GetPane( "InfoBar" ).Hide();
767  m_auimgr.Update();
768 #endif
769 }
wxAuiManager m_auimgr

References EDA_BASE_FRAME::m_auimgr.

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

◆ GetAutoSaveFilePrefix()

static wxString EDA_BASE_FRAME::GetAutoSaveFilePrefix ( )
inlinestaticprotectedinherited
Returns
the string to prepend to a file name for automatic save.

Definition at line 583 of file eda_base_frame.h.

584  {
585  return wxT( "_autosave-" );
586  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doCloseWindow(), PCB_EDIT_FRAME::Files_io_from_id(), PCB_EDIT_FRAME::OnExportSTEP(), SCH_EDIT_FRAME::SaveEEFile(), and PCB_EDIT_FRAME::SavePcbFile().

◆ GetAutoSaveInterval()

int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 190 of file eda_base_frame.h.

190 { return m_autoSaveInterval; }

References EDA_BASE_FRAME::m_autoSaveInterval.

◆ GetCurrentFileName()

virtual wxString EDA_BASE_FRAME::GetCurrentFileName ( ) const
inlinevirtualinherited

Get the full filename + path of the currently opened file in the frame.

If no file is open, an empty string is returned.

Returns
the filename and full path to the open file

Reimplemented in PCB_EDIT_FRAME, SCH_EDIT_FRAME, PL_EDITOR_FRAME, and KICAD_MANAGER_FRAME.

Definition at line 420 of file eda_base_frame.h.

420 { return wxEmptyString; }

Referenced by EDA_BASE_FRAME::SaveSettings().

◆ GetCurrentSelection()

virtual SELECTION& TOOLS_HOLDER::GetCurrentSelection ( )
inlinevirtualinherited

Get the current selection from the canvas area.

Returns
the current selection.

Reimplemented in PCB_EDIT_FRAME, GERBVIEW_FRAME, SYMBOL_VIEWER_FRAME, SCH_EDIT_FRAME, PL_EDITOR_FRAME, DISPLAY_FOOTPRINTS_FRAME, SYMBOL_EDIT_FRAME, FOOTPRINT_VIEWER_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 102 of file tools_holder.h.

103  {
104  return m_dummySelection;
105  }
SELECTION m_dummySelection
Definition: tools_holder.h:161

References TOOLS_HOLDER::m_dummySelection.

Referenced by EDA_BASE_FRAME::HandleUpdateUIEvent(), and ACTION_MANAGER::RunHotKey().

◆ GetDataFilename()

const wxString PCB_CALCULATOR_FRAME::GetDataFilename ( )
private
Returns
the full filename of the selected pcb_calculator data file

Definition at line 394 of file pcb_calculator_frame.cpp.

395 {
396  if( m_regulators_fileNameCtrl->GetValue().IsEmpty() )
397  return wxEmptyString;
398 
399  wxFileName fn( m_regulators_fileNameCtrl->GetValue() );
400  fn.SetExt( DataFileNameExt );
401  return fn.GetFullPath();
402 }
const wxString DataFileNameExt(wxT("pcbcalc"))

References DataFileNameExt(), and PCB_CALCULATOR_FRAME_BASE::m_regulators_fileNameCtrl.

Referenced by OnClosePcbCalc(), OnDataFileSelection(), and Regulators_WriteConfig().

◆ GetDoImmediateActions()

bool TOOLS_HOLDER::GetDoImmediateActions ( ) const
inlineinherited

Indicate that hotkeys should perform an immediate action even if another tool is currently active.

If false, the first hotkey should select the relevant tool.

Definition at line 128 of file tools_holder.h.

128 { return m_immediateActions; }
bool m_immediateActions
Definition: tools_holder.h:170

References TOOLS_HOLDER::m_immediateActions.

◆ GetDragAction()

MOUSE_DRAG_ACTION TOOLS_HOLDER::GetDragAction ( ) const
inlineinherited

Indicates whether a drag should draw a selection rectangle or drag selected (or unselected) objects.

Definition at line 134 of file tools_holder.h.

134 { return m_dragAction; }
MOUSE_DRAG_ACTION m_dragAction
Definition: tools_holder.h:174

References TOOLS_HOLDER::m_dragAction.

Referenced by PL_SELECTION_TOOL::Main(), EE_SELECTION_TOOL::Main(), and PCB_SELECTION_TOOL::Main().

◆ GetFileFromHistory()

wxString EDA_BASE_FRAME::GetFileFromHistory ( int  cmdId,
const wxString &  type,
FILE_HISTORY aFileHistory = nullptr 
)
inherited

Fetches the file name from the file history list.

This removes the selected file, if this file does not exist. The menu is also updated, if #FILE_HISTORY::UseMenu was called at initialization time.

Parameters
cmdIdThe command ID associated with the aFileHistory object.
typePlease document me!
aFileHistoryThe FILE_HISTORY in use. If null, the main application file history is used
Returns
a wxString containing the selected filename

Definition at line 838 of file eda_base_frame.cpp.

840 {
841  if( !aFileHistory )
842  aFileHistory = m_fileHistory;
843 
844  wxASSERT( aFileHistory );
845 
846  int baseId = aFileHistory->GetBaseId();
847 
848  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) aFileHistory->GetCount() );
849 
850  unsigned i = cmdId - baseId;
851 
852  if( i < aFileHistory->GetCount() )
853  {
854  wxString fn = aFileHistory->GetHistoryFile( i );
855 
856  if( wxFileName::FileExists( fn ) )
857  return fn;
858  else
859  {
860  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
861  wxMessageBox( msg );
862 
863  aFileHistory->RemoveFileFromHistory( i );
864  }
865  }
866 
867  // Update the menubar to update the file history menu
868  if( GetMenuBar() )
869  {
870  ReCreateMenuBar();
871  GetMenuBar()->Refresh();
872  }
873 
874  return wxEmptyString;
875 }
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
#define _(s)
Definition: 3d_actions.cpp:33
FILE_HISTORY * m_fileHistory
virtual void ReCreateMenuBar()
Recreates the menu bar.

References _, Format(), EDA_BASE_FRAME::m_fileHistory, and EDA_BASE_FRAME::ReCreateMenuBar().

Referenced by GERBVIEW_FRAME::OnDrlFileHistory(), KICAD_MANAGER_FRAME::OnFileHistory(), PL_EDITOR_FRAME::OnFileHistory(), PCB_EDIT_FRAME::OnFileHistory(), GERBVIEW_FRAME::OnGbrFileHistory(), GERBVIEW_FRAME::OnJobFileHistory(), SCH_EDIT_FRAME::OnLoadFile(), and GERBVIEW_FRAME::OnZipFileHistory().

◆ GetFileHistory()

FILE_HISTORY& EDA_BASE_FRAME::GetFileHistory ( )
inlineinherited

Get the frame's main file history.

Returns
the main file history

Definition at line 404 of file eda_base_frame.h.

405  {
406  return *m_fileHistory;
407  }
FILE_HISTORY * m_fileHistory

References EDA_BASE_FRAME::m_fileHistory.

Referenced by KICAD_MANAGER_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), and PCB_EDIT_FRAME::ReCreateMenuBar().

◆ GetFrameType()

FRAME_T EDA_BASE_FRAME::GetFrameType ( ) const
inlineinherited

Definition at line 193 of file eda_base_frame.h.

193 { return m_ident; }

References EDA_BASE_FRAME::m_ident.

◆ GetInfoBar()

◆ GetMaxUndoItems()

int EDA_BASE_FRAME::GetMaxUndoItems ( ) const
inlineinherited

Definition at line 563 of file eda_base_frame.h.

563 { return m_undoRedoCountMax; }

References EDA_BASE_FRAME::m_undoRedoCountMax.

Referenced by EDA_DRAW_FRAME::SaveSettings().

◆ GetMoveWarpsCursor()

bool TOOLS_HOLDER::GetMoveWarpsCursor ( ) const
inlineinherited

Indicate that a move operation should warp the mouse pointer to the origin of the move object.

This improves snapping, but some users are allergic to mouse warping.

Definition at line 140 of file tools_holder.h.

140 { return m_moveWarpsCursor; }
bool m_moveWarpsCursor
Definition: tools_holder.h:176

References TOOLS_HOLDER::m_moveWarpsCursor.

Referenced by EDIT_TOOL::doMoveSelection(), ROUTER_TOOL::InlineDrag(), SYMBOL_EDITOR_MOVE_TOOL::Main(), and SCH_MOVE_TOOL::Main().

◆ GetMruPath()

◆ GetPrmValue()

double PCB_CALCULATOR_FRAME::GetPrmValue ( enum PRMS_ID  aPrmId) const

Function GetPrmValue Returns a param value.

Parameters
aPrmId= param id to write
Returns
the value always in normalized unit (meter, Hz, Ohm, radian)

Definition at line 139 of file params_read_write.cpp.

140 {
142  for( unsigned ii = 0; ii < tr_ident->GetPrmsCount(); ii++ )
143  {
144  TRANSLINE_PRM* prm = tr_ident->GetPrm( ii );
145  if( aPrmId == prm->m_Id )
146  return prm->m_NormalizedValue;
147  }
148  return 1.0;
149 }
double m_NormalizedValue
unsigned GetPrmsCount() const
enum TRANSLINE_TYPE_ID m_currTransLineType
TRANSLINE_PRM * GetPrm(unsigned aIdx) const
std::vector< TRANSLINE_IDENT * > m_transline_list

References TRANSLINE_IDENT::GetPrm(), TRANSLINE_IDENT::GetPrmsCount(), m_currTransLineType, TRANSLINE_PRM::m_Id, TRANSLINE_PRM::m_NormalizedValue, and m_transline_list.

Referenced by GetPropertyInDialog().

◆ GetRedoCommandCount()

virtual int EDA_BASE_FRAME::GetRedoCommandCount ( ) const
inlinevirtualinherited

◆ GetSettingsManager()

◆ GetSeverity()

virtual SEVERITY EDA_BASE_FRAME::GetSeverity ( int  aErrorCode) const
inlinevirtualinherited

Reimplemented in PCB_BASE_FRAME.

Definition at line 130 of file eda_base_frame.h.

References RPT_SEVERITY_UNDEFINED.

Referenced by RC_TREE_MODEL::GetValue().

◆ GetToolCanvas()

wxWindow* PCB_CALCULATOR_FRAME::GetToolCanvas ( ) const
inlineoverridevirtual

Canvas access.

Implements TOOLS_HOLDER.

Definition at line 361 of file pcb_calculator_frame.h.

362  {
363  return nullptr;
364  }

◆ GetToolManager()

TOOL_MANAGER* TOOLS_HOLDER::GetToolManager ( ) const
inlineinherited

Return the MVC controller.

Definition at line 55 of file tools_holder.h.

55 { return m_toolManager; }
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:157

References TOOLS_HOLDER::m_toolManager.

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), BOARD_COMMIT::BOARD_COMMIT(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), TOOLS_HOLDER::CommonSettingsChanged(), DIALOG_FOOTPRINT_CHECKER::deleteAllMarkers(), DIALOG_ERC::deleteAllMarkers(), DIALOG_DRC::deleteAllMarkers(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), PL_DRAW_PANEL_GAL::DisplayWorksheet(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), DIALOG_CLEANUP_GRAPHICS::doCleanup(), SIM_PLOT_FRAME::doCloseWindow(), DIALOG_GLOBAL_DELETION::doGlobalDeletions(), SCH_FIELD::DoHypertextMenu(), DRAWING_TOOL::DrawVia(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), GERBVIEW_FRAME::GERBVIEW_FRAME(), FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_NAVIGATE_TOOL::HypertextCommand(), ROUTER_TOOL::InlineBreakTrack(), KICAD_MANAGER_FRAME::InstallPreferences(), PL_EDITOR_FRAME::InstallPreferences(), FOOTPRINT_EDIT_FRAME::InstallPreferences(), SYMBOL_EDIT_FRAME::InstallPreferences(), GERBVIEW_FRAME::InstallPreferences(), PCB_EDIT_FRAME::InstallPreferences(), SCH_EDIT_FRAME::InstallPreferences(), SYMBOL_EDIT_FRAME::LoadPart(), PCB_EDIT_FRAME::LoadProjectSettings(), FOOTPRINT_EDIT_FRAME::LoadSettings(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_DRC::OnActivateDlg(), DIALOG_FOOTPRINT_CHECKER::OnCancelClick(), DIALOG_DRC::OnCancelClick(), DIALOG_INSPECTOR::onCellClicked(), DIALOG_ERC::OnCloseErcDialog(), SYMBOL_TREE_PANE::onComponentSelected(), DIALOG_FOOTPRINT_CHECKER::OnDeleteOneClick(), DIALOG_DRC::OnDeleteOneClick(), DIALOG_ERC::OnERCItemSelected(), DIALOG_CONSTRAINTS_REPORTER::OnErrorLinkClicked(), DIALOG_INSPECTION_REPORTER::OnErrorLinkClicked(), KICAD_MANAGER_FRAME::OnIdle(), FOOTPRINTS_LISTBOX::OnLeftDClick(), APPEARANCE_CONTROLS::onNetclassContextMenu(), APPEARANCE_CONTROLS::onNetContextMenu(), SIM_PLOT_FRAME::onProbe(), DIALOG_PLOT::onRunDRC(), DIALOG_DRC::OnRunDRCClick(), HIERARCHY_NAVIG_DLG::onSelectSheetPath(), SCH_EDIT_FRAME::onSize(), DIALOG_FIELDS_EDITOR_GLOBAL::OnTableCellClick(), SIM_PLOT_FRAME::onTune(), PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER(), DIALOG_PLOT::Plot(), TOOLS_HOLDER::PopTool(), SCH_EDIT_FRAME::PutDataInPreviousState(), PL_EDITOR_FRAME::RollbackFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_EDIT_FRAME::SaveSettings(), EDA_3D_VIEWER::SaveSettings(), DIALOG_FIND::search(), CVPCB_MAINFRAME::setupEventHandlers(), APPEARANCE_CONTROLS::showNetclass(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow(), DIALOG_3D_VIEW_OPTIONS::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataToWindow(), DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::TransferDataToWindow(), DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::TransferDataToWindow(), EDA_DRAW_FRAME::UpdateMsgPanel(), NET_GRID_TABLE::updateNetVisibility(), DIALOG_NETLIST::~DIALOG_NETLIST(), and DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB().

◆ GetType()

HOLDER_TYPE KIWAY_HOLDER::GetType ( ) const
inlineinherited

Definition at line 49 of file kiway_holder.h.

49 { return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:79

References KIWAY_HOLDER::m_type.

Referenced by DIALOG_SHIM::DIALOG_SHIM().

◆ GetUndoCommandCount()

virtual int EDA_BASE_FRAME::GetUndoCommandCount ( ) const
inlinevirtualinherited

◆ GetUserUnits()

EDA_UNITS EDA_BASE_FRAME::GetUserUnits ( ) const
inlineinherited

Return the user units currently in use.

Definition at line 114 of file eda_base_frame.h.

115  {
116  return m_userUnits;
117  }
EDA_UNITS m_userUnits
Map containing the UI update handlers registered with wx for each action.

References EDA_BASE_FRAME::m_userUnits.

Referenced by DIALOG_CONSTRAINTS_REPORTER::AddPage(), PANEL_SETUP_TRACKS_AND_VIAS::AppendDiffPairs(), PANEL_SETUP_TRACKS_AND_VIAS::AppendTrackWidth(), PANEL_SETUP_TRACKS_AND_VIAS::AppendViaSize(), PANEL_SETUP_BOARD_STACKUP::computeBoardThickness(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EDA_DRAW_FRAME::DisplayGridMsg(), GERBER_FILE_IMAGE::DisplayImageInfo(), DIALOG_GROUP_PROPERTIES::DoAddMember(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawBoardCharacteristics(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawSpecificationStackup(), EVT_GRID_CMD_CELL_CHANGED(), PCB_EDIT_FRAME::GenFootprintsReport(), PANEL_FP_EDITOR_DEFAULTS::getGridValue(), PANEL_SETUP_TEXT_AND_GRAPHICS::getGridValue(), BOARD_INSPECTION_TOOL::getItemDescription(), LIB_ARC::GetMsgPanelInfo(), LIB_CIRCLE::GetMsgPanelInfo(), LIB_RECTANGLE::GetMsgPanelInfo(), SCH_PIN::GetMsgPanelInfo(), LIB_POLYLINE::GetMsgPanelInfo(), LIB_TEXT::GetMsgPanelInfo(), PCB_MARKER::GetMsgPanelInfo(), PL_EDITOR_LAYOUT::GetMsgPanelInfo(), LIB_BEZIER::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), DS_DRAW_ITEM_BASE::GetMsgPanelInfo(), PCB_TARGET::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), SCH_BITMAP::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), LIB_FIELD::GetMsgPanelInfo(), LIB_PIN::GetMsgPanelInfo(), TRACK::GetMsgPanelInfo(), FP_TEXT::GetMsgPanelInfo(), DIMENSION_BASE::GetMsgPanelInfo(), PCB_SHAPE::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), ALIGNED_DIMENSION::GetMsgPanelInfo(), VIA::GetMsgPanelInfo(), LEADER::GetMsgPanelInfo(), PAD::GetMsgPanelInfo(), EDA_DRAW_FRAME::GetUnitPair(), GetUserUnits(), RC_TREE_MODEL::GetValue(), BOARD_INSPECTION_TOOL::InspectClearance(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), PANEL_SETUP_BOARD_STACKUP::onThicknessChange(), DIALOG_NET_INSPECTOR::onUnitsChanged(), UNIT_BINDER::onUnitsChanged(), PANEL_PREV_3D::PANEL_PREV_3D(), PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP(), POSITION_RELATIVE_TOOL::PositionRelative(), DRC_TOOL::RunTests(), GERBVIEW_INSPECTION_TOOL::ShowDCodes(), COMMON_TOOLS::ToggleUnits(), PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow(), PANEL_SETUP_CONSTRAINTS::TransferDataToWindow(), UNIT_BINDER::UNIT_BINDER(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), EDITOR_CONDITIONS::unitsFunc(), VIA_SIZE_MENU::update(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), BOARD_NETLIST_UPDATER::updateCopperZoneNets(), GERBVIEW_FRAME::updateDCodeSelectBox(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), GERBVIEW_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), PL_EDITOR_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), and DRC_TOOL::userUnits().

◆ GetWindowSettings()

WINDOW_SETTINGS * EDA_BASE_FRAME::GetWindowSettings ( APP_SETTINGS_BASE aCfg)
virtualinherited

Return a pointer to the window settings for this frame.

By default, points to aCfg->m_Window for top-level frames.

Parameters
aCfgis this frame's config object

Reimplemented in FOOTPRINT_WIZARD_FRAME, SIM_PLOT_FRAME, FOOTPRINT_VIEWER_FRAME, SYMBOL_VIEWER_FRAME, and DISPLAY_FOOTPRINTS_FRAME.

Definition at line 713 of file eda_base_frame.cpp.

714 {
715  return &aCfg->m_Window;
716 }
WINDOW_SETTINGS m_Window
Definition: app_settings.h:181

References APP_SETTINGS_BASE::m_Window.

Referenced by EDA_BASE_FRAME::LoadSettings(), EDA_DRAW_FRAME::LoadSettings(), EDA_BASE_FRAME::SaveSettings(), and EDA_DRAW_FRAME::SaveSettings().

◆ GetWindowSize()

wxSize EDA_BASE_FRAME::GetWindowSize ( )
inherited

Get the undecorated window size that can be used for restoring the window size.

This is needed for GTK, since the normal wxWidgets GetSize() call will return a window size that includes the window decorations added by the window manager.

Returns
the undecorated window size

Definition at line 1125 of file eda_base_frame.cpp.

1126 {
1127 #ifdef __WXGTK__
1128  // GTK includes the window decorations in the normal GetSize call,
1129  // so we have to use a GTK-specific sizing call that returns the
1130  // non-decorated window size.
1131  int width = 0;
1132  int height = 0;
1133  GTKDoGetSize( &width, &height );
1134 
1135  wxSize winSize( width, height );
1136 #else
1137  wxSize winSize = GetSize();
1138 #endif
1139 
1140  return winSize;
1141 }

Referenced by EDA_BASE_FRAME::OnMaximize(), and EDA_BASE_FRAME::SaveWindowSettings().

◆ HandleSystemColorChange()

void EDA_BASE_FRAME::HandleSystemColorChange ( )
virtualinherited

Update the UI in response to a change in the system colors.

Definition at line 1144 of file eda_base_frame.cpp.

1145 {
1146  // Update the icon theme when the system theme changes and update the toolbars
1147  if( GetBitmapStore()->ThemeChanged() )
1148  ThemeChanged();
1149 
1150  // This isn't handled by ThemeChanged()
1151  if( GetMenuBar() )
1152  {
1153  // For icons in menus, icon scaling & hotkeys
1154  ReCreateMenuBar();
1155  GetMenuBar()->Refresh();
1156  }
1157 }
virtual void ThemeChanged()
Process light/dark theme change.
virtual void ReCreateMenuBar()
Recreates the menu bar.
BITMAP_STORE * GetBitmapStore()
Definition: bitmap.cpp:92

References GetBitmapStore(), EDA_BASE_FRAME::ReCreateMenuBar(), and EDA_BASE_FRAME::ThemeChanged().

Referenced by EDA_BASE_FRAME::onSystemColorChange().

◆ HandleUpdateUIEvent()

void EDA_BASE_FRAME::HandleUpdateUIEvent ( wxUpdateUIEvent &  aEvent,
EDA_BASE_FRAME aFrame,
ACTION_CONDITIONS  aCond 
)
staticinherited

Handle events generated when the UI is trying to figure out the current state of the UI controls related to TOOL_ACTIONS (e.g.

enabled, checked, etc.).

Parameters
aEventis the wxUpdateUIEvent to be processed.
aFrameis the frame to get the selection from
aCondare the #UI SELECTION_CONDITIONS used

Definition at line 350 of file eda_base_frame.cpp.

352 {
353  bool checkRes = false;
354  bool enableRes = true;
355  bool showRes = true;
356  SELECTION& selection = aFrame->GetCurrentSelection();
357 
358  try
359  {
360  checkRes = aCond.checkCondition( selection );
361  enableRes = aCond.enableCondition( selection );
362  showRes = aCond.showCondition( selection );
363  }
364  catch( std::exception& )
365  {
366  // Something broke with the conditions, just skip the event.
367  aEvent.Skip();
368  return;
369  }
370 
371  aEvent.Enable( enableRes );
372  aEvent.Show( showRes );
373 
374  // wxWidgets 3.1.5+ includes a field in the event that says if the event supports being
375  // checked, since wxMenuItems don't want to be checked unless they actually are checkable
376 #if wxCHECK_VERSION( 3, 1, 5 )
377  if( aEvent.IsCheckable() )
378  aEvent.Check( checkRes );
379 #else
380  bool canCheck = true;
381 
382  // wxMenuItems don't want to be checked unless they actually are checkable, so we have to check to
383  // see if they can be and can't just universally apply a check in this event.
384  if( auto menu = dynamic_cast<wxMenu*>( aEvent.GetEventObject() ) )
385  canCheck = menu->FindItem( aEvent.GetId() )->IsCheckable();
386 
387  if( canCheck )
388  aEvent.Check( checkRes );
389 #endif
390 }
SELECTION_CONDITION showCondition
Returns true if the UI control should be shown.
SELECTION_CONDITION enableCondition
Returns true if the UI control should be enabled.
SELECTION_CONDITION checkCondition
Returns true if the UI control should be checked.
virtual SELECTION & GetCurrentSelection()
Get the current selection from the canvas area.
Definition: tools_holder.h:102

References ACTION_CONDITIONS::checkCondition, ACTION_CONDITIONS::enableCondition, TOOLS_HOLDER::GetCurrentSelection(), and ACTION_CONDITIONS::showCondition.

Referenced by EDA_BASE_FRAME::RegisterUIUpdateHandler().

◆ help_name()

wxString EDA_BASE_FRAME::help_name ( )
virtualinherited

Reimplemented in KICAD_MANAGER_FRAME.

Definition at line 732 of file eda_base_frame.cpp.

733 {
734  return Kiface().GetHelpFileName();
735 }
const wxString & GetHelpFileName() const
Return just the basename portion of the current help file.
Definition: kiface_i.h:109
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.

References KIFACE_I::GetHelpFileName(), and Kiface().

Referenced by COMMON_CONTROL::ShowHelp().

◆ ImportHotkeyConfigFromFile()

void EDA_BASE_FRAME::ImportHotkeyConfigFromFile ( std::map< std::string, TOOL_ACTION * >  aActionMap,
const wxString &  aDefaultShortname 
)
inherited

Prompt the user for a hotkey file to read, and read it.

Parameters
aActionMapcurrent hotkey map (over which the imported hotkeys will be applied).
aDefaultShortnamea default short name (extension not needed) like Eeschema, KiCad...

◆ initColorCodePanel()

◆ initESeriesPanel()

void PCB_CALCULATOR_FRAME::initESeriesPanel ( )
private

Definition at line 394 of file eserie.cpp.

395 {
396  wxString msg;
397 
398  // show markdown formula explanation in lower help panel
399  ConvertMarkdown2Html( wxGetTranslation( eseries_help ), msg );
400  m_panelESeriesHelp->SetPage( msg );
401 }
void ConvertMarkdown2Html(const wxString &aMarkdownInput, wxString &aHtmlOutput)
wxString eseries_help
Definition: eserie.cpp:39

References ConvertMarkdown2Html(), eseries_help, and PCB_CALCULATOR_FRAME_BASE::m_panelESeriesHelp.

Referenced by PCB_CALCULATOR_FRAME().

◆ initExitKey()

void EDA_BASE_FRAME::initExitKey ( )
protectedinherited

Sets the common key-pair for exiting the application (Ctrl-Q) and ties it to the wxID_EXIT event id.

This is useful in sub-applications to pass the event up to a non-owning window.

Definition at line 1035 of file eda_base_frame.cpp.

1036 {
1037  wxAcceleratorEntry entries[1];
1038  entries[0].Set( wxACCEL_CTRL, int( 'Q' ), wxID_EXIT );
1039  wxAcceleratorTable accel( 1, entries );
1040  SetAcceleratorTable( accel );
1041 }

◆ initTrackWidthPanel()

void PCB_CALCULATOR_FRAME::initTrackWidthPanel ( )
private

Panel-specific initializers.

Definition at line 420 of file tracks_width_versus_current.cpp.

421 {
422  wxString msg;
423 
424  // Disable calculations while we initialise.
425  m_TWNested = true;
426 
427  // Read parameter values.
428  auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() );
429 
430  m_TrackCurrentValue->SetValue( cfg->m_TrackWidth.current );
431  m_TrackDeltaTValue->SetValue( cfg->m_TrackWidth.delta_tc );
432  m_TrackLengthValue->SetValue( cfg->m_TrackWidth.track_len );
433  m_TW_CuLength_choiceUnit->SetSelection( cfg->m_TrackWidth.track_len_units );
434 #if 0 // the IPC formula is valid for copper traces, so we do not currently adjust the resistivity
435  m_TWResistivity->SetValue( cfg->m_TrackWidth.resistivity );
436 #else
438 #endif
439  m_ExtTrackWidthValue->SetValue( cfg->m_TrackWidth.ext_track_width );
440  m_TW_ExtTrackWidth_choiceUnit->SetSelection( cfg->m_TrackWidth.ext_track_width_units );
441  m_ExtTrackThicknessValue->SetValue( cfg->m_TrackWidth.ext_track_thickness );
442  m_ExtTrackThicknessUnit->SetSelection( cfg->m_TrackWidth.ext_track_thickness_units );
443  m_IntTrackWidthValue->SetValue( cfg->m_TrackWidth.int_track_width );
444  m_TW_IntTrackWidth_choiceUnit->SetSelection( cfg->m_TrackWidth.int_track_width_units );
445  m_IntTrackThicknessValue->SetValue( cfg->m_TrackWidth.int_track_thickness );
446  m_IntTrackThicknessUnit->SetSelection( cfg->m_TrackWidth.int_track_thickness_units );
447 
448  if( tracks_width_versus_current_formula.StartsWith( "<!" ) )
450  else
451  {
452  wxString html_txt;
453  ConvertMarkdown2Html( wxGetTranslation( tracks_width_versus_current_formula ), html_txt );
454  m_htmlWinFormulas->SetPage( html_txt );
455  }
456 
457  // Make sure the correct master mode is displayed.
459 
460  // Enable calculations and perform the initial one.
461  m_TWNested = false;
462  wxCommandEvent dummy;
464 }
void OnTWParametersChanged(wxCommandEvent &event) override
Function OnTWParametersChanged Called when the user changes the general parameters (i....
UNIT_SELECTOR_LEN * m_TW_ExtTrackWidth_choiceUnit
UNIT_SELECTOR_LEN * m_TW_IntTrackWidth_choiceUnit
void ConvertMarkdown2Html(const wxString &aMarkdownInput, wxString &aHtmlOutput)
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
Definition: sch_symbol.cpp:69
void TWUpdateModeDisplay()
Function TWUpdateModeDisplay Updates the fields to show whether the maximum current,...
const double copper_resistivity
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
wxString tracks_width_versus_current_formula
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
UNIT_SELECTOR_THICKNESS * m_IntTrackThicknessUnit
UNIT_SELECTOR_LEN * m_TW_CuLength_choiceUnit
UNIT_SELECTOR_THICKNESS * m_ExtTrackThicknessUnit

References ConvertMarkdown2Html(), copper_resistivity, dummy(), Format(), Kiface(), PCB_CALCULATOR_FRAME_BASE::m_ExtTrackThicknessUnit, PCB_CALCULATOR_FRAME_BASE::m_ExtTrackThicknessValue, PCB_CALCULATOR_FRAME_BASE::m_ExtTrackWidthValue, PCB_CALCULATOR_FRAME_BASE::m_htmlWinFormulas, PCB_CALCULATOR_FRAME_BASE::m_IntTrackThicknessUnit, PCB_CALCULATOR_FRAME_BASE::m_IntTrackThicknessValue, PCB_CALCULATOR_FRAME_BASE::m_IntTrackWidthValue, PCB_CALCULATOR_FRAME_BASE::m_TrackCurrentValue, PCB_CALCULATOR_FRAME_BASE::m_TrackDeltaTValue, PCB_CALCULATOR_FRAME_BASE::m_TrackLengthValue, PCB_CALCULATOR_FRAME_BASE::m_TW_CuLength_choiceUnit, PCB_CALCULATOR_FRAME_BASE::m_TW_ExtTrackWidth_choiceUnit, PCB_CALCULATOR_FRAME_BASE::m_TW_IntTrackWidth_choiceUnit, m_TWNested, PCB_CALCULATOR_FRAME_BASE::m_TWResistivity, OnTWParametersChanged(), tracks_width_versus_current_formula, and TWUpdateModeDisplay().

Referenced by PCB_CALCULATOR_FRAME().

◆ initViaSizePanel()

void PCB_CALCULATOR_FRAME::initViaSizePanel ( )
private

Definition at line 127 of file via.cpp.

128 {
129  auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() );
130 
131  m_textCtrlHoleDia->SetValue( cfg->m_ViaSize.hole_diameter );
132  m_choiceHoleDia->SetSelection( cfg->m_ViaSize.hole_diameter_units );
133 
134  m_textCtrlPlatingThickness->SetValue( cfg->m_ViaSize.thickness );
135  m_choicePlatingThickness->SetSelection( cfg->m_ViaSize.thickness_units );
136 
137  m_textCtrlViaLength->SetValue( cfg->m_ViaSize.length );
138  m_choiceViaLength->SetSelection( cfg->m_ViaSize.length_units );
139 
140  m_textCtrlViaPadDia->SetValue( cfg->m_ViaSize.pad_diameter );
141  m_choiceViaPadDia->SetSelection( cfg->m_ViaSize.pad_diameter_units );
142 
143  m_textCtrlClearanceDia->SetValue( cfg->m_ViaSize.clearance_diameter );
144  m_choiceClearanceDia->SetSelection( cfg->m_ViaSize.clearance_diameter_units );
145 
146  m_textCtrlImpedance->SetValue( cfg->m_ViaSize.characteristic_impedance );
147  m_choiceImpedance->SetSelection( cfg->m_ViaSize.characteristic_impedance_units );
148 
149  m_textCtrlAppliedCurrent->SetValue( cfg->m_ViaSize.applied_current );
150  m_textCtrlPlatingResistivity->SetValue( cfg->m_ViaSize.plating_resistivity );
151  m_textCtrlPlatingPermittivity->SetValue( cfg->m_ViaSize.permittivity );
152  m_textCtrlTemperatureDiff->SetValue( cfg->m_ViaSize.temp_rise );
153  m_textCtrlRiseTime->SetValue( cfg->m_ViaSize.pulse_rise_time );
154 }
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
UNIT_SELECTOR_LEN * m_choiceClearanceDia
UNIT_SELECTOR_LEN * m_choicePlatingThickness
UNIT_SELECTOR_RESISTOR * m_choiceImpedance

References Kiface(), PCB_CALCULATOR_FRAME_BASE::m_choiceClearanceDia, PCB_CALCULATOR_FRAME_BASE::m_choiceHoleDia, PCB_CALCULATOR_FRAME_BASE::m_choiceImpedance, PCB_CALCULATOR_FRAME_BASE::m_choicePlatingThickness, PCB_CALCULATOR_FRAME_BASE::m_choiceViaLength, PCB_CALCULATOR_FRAME_BASE::m_choiceViaPadDia, PCB_CALCULATOR_FRAME_BASE::m_textCtrlAppliedCurrent, PCB_CALCULATOR_FRAME_BASE::m_textCtrlClearanceDia, PCB_CALCULATOR_FRAME_BASE::m_textCtrlHoleDia, PCB_CALCULATOR_FRAME_BASE::m_textCtrlImpedance, PCB_CALCULATOR_FRAME_BASE::m_textCtrlPlatingPermittivity, PCB_CALCULATOR_FRAME_BASE::m_textCtrlPlatingResistivity, PCB_CALCULATOR_FRAME_BASE::m_textCtrlPlatingThickness, PCB_CALCULATOR_FRAME_BASE::m_textCtrlRiseTime, PCB_CALCULATOR_FRAME_BASE::m_textCtrlTemperatureDiff, PCB_CALCULATOR_FRAME_BASE::m_textCtrlViaLength, and PCB_CALCULATOR_FRAME_BASE::m_textCtrlViaPadDia.

Referenced by PCB_CALCULATOR_FRAME().

◆ InstallPreferences()

virtual void EDA_BASE_FRAME::InstallPreferences ( PAGED_DIALOG ,
PANEL_HOTKEYS_EDITOR  
)
inlinevirtualinherited

Allow a frame to load its preference panels (if any) into the preferences dialog.

Parameters
aParenta paged dialog into which the preference panels should be installed.

Reimplemented in SCH_EDIT_FRAME, PCB_EDIT_FRAME, GERBVIEW_FRAME, SYMBOL_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, PL_EDITOR_FRAME, and KICAD_MANAGER_FRAME.

Definition at line 279 of file eda_base_frame.h.

279 { }

Referenced by EDA_BASE_FRAME::OnPreferences().

◆ isAutoSaveRequired()

virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Return the auto save status of the application.

Override this function if your derived frame supports automatic file saving.

Reimplemented in SCH_EDIT_FRAME, and PCB_EDIT_FRAME.

Definition at line 598 of file eda_base_frame.h.

598 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ IsContentModified()

bool EDA_BASE_FRAME::IsContentModified ( )
virtualinherited

Get if the contents of the frame have been modified since the last save.

Returns
true if the contents of the frame have not been saved

Reimplemented in SCH_EDIT_FRAME, CVPCB_MAINFRAME, PL_EDITOR_FRAME, PCB_EDIT_FRAME, SYMBOL_EDIT_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 1028 of file eda_base_frame.cpp.

1029 {
1030  // This function should be overridden in child classes
1031  return false;
1032 }

Referenced by EDITOR_CONDITIONS::contentModifiedFunc().

◆ IsCurrentTool()

bool TOOLS_HOLDER::IsCurrentTool ( const TOOL_ACTION aAction) const
inherited

Definition at line 108 of file tools_holder.cpp.

109 {
110  if( m_toolStack.empty() )
111  return &aAction == &ACTIONS::selectionTool;
112  else
113  return m_toolStack.back() == aAction.GetName();
114 }
std::vector< std::string > m_toolStack
Definition: tools_holder.h:163
static TOOL_ACTION selectionTool
Definition: actions.h:156
const std::string & GetName() const
Return name of the action.
Definition: tool_action.h:83

References TOOL_ACTION::GetName(), TOOLS_HOLDER::m_toolStack, and ACTIONS::selectionTool.

Referenced by BOARD_INSPECTION_TOOL::HighlightNetTool(), SCH_EDIT_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), and EDITOR_CONDITIONS::toolFunc().

◆ IsDismissed()

bool KIWAY_PLAYER::IsDismissed ( )
inherited
Returns
false only if both the frame is acting in modal mode and it has not been dismissed yet with DismissModal(). True if the dialog is not modal or if it is modal and has been dismissed.

Definition at line 155 of file kiway_player.cpp.

156 {
157  return !m_modal_loop;
158 }
WX_EVENT_LOOP * m_modal_loop
< Points to nested event_loop. NULL means not modal and dismissed.
Definition: kiway_player.h:196

References KIWAY_PLAYER::m_modal_loop.

Referenced by SYMBOL_VIEWER_FRAME::doCloseWindow(), FOOTPRINT_VIEWER_FRAME::doCloseWindow(), and FOOTPRINT_WIZARD_FRAME::doCloseWindow().

◆ IsModal()

bool KIWAY_PLAYER::IsModal ( ) const
inlineoverridevirtualinherited

Return true if the frame is shown in our modal mode and false if the frame is shown as an usual frame.

In modal mode, the caller that created the frame is responsible to Destroy() this frame after closing.

Reimplemented from EDA_BASE_FRAME.

Definition at line 170 of file kiway_player.h.

170 { return m_modal; }

References KIWAY_PLAYER::m_modal.

Referenced by FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), SYMBOL_VIEWER_FRAME::doCloseWindow(), FOOTPRINT_VIEWER_FRAME::doCloseWindow(), FOOTPRINT_WIZARD_FRAME::doCloseWindow(), FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME(), KIWAY_PLAYER::ShowModal(), and SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME().

◆ IsPrmSelected()

bool PCB_CALCULATOR_FRAME::IsPrmSelected ( enum PRMS_ID  aPrmId) const

Function IsPrmSelected.

Returns
true if the param aPrmId is selected Has meaning only for params that have a radio button

Definition at line 241 of file params_read_write.cpp.

242 {
243  switch( aPrmId )
244  {
245  default:
246  wxMessageBox( wxT( "IsPrmSelected() error" ) );
247  break;
248 
249  case PHYS_WIDTH_PRM:
250  case PHYS_DIAM_IN_PRM:
251  return m_radioBtnPrm1->GetValue();
252  break;
253 
254  case PHYS_S_PRM:
255  case PHYS_DIAM_OUT_PRM:
256  return m_radioBtnPrm2->GetValue();
257  break;
258  }
259  return false;
260 }

References PCB_CALCULATOR_FRAME_BASE::m_radioBtnPrm1, PCB_CALCULATOR_FRAME_BASE::m_radioBtnPrm2, PHYS_DIAM_IN_PRM, PHYS_DIAM_OUT_PRM, PHYS_S_PRM, and PHYS_WIDTH_PRM.

Referenced by IsSelectedInDialog().

◆ IsType()

bool EDA_BASE_FRAME::IsType ( FRAME_T  aType) const
inlineinherited

Definition at line 192 of file eda_base_frame.h.

192 { return m_ident == aType; }

References EDA_BASE_FRAME::m_ident.

Referenced by SYMBOL_EDITOR_CONTROL::AddLibrary(), PCB_CONTROL::AddLibrary(), SYMBOL_EDITOR_CONTROL::AddSymbol(), ALIGN_DISTRIBUTE_TOOL::AlignBottom(), ALIGN_DISTRIBUTE_TOOL::AlignCenterX(), ALIGN_DISTRIBUTE_TOOL::AlignCenterY(), ALIGN_DISTRIBUTE_TOOL::AlignTop(), BOARD_COMMIT::BOARD_COMMIT(), EDA_3D_VIEWER::CreateMenuBar(), SYMBOL_EDITOR_CONTROL::CutCopyDelete(), DIALOG_GRID_SETTINGS::DIALOG_GRID_SETTINGS(), DIALOG_MOVE_EXACT::DIALOG_MOVE_EXACT(), DIALOG_PUSH_PAD_PROPERTIES::DIALOG_PUSH_PAD_PROPERTIES(), DIALOG_RULE_AREA_PROPERTIES::DIALOG_RULE_AREA_PROPERTIES(), KIGFX::SCH_VIEW::DisplaySheet(), ALIGN_DISTRIBUTE_TOOL::DistributeHorizontally(), ALIGN_DISTRIBUTE_TOOL::DistributeVertically(), ALIGN_DISTRIBUTE_TOOL::doAlignLeft(), ALIGN_DISTRIBUTE_TOOL::doAlignRight(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeCentersVertically(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsHorizontally(), ALIGN_DISTRIBUTE_TOOL::doDistributeGapsVertically(), COMMON_TOOLS::doZoomFit(), SYMBOL_EDITOR_CONTROL::DuplicateSymbol(), SYMBOL_EDITOR_CONTROL::EditSymbol(), SYMBOL_EDITOR_CONTROL::ExportSymbol(), FOOTPRINT::GetMsgPanelInfo(), ALIGN_DISTRIBUTE_TOOL::GetSelections(), CONVERT_TOOL::Init(), SYMBOL_EDITOR_CONTROL::Init(), DIALOG_EDIT_ONE_FIELD::init(), PCB_SELECTION_TOOL::Init(), DIALOG_PAD_PROPERTIES::initValues(), CONVERT_TOOL::LinesToPoly(), PCB_SELECTION_TOOL::Main(), APPEARANCE_CONTROLS::OnColorSwatchChanged(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), APPEARANCE_CONTROLS::onObjectVisibilityChanged(), PCB_CONTROL::Paste(), SYMBOL_EDITOR_CONTROL::PinLibrary(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), SYMBOL_EDITOR_CONTROL::Revert(), SYMBOL_EDITOR_CONTROL::Save(), APPEARANCE_CONTROLS::setVisibleObjects(), EE_INSPECTION_TOOL::ShowDatasheet(), EE_INSPECTION_TOOL::ShowERCDialog(), SYMBOL_EDITOR_CONTROL::ToggleSymbolTree(), SYMBOL_EDITOR_CONTROL::UnpinLibrary(), and DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample().

◆ IsWritable()

bool EDA_BASE_FRAME::IsWritable ( const wxFileName &  aFileName)
inherited

Checks if aFileName can be written.

The function performs a number of tests on aFileName to verify that it can be saved. If aFileName defines a path with no file name, them the path is tested for user write permission. If aFileName defines a file name that does not exist in the path, the path is tested for user write permission. If aFileName defines a file that already exits, the file name is tested for user write permissions.

Note
The file name path must be set or an assertion will be raised on debug builds and return false on release builds.
Parameters
aFileNameThe full path and/or file name of the file to test.
Returns
False if aFileName cannot be written.

Definition at line 937 of file eda_base_frame.cpp.

938 {
939  wxString msg;
940  wxFileName fn = aFileName;
941 
942  // Check for absence of a file path with a file name. Unfortunately KiCad
943  // uses paths relative to the current project path without the ./ part which
944  // confuses wxFileName. Making the file name path absolute may be less than
945  // elegant but it solves the problem.
946  if( fn.GetPath().IsEmpty() && fn.HasName() )
947  fn.MakeAbsolute();
948 
949  wxCHECK_MSG( fn.IsOk(), false,
950  wxT( "File name object is invalid. Bad programmer!" ) );
951  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
952  wxT( "File name object path <" ) + fn.GetFullPath() +
953  wxT( "> is not set. Bad programmer!" ) );
954 
955  if( fn.IsDir() && !fn.IsDirWritable() )
956  {
957  msg.Printf( _( "You do not have write permissions to folder \"%s\"." ),
958  fn.GetPath() );
959  }
960  else if( !fn.FileExists() && !fn.IsDirWritable() )
961  {
962  msg.Printf( _( "You do not have write permissions to save file \"%s\" to folder \"%s\"." ),
963  fn.GetFullName(), fn.GetPath() );
964  }
965  else if( fn.FileExists() && !fn.IsFileWritable() )
966  {
967  msg.Printf( _( "You do not have write permissions to save file \"%s\"." ),
968  fn.GetFullPath() );
969  }
970 
971  if( !msg.IsEmpty() )
972  {
973  wxMessageBox( msg );
974  return false;
975  }
976 
977  return true;
978 }
#define _(s)
Definition: 3d_actions.cpp:33

References _.

Referenced by SCH_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::SaveEEFile(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), and SCH_EDIT_FRAME::SaveProjectSettings().

◆ Kiway()

KIWAY& KIWAY_HOLDER::Kiway ( ) const
inlineinherited

Return a reference to the KIWAY that this object has an opportunity to participate in.

A KIWAY_HOLDER is not necessarily a KIWAY_PLAYER.

Definition at line 56 of file kiway_holder.h.

57  {
58  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
59  return *m_kiway;
60  }
KIWAY * m_kiway
Definition: kiway_holder.h:78

References KIWAY_HOLDER::m_kiway.

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), CVPCB_MAINFRAME::BuildLibrariesListBox(), SYMBOL_EDIT_FRAME::canCloseWindow(), SCH_EDIT_FRAME::canCloseWindow(), KICAD_MANAGER_FRAME::CloseProject(), COMMON_CONTROL::ConfigurePaths(), DIALOG_CHOOSE_FOOTPRINT::ConstructRightPanel(), DIALOG_CHOOSE_SYMBOL::ConstructRightPanel(), PCB_BASE_FRAME::CreateAndShow3D_Frame(), FOOTPRINT_EDITOR_CONTROL::CreateFootprint(), CVPCB_MAINFRAME::CVPCB_MAINFRAME(), DIALOG_RESCUE_EACH::DIALOG_RESCUE_EACH(), DIALOG_SHIM::DIALOG_SHIM(), CVPCB_MAINFRAME::DisplayStatus(), SCH_EDIT_FRAME::doCloseWindow(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), BACK_ANNOTATE::FetchNetlistFromPCB(), DISPLAY_FOOTPRINTS_FRAME::GetFootprint(), KICAD_MANAGER_FRAME::ImportNonKiCadProject(), KICAD_MANAGER_FRAME::language_change(), KIWAY_PLAYER::language_change(), DIALOG_CHANGE_SYMBOLS::launchMatchIdSymbolBrowser(), DIALOG_CHANGE_SYMBOLS::launchNewIdSymbolBrowser(), LIB_TREE_MODEL_ADAPTER::LIB_TREE_MODEL_ADAPTER(), CVPCB_MAINFRAME::LoadFootprintFiles(), TEXT_BUTTON_SYMBOL_CHOOSER::OnButtonClick(), TEXT_BUTTON_FP_CHOOSER::OnButtonClick(), PL_EDITOR_FRAME::OnExit(), SCH_EDIT_FRAME::OnExit(), FOOTPRINT_EDIT_FRAME::OnExitKiCad(), FOOTPRINT_VIEWER_FRAME::OnExitKiCad(), SYMBOL_EDIT_FRAME::OnExitKiCad(), SAVE_AS_TRAVERSER::OnFile(), DIALOG_CHOOSE_SYMBOL::OnInitDialog(), SCH_EDIT_FRAME::OnOpenCvpcb(), SCH_EDIT_FRAME::OnOpenPcbnew(), EDA_BASE_FRAME::OnPreferences(), DIALOG_SYMBOL_REMAP::OnRemapSymbols(), DIALOG_EDIT_ONE_FIELD::OnTextValueSelectButtonClick(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), FOOTPRINT_EDIT_FRAME::OnUpdateLoadFootprintFromBoard(), SCH_EDIT_FRAME::OnUpdatePCB(), FOOTPRINT_EDIT_FRAME::OnUpdateSaveFootprintToBoard(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), SCH_BASE_FRAME::PickSymbolFromLibBrowser(), KIWAY_HOLDER::Prj(), SCH_EDIT_TOOL::Properties(), BACK_ANNOTATE::PushNewLinksToPCB(), CVPCB_MAINFRAME::ReadNetListAndFpFiles(), FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList(), SCH_EDITOR_CONTROL::rescueProject(), EE_INSPECTION_TOOL::RunSimulation(), SYMBOL_EDIT_FRAME::Save(), CVPCB_MAINFRAME::SaveFootprintAssociation(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), LIB_TREE_MODEL_ADAPTER::SavePinnedItems(), SCH_EDIT_FRAME::SendCrossProbeClearHighlight(), SCH_EDIT_FRAME::SendCrossProbeNetName(), PCB_EDIT_FRAME::SendCrossProbeNetName(), CVPCB_MAINFRAME::SendMessageToEESCHEMA(), PCB_EDIT_FRAME::SendMessageToEESCHEMA(), SCH_EDIT_FRAME::SendMessageToPCBNEW(), SCH_EDIT_FRAME::sendNetlistToCvpcb(), SCH_EDIT_FRAME::SetCrossProbeConnection(), SYMBOL_EDIT_FRAME::SetCurPart(), CVPCB_CONTROL::ShowFootprintViewer(), COMMON_CONTROL::ShowLibraryTable(), COMMON_CONTROL::ShowPlayer(), KICAD_MANAGER_CONTROL::ShowPlayer(), SCH_EDIT_FRAME::ShowSchematicSetupDialog(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), BOARD_EDITOR_CONTROL::UpdateSchematicFromPCB(), and DIALOG_EXCHANGE_FOOTPRINTS::ViewAndSelectFootprint().

◆ kiway_express()

void KIWAY_PLAYER::kiway_express ( KIWAY_EXPRESS aEvent)
protectedinherited

event handler, routes to derivative specific virtual KiwayMailIn()

Definition at line 176 of file kiway_player.cpp.

177 {
178  // logging support
179  KiwayMailIn( aEvent ); // call the virtual, override in derived.
180 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Receive KIWAY_EXPRESS messages from other players.

References KIWAY_PLAYER::KiwayMailIn().

◆ KiwayMailIn()

void KIWAY_PLAYER::KiwayMailIn ( KIWAY_EXPRESS aEvent)
virtualinherited

Receive KIWAY_EXPRESS messages from other players.

Override it in derived classes.

Reimplemented in SYMBOL_EDIT_FRAME, FOOTPRINT_EDIT_FRAME, SCH_EDIT_FRAME, PCB_EDIT_FRAME, and CVPCB_MAINFRAME.

Definition at line 70 of file kiway_player.cpp.

71 {
72  // override this in derived classes.
73 }

Referenced by KIWAY_PLAYER::kiway_express(), and KIWAY::ProcessEvent().

◆ language_change()

void KIWAY_PLAYER::language_change ( wxCommandEvent &  event)
protectedinherited

An event handler called on a language menu selection.

Definition at line 183 of file kiway_player.cpp.

184 {
185  int id = event.GetId();
186 
187  // tell all the KIWAY_PLAYERs about the language change.
188  Kiway().SetLanguage( id );
189 }
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:56
virtual void SetLanguage(int aLanguage)
Change the language and then calls ShowChangedLanguage() on all #KIWAY_PLAYERs.
Definition: kiway.cpp:470

References KIWAY_HOLDER::Kiway(), and KIWAY::SetLanguage().

◆ LoadSettings()

void PCB_CALCULATOR_FRAME::LoadSettings ( APP_SETTINGS_BASE aCfg)
overrideprivatevirtual

Load common frame parameters from a configuration file.

Don't forget to call the base method or your frames won't remember their positions and sizes.

Reimplemented from EDA_BASE_FRAME.

Definition at line 281 of file pcb_calculator_frame.cpp.

282 {
283  if( aCfg == NULL )
284  return;
285 
287 
288  PCB_CALCULATOR_SETTINGS* cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( aCfg );
289 
290  m_currTransLineType = static_cast<TRANSLINE_TYPE_ID>( cfg->m_TransLine.type );
291  m_Notebook->ChangeSelection( cfg->m_LastPage );
292  m_rbToleranceSelection->SetSelection( cfg->m_ColorCodeTolerance );
293  m_AttenuatorsSelection->SetSelection( cfg->m_Attenuators.type );
294  m_BoardClassesUnitsSelector->SetSelection( cfg->m_BoardClassUnits );
295 
296  // Regul panel config:
297  m_RegulR1Value->SetValue( cfg->m_Regulators.r1 );
298  m_RegulR2Value->SetValue( cfg->m_Regulators.r2 );
299  m_RegulVrefValue->SetValue( cfg->m_Regulators.vref );
300  m_RegulVoutValue->SetValue( cfg->m_Regulators.vout );
303  m_choiceRegType->SetSelection( cfg->m_Regulators.type );
304 
305  wxRadioButton* regprms[3] = { m_rbRegulR1, m_rbRegulR2, m_rbRegulVout };
306 
307  if( cfg->m_Regulators.last_param >= 3 )
308  cfg->m_Regulators.last_param = 0;
309 
310  for( int ii = 0; ii < 3; ii++ )
311  regprms[ii]->SetValue( cfg->m_Regulators.last_param == ii );
312 
313  // Electrical panel config
316 
317  for( TRANSLINE_IDENT* transline : m_transline_list )
318  transline->ReadConfig();
319 
320  for( ATTENUATOR* attenuator : m_attenuator_list )
321  attenuator->ReadConfig();
322 }
#define NULL
enum TRANSLINE_TYPE_ID m_currTransLineType
void SetDataFilename(const wxString &aFilename)
Initialize the full filename of the selected pcb_calculator data file force the standard extension of...
UNIT_SELECTOR_LEN * m_BoardClassesUnitsSelector
std::vector< TRANSLINE_IDENT * > m_transline_list
UNIT_SELECTOR_LEN * m_ElectricalSpacingUnitsSelector
virtual void LoadSettings(APP_SETTINGS_BASE *aCfg)
Load common frame parameters from a configuration file.
std::vector< ATTENUATOR * > m_attenuator_list

References PCB_CALCULATOR_SETTINGS::REGULATORS::data_file, PCB_CALCULATOR_SETTINGS::REGULATORS::last_param, EDA_BASE_FRAME::LoadSettings(), m_attenuator_list, PCB_CALCULATOR_SETTINGS::m_Attenuators, PCB_CALCULATOR_FRAME_BASE::m_AttenuatorsSelection, PCB_CALCULATOR_FRAME_BASE::m_BoardClassesUnitsSelector, PCB_CALCULATOR_SETTINGS::m_BoardClassUnits, PCB_CALCULATOR_FRAME_BASE::m_choiceRegType, PCB_CALCULATOR_SETTINGS::m_ColorCodeTolerance, m_currTransLineType, PCB_CALCULATOR_SETTINGS::m_Electrical, PCB_CALCULATOR_FRAME_BASE::m_ElectricalSpacingUnitsSelector, PCB_CALCULATOR_FRAME_BASE::m_ElectricalSpacingVoltage, PCB_CALCULATOR_SETTINGS::m_LastPage, m_lastSelectedRegulatorName, PCB_CALCULATOR_FRAME_BASE::m_Notebook, PCB_CALCULATOR_FRAME_BASE::m_rbRegulR1, PCB_CALCULATOR_FRAME_BASE::m_rbRegulR2, PCB_CALCULATOR_FRAME_BASE::m_rbRegulVout, PCB_CALCULATOR_FRAME_BASE::m_rbToleranceSelection, PCB_CALCULATOR_SETTINGS::m_Regulators, PCB_CALCULATOR_FRAME_BASE::m_RegulR1Value, PCB_CALCULATOR_FRAME_BASE::m_RegulR2Value, PCB_CALCULATOR_FRAME_BASE::m_RegulVoutValue, PCB_CALCULATOR_FRAME_BASE::m_RegulVrefValue, PCB_CALCULATOR_SETTINGS::m_TransLine, m_transline_list, NULL, PCB_CALCULATOR_SETTINGS::REGULATORS::r1, PCB_CALCULATOR_SETTINGS::REGULATORS::r2, PCB_CALCULATOR_SETTINGS::REGULATORS::selected_regulator, SetDataFilename(), PCB_CALCULATOR_SETTINGS::ELECTRICAL::spacing_units, PCB_CALCULATOR_SETTINGS::ELECTRICAL::spacing_voltage, PCB_CALCULATOR_SETTINGS::ATTENUATORS::type, PCB_CALCULATOR_SETTINGS::REGULATORS::type, PCB_CALCULATOR_SETTINGS::TRANSMISSION_LINE::type, PCB_CALCULATOR_SETTINGS::REGULATORS::vout, and PCB_CALCULATOR_SETTINGS::REGULATORS::vref.

Referenced by PCB_CALCULATOR_FRAME().

◆ LoadWindowSettings()

void EDA_BASE_FRAME::LoadWindowSettings ( const WINDOW_SETTINGS aCfg)
inherited

Load window settings from the given settings object.

Normally called by LoadSettings() unless the window in question is a child window that* stores its settings somewhere other than APP_SETTINGS_BASE::m_Window.

Definition at line 613 of file eda_base_frame.cpp.

614 {
615  LoadWindowState( aCfg->state );
616 
617  if( m_hasAutoSave )
618  m_autoSaveInterval = Pgm().GetCommonSettings()->m_System.autosave_interval;
619 
620  m_perspective = aCfg->perspective;
621  m_mruPath = aCfg->mru_path;
622 
623  TOOLS_HOLDER::CommonSettingsChanged( false, false );
624 }
wxString mru_path
Definition: app_settings.h:84
wxString m_mruPath
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
void LoadWindowState(const wxString &aFileName)
wxString m_perspective
wxString perspective
Definition: app_settings.h:85
WINDOW_STATE state
Definition: app_settings.h:83
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Notification event that some of the common (suite-wide) settings have changed.

References TOOLS_HOLDER::CommonSettingsChanged(), EDA_BASE_FRAME::LoadWindowState(), EDA_BASE_FRAME::m_autoSaveInterval, EDA_BASE_FRAME::m_hasAutoSave, EDA_BASE_FRAME::m_mruPath, EDA_BASE_FRAME::m_perspective, WINDOW_SETTINGS::mru_path, WINDOW_SETTINGS::perspective, Pgm(), and WINDOW_SETTINGS::state.

Referenced by EDA_BASE_FRAME::LoadSettings().

◆ LoadWindowState() [1/2]

void EDA_BASE_FRAME::LoadWindowState ( const wxString &  aFileName)
inherited

Definition at line 488 of file eda_base_frame.cpp.

489 {
490  if( !Pgm().GetCommonSettings()->m_Session.remember_open_files )
491  return;
492 
493  const PROJECT_FILE_STATE* state = Prj().GetLocalSettings().GetFileState( aFileName );
494 
495  if( state != nullptr )
496  {
497  LoadWindowState( state->window );
498  }
499 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
void LoadWindowState(const wxString &aFileName)
virtual PROJECT_LOCAL_SETTINGS & GetLocalSettings() const
Definition: project.h:151
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
struct WINDOW_STATE window
const PROJECT_FILE_STATE * GetFileState(const wxString &aFileName)

References PROJECT_LOCAL_SETTINGS::GetFileState(), PROJECT::GetLocalSettings(), Pgm(), KIWAY_HOLDER::Prj(), and PROJECT_FILE_STATE::window.

Referenced by KICAD_MANAGER_FRAME::LoadProject(), PCB_EDIT_FRAME::LoadProjectSettings(), EDA_BASE_FRAME::LoadWindowSettings(), and SCH_EDIT_FRAME::OpenProjectFiles().

◆ LoadWindowState() [2/2]

void EDA_BASE_FRAME::LoadWindowState ( const WINDOW_STATE aState)
virtualinherited

Load frame state info from a configuration file.

Definition at line 502 of file eda_base_frame.cpp.

503 {
504  bool wasDefault = false;
505 
506  m_framePos.x = aState.pos_x;
507  m_framePos.y = aState.pos_y;
508  m_frameSize.x = aState.size_x;
509  m_frameSize.y = aState.size_y;
510 
511  wxLogTrace( traceDisplayLocation, "Config position (%d, %d) with size (%d, %d)",
513 
514  // Ensure minimum size is set if the stored config was zero-initialized
515  if( m_frameSize.x < minSize( m_ident ).x || m_frameSize.y < minSize( m_ident ).y )
516  {
518  wasDefault = true;
519 
520  wxLogTrace( traceDisplayLocation, "Using minimum size (%d, %d)", m_frameSize.x, m_frameSize.y );
521  }
522 
523  wxLogTrace( traceDisplayLocation, "Number of displays: %d", wxDisplay::GetCount() );
524 
525  if( aState.display >= wxDisplay::GetCount() )
526  {
527  wxLogTrace( traceDisplayLocation, "Previous display not found" );
528 
529  // If it isn't attached, use the first display
530  // Warning wxDisplay has 2 ctor variants. the parameter needs a type:
531  const unsigned int index = 0;
532  wxDisplay display( index );
533  wxRect clientSize = display.GetGeometry();
534 
535  m_framePos = wxDefaultPosition;
536 
537  // Ensure the window fits on the display, since the other one could have been larger
538  if( m_frameSize.x > clientSize.width )
539  m_frameSize.x = clientSize.width;
540 
541  if( m_frameSize.y > clientSize.height )
542  m_frameSize.y = clientSize.height;
543  }
544  else
545  {
546  wxPoint upperRight( m_framePos.x + m_frameSize.x, m_framePos.y );
547  wxPoint upperLeft( m_framePos.x, m_framePos.y );
548 
549  wxDisplay display( aState.display );
550  wxRect clientSize = display.GetClientArea();
551 
552 #ifndef _WIN32
553  // The percentage size (represented in decimal) of the region around the screen's border where
554  // an upper corner is not allowed
555  #define SCREEN_BORDER_REGION 0.10
556 #else
557  // Windows uses a very rectangular clearly defined display region, there is no ambigious "screen border region"
558  // GetClientArea already accounts for the taskbar stealing display space
559  #define SCREEN_BORDER_REGION 0
560 #endif
561 
562  int yLimTop = clientSize.y + ( clientSize.height * ( SCREEN_BORDER_REGION ) );
563  int yLimBottom = clientSize.y + ( clientSize.height * ( 1.0 - SCREEN_BORDER_REGION ) );
564  int xLimLeft = clientSize.x + ( clientSize.width * SCREEN_BORDER_REGION );
565  int xLimRight = clientSize.x + ( clientSize.width * ( 1.0 - SCREEN_BORDER_REGION ) );
566 
567  if( upperLeft.x > xLimRight || // Upper left corner too close to right edge of screen
568  upperRight.x < xLimLeft || // Upper right corner too close to left edge of screen
569  upperLeft.y < yLimTop || // Upper corner too close to the bottom of the screen
570  upperLeft.y > yLimBottom )
571  {
572  m_framePos = wxDefaultPosition;
573  wxLogTrace( traceDisplayLocation, "Resetting to default position" );
574  }
575  }
576 
577  // Ensure Window title bar is visible
578 #if defined( __WXOSX__ )
579  // for macOSX, the window must be below system (macOSX) toolbar
580  int Ypos_min = 20;
581 #else
582  int Ypos_min = 0;
583 #endif
584  if( m_framePos.y < Ypos_min )
585  m_framePos.y = Ypos_min;
586 
587  wxLogTrace( traceDisplayLocation, "Final window position (%d, %d) with size (%d, %d)",
589 
590  SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
591 
592  // Center the window if we reset to default
593  if( m_framePos.x == -1 )
594  {
595  wxLogTrace( traceDisplayLocation, "Centering window" );
596  Center();
597  m_framePos = GetPosition();
598  }
599 
600  // Record the frame sizes in an un-maximized state
603 
604  // Maximize if we were maximized before
605  if( aState.maximized || ( wasDefault && m_maximizeByDefault ) )
606  {
607  wxLogTrace( traceDisplayLocation, "Maximizing window" );
608  Maximize();
609  }
610 }
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
wxPoint m_normalFramePos
#define SCREEN_BORDER_REGION
wxSize m_normalFrameSize
static const wxSize defaultSize(FRAME_T aFrameType)
static const wxSize minSize(FRAME_T aFrameType)
unsigned int display
Definition: app_settings.h:75

References PCAD2KICAD::Center, defaultSize(), WINDOW_STATE::display, EDA_BASE_FRAME::m_framePos, EDA_BASE_FRAME::m_frameSize, EDA_BASE_FRAME::m_ident, EDA_BASE_FRAME::m_maximizeByDefault, EDA_BASE_FRAME::m_normalFramePos, EDA_BASE_FRAME::m_normalFrameSize, WINDOW_STATE::maximized, minSize(), WINDOW_STATE::pos_x, WINDOW_STATE::pos_y, SCREEN_BORDER_REGION, WINDOW_STATE::size_x, WINDOW_STATE::size_y, and traceDisplayLocation.

◆ NonUserClose()

bool EDA_BASE_FRAME::NonUserClose ( bool  aForce)
inlineinherited

Definition at line 565 of file eda_base_frame.h.

566  {
567  m_isNonUserClose = true;
568  return Close( aForce );
569  }

References EDA_BASE_FRAME::m_isNonUserClose.

Referenced by KIWAY::PlayerClose().

◆ OnAddRegulator()

void PCB_CALCULATOR_FRAME::OnAddRegulator ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 167 of file regulators_funct.cpp.

168 {
169  DIALOG_REGULATOR_FORM dlg( this, wxEmptyString );
170  if( dlg.ShowModal() != wxID_OK )
171  return;
172  if( !dlg.IsOK() )
173  {
174  wxMessageBox( _("Bad or missing parameters!") );
175  return;
176  }
177 
178  REGULATOR_DATA * new_item = dlg.BuildRegulatorFromData();
179 
180  // Add new item, if not existing
181  if( m_RegulatorList.GetReg( new_item->m_Name ) == NULL )
182  {
183  // Add item in list
184  m_RegulatorList.Add( new_item );
185  m_RegulatorListChanged = true;
186  m_choiceRegulatorSelector->Clear();
190  }
191  else
192  {
193  wxMessageBox( _("This regulator is already in list. Aborted") );
194  delete new_item;
195  }
196 }
REGULATOR_DATA * GetReg(const wxString &aName)
wxArrayString GetRegList() const
#define NULL
void Add(REGULATOR_DATA *aItem)
REGULATOR_LIST m_RegulatorList
#define _(s)
Definition: 3d_actions.cpp:33
void SelectLastSelectedRegulator()
Function SelectLastSelectedRegulator If m_lastSelectedRegulatorName is empty, just calls RegulatorPag...

References _, REGULATOR_LIST::Add(), DIALOG_REGULATOR_FORM::BuildRegulatorFromData(), REGULATOR_LIST::GetReg(), REGULATOR_LIST::GetRegList(), DIALOG_REGULATOR_FORM::IsOK(), PCB_CALCULATOR_FRAME_BASE::m_choiceRegulatorSelector, m_lastSelectedRegulatorName, REGULATOR_DATA::m_Name, m_RegulatorList, m_RegulatorListChanged, NULL, and SelectLastSelectedRegulator().

◆ OnAttenuatorSelection()

void PCB_CALCULATOR_FRAME::OnAttenuatorSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 37 of file attenuators.cpp.

38 {
39  SetAttenuator( (unsigned) event.GetSelection() );
40  Refresh();
41 }
void Refresh()
Update the board display after modifying it by a python script (note: it is automatically called by a...
void SetAttenuator(unsigned aIdx)
Definition: attenuators.cpp:44

References Refresh(), and SetAttenuator().

◆ onAutoSaveTimer()

void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Handle the auto save timer event.

Definition at line 294 of file eda_base_frame.cpp.

295 {
296  if( !doAutoSave() )
297  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
298 }
virtual bool doAutoSave()
This should be overridden by the derived class to handle the auto save feature.
wxTimer * m_autoSaveTimer

References EDA_BASE_FRAME::doAutoSave(), EDA_BASE_FRAME::m_autoSaveInterval, and EDA_BASE_FRAME::m_autoSaveTimer.

Referenced by EDA_BASE_FRAME::EDA_BASE_FRAME().

◆ OnBoardClassesUnitsSelection()

void PCB_CALCULATOR_FRAME::OnBoardClassesUnitsSelection ( wxCommandEvent &  event)
overridevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 86 of file board_classes_values.cpp.

87 {
89 }
virtual double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_LEN * m_BoardClassesUnitsSelector
void BoardClassesUpdateData(double aUnitScale)

References BoardClassesUpdateData(), UNIT_SELECTOR_LEN::GetUnitScale(), and PCB_CALCULATOR_FRAME_BASE::m_BoardClassesUnitsSelector.

◆ OnCalculateAttenuator()

void PCB_CALCULATOR_FRAME::OnCalculateAttenuator ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 58 of file attenuators.cpp.

59 {
63 }
virtual bool Calculate()
Function Calculate calculates the values of components in attenuator.
void TransfPanelDataToAttenuator()
Definition: attenuators.cpp:66
void TransfAttenuatorResultsToPanel()

References ATTENUATOR::Calculate(), m_currAttenuator, TransfAttenuatorResultsToPanel(), and TransfPanelDataToAttenuator().

◆ OnCalculateESeries()

void PCB_CALCULATOR_FRAME::OnCalculateESeries ( wxCommandEvent &  event)
overrideprivatevirtual

Called on calculate button and executes all E-series calculations.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 289 of file eserie.cpp.

290 {
291  double reqr; // required resistor stored in local copy
292  double error, err3 = 0;
293  wxString es, fs; // error and formula strings
294 
295  reqr = ( 1000 * DoubleFromString( m_ResRequired->GetValue() ) );
296  r.SetRequiredValue( reqr ); // keep a local copy of requred resistor value
297  r.NewCalc(); // assume all values available
298  /*
299  * Exclude itself. For the case, a value from the available series is found as required value,
300  * the calculator assumes this value needs a replacement for the reason of being not available.
301  * Two further exclude values can be entered to exclude and are skipped as not being availabe.
302  * All values entered in KiloOhms are converted to Ohm for internal calculation
303  */
304  r.Exclude( 1000 * DoubleFromString( m_ResRequired->GetValue()));
305  r.Exclude( 1000 * DoubleFromString( m_ResExclude1->GetValue()));
306  r.Exclude( 1000 * DoubleFromString( m_ResExclude2->GetValue()));
307  r.Calculate();
308 
309  fs = r.get_rslt()[S2R].e_name; // show 2R solution formula string
310  m_ESeries_Sol2R->SetValue( fs );
311  error = reqr + r.get_rslt()[S2R].e_value; // absolute value of solution
312  error = ( reqr / error - 1 ) * 100; // error in percent
313 
314  if( error )
315  {
316  if( std::abs( error ) < 0.01 )
317  es.Printf( "<%.2f", 0.01 );
318  else
319  es.Printf( "%+.2f",error);
320  }
321  else
322  {
323  es = _( "Exact" );
324  }
325 
326  m_ESeriesError2R->SetValue( es ); // anyway show 2R error string
327 
328  if( r.get_rslt()[S3R].e_use ) // if 3R solution available
329  {
330  err3 = reqr + r.get_rslt()[S3R].e_value; // calculate the 3R
331  err3 = ( reqr / err3 - 1 ) * 100; // error in percent
332 
333  if( err3 )
334  {
335  if( std::abs( err3 ) < 0.01 )
336  es.Printf( "<%.2f", 0.01 );
337  else
338  es.Printf( "%+.2f",err3);
339  }
340  else
341  {
342  es = _( "Exact" );
343  }
344 
345  m_ESeriesError3R->SetValue( es ); // show 3R error string
346  fs = r.get_rslt()[S3R].e_name;
347  m_ESeries_Sol3R->SetValue( fs ); // show 3R formula string
348  }
349  else // nothing better than 2R found
350  {
351  fs = _( "Not worth using" );
352  m_ESeries_Sol3R->SetValue( fs );
353  m_ESeriesError3R->SetValue( wxEmptyString );
354  }
355 
356  fs = wxEmptyString;
357 
358  if( r.get_rslt()[S4R].e_use ) // show 4R solution if available
359  {
360  fs = r.get_rslt()[S4R].e_name;
361 
362  error = reqr + r.get_rslt()[S4R].e_value; // absolute value of solution
363  error = ( reqr / error - 1 ) * 100; // error in percent
364 
365  if( error )
366  es.Printf( "%+.2f",error );
367  else
368  es = _( "Exact" );
369 
370  m_ESeriesError4R->SetValue( es );
371  }
372  else // no 4R solution
373  {
374  fs = _( "Not worth using" );
375  es = wxEmptyString;
376  m_ESeriesError4R->SetValue( es );
377  }
378 
379  m_ESeries_Sol4R->SetValue( fs );
380 }
Definition: eserie.h:45
Definition: eserie.h:45
Definition: eserie.h:45
double DoubleFromString(const wxString &TextValue)
#define _(s)
Definition: 3d_actions.cpp:33

References _, eserie::Calculate(), DoubleFromString(), eserie::Exclude(), eserie::get_rslt(), PCB_CALCULATOR_FRAME_BASE::m_ESeries_Sol2R, PCB_CALCULATOR_FRAME_BASE::m_ESeries_Sol3R, PCB_CALCULATOR_FRAME_BASE::m_ESeries_Sol4R, PCB_CALCULATOR_FRAME_BASE::m_ESeriesError2R, PCB_CALCULATOR_FRAME_BASE::m_ESeriesError3R, PCB_CALCULATOR_FRAME_BASE::m_ESeriesError4R, PCB_CALCULATOR_FRAME_BASE::m_ResExclude1, PCB_CALCULATOR_FRAME_BASE::m_ResExclude2, PCB_CALCULATOR_FRAME_BASE::m_ResRequired, eserie::NewCalc(), S2R, S3R, S4R, and eserie::SetRequiredValue().

◆ OnCharHook()

void EDA_BASE_FRAME::OnCharHook ( wxKeyEvent &  aKeyEvent)
virtualinherited

Capture the key event before it is sent to the GUI.

The basic frame does not capture this event. Editor frames should override this event function to capture and filter these keys when they are used as hotkeys, and skip it if the key is not used as hotkey (otherwise the key events will be not sent to menus).

Reimplemented in FOOTPRINT_VIEWER_FRAME.

Definition at line 307 of file eda_base_frame.cpp.

308 {
309  wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( aKeyEvent ) );
310 
311  // Key events can be filtered here.
312  // Currently no filtering is made.
313  aKeyEvent.Skip();
314 }
wxString dump(const wxArrayString &aArray)
Debug helper for printing wxArrayString contents.
const wxChar *const kicadTraceKeyEvent
Flag to enable wxKeyEvent debug tracing.

References dump(), and kicadTraceKeyEvent.

◆ OnClosePcbCalc()

void PCB_CALCULATOR_FRAME::OnClosePcbCalc ( wxCloseEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 248 of file pcb_calculator_frame.cpp.

249 {
251  {
252  wxString msg;
253  wxString title = _( "Write Data Failed" );
254 
255  if( GetDataFilename().IsEmpty() )
256  {
257  msg = _( "No data filename to save modifications.\n"
258  "Do you want to exit and abandon your changes?" );
259 
260  if( wxMessageBox( msg, title, wxYES_NO | wxICON_QUESTION ) == wxNO )
261  return;
262  }
263  else
264  {
265  if( !WriteDataFile() )
266  {
267  msg.Printf( _( "Unable to write file '%s'\n"
268  "Do you want to exit and abandon your changes?"),
269  GetDataFilename() );
270 
271  if( wxMessageBox( msg, title, wxYES_NO | wxICON_ERROR ) == wxNO )
272  return;
273  }
274  }
275  }
276 
277  event.Skip();
278 }
const wxString GetDataFilename()
#define _(s)
Definition: 3d_actions.cpp:33

References _, GetDataFilename(), m_RegulatorListChanged, and WriteDataFile().

◆ OnDataFileSelection()

void PCB_CALCULATOR_FRAME::OnDataFileSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 121 of file regulators_funct.cpp.

122 {
123  wxString fullfilename = GetDataFilename();
124 
125  wxString wildcard;
126  wildcard.Printf( _("PCB Calculator data file (*.%s)|*.%s"),
128 
129  wxFileDialog dlg( m_panelRegulators,
130  _("Select PCB Calculator Data File"),
131  wxEmptyString, fullfilename,
132  wildcard, wxFD_OPEN );
133 
134  if (dlg.ShowModal() == wxID_CANCEL)
135  return;
136 
137  fullfilename = dlg.GetPath();
138 
139  if( fullfilename == GetDataFilename() )
140  return;
141 
142  SetDataFilename( fullfilename );
143  if( wxFileExists( fullfilename ) && m_RegulatorList.GetCount() > 0 ) // Read file
144  {
145  if( wxMessageBox( _("Do you want to load this file and replace current regulator list?" ) )
146  != wxID_OK )
147  return;
148  }
149 
150  if( ReadDataFile() )
151  {
152  m_RegulatorListChanged = false;
153  m_choiceRegulatorSelector->Clear();
156  }
157 
158  else
159  {
160  wxString msg;
161  msg.Printf( _("Unable to read data file \"%s\""), fullfilename );
162  wxMessageBox( msg );
163  }
164 }
const wxString DataFileNameExt
const wxString GetDataFilename()
wxArrayString GetRegList() const
unsigned int GetCount()
void SetDataFilename(const wxString &aFilename)
Initialize the full filename of the selected pcb_calculator data file force the standard extension of...
REGULATOR_LIST m_RegulatorList
#define _(s)
Definition: 3d_actions.cpp:33
void SelectLastSelectedRegulator()
Function SelectLastSelectedRegulator If m_lastSelectedRegulatorName is empty, just calls RegulatorPag...

References _, DataFileNameExt, REGULATOR_LIST::GetCount(), GetDataFilename(), REGULATOR_LIST::GetRegList(), PCB_CALCULATOR_FRAME_BASE::m_choiceRegulatorSelector, PCB_CALCULATOR_FRAME_BASE::m_panelRegulators, m_RegulatorList, m_RegulatorListChanged, ReadDataFile(), SelectLastSelectedRegulator(), and SetDataFilename().

◆ OnEditRegulator()

void PCB_CALCULATOR_FRAME::OnEditRegulator ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 199 of file regulators_funct.cpp.

200 {
201  wxString name = m_choiceRegulatorSelector->GetStringSelection();
203  if( item == NULL )
204  return;
205 
206  DIALOG_REGULATOR_FORM dlg( this, name );
207 
208  dlg.CopyRegulatorDataToDialog( item );
209  if( dlg.ShowModal() != wxID_OK )
210  return;
211 
212  REGULATOR_DATA * new_item = dlg.BuildRegulatorFromData();
213  m_RegulatorList.Replace( new_item );
214 
215  m_RegulatorListChanged = true;
216 
218 }
REGULATOR_DATA * GetReg(const wxString &aName)
#define NULL
REGULATOR_LIST m_RegulatorList
const char * name
Definition: DXF_plotter.cpp:59
void Replace(REGULATOR_DATA *aItem)
Replace an old REGULATOR_DATA by a new one The old one is deleted the 2 items must have the same name...
void SelectLastSelectedRegulator()
Function SelectLastSelectedRegulator If m_lastSelectedRegulatorName is empty, just calls RegulatorPag...

References DIALOG_REGULATOR_FORM::BuildRegulatorFromData(), DIALOG_REGULATOR_FORM::CopyRegulatorDataToDialog(), REGULATOR_LIST::GetReg(), PCB_CALCULATOR_FRAME_BASE::m_choiceRegulatorSelector, m_RegulatorList, m_RegulatorListChanged, name, NULL, REGULATOR_LIST::Replace(), and SelectLastSelectedRegulator().

◆ OnElectricalSpacingRefresh()

void PCB_CALCULATOR_FRAME::OnElectricalSpacingRefresh ( wxCommandEvent &  event)
overrideprivatevirtual

◆ OnElectricalSpacingUnitsSelection()

void PCB_CALCULATOR_FRAME::OnElectricalSpacingUnitsSelection ( wxCommandEvent &  event)
overrideprivatevirtual

◆ OnESeriesSelection()

void PCB_CALCULATOR_FRAME::OnESeriesSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Radio Buttons to select the E-serie for the resistor calculator.

Parameters
eventcontains the radio button state

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 382 of file eserie.cpp.

383 {
384  if( event.GetEventObject() == m_e1 )
385  r.SetSeries( E1 );
386  else if( event.GetEventObject() == m_e3 )
387  r.SetSeries( E3 );
388  else if( event.GetEventObject() == m_e12 )
389  r.SetSeries( E12 );
390  else
391  r.SetSeries( E6 );
392 }
Definition: eserie.h:39
Definition: eserie.h:39
Definition: eserie.h:39
Definition: eserie.h:39

References E1, E12, E3, E6, PCB_CALCULATOR_FRAME_BASE::m_e1, PCB_CALCULATOR_FRAME_BASE::m_e12, PCB_CALCULATOR_FRAME_BASE::m_e3, and eserie::SetSeries().

◆ OnKicadAbout()

void EDA_BASE_FRAME::OnKicadAbout ( wxCommandEvent &  event)
inherited

Definition at line 896 of file eda_base_frame.cpp.

897 {
898  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
899  ShowAboutDialog( this );
900 }
void ShowAboutDialog(EDA_BASE_FRAME *aParent)
The base frame for deriving all KiCad main window classes.

References ShowAboutDialog().

◆ OnMaximize()

void EDA_BASE_FRAME::OnMaximize ( wxMaximizeEvent &  aEvent)
inherited

Definition at line 1103 of file eda_base_frame.cpp.

1104 {
1105  // When we maximize the window, we want to save the old information
1106  // so that we can add it to the settings on next window load.
1107  // Contrary to the documentation, this event seems to be generated
1108  // when the window is also being unmaximized on OSX, so we only
1109  // capture the size information when we maximize the window when on OSX.
1110 #ifdef __WXOSX__
1111  if( !IsMaximized() )
1112 #endif
1113  {
1115  m_normalFramePos = GetPosition();
1116  wxLogTrace( traceDisplayLocation, "Maximizing window - Saving position (%d, %d) with size (%d, %d)",
1118  }
1119 
1120  // Skip event to actually maximize the window
1121  aEvent.Skip();
1122 }
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
wxPoint m_normalFramePos
wxSize m_normalFrameSize
wxSize GetWindowSize()
Get the undecorated window size that can be used for restoring the window size.

References EDA_BASE_FRAME::GetWindowSize(), EDA_BASE_FRAME::m_normalFramePos, EDA_BASE_FRAME::m_normalFrameSize, and traceDisplayLocation.

◆ OnMenuEvent()

void EDA_BASE_FRAME::OnMenuEvent ( wxMenuEvent &  event)
inherited

The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't captured by the menus themselves.

Definition at line 317 of file eda_base_frame.cpp.

318 {
319  if( !m_toolDispatcher )
320  aEvent.Skip();
321  else
323 }
virtual void DispatchWxEvent(wxEvent &aEvent)
Process wxEvents (mostly UI events), translate them to TOOL_EVENTs, and make tools handle those.
TOOL_DISPATCHER * m_toolDispatcher
Definition: tools_holder.h:159

References TOOL_DISPATCHER::DispatchWxEvent(), and TOOLS_HOLDER::m_toolDispatcher.

◆ OnMove()

virtual void EDA_BASE_FRAME::OnMove ( wxMoveEvent &  aEvent)
inlinevirtualinherited

Reimplemented in EDA_DRAW_FRAME.

Definition at line 181 of file eda_base_frame.h.

182  {
183  aEvent.Skip();
184  }

◆ OnPreferences()

void EDA_BASE_FRAME::OnPreferences ( wxCommandEvent &  event)
inherited

Definition at line 903 of file eda_base_frame.cpp.

904 {
905  PAGED_DIALOG dlg( this, _( "Preferences" ), true );
906  wxTreebook* book = dlg.GetTreebook();
907 
908  book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) );
909 
910  book->AddPage( new PANEL_MOUSE_SETTINGS( &dlg, book ), _( "Mouse and Touchpad" ) );
911 
912  PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false );
913  book->AddPage( hotkeysPanel, _( "Hotkeys" ) );
914 
915  for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i )
916  {
917  KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false );
918 
919  if( frame )
920  frame->InstallPreferences( &dlg, hotkeysPanel );
921  }
922 
923  // The Kicad manager frame is not a player so we have to add it by hand
924  wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME );
925 
926  if( manager )
927  static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
928 
929  for( size_t i = 0; i < book->GetPageCount(); ++i )
930  book->GetPage( i )->Layout();
931 
932  if( dlg.ShowModal() == wxID_OK )
933  dlg.Kiway().CommonSettingsChanged( false, false );
934 }
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:61
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:56
FRAME_T
The set of EDA_BASE_FRAME derivatives, typically stored in EDA_BASE_FRAME::m_Ident.
Definition: frame_type.h:32
virtual KIWAY_PLAYER * Player(FRAME_T aFrameType, bool doCreate=true, wxTopLevelWindow *aParent=nullptr)
Return the KIWAY_PLAYER* given a FRAME_T.
Definition: kiway.cpp:368
#define KICAD_MANAGER_FRAME_NAME
#define _(s)
Definition: 3d_actions.cpp:33
virtual void InstallPreferences(PAGED_DIALOG *, PANEL_HOTKEYS_EDITOR *)
Allow a frame to load its preference panels (if any) into the preferences dialog.

References _, KIWAY::CommonSettingsChanged(), PAGED_DIALOG::GetTreebook(), EDA_BASE_FRAME::InstallPreferences(), KICAD_MANAGER_FRAME_NAME, KIWAY_HOLDER::Kiway(), KIWAY_PLAYER_COUNT, and KIWAY::Player().

Referenced by APPEARANCE_CONTROLS::onReadOnlySwatch().

◆ OnRegulatorCalcButtonClick()

void PCB_CALCULATOR_FRAME::OnRegulatorCalcButtonClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 39 of file regulators_funct.cpp.

40 {
42 }

References RegulatorsSolve().

◆ OnRegulatorResetButtonClick()

void PCB_CALCULATOR_FRAME::OnRegulatorResetButtonClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 45 of file regulators_funct.cpp.

46 {
47  m_RegulR1Value->SetValue( wxT( "10" ) );
48  m_RegulR2Value->SetValue( wxT( "10" ) );
49  m_RegulVrefValue->SetValue( wxT( "3" ) );
50  m_RegulVoutValue->SetValue( wxT( "12" ) );
51  m_choiceRegType->SetSelection( 0 );
52  m_rbRegulR1->SetValue(1);
53  m_rbRegulR2->SetValue(0);
54  m_rbRegulVout->SetValue(0);
56 }
void RegulatorPageUpdate()
Function RegulatorPageUpdate: Update the regulator page dialog display: enable the current regulator ...

References PCB_CALCULATOR_FRAME_BASE::m_choiceRegType, PCB_CALCULATOR_FRAME_BASE::m_rbRegulR1, PCB_CALCULATOR_FRAME_BASE::m_rbRegulR2, PCB_CALCULATOR_FRAME_BASE::m_rbRegulVout, PCB_CALCULATOR_FRAME_BASE::m_RegulR1Value, PCB_CALCULATOR_FRAME_BASE::m_RegulR2Value, PCB_CALCULATOR_FRAME_BASE::m_RegulVoutValue, PCB_CALCULATOR_FRAME_BASE::m_RegulVrefValue, and RegulatorPageUpdate().

◆ OnRegulatorSelection()

void PCB_CALCULATOR_FRAME::OnRegulatorSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 96 of file regulators_funct.cpp.

97 {
98  wxString name = m_choiceRegulatorSelector->GetStringSelection();
100  if( item )
101  {
103  m_choiceRegType->SetSelection( item->m_Type );
104  wxString value;
105  value.Printf( wxT("%g"), item->m_Vref );
106  m_RegulVrefValue->SetValue( value );
107  value.Printf( wxT("%g"), item->m_Iadj );
108  m_RegulIadjValue->SetValue( value );
109  }
110 
111  // Call RegulatorPageUpdate to enable/sisable tools,
112  // even if no item selected
114 }
void RegulatorPageUpdate()
Function RegulatorPageUpdate: Update the regulator page dialog display: enable the current regulator ...
REGULATOR_DATA * GetReg(const wxString &aName)
REGULATOR_LIST m_RegulatorList
const char * name
Definition: DXF_plotter.cpp:59

References REGULATOR_LIST::GetReg(), PCB_CALCULATOR_FRAME_BASE::m_choiceRegType, PCB_CALCULATOR_FRAME_BASE::m_choiceRegulatorSelector, REGULATOR_DATA::m_Iadj, m_lastSelectedRegulatorName, REGULATOR_DATA::m_Name, m_RegulatorList, PCB_CALCULATOR_FRAME_BASE::m_RegulIadjValue, PCB_CALCULATOR_FRAME_BASE::m_RegulVrefValue, REGULATOR_DATA::m_Type, REGULATOR_DATA::m_Vref, name, and RegulatorPageUpdate().

Referenced by SelectLastSelectedRegulator().

◆ OnRegulTypeSelection()

void PCB_CALCULATOR_FRAME::OnRegulTypeSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 90 of file regulators_funct.cpp.

91 {
93 }
void RegulatorPageUpdate()
Function RegulatorPageUpdate: Update the regulator page dialog display: enable the current regulator ...

References RegulatorPageUpdate().

◆ OnRemoveRegulator()

void PCB_CALCULATOR_FRAME::OnRemoveRegulator ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 221 of file regulators_funct.cpp.

222 {
223  wxString name = wxGetSingleChoice( _("Remove Regulator"), wxEmptyString,
225  if( name.IsEmpty() )
226  return;
227 
229  m_RegulatorListChanged = true;
230  m_choiceRegulatorSelector->Clear();
234 
236 }
wxArrayString GetRegList() const
void Remove(const wxString &aRegName)
REGULATOR_LIST m_RegulatorList
const char * name
Definition: DXF_plotter.cpp:59
#define _(s)
Definition: 3d_actions.cpp:33
void SelectLastSelectedRegulator()
Function SelectLastSelectedRegulator If m_lastSelectedRegulatorName is empty, just calls RegulatorPag...

References _, REGULATOR_LIST::GetRegList(), PCB_CALCULATOR_FRAME_BASE::m_choiceRegulatorSelector, m_lastSelectedRegulatorName, m_RegulatorList, m_RegulatorListChanged, name, REGULATOR_LIST::Remove(), and SelectLastSelectedRegulator().

◆ onSystemColorChange()

void EDA_BASE_FRAME::onSystemColorChange ( wxSysColourChangedEvent &  aEvent)
protectedinherited

Definition at line 1160 of file eda_base_frame.cpp.

1161 {
1162  // Call the handler to update the colors used in the frame
1164 
1165  // Skip the change event to ensure the rest of the window controls get it
1166  aEvent.Skip();
1167 }
virtual void HandleSystemColorChange()
Update the UI in response to a change in the system colors.

References EDA_BASE_FRAME::HandleSystemColorChange().

◆ OnToleranceSelection()

void PCB_CALCULATOR_FRAME::OnToleranceSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 36 of file colorcode.cpp.

37 {
38  ToleranceSelection( event.GetSelection() );
39 }
void ToleranceSelection(int aSelection)
Definition: colorcode.cpp:42

References ToleranceSelection().

◆ OnTranslineAnalyse()

void PCB_CALCULATOR_FRAME::OnTranslineAnalyse ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTranslineAnalyse Run a new analyse for the current transline with current parameters and displays the electrical parameters.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 366 of file pcb_calculator_frame.cpp.

367 {
368  if( m_currTransLine )
369  {
372  }
373 }
void analyze()
Definition: transline.cpp:203
void TransfDlgDataToTranslineParams()
Function TransfDlgDataToTranslineParams Read values entered in dialog frame, and transfert these valu...

References TRANSLINE::analyze(), m_currTransLine, and TransfDlgDataToTranslineParams().

◆ OnTranslineEpsilonR_Button()

void PCB_CALCULATOR_FRAME::OnTranslineEpsilonR_Button ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTranslineEpsilonR_Button Shows a list of current relative dielectric constant(Er) and set the selected value in main dialog frame.

Function OnEpsilonR_Button Shows a list of current relative dielectric constant(Er) and set the selected value in main dialog frame.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 116 of file transline_dlg_funct.cpp.

117 {
118  wxArrayString list = StandardRelativeDielectricConstantList();
119  list.Add( "" ); // Add an empty line for no selection
120 
121  // Find the previous choice index:
122  wxString prevChoiceStr = m_Value_EpsilonR->GetValue();
123  int prevChoice = 0;
124  findMatch( list, prevChoiceStr, prevChoice );
125 
126  int index = wxGetSingleChoiceIndex( wxEmptyString, _( "Relative Dielectric Constants" ),
127  list, prevChoice );
128 
129  if( index >= 0 && !list.Item( index ).IsEmpty() ) // i.e. non canceled.
130  m_Value_EpsilonR->SetValue( list.Item( index ).BeforeFirst( ' ' ) );
131 }
wxArrayString StandardRelativeDielectricConstantList()
Definition: common_data.cpp:28
static bool findMatch(wxArrayString &aList, const wxString &aValue, int &aIdx)
#define _(s)
Definition: 3d_actions.cpp:33

References _, findMatch(), PCB_CALCULATOR_FRAME_BASE::m_Value_EpsilonR, and StandardRelativeDielectricConstantList().

◆ OnTransLineResetButtonClick()

void PCB_CALCULATOR_FRAME::OnTransLineResetButtonClick ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTransLineResetButtonClick Called when the user clicks the reset button; sets the parameters to their default values.

Function OnTransLineResetButtonClick Called when the user clicks the reset button.

This sets the parameters to their default values.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 462 of file transline_dlg_funct.cpp.

463 {
465  m_TranslineSelection->SetSelection( DEFAULT_TYPE );
466 
467  m_panelTransline->GetSizer()->Layout();
468  m_panelTransline->Refresh();
469 }
void TranslineTypeSelection(enum TRANSLINE_TYPE_ID aType)
Function TranslineTypeSelection Must be called after selection of a new transline.

References DEFAULT_TYPE, PCB_CALCULATOR_FRAME_BASE::m_panelTransline, PCB_CALCULATOR_FRAME_BASE::m_TranslineSelection, and TranslineTypeSelection().

◆ OnTranslineRho_Button()

void PCB_CALCULATOR_FRAME::OnTranslineRho_Button ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTranslineRho_Button Shows a list of current Specific resistance list (rho) and set the selected value in main dialog frame.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 162 of file transline_dlg_funct.cpp.

163 {
164  wxArrayString list = StandardResistivityList();
165  list.Add( "" ); // Add an empty line for no selection
166 
167  // Find the previous choice index:
168  wxString prevChoiceStr = m_Value_Rho->GetValue();
169  int prevChoice = 0;
170  findMatch( list, prevChoiceStr, prevChoice );
171 
172  int index = wxGetSingleChoiceIndex( wxEmptyString, _( "Specific Resistance" ), list,
173  prevChoice, NULL );
174 
175  if( index >= 0 && !list.Item( index ).IsEmpty() ) // i.e. non canceled.
176  m_Value_Rho->SetValue( list.Item( index ).BeforeFirst( ' ' ) );
177 }
static bool findMatch(wxArrayString &aList, const wxString &aValue, int &aIdx)
#define NULL
wxArrayString StandardResistivityList()
Definition: common_data.cpp:84
#define _(s)
Definition: 3d_actions.cpp:33

References _, findMatch(), PCB_CALCULATOR_FRAME_BASE::m_Value_Rho, NULL, and StandardResistivityList().

◆ OnTranslineSelection()

void PCB_CALCULATOR_FRAME::OnTranslineSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTranslineSelection Called on new transmission line selection.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 444 of file transline_dlg_funct.cpp.

445 {
446  enum TRANSLINE_TYPE_ID id = (enum TRANSLINE_TYPE_ID) event.GetSelection();
447 
449 
450  // Texts and units choice widgets can have their size modified:
451  // The new size must be taken in account
452  m_panelTransline->GetSizer()->Layout();
453  m_panelTransline->Refresh();
454 }
TRANSLINE_TYPE_ID
void TranslineTypeSelection(enum TRANSLINE_TYPE_ID aType)
Function TranslineTypeSelection Must be called after selection of a new transline.

References PCB_CALCULATOR_FRAME_BASE::m_panelTransline, and TranslineTypeSelection().

◆ OnTranslineSynthetize()

void PCB_CALCULATOR_FRAME::OnTranslineSynthetize ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTranslineSynthetize Run a new synthezis for the current transline with current parameters and displays the geometrical parameters.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 381 of file pcb_calculator_frame.cpp.

382 {
383  if( m_currTransLine )
384  {
387  }
388 }
void TransfDlgDataToTranslineParams()
Function TransfDlgDataToTranslineParams Read values entered in dialog frame, and transfert these valu...
virtual void synthesize()
Definition: transline.cpp:212

References m_currTransLine, TRANSLINE::synthesize(), and TransfDlgDataToTranslineParams().

◆ OnTranslineTanD_Button()

void PCB_CALCULATOR_FRAME::OnTranslineTanD_Button ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTranslineTanD_Button Shows a list of current dielectric loss factor (tangent delta) and set the selected value in main dialog frame.

Function OnTanD_Button Shows a list of current dielectric loss factor (tangent delta) and set the selected value in main dialog frame.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 139 of file transline_dlg_funct.cpp.

140 {
141  wxArrayString list = StandardLossTangentList();
142  list.Add( "" ); // Add an empty line for no selection
143 
144  // Find the previous choice index:
145  wxString prevChoiceStr = m_Value_TanD->GetValue();
146  int prevChoice = 0;
147  findMatch( list, prevChoiceStr, prevChoice );
148 
149  int index = wxGetSingleChoiceIndex( wxEmptyString, _( "Dielectric Loss Factor" ), list,
150  prevChoice, NULL );
151 
152  if( index >= 0 && !list.Item( index ).IsEmpty() ) // i.e. non canceled.
153  m_Value_TanD->SetValue( list.Item( index ).BeforeFirst( ' ' ) );
154 }
static bool findMatch(wxArrayString &aList, const wxString &aValue, int &aIdx)
#define NULL
wxArrayString StandardLossTangentList()
Definition: common_data.cpp:55
#define _(s)
Definition: 3d_actions.cpp:33

References _, findMatch(), PCB_CALCULATOR_FRAME_BASE::m_Value_TanD, NULL, and StandardLossTangentList().

◆ OnTWCalculateFromCurrent()

void PCB_CALCULATOR_FRAME::OnTWCalculateFromCurrent ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTWCalculateFromCurrent Called when the user changes the desired maximum current.

This sets the current as the controlling value and performs the calculations.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 85 of file tracks_width_versus_current.cpp.

86 {
87  // Setting the calculated values generates further events. Stop them.
88  if( m_TWNested )
89  {
90  event.StopPropagation();
91  return;
92  }
93 
94  m_TWNested = true;
95 
96  // Update state.
98  {
101  }
102 
103  // Prepare parameters:
104  double current = std::abs( DoubleFromString( m_TrackCurrentValue->GetValue() ) );
105  double extThickness = std::abs( DoubleFromString( m_ExtTrackThicknessValue->GetValue() ) );
106  double intThickness = std::abs( DoubleFromString( m_IntTrackThicknessValue->GetValue() ) );
107  double deltaT_C = std::abs( DoubleFromString( m_TrackDeltaTValue->GetValue() ) );
108 
109  // Normalize by units.
110  extThickness *= m_ExtTrackThicknessUnit->GetUnitScale();
111  intThickness *= m_IntTrackThicknessUnit->GetUnitScale();
112 
113  // Calculate the widths.
114  double extTrackWidth = TWCalculateWidth( current, extThickness, deltaT_C, false );
115  double intTrackWidth = TWCalculateWidth( current, intThickness, deltaT_C, true );
116 
117  // Update the display.
118  TWDisplayValues( current, extTrackWidth, intTrackWidth, extThickness, intThickness );
119 
120  // Re-enable the events.
121  m_TWNested = false;
122 }
virtual double GetUnitScale() override
Function GetUnitScale.
enum PCB_CALCULATOR_FRAME::@39 m_TWMode
double TWCalculateWidth(double aCurrent, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
Function TWCalculateWidth Calculate track width required based on given current and temperature rise.
void TWUpdateModeDisplay()
Function TWUpdateModeDisplay Updates the fields to show whether the maximum current,...
double DoubleFromString(const wxString &TextValue)
UNIT_SELECTOR_THICKNESS * m_IntTrackThicknessUnit
void TWDisplayValues(double aCurrent, double aExtWidth, double aIntWidth, double aExtThickness, double aIntThickness)
Function TWDisplayValues Displays the results of a calculation (including resulting values such as th...
UNIT_SELECTOR_THICKNESS * m_ExtTrackThicknessUnit

References DoubleFromString(), UNIT_SELECTOR_THICKNESS::GetUnitScale(), PCB_CALCULATOR_FRAME_BASE::m_ExtTrackThicknessUnit, PCB_CALCULATOR_FRAME_BASE::m_ExtTrackThicknessValue, PCB_CALCULATOR_FRAME_BASE::m_IntTrackThicknessUnit, PCB_CALCULATOR_FRAME_BASE::m_IntTrackThicknessValue, PCB_CALCULATOR_FRAME_BASE::m_TrackCurrentValue, PCB_CALCULATOR_FRAME_BASE::m_TrackDeltaTValue, m_TWMode, m_TWNested, TW_MASTER_CURRENT, TWCalculateWidth(), TWDisplayValues(), and TWUpdateModeDisplay().

Referenced by OnTWParametersChanged().

◆ OnTWCalculateFromExtWidth()

void PCB_CALCULATOR_FRAME::OnTWCalculateFromExtWidth ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTWCalculateFromExtWidth Called when the user changes the desired external trace width.

This sets the external width as the controlling value and performs the calculations.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 125 of file tracks_width_versus_current.cpp.

126 {
127  // Setting the calculated values generates further events. Stop them.
128  if( m_TWNested )
129  {
130  event.StopPropagation();
131  return;
132  }
133  m_TWNested = true;
134 
135  // Update state.
137  {
140  }
141 
142  // Load parameters.
143  double current;
144  double extThickness = std::abs( DoubleFromString( m_ExtTrackThicknessValue->GetValue() ) );
145  double intThickness = std::abs( DoubleFromString( m_IntTrackThicknessValue->GetValue() ) );
146  double deltaT_C = std::abs( DoubleFromString( m_TrackDeltaTValue->GetValue() ) );
147  double extTrackWidth = std::abs( DoubleFromString( m_ExtTrackWidthValue->GetValue() ) );
148  double intTrackWidth;
149 
150  // Normalize units.
151  extThickness *= m_ExtTrackThicknessUnit->GetUnitScale();
152  intThickness *= m_IntTrackThicknessUnit->GetUnitScale();
153  extTrackWidth *= m_TW_ExtTrackWidth_choiceUnit->GetUnitScale();
154 
155  // Calculate the maximum current.
156  current = TWCalculateCurrent( extTrackWidth, extThickness, deltaT_C, false );
157 
158  // And now calculate the corresponding internal width.
159  intTrackWidth = TWCalculateWidth( current, intThickness, deltaT_C, true );
160 
161  // Update the display.
162  TWDisplayValues( current, extTrackWidth, intTrackWidth, extThickness, intThickness );
163 
164  // Re-enable the events.
165  m_TWNested = false;
166 }
UNIT_SELECTOR_LEN * m_TW_ExtTrackWidth_choiceUnit
virtual double GetUnitScale() override
Function GetUnitScale.
double TWCalculateCurrent(double aWidth, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
Function TWCalculateCurrent Calculate maximum current based on given width and temperature rise.
enum PCB_CALCULATOR_FRAME::@39 m_TWMode
double TWCalculateWidth(double aCurrent, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
Function TWCalculateWidth Calculate track width required based on given current and temperature rise.
void TWUpdateModeDisplay()
Function TWUpdateModeDisplay Updates the fields to show whether the maximum current,...
double DoubleFromString(const wxString &TextValue)
UNIT_SELECTOR_THICKNESS * m_IntTrackThicknessUnit
virtual double GetUnitScale() override
Function GetUnitScale.
void TWDisplayValues(double aCurrent, double aExtWidth, double aIntWidth, double aExtThickness, double aIntThickness)
Function TWDisplayValues Displays the results of a calculation (including resulting values such as th...
UNIT_SELECTOR_THICKNESS * m_ExtTrackThicknessUnit

References DoubleFromString(), UNIT_SELECTOR_LEN::GetUnitScale(), UNIT_SELECTOR_THICKNESS::GetUnitScale(), PCB_CALCULATOR_FRAME_BASE::m_ExtTrackThicknessUnit, PCB_CALCULATOR_FRAME_BASE::m_ExtTrackThicknessValue, PCB_CALCULATOR_FRAME_BASE::m_ExtTrackWidthValue, PCB_CALCULATOR_FRAME_BASE::m_IntTrackThicknessUnit, PCB_CALCULATOR_FRAME_BASE::m_IntTrackThicknessValue, PCB_CALCULATOR_FRAME_BASE::m_TrackDeltaTValue, PCB_CALCULATOR_FRAME_BASE::m_TW_ExtTrackWidth_choiceUnit, m_TWMode, m_TWNested, TW_MASTER_EXT_WIDTH, TWCalculateCurrent(), TWCalculateWidth(), TWDisplayValues(), and TWUpdateModeDisplay().

Referenced by OnTWParametersChanged().

◆ OnTWCalculateFromIntWidth()

void PCB_CALCULATOR_FRAME::OnTWCalculateFromIntWidth ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTWCalculateFromIntWidth Called when the user changes the desired internal trace width.

This sets the internal width as the controlling value and performs the calculations.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 169 of file tracks_width_versus_current.cpp.

170 {
171  // Setting the calculated values generates further events. Stop them.
172  if( m_TWNested )
173  {
174  event.StopPropagation();
175  return;
176  }
177 
178  m_TWNested = true;
179 
180  // Update state.
182  {
185  }
186 
187  // Load parameters.
188  double current;
189  double extThickness = std::abs( DoubleFromString( m_ExtTrackThicknessValue->GetValue() ) );
190  double intThickness = std::abs( DoubleFromString( m_IntTrackThicknessValue->GetValue() ) );
191  double deltaT_C = std::abs( DoubleFromString( m_TrackDeltaTValue->GetValue() ) );
192  double extTrackWidth;
193  double intTrackWidth = std::abs( DoubleFromString( m_IntTrackWidthValue->GetValue() ) );
194 
195  // Normalize units.
196  extThickness *= m_ExtTrackThicknessUnit->GetUnitScale();
197  intThickness *= m_IntTrackThicknessUnit->GetUnitScale();
198  intTrackWidth *= m_TW_IntTrackWidth_choiceUnit->GetUnitScale();
199 
200  // Calculate the maximum current.
201  current = TWCalculateCurrent( intTrackWidth, intThickness, deltaT_C, true );
202 
203  // And now calculate the corresponding external width.
204  extTrackWidth = TWCalculateWidth( current, extThickness, deltaT_C, false );
205 
206  // Update the display.
207  TWDisplayValues( current, extTrackWidth, intTrackWidth, extThickness, intThickness );
208 
209  // Re-enable the events.
210  m_TWNested = false;
211 }
UNIT_SELECTOR_LEN * m_TW_IntTrackWidth_choiceUnit
virtual double GetUnitScale() override
Function GetUnitScale.
double TWCalculateCurrent(double aWidth, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
Function TWCalculateCurrent Calculate maximum current based on given width and temperature rise.
enum PCB_CALCULATOR_FRAME::@39 m_TWMode
double TWCalculateWidth(double aCurrent, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
Function TWCalculateWidth Calculate track width required based on given current and temperature rise.