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)
 Function GetPrmValue Returns a param value. More...
 
bool IsPrmSelected (enum PRMS_ID aPrmId)
 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 &event)
 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
 
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 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)
 
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 ()
 
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 519 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 37 of file pcb_calculator_frame.cpp.

37  :
38  PCB_CALCULATOR_FRAME_BASE( aParent ),
39  m_lastNotebookPage( -1 ),
40  m_macHack( true )
41 {
42  m_bpButtonCalcAtt->SetBitmap( KiBitmap( small_down_xpm ) );
43  m_bpButtonAnalyze->SetBitmap( KiBitmap( small_down_xpm ) );
45 
46  SetKiway( this, aKiway );
50  m_RegulatorListChanged = false;
52  m_TWNested = false;
53 
54  SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include
55  // some methods in code and avoid link errors
56 
57  // Populate transline list ordered like in dialog menu list
58  const static TRANSLINE_TYPE_ID tltype_list[8] =
59  {
61  CPW_TYPE,
64  COAX_TYPE,
68  };
69 
70  for( int ii = 0; ii < 8; ii++ )
71  m_transline_list.push_back( new TRANSLINE_IDENT( tltype_list[ii] ) );
72 
73  // Populate attenuator list ordered like in dialog menu list
74  m_attenuator_list.push_back( new ATTENUATOR_PI() );
75  m_attenuator_list.push_back( new ATTENUATOR_TEE() );
76  m_attenuator_list.push_back( new ATTENUATOR_BRIDGE() );
77  m_attenuator_list.push_back( new ATTENUATOR_SPLITTER() );
79 
80  wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
81  infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
82  m_staticTextAttMsg->SetFont( infoFont );
83 
84  m_IadjUnitLabel->SetLabel( wxT( "µA" ) );
85 
86  m_attZinUnit->SetLabel( wxT( "Ω" ) );
87  m_attZoutUnit->SetLabel( wxT( "Ω" ) );
88  m_attR1Unit->SetLabel( wxT( "Ω" ) );
89  m_attR2Unit->SetLabel( wxT( "Ω" ) );
90  m_attR3Unit->SetLabel( wxT( "Ω" ) );
91 
92  m_r1Units->SetLabel( wxT( "kΩ" ) );
93  m_r2Units->SetLabel( wxT( "kΩ" ) );
94 
95  m_reqResUnits->SetLabel( wxT( "kΩ" ) );
96  m_exclude1Units->SetLabel( wxT( "kΩ" ) );
97  m_exclude2Units->SetLabel( wxT( "kΩ" ) );
98 
99  m_EpsilonR_label->SetLabel( wxT( "εr" ) );
100 
101  m_trackTempUnits->SetLabel( wxT( "°C" ) );
102  m_resistivityUnits->SetLabel( wxT( "Ω•m" ) );
103 
104  m_viaResistivityUnits->SetLabel( wxT( "Ω•m" ) );
105 
106  m_viaTempUnits->SetLabel( wxT( "°C" ) );
107  m_viaResUnits->SetLabel( wxT( "Ω" ) );
108  m_viaThermalResUnits->SetLabel( wxT( "°C/W" ) );
109  m_viaReactanceUnits->SetLabel( wxT( "Ω" ) );
110 
111  m_extTrackResUnits->SetLabel( wxT( "Ω" ) );
112  m_intTrackResUnits->SetLabel( wxT( "Ω" ) );
113 
114  LoadSettings( config() );
115 
116  ReadDataFile();
117 
119  m_TranslineSelection->SetSelection( m_currTransLineType );
120 
125 
126  SetAttenuator( m_AttenuatorsSelection->GetSelection() );
127 
128  ToleranceSelection( m_rbToleranceSelection->GetSelection() );
129 
131 
133 
136 
137  // Give an icon
138  wxIcon icon;
139  wxIconBundle icon_bundle;
140 
141  icon.CopyFromBitmap( KiBitmap( icon_pcbcalculator_xpm ) );
142  icon_bundle.AddIcon( icon );
143  icon.CopyFromBitmap( KiBitmap( icon_pcbcalculator_32_xpm ) );
144  icon_bundle.AddIcon( icon );
145  icon.CopyFromBitmap( KiBitmap( icon_pcbcalculator_16_xpm ) );
146  icon_bundle.AddIcon( icon );
147 
148  SetIcons( icon_bundle );
149 
150  // Autosize the the row label column to be sure label are not truncated
151  m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
152  m_gridElectricalSpacingValues->SetRowLabelSize( wxGRID_AUTOSIZE );
153 
154  GetSizer()->SetSizeHints( this );
155 
156  // Set previous size and position
157  SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
158 
159  if( m_framePos == wxDefaultPosition )
160  Centre();
161 }
void ToleranceSelection(int aSelection)
Definition: colorcode.cpp:44
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.
const BITMAP_OPAQUE icon_pcbcalculator_xpm[1]
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
const BITMAP_OPAQUE icon_pcbcalculator_16_xpm[1]
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:82
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.
const BITMAP_OPAQUE small_down_xpm[1]
Definition: small_down.cpp:23
const BITMAP_OPAQUE small_up_xpm[1]
Definition: small_up.cpp:23
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
const BITMAP_OPAQUE icon_pcbcalculator_32_xpm[1]
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_16_xpm, icon_pcbcalculator_32_xpm, icon_pcbcalculator_xpm, 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_xpm, small_up_xpm, STRIPLINE_TYPE, ToleranceSelection(), TranslineTypeSelection(), TW_MASTER_CURRENT, and TWISTEDPAIR_TYPE.

◆ ~PCB_CALCULATOR_FRAME()

PCB_CALCULATOR_FRAME::~PCB_CALCULATOR_FRAME ( )

Definition at line 164 of file pcb_calculator_frame.cpp.

165 {
166  for( unsigned ii = 0; ii < m_transline_list.size(); ii++ )
167  delete m_transline_list[ii];
168 
169  for( unsigned ii = 0; ii < m_attenuator_list.size(); ii++ )
170  delete m_attenuator_list[ii];
171 
172  delete m_ccValueNamesBitmap;
173  delete m_ccValuesBitmap;
174  delete m_ccMultipliersBitmap;
175  delete m_ccTolerancesBitmap;
176 
177  // This needed for OSX: avoids furter OnDraw processing after this destructor and before
178  // the native window is destroyed
179  this->Freeze();
180 }
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 409 of file eda_base_frame.cpp.

410 {
411  COMMON_CONTROL* commonControl = m_toolManager->GetTool<COMMON_CONTROL>();
412  ACTION_MENU* helpMenu = new ACTION_MENU( false, commonControl );
413 
414  helpMenu->Add( ACTIONS::help );
415  helpMenu->Add( ACTIONS::gettingStarted );
416  helpMenu->Add( ACTIONS::listHotKeys );
417  helpMenu->Add( ACTIONS::getInvolved );
418  helpMenu->Add( ACTIONS::reportBug );
419 
420  helpMenu->AppendSeparator();
421  helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, about_xpm );
422 
423  aMenuBar->Append( helpMenu, _( "&Help" ) );
424 }
static TOOL_ACTION listHotKeys
Definition: actions.h:180
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:45
static TOOL_ACTION reportBug
Definition: actions.h:182
const BITMAP_OPAQUE about_xpm[1]
Definition: about.cpp:40
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:181
static TOOL_ACTION gettingStarted
Definition: actions.h:178

References _, about_xpm, 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(), CVPCB_MAINFRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::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 1054 of file eda_base_frame.cpp.

1055 {
1056  SetUserUnits( aUnits );
1058 
1059  wxCommandEvent e( UNITS_CHANGED );
1060  ProcessEventLocally( e );
1061 }
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 943 of file eda_base_frame.cpp.

944 {
945  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
946 
947  wxFileName autoSaveFileName = aFileName;
948 
949  // Check for auto save file.
950  autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
951 
952  wxLogTrace( traceAutoSave,
953  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
954 
955  if( !autoSaveFileName.FileExists() )
956  return;
957 
958  wxString msg = wxString::Format( _(
959  "Well this is potentially embarrassing!\n"
960  "It appears that the last time you were editing the file\n"
961  "\"%s\"\n"
962  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
963  aFileName.GetFullName()
964  );
965 
966  int response = wxMessageBox( msg, Pgm().App().GetAppName(), wxYES_NO | wxICON_QUESTION, this );
967 
968  // Make a backup of the current file, delete the file, and rename the auto save file to
969  // the file name.
970  if( response == wxYES )
971  {
972  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
973  {
974  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
975  Pgm().App().GetAppName(), wxOK | wxICON_EXCLAMATION, this );
976  }
977  }
978  else
979  {
980  wxLogTrace( traceAutoSave,
981  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
982 
983  // Remove the auto save file when using the previous file as is.
984  wxRemoveFile( autoSaveFileName.GetFullPath() );
985  }
986 }
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 SCH_EDIT_FRAME::OpenProjectFiles(), and PCB_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 840 of file eda_base_frame.cpp.

841 {
842  if( !aFileHistory )
843  aFileHistory = m_fileHistory;
844 
845  wxASSERT( aFileHistory );
846 
847  aFileHistory->ClearFileHistory();
848 
849  // Update the menubar to update the file history menu
850  if( GetMenuBar() )
851  {
852  ReCreateMenuBar();
853  GetMenuBar()->Refresh();
854  }
855 }
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 437 of file eda_base_frame.cpp.

438 {
439  TOOLS_HOLDER::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
440 
441  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
442 
443  if( m_fileHistory )
444  {
445  int historySize = settings->m_System.file_history_size;
446  m_fileHistory->SetMaxFiles( (unsigned) std::max( 0, historySize ) );
447  }
448 
449  if( GetMenuBar() )
450  {
451  // For icons in menus, icon scaling & hotkeys
452  ReCreateMenuBar();
453  GetMenuBar()->Refresh();
454  }
455 }
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 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.

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

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 KICAD_MANAGER_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 681 of file eda_base_frame.cpp.

682 {
683  // KICAD_MANAGER_FRAME overrides this
684  return Kiface().KifaceSettings();
685 }
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(), SYMBOL_EDIT_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 338 of file eda_base_frame.h.

339  {
340  wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
341  return baseCfgName;
342  }
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 706 of file eda_base_frame.cpp.

707 {
708 #if defined( __WXOSX_MAC__ )
710 #else
711  m_infoBar = new WX_INFOBAR( this, &m_auimgr );
712 
713  m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
714 #endif
715 }
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:71
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 = 0; // 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 PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 293 of file eda_base_frame.cpp.

294 {
295  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
296 }

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 718 of file eda_base_frame.cpp.

719 {
720 #if defined( __WXOSX_MAC__ )
721  m_auimgr.Update();
722 #else
723  // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
724  // hidding it.
725  m_auimgr.Update();
726 
727  // We don't want the infobar displayed right away
728  m_auimgr.GetPane( "InfoBar" ).Hide();
729  m_auimgr.Update();
730 #endif
731 }
wxAuiManager m_auimgr

References EDA_BASE_FRAME::m_auimgr.

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

Definition at line 488 of file eda_base_frame.h.

488 { return m_aboutTitle; }
wxString m_aboutTitle

References EDA_BASE_FRAME::m_aboutTitle.

Referenced by DIALOG_ABOUT::DIALOG_ABOUT(), and COMMON_CONTROL::ReportBug().

◆ GetAutoSaveFilePrefix()

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

Definition at line 572 of file eda_base_frame.h.

573  {
574  return wxT( "_autosave-" );
575  }

Referenced by EDA_BASE_FRAME::CheckForAutoSaveFile(), SCH_EDIT_FRAME::doAutoSave(), PCB_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 419 of file eda_base_frame.h.

419 { 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, SCH_EDIT_FRAME, SYMBOL_VIEWER_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 800 of file eda_base_frame.cpp.

802 {
803  if( !aFileHistory )
804  aFileHistory = m_fileHistory;
805 
806  wxASSERT( aFileHistory );
807 
808  int baseId = aFileHistory->GetBaseId();
809 
810  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) aFileHistory->GetCount() );
811 
812  unsigned i = cmdId - baseId;
813 
814  if( i < aFileHistory->GetCount() )
815  {
816  wxString fn = aFileHistory->GetHistoryFile( i );
817 
818  if( wxFileName::FileExists( fn ) )
819  return fn;
820  else
821  {
822  wxString msg = wxString::Format( _( "File \"%s\" was not found." ), fn );
823  wxMessageBox( msg );
824 
825  aFileHistory->RemoveFileFromHistory( i );
826  }
827  }
828 
829  // Update the menubar to update the file history menu
830  if( GetMenuBar() )
831  {
832  ReCreateMenuBar();
833  GetMenuBar()->Refresh();
834  }
835 
836  return wxEmptyString;
837 }
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 403 of file eda_base_frame.h.

404  {
405  return *m_fileHistory;
406  }
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().

◆ GetInfoBar()

◆ GetMaxUndoItems()

int EDA_BASE_FRAME::GetMaxUndoItems ( ) const
inlineinherited

Definition at line 557 of file eda_base_frame.h.

557 { 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)

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()
enum TRANSLINE_TYPE_ID m_currTransLineType
std::vector< TRANSLINE_IDENT * > m_transline_list
TRANSLINE_PRM * GetPrm(unsigned aIdx)

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 DIALOG_GLOBAL_DELETION::acceptPcbDelete(), 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_GRAPHICS::doCleanup(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), SIM_PLOT_FRAME::doCloseWindow(), SCH_FIELD::DoHypertextMenu(), DRAWING_TOOL::DrawVia(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), PCB_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_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_3D_VIEW_OPTIONS::TransferDataFromWindow(), DIALOG_LIB_EDIT_TEXT::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow(), DIALOG_FIELDS_EDITOR_GLOBAL::TransferDataToWindow(), DIALOG_3D_VIEW_OPTIONS::TransferDataToWindow(), DIALOG_LIB_EDIT_TEXT::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(), 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::DrawDimension(), DRAWING_TOOL::drawSegment(), 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_CIRCLE::GetMsgPanelInfo(), LIB_RECTANGLE::GetMsgPanelInfo(), SCH_PIN::GetMsgPanelInfo(), LIB_ARC::GetMsgPanelInfo(), LIB_POLYLINE::GetMsgPanelInfo(), PCB_MARKER::GetMsgPanelInfo(), LIB_TEXT::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(), TRACK::GetMsgPanelInfo(), FP_TEXT::GetMsgPanelInfo(), LIB_PIN::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_SETUP_BOARD_STACKUP::onUpdateThicknessValue(), 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(), GERBVIEW_FRAME::updateDCodeSelectBox(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), GERBVIEW_FRAME::UpdateStatusBar(), PL_EDITOR_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), DRC_TOOL::userUnits(), and PANEL_SETUP_TRACKS_AND_VIAS::Validate().

◆ 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 SIM_PLOT_FRAME, FOOTPRINT_WIZARD_FRAME, FOOTPRINT_VIEWER_FRAME, SYMBOL_VIEWER_FRAME, and DISPLAY_FOOTPRINTS_FRAME.

Definition at line 675 of file eda_base_frame.cpp.

676 {
677  return &aCfg->m_Window;
678 }
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 1086 of file eda_base_frame.cpp.

1087 {
1088 #ifdef __WXGTK__
1089  // GTK includes the window decorations in the normal GetSize call,
1090  // so we have to use a GTK-specific sizing call that returns the
1091  // non-decorated window size.
1092  int width = 0;
1093  int height = 0;
1094  GTKDoGetSize( &width, &height );
1095 
1096  wxSize winSize( width, height );
1097 #else
1098  wxSize winSize = GetSize();
1099 #endif
1100 
1101  return winSize;
1102 }

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

◆ 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 341 of file eda_base_frame.cpp.

343 {
344  bool checkRes = false;
345  bool enableRes = true;
346  bool showRes = true;
347  SELECTION& selection = aFrame->GetCurrentSelection();
348 
349  try
350  {
351  checkRes = aCond.checkCondition( selection );
352  enableRes = aCond.enableCondition( selection );
353  showRes = aCond.showCondition( selection );
354  }
355  catch( std::exception& )
356  {
357  // Something broke with the conditions, just skip the event.
358  aEvent.Skip();
359  return;
360  }
361 
362  aEvent.Enable( enableRes );
363  aEvent.Show( showRes );
364 
365  // wxWidgets 3.1.5+ includes a field in the event that says if the event supports being
366  // checked, since wxMenuItems don't want to be checked unless they actually are checkable
367 #if wxCHECK_VERSION( 3, 1, 5 )
368  if( aEvent.IsCheckable() )
369  aEvent.Check( checkRes );
370 #else
371  bool canCheck = true;
372 
373  // wxMenuItems don't want to be checked unless they actually are checkable, so we have to check to
374  // see if they can be and can't just universally apply a check in this event.
375  if( auto menu = dynamic_cast<wxMenu*>( aEvent.GetEventObject() ) )
376  canCheck = menu->FindItem( aEvent.GetId() )->IsCheckable();
377 
378  if( canCheck )
379  aEvent.Check( checkRes );
380 #endif
381 }
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 694 of file eda_base_frame.cpp.

695 {
696  return Kiface().GetHelpFileName();
697 }
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()

void PCB_CALCULATOR_FRAME::initColorCodePanel ( )
private

Definition at line 29 of file colorcode.cpp.

30 {
31  m_ccValueNamesBitmap = new wxBitmap( color_code_value_and_name_xpm );
32  m_ccValuesBitmap = new wxBitmap( color_code_value_xpm );
33  m_ccMultipliersBitmap = new wxBitmap( color_code_multiplier_xpm );
34  m_ccTolerancesBitmap = new wxBitmap( color_code_tolerance_xpm );
35 }

References m_ccMultipliersBitmap, m_ccTolerancesBitmap, m_ccValueNamesBitmap, and m_ccValuesBitmap.

Referenced by PCB_CALCULATOR_FRAME().

◆ 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 996 of file eda_base_frame.cpp.

997 {
998  wxAcceleratorEntry entries[1];
999  entries[0].Set( wxACCEL_CTRL, int( 'Q' ), wxID_EXIT );
1000  wxAcceleratorTable accel( 1, entries );
1001  SetAcceleratorTable( accel );
1002 }

◆ initTrackWidthPanel()

void PCB_CALCULATOR_FRAME::initTrackWidthPanel ( )
private

Panel-specific initializers.

Definition at line 418 of file tracks_width_versus_current.cpp.

419 {
420  wxString msg;
421 
422  // Disable calculations while we initialise.
423  m_TWNested = true;
424 
425  // Read parameter values.
426  auto cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( Kiface().KifaceSettings() );
427 
428  m_TrackCurrentValue->SetValue( cfg->m_TrackWidth.current );
429  m_TrackDeltaTValue->SetValue( cfg->m_TrackWidth.delta_tc );
430  m_TrackLengthValue->SetValue( cfg->m_TrackWidth.track_len );
431  m_TW_CuLength_choiceUnit->SetSelection( cfg->m_TrackWidth.track_len_units );
432  m_TWResistivity->SetValue( cfg->m_TrackWidth.resistivity );
433  m_ExtTrackWidthValue->SetValue( cfg->m_TrackWidth.ext_track_width );
434  m_TW_ExtTrackWidth_choiceUnit->SetSelection( cfg->m_TrackWidth.ext_track_width_units );
435  m_ExtTrackThicknessValue->SetValue( cfg->m_TrackWidth.ext_track_thickness );
436  m_ExtTrackThicknessUnit->SetSelection( cfg->m_TrackWidth.ext_track_thickness_units );
437  m_IntTrackWidthValue->SetValue( cfg->m_TrackWidth.int_track_width );
438  m_TW_IntTrackWidth_choiceUnit->SetSelection( cfg->m_TrackWidth.int_track_width_units );
439  m_IntTrackThicknessValue->SetValue( cfg->m_TrackWidth.int_track_thickness );
440  m_IntTrackThicknessUnit->SetSelection( cfg->m_TrackWidth.int_track_thickness_units );
441 
442  if( tracks_width_versus_current_formula.StartsWith( "<!" ) )
444  else
445  {
446  wxString html_txt;
447  ConvertMarkdown2Html( wxGetTranslation( tracks_width_versus_current_formula ), html_txt );
448  m_htmlWinFormulas->SetPage( html_txt );
449  }
450 
451  // Make sure the correct master mode is displayed.
453 
454  // Enable calculations and perform the initial one.
455  m_TWNested = false;
456  wxCommandEvent dummy;
458 }
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,...
KIFACE_I & Kiface()
Global KIFACE_I "get" accessor.
wxString tracks_width_versus_current_formula
UNIT_SELECTOR_THICKNESS * m_IntTrackThicknessUnit
UNIT_SELECTOR_LEN * m_TW_CuLength_choiceUnit
UNIT_SELECTOR_THICKNESS * m_ExtTrackThicknessUnit

References ConvertMarkdown2Html(), dummy(), 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 pcb_calculator/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 278 of file eda_base_frame.h.

278 { }

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 PCB_EDIT_FRAME, and SCH_EDIT_FRAME.

Definition at line 587 of file eda_base_frame.h.

587 { 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 PCB_EDIT_FRAME, SCH_EDIT_FRAME, CVPCB_MAINFRAME, PL_EDITOR_FRAME, SYMBOL_EDIT_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 989 of file eda_base_frame.cpp.

990 {
991  // This function should be overridden in child classes
992  return false;
993 }

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)

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(), SYMBOL_EDITOR_CONTROL::ShowComponentTree(), EE_INSPECTION_TOOL::ShowDatasheet(), EE_INSPECTION_TOOL::ShowERCDialog(), 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 899 of file eda_base_frame.cpp.

900 {
901  wxString msg;
902  wxFileName fn = aFileName;
903 
904  // Check for absence of a file path with a file name. Unfortunately KiCad
905  // uses paths relative to the current project path without the ./ part which
906  // confuses wxFileName. Making the file name path absolute may be less than
907  // elegant but it solves the problem.
908  if( fn.GetPath().IsEmpty() && fn.HasName() )
909  fn.MakeAbsolute();
910 
911  wxCHECK_MSG( fn.IsOk(), false,
912  wxT( "File name object is invalid. Bad programmer!" ) );
913  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
914  wxT( "File name object path <" ) + fn.GetFullPath() +
915  wxT( "> is not set. Bad programmer!" ) );
916 
917  if( fn.IsDir() && !fn.IsDirWritable() )
918  {
919  msg.Printf( _( "You do not have write permissions to folder \"%s\"." ),
920  fn.GetPath() );
921  }
922  else if( !fn.FileExists() && !fn.IsDirWritable() )
923  {
924  msg.Printf( _( "You do not have write permissions to save file \"%s\" to folder \"%s\"." ),
925  fn.GetFullName(), fn.GetPath() );
926  }
927  else if( fn.FileExists() && !fn.IsFileWritable() )
928  {
929  msg.Printf( _( "You do not have write permissions to save file \"%s\"." ),
930  fn.GetFullPath() );
931  }
932 
933  if( !msg.IsEmpty() )
934  {
935  wxMessageBox( msg );
936  return false;
937  }
938 
939  return true;
940 }
#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::BuildLIBRARY_LISTBOX(), 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(), 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, PCB_EDIT_FRAME, SCH_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:447

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 575 of file eda_base_frame.cpp.

576 {
577  LoadWindowState( aCfg->state );
578 
579  if( m_hasAutoSave )
580  m_autoSaveInterval = Pgm().GetCommonSettings()->m_System.autosave_interval;
581 
582  m_perspective = aCfg->perspective;
583  m_mruPath = aCfg->mru_path;
584 
585  TOOLS_HOLDER::CommonSettingsChanged( false, false );
586 }
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 458 of file eda_base_frame.cpp.

459 {
460  if( !Pgm().GetCommonSettings()->m_Session.remember_open_files )
461  return;
462 
463  const PROJECT_FILE_STATE* state = Prj().GetLocalSettings().GetFileState( aFileName );
464 
465  if( state != nullptr )
466  {
467  LoadWindowState( state->window );
468  }
469 }
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 472 of file eda_base_frame.cpp.

473 {
474  bool wasDefault = false;
475 
476  m_framePos.x = aState.pos_x;
477  m_framePos.y = aState.pos_y;
478  m_frameSize.x = aState.size_x;
479  m_frameSize.y = aState.size_y;
480 
481  wxLogTrace( traceDisplayLocation, "Config position (%d, %d) with size (%d, %d)",
483 
484  // Ensure minimum size is set if the stored config was zero-initialized
485  if( m_frameSize.x < minSize( m_ident ).x || m_frameSize.y < minSize( m_ident ).y )
486  {
488  wasDefault = true;
489 
490  wxLogTrace( traceDisplayLocation, "Using minimum size (%d, %d)", m_frameSize.x, m_frameSize.y );
491  }
492 
493  wxLogTrace( traceDisplayLocation, "Number of displays: %d", wxDisplay::GetCount() );
494 
495  if( aState.display >= wxDisplay::GetCount() )
496  {
497  wxLogTrace( traceDisplayLocation, "Previous display not found" );
498 
499  // If it isn't attached, use the first display
500  // Warning wxDisplay has 2 ctor variants. the parameter needs a type:
501  const unsigned int index = 0;
502  wxDisplay display( index );
503  wxRect clientSize = display.GetGeometry();
504 
505  m_framePos = wxDefaultPosition;
506 
507  // Ensure the window fits on the display, since the other one could have been larger
508  if( m_frameSize.x > clientSize.width )
509  m_frameSize.x = clientSize.width;
510 
511  if( m_frameSize.y > clientSize.height )
512  m_frameSize.y = clientSize.height;
513  }
514  else
515  {
516  wxPoint upperRight( m_framePos.x + m_frameSize.x, m_framePos.y );
517  wxPoint upperLeft( m_framePos.x, m_framePos.y );
518 
519  wxDisplay display( aState.display );
520  wxRect clientSize = display.GetClientArea();
521 
522  // The percentage size (represented in decimal) of the region around the screen's border where
523  // an upper corner is not allowed
524 #define SCREEN_BORDER_REGION 0.10
525 
526  int yLim = clientSize.y + ( clientSize.height * ( 1.0 - SCREEN_BORDER_REGION ) );
527  int xLimLeft = clientSize.x + ( clientSize.width * SCREEN_BORDER_REGION );
528  int xLimRight = clientSize.x + ( clientSize.width * ( 1.0 - SCREEN_BORDER_REGION ) );
529 
530  if( upperLeft.x > xLimRight || // Upper left corner too close to right edge of screen
531  upperRight.x < xLimLeft || // Upper right corner too close to left edge of screen
532  upperRight.y > yLim ) // Upper corner too close to the bottom of the screen
533  {
534  m_framePos = wxDefaultPosition;
535  wxLogTrace( traceDisplayLocation, "Resetting to default position" );
536  }
537  }
538 
539  // Ensure Window title bar is visible
540 #if defined( __WXOSX__ )
541  // for macOSX, the window must be below system (macOSX) toolbar
542  int Ypos_min = 20;
543 #else
544  int Ypos_min = 0;
545 #endif
546  if( m_framePos.y < Ypos_min )
547  m_framePos.y = Ypos_min;
548 
549  wxLogTrace( traceDisplayLocation, "Final window position (%d, %d) with size (%d, %d)",
551 
552  SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
553 
554  // Center the window if we reset to default
555  if( m_framePos.x == -1 )
556  {
557  wxLogTrace( traceDisplayLocation, "Centering window" );
558  Center();
559  m_framePos = GetPosition();
560  }
561 
562  // Record the frame sizes in an un-maximized state
565 
566  // Maximize if we were maximized before
567  if( aState.maximized || ( wasDefault && m_maximizeByDefault ) )
568  {
569  wxLogTrace( traceDisplayLocation, "Maximizing window" );
570  Maximize();
571  }
572 }
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 559 of file eda_base_frame.h.

560  {
561  m_isNonUserClose = true;
562  return Close( aForce );
563  }

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 286 of file eda_base_frame.cpp.

287 {
288  if( !doAutoSave() )
289  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
290 }
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 &  event)
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 299 of file eda_base_frame.cpp.

300 {
301  wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( event ) );
302  // Key events can be filtered here.
303  // Currently no filtering is made.
304  event.Skip();
305 }
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 858 of file eda_base_frame.cpp.

859 {
860  void ShowAboutDialog(EDA_BASE_FRAME * aParent); // See AboutDialog_main.cpp
861  ShowAboutDialog( this );
862 }
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 1064 of file eda_base_frame.cpp.

1065 {
1066  // When we maximize the window, we want to save the old information
1067  // so that we can add it to the settings on next window load.
1068  // Contrary to the documentation, this event seems to be generated
1069  // when the window is also being unmaximized on OSX, so we only
1070  // capture the size information when we maximize the window when on OSX.
1071 #ifdef __WXOSX__
1072  if( !IsMaximized() )
1073 #endif
1074  {
1076  m_normalFramePos = GetPosition();
1077  wxLogTrace( traceDisplayLocation, "Maximizing window - Saving position (%d, %d) with size (%d, %d)",
1079  }
1080 
1081  // Skip event to actually maximize the window
1082  aEvent.Skip();
1083 }
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 308 of file eda_base_frame.cpp.

309 {
310  if( !m_toolDispatcher )
311  aEvent.Skip();
312  else
314 }
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 865 of file eda_base_frame.cpp.

866 {
867  PAGED_DIALOG dlg( this, _( "Preferences" ), true );
868  wxTreebook* book = dlg.GetTreebook();
869 
870  book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) );
871 
872  book->AddPage( new PANEL_MOUSE_SETTINGS( &dlg, book ), _( "Mouse and Touchpad" ) );
873 
874  PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false );
875  book->AddPage( hotkeysPanel, _( "Hotkeys" ) );
876 
877  for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i )
878  {
879  KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false );
880 
881  if( frame )
882  frame->InstallPreferences( &dlg, hotkeysPanel );
883  }
884 
885  // The Kicad manager frame is not a player so we have to add it by hand
886  wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME );
887 
888  if( manager )
889  static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
890 
891  for( size_t i = 0; i < book->GetPageCount(); ++i )
892  book->GetPage( i )->Layout();
893 
894  if( dlg.ShowModal() == wxID_OK )
895  dlg.Kiway().CommonSettingsChanged( false, false );
896 }
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:345
#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().

◆ OnToleranceSelection()

void PCB_CALCULATOR_FRAME::OnToleranceSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 38 of file colorcode.cpp.

39 {
40  ToleranceSelection( event.GetSelection() );
41 }
void ToleranceSelection(int aSelection)
Definition: colorcode.cpp:44

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 117 of file transline_dlg_funct.cpp.

118 {
119  wxArrayString list = StandardRelativeDielectricConstantList();
120  list.Add( "" ); // Add an empty line for no selection
121 
122  // Find the previous choice index:
123  wxString prevChoiceStr = m_Value_EpsilonR->GetValue();
124  int prevChoice = 0;
125  findMatch( list, prevChoiceStr, prevChoice );
126 
127  int index = wxGetSingleChoiceIndex( wxEmptyString, _( "Relative Dielectric Constants" ),
128  list, prevChoice );
129 
130  if( index >= 0 && !list.Item( index ).IsEmpty() ) // i.e. non canceled.
131  m_Value_EpsilonR->SetValue( list.Item( index ).BeforeFirst( ' ' ) );
132 }
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 463 of file transline_dlg_funct.cpp.

464 {
466  m_TranslineSelection->SetSelection( DEFAULT_TYPE );
467 
468  m_panelTransline->GetSizer()->Layout();
469  m_panelTransline->Refresh();
470 }
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 163 of file transline_dlg_funct.cpp.

164 {
165  wxArrayString list = StandardResistivityList();
166  list.Add( "" ); // Add an empty line for no selection
167 
168  // Find the previous choice index:
169  wxString prevChoiceStr = m_Value_Rho->GetValue();
170  int prevChoice = 0;
171  findMatch( list, prevChoiceStr, prevChoice );
172 
173  int index = wxGetSingleChoiceIndex( wxEmptyString, _( "Specific Resistance" ), list,
174  prevChoice, NULL );
175 
176  if( index >= 0 && !list.Item( index ).IsEmpty() ) // i.e. non canceled.
177  m_Value_Rho->SetValue( list.Item( index ).BeforeFirst( ' ' ) );
178 }
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 445 of file transline_dlg_funct.cpp.

446 {
447  enum TRANSLINE_TYPE_ID id = (enum TRANSLINE_TYPE_ID) event.GetSelection();
448 
450 
451  // Texts and units choice widgets can have their size modified:
452  // The new size must be taken in account
453  m_panelTransline->GetSizer()->Layout();
454  m_panelTransline->Refresh();
455 }
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 140 of file transline_dlg_funct.cpp.

141 {
142  wxArrayString list = StandardLossTangentList();
143  list.Add( "" ); // Add an empty line for no selection
144 
145  // Find the previous choice index:
146  wxString prevChoiceStr = m_Value_TanD->GetValue();
147  int prevChoice = 0;
148  findMatch( list, prevChoiceStr, prevChoice );
149 
150  int index = wxGetSingleChoiceIndex( wxEmptyString, _( "Dielectric Loss Factor" ), list,
151  prevChoice, NULL );
152 
153  if( index >= 0 && !list.Item( index ).IsEmpty() ) // i.e. non canceled.
154  m_Value_TanD->SetValue( list.Item( index ).BeforeFirst( ' ' ) );
155 }
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 83 of file tracks_width_versus_current.cpp.

84 {
85  // Setting the calculated values generates further events. Stop them.
86  if( m_TWNested )
87  {
88  event.StopPropagation();
89  return;
90  }
91 
92  m_TWNested = true;
93 
94  // Update state.
96  {
99  }
100 
101  // Prepare parameters:
102  double current = std::abs( DoubleFromString( m_TrackCurrentValue->GetValue() ) );
103  double extThickness = std::abs( DoubleFromString( m_ExtTrackThicknessValue->GetValue() ) );
104  double intThickness = std::abs( DoubleFromString( m_IntTrackThicknessValue->GetValue() ) );
105  double deltaT_C = std::abs( DoubleFromString( m_TrackDeltaTValue->GetValue() ) );
106 
107  // Normalize by units.
108  extThickness *= m_ExtTrackThicknessUnit->GetUnitScale();
109  intThickness *= m_IntTrackThicknessUnit->GetUnitScale();
110 
111  // Calculate the widths.
112  double extTrackWidth = TWCalculateWidth( current, extThickness, deltaT_C, false );
113  double intTrackWidth = TWCalculateWidth( current, intThickness, deltaT_C, true );
114 
115  // Update the display.
116  TWDisplayValues( current, extTrackWidth, intTrackWidth, extThickness, intThickness );
117 
118  // Re-enable the events.
119  m_TWNested = false;
120 }
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 123 of file tracks_width_versus_current.cpp.

124 {
125  // Setting the calculated values generates further events. Stop them.
126  if( m_TWNested )
127  {
128  event.StopPropagation();
129  return;
130  }
131  m_TWNested = true;
132 
133  // Update state.
135  {
138  }
139 
140  // Load parameters.
141  double current;
142  double extThickness = std::abs( DoubleFromString( m_ExtTrackThicknessValue->GetValue() ) );
143  double intThickness = std::abs( DoubleFromString( m_IntTrackThicknessValue->GetValue() ) );
144  double deltaT_C = std::abs( DoubleFromString( m_TrackDeltaTValue->GetValue() ) );
145  double extTrackWidth = std::abs( DoubleFromString( m_ExtTrackWidthValue->GetValue() ) );
146  double intTrackWidth;
147 
148  // Normalize units.
149  extThickness *= m_ExtTrackThicknessUnit->GetUnitScale();
150  intThickness *= m_IntTrackThicknessUnit->GetUnitScale();
151  extTrackWidth *= m_TW_ExtTrackWidth_choiceUnit->GetUnitScale();
152 
153  // Calculate the maximum current.
154  current = TWCalculateCurrent( extTrackWidth, extThickness, deltaT_C, false );
155 
156  // And now calculate the corresponding internal width.
157  intTrackWidth = TWCalculateWidth( current, intThickness, deltaT_C, true );
158 
159  // Update the display.
160  TWDisplayValues( current, extTrackWidth, intTrackWidth, extThickness, intThickness );
161 
162  // Re-enable the events.
163  m_TWNested = false;
164 }
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 167 of file tracks_width_versus_current.cpp.

168 {
169  // Setting the calculated values generates further events. Stop them.
170  if( m_TWNested )
171  {
172  event.StopPropagation();
173  return;
174  }
175 
176  m_TWNested = true;
177 
178  // Update state.
180  {
183  }
184 
185  // Load parameters.
186  double current;
187  double extThickness = std::abs( DoubleFromString( m_ExtTrackThicknessValue->GetValue() ) );
188  double intThickness = std::abs( DoubleFromString( m_IntTrackThicknessValue->GetValue() ) );
189  double deltaT_C = std::abs( DoubleFromString( m_TrackDeltaTValue->GetValue() ) );
190  double extTrackWidth;
191  double intTrackWidth = std::abs( DoubleFromString( m_IntTrackWidthValue->GetValue() ) );
192 
193  // Normalize units.
194  extThickness *= m_ExtTrackThicknessUnit->GetUnitScale();
195  intThickness *= m_IntTrackThicknessUnit->GetUnitScale();
196  intTrackWidth *= m_TW_IntTrackWidth_choiceUnit->GetUnitScale();
197 
198  // Calculate the maximum current.
199  current = TWCalculateCurrent( intTrackWidth, intThickness, deltaT_C, true );
200 
201  // And now calculate the corresponding external width.
202  extTrackWidth = TWCalculateWidth( current, extThickness, deltaT_C, false );
203 
204  // Update the display.
205  TWDisplayValues( current, extTrackWidth, intTrackWidth, extThickness, intThickness );
206 
207  // Re-enable the events.
208  m_TWNested = false;
209 }
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.
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_IntTrackThicknessUnit, PCB_CALCULATOR_FRAME_BASE::m_IntTrackThicknessValue, PCB_CALCULATOR_FRAME_BASE::m_IntTrackWidthValue, PCB_CALCULATOR_FRAME_BASE::m_TrackDeltaTValue, PCB_CALCULATOR_FRAME_BASE::m_TW_IntTrackWidth_choiceUnit, m_TWMode, m_TWNested, TW_MASTER_INT_WIDTH, TWCalculateCurrent(), TWCalculateWidth(), TWDisplayValues(), and TWUpdateModeDisplay().

Referenced by OnTWParametersChanged().

◆ OnTWParametersChanged()

void PCB_CALCULATOR_FRAME::OnTWParametersChanged ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTWParametersChanged Called when the user changes the general parameters (i.e., anything that is not one of the controlling values).

This update the calculations.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 66 of file tracks_width_versus_current.cpp.

67 {
68  switch(m_TWMode)
69  {
70  case TW_MASTER_CURRENT:
71  OnTWCalculateFromCurrent( event );
72  break;
75  break;
78  break;
79  }
80 }
enum PCB_CALCULATOR_FRAME::@39 m_TWMode
void OnTWCalculateFromCurrent(wxCommandEvent &event) override
Function OnTWCalculateFromCurrent Called when the user changes the desired maximum current.
void OnTWCalculateFromIntWidth(wxCommandEvent &event) override
Function OnTWCalculateFromIntWidth Called when the user changes the desired internal trace width.
void OnTWCalculateFromExtWidth(wxCommandEvent &event) override
Function OnTWCalculateFromExtWidth Called when the user changes the desired external trace width.

References m_TWMode, OnTWCalculateFromCurrent(), OnTWCalculateFromExtWidth(), OnTWCalculateFromIntWidth(), TW_MASTER_CURRENT, TW_MASTER_EXT_WIDTH, and TW_MASTER_INT_WIDTH.

Referenced by initTrackWidthPanel().

◆ OnTWResetButtonClick()

void PCB_CALCULATOR_FRAME::OnTWResetButtonClick ( wxCommandEvent &  event)
overrideprivatevirtual

Function OnTWResetButtonClick 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 212 of file tracks_width_versus_current.cpp.

213 {
214  // a wxString:Format( "%g", xx) is used to use local separator in floats
215  m_TrackCurrentValue->SetValue( wxString::Format( "%g", 1.0 ) );
216  m_TrackDeltaTValue->SetValue( wxString::Format( "%g", 10.0 ) );
217  m_TrackLengthValue->SetValue( wxString::Format( "%g", 20.0 ) );
218  m_TW_CuLength_choiceUnit->SetSelection( 0 );
219  m_TWResistivity->SetValue( wxString::Format( "%g", 1.72e-8 ) );
220  m_ExtTrackWidthValue->SetValue( wxString::Format( "%g", 0.2 ) );
221  m_TW_ExtTrackWidth_choiceUnit->SetSelection( 0 );
222  m_ExtTrackThicknessValue->SetValue( wxString::Format( "%g", 0.035 ) );
223  m_ExtTrackThicknessUnit->SetSelection( 0 );
224  m_IntTrackWidthValue->SetValue( wxString::Format( "%g", 0.2 ) );
225  m_TW_IntTrackWidth_choiceUnit->SetSelection( 0 );
226  m_IntTrackThicknessValue->SetValue( wxString::Format( "%g", 0.035 ) );
227