KiCad PCB EDA Suite
PCB_CALCULATOR_FRAME Class Reference

PCB calculator the main frame. More...

#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 }
 Specifies whether we are interacting with the undo or redo stacks. 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)
 Read/write params values and results. More...
 
void SetResult (int aLineNumber, const wxString &aText)
 Put the text into the given result line. More...
 
void SetPrmBgColor (enum PRMS_ID aPrmId, const KIGFX::COLOR4D *aCol)
 Set the background color of a parameter. More...
 
double GetPrmValue (enum PRMS_ID aPrmId) const
 Return a param value. More...
 
bool IsPrmSelected (enum PRMS_ID aPrmId) const
 Function IsPrmSelected. More...
 
void OnBoardClassesUnitsSelection (wxCommandEvent &event) override
 
void BoardClassesUpdateData (double aUnitScale)
 
wxWindow * GetToolCanvas () const override
 Canvas access. More...
 
virtual bool OpenProjectFiles (const std::vector< wxString > &aFileList, int aCtl=0)
 Open a project or set of files given by aFileList. More...
 
virtual void ParseArgs (wxCmdLineParser &aParser)
 Handle command-line arguments in a frame-specific way. More...
 
virtual bool ShowModal (wxString *aResult=nullptr, wxWindow *aResultantFocusWindow=nullptr)
 Show this wxFrame as if it were a modal dialog, with all other instantiated wxFrames disabled until this KIWAY_PLAYER derivative calls DismissModal(). More...
 
virtual void KiwayMailIn (KIWAY_EXPRESS &aEvent)
 Receive KIWAY_EXPRESS messages from other players. More...
 
bool Destroy () override
 Our version of Destroy() which is virtual from wxWidgets. More...
 
bool IsModal () const override
 Return true if the frame is shown in our modal mode and false if the frame is shown as an usual frame. More...
 
void SetModal (bool aIsModal)
 
bool IsDismissed ()
 
void DismissModal (bool aRetVal, const wxString &aResult=wxEmptyString)
 
void CreateServer (int service, bool local=true)
 
void OnSockRequest (wxSocketEvent &evt)
 
void OnSockRequestServer (wxSocketEvent &evt)
 
virtual void ExecuteRemoteCommand (const char *cmdline)
 Execute a remote command sent via socket (to port KICAD_PCB_PORT_SERVICE_NUMBER, currently 4242). More...
 
EDA_UNITS GetUserUnits () const
 Return the user units currently in use. More...
 
void SetUserUnits (EDA_UNITS aUnits)
 
void ChangeUserUnits (EDA_UNITS aUnits)
 
virtual void ToggleUserUnits ()
 
SETTINGS_MANAGERGetSettingsManager () const
 
virtual SEVERITY GetSeverity (int aErrorCode) const
 
bool ProcessEvent (wxEvent &aEvent) override
 Override the default process event handler to implement the auto save feature. More...
 
virtual void OnCharHook (wxKeyEvent &aKeyEvent)
 Capture the key event before it is sent to the GUI. More...
 
void OnMenuEvent (wxMenuEvent &event)
 The TOOL_DISPATCHER needs these to work around some issues in wxWidgets where the menu events aren't captured by the menus themselves. More...
 
virtual void RegisterUIUpdateHandler (int aID, const ACTION_CONDITIONS &aConditions) override
 Register a UI update handler for the control with ID aID. More...
 
virtual void RegisterUIUpdateHandler (const TOOL_ACTION &aAction, const ACTION_CONDITIONS &aConditions)
 Register an action's update conditions with the UI layer to allow the UI to appropriately display the state of its controls. More...
 
virtual void UnregisterUIUpdateHandler (int aID) override
 Unregister a UI handler for a given ID that was registered using RegisterUIUpdateHandler. More...
 
virtual void UnregisterUIUpdateHandler (const TOOL_ACTION &aAction)
 Unregister a UI handler for an action that was registered using RegisterUIUpdateHandler. More...
 
virtual void OnMove (wxMoveEvent &aEvent)
 
virtual void OnSize (wxSizeEvent &aEvent)
 
void OnMaximize (wxMaximizeEvent &aEvent)
 
void SetAutoSaveInterval (int aInterval)
 
int GetAutoSaveInterval () const
 
bool IsType (FRAME_T aType) const
 
FRAME_T GetFrameType () const
 
virtual const SEARCH_STACKsys_search ()
 Return a SEARCH_STACK pertaining to entire program. More...
 
virtual wxString help_name ()
 
void OnKicadAbout (wxCommandEvent &event)
 
void OnPreferences (wxCommandEvent &event)
 Displays the preferences and settings of all opened editors paged dialog. More...
 
void PrintMsg (const wxString &text)
 
void CreateInfoBar ()
 
void FinishAUIInitialization ()
 
WX_INFOBARGetInfoBar ()
 
void ShowInfoBarError (const wxString &aErrorMsg, bool aShowCloseButton=false, WX_INFOBAR::MESSAGE_TYPE aType=WX_INFOBAR::MESSAGE_TYPE::GENERIC)
 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...
 
void ShowChangedLanguage () override
 Redraw the menus and what not in current language. More...
 
void CommonSettingsChanged (bool aEnvVarsChanged, bool aTextVarsChanged) override
 Notification event that some of the common (suite-wide) settings have changed. More...
 
virtual void ThemeChanged ()
 Process light/dark theme change. More...
 
virtual void ProjectChanged ()
 Notification event that the project has changed. More...
 
const wxString & GetAboutTitle () const
 
virtual bool IsContentModified () const
 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)
 Remove the aItemCount of old commands from aList and delete commands, pickers and picked items if needed. More...
 
virtual void ClearUndoRedoList ()
 Clear the undo and redo list using ClearUndoORRedoList() More...
 
virtual void PushCommandToUndoList (PICKED_ITEMS_LIST *aItem)
 Add a command to undo in the undo list. More...
 
virtual void PushCommandToRedoList (PICKED_ITEMS_LIST *aItem)
 Add a command to redo in the redo list. More...
 
virtual PICKED_ITEMS_LISTPopCommandFromUndoList ()
 Return the last command to undo and remove it from list, nothing is deleted. More...
 
virtual PICKED_ITEMS_LISTPopCommandFromRedoList ()
 Return the last command to undo and remove it from list, nothing is deleted. More...
 
virtual int GetUndoCommandCount () const
 
virtual int GetRedoCommandCount () const
 
int GetMaxUndoItems () const
 
bool NonUserClose (bool aForce)
 
virtual void HandleSystemColorChange ()
 Update the UI in response to a change in the system colors. More...
 
TOOL_MANAGERGetToolManager () const
 Return the MVC controller. More...
 
virtual SELECTIONGetCurrentSelection ()
 Get the current selection from the canvas area. More...
 
virtual void PushTool (const std::string &actionName)
 NB: the definition of "tool" is different at the user level. More...
 
virtual void PopTool (const std::string &actionName)
 
bool ToolStackIsEmpty ()
 
std::string CurrentToolName () const
 
bool IsCurrentTool (const TOOL_ACTION &aAction) const
 
virtual void DisplayToolMsg (const wxString &msg)
 
bool GetDoImmediateActions () const
 Indicate that hotkeys should perform an immediate action even if another tool is currently active. More...
 
MOUSE_DRAG_ACTION GetDragAction () const
 Indicates whether a drag should draw a selection rectangle or drag selected (or unselected) objects. More...
 
bool GetMoveWarpsCursor () const
 Indicate that a move operation should warp the mouse pointer to the origin of the move object. More...
 
virtual void RefreshCanvas ()
 
HOLDER_TYPE GetType () const
 
KIWAYKiway () const
 Return a reference to the KIWAY that this object has an opportunity to participate in. More...
 
PROJECTPrj () const
 Return a reference to the PROJECT associated with this KIWAY. More...
 
void SetKiway (wxWindow *aDest, KIWAY *aKiway)
 It is only used for debugging, since "this" is not a wxWindow*. More...
 

Static Public Member Functions

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

Public Attributes

REGULATOR_LIST m_RegulatorList
 

Protected Member Functions

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

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
 
wxStaticText * m_left_message8
 
wxStaticText * m_Message8
 
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
 
wxSocketServer * m_socketServer
 
std::vector< wxSocketBase * > m_sockets
 interprocess communication More...
 
FRAME_T m_ident
 
wxPoint m_framePos
 
wxSize m_frameSize
 
bool m_maximizeByDefault
 
int m_displayIndex
 
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 ()
 Write track width parameters in configuration. More...
 
void OnTWParametersChanged (wxCommandEvent &event) override
 Update the calculations the user changes the general parameters. More...
 
void OnTWCalculateFromCurrent (wxCommandEvent &event) override
 Update the calculations when the user changes the desired maximum current. More...
 
void OnTWCalculateFromExtWidth (wxCommandEvent &event) override
 Update the calculations when the user changes the desired external trace width. More...
 
void OnTWCalculateFromIntWidth (wxCommandEvent &event) override
 Update the calculations when the user changes the desired internal trace width. More...
 
void OnTWResetButtonClick (wxCommandEvent &event) override
 Update the calculations when the user clicks the reset button. More...
 
double TWCalculateWidth (double aCurrent, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
 Calculate track width required based on given current and temperature rise. More...
 
double TWCalculateCurrent (double aWidth, double aThickness, double aDeltaT_C, bool aUseInternalLayer)
 Calculate maximum current based on given width and temperature rise. More...
 
void TWDisplayValues (double aCurrent, double aExtWidth, double aIntWidth, double aExtThickness, double aIntThickness)
 Display the results of a calculation (including resulting values such as the resistance and power loss). More...
 
void TWUpdateModeDisplay ()
 Update the fields to show whether the maximum current, external trace width, or internal trace width is currently the controlling parameter. More...
 
void writeViaSizeConfig ()
 Write via size parameters in configuration. More...
 
void OnViaCalculate (wxCommandEvent &event) override
 Called when the user changes any value in the via calculator. More...
 
void OnViaEpsilonR_Button (wxCommandEvent &event) override
 Shows a list of current relative dielectric constant(Er) and set the selected value in main dialog frame. More...
 
void OnViaRho_Button (wxCommandEvent &event) override
 Shows a list of current Specific resistance list (rho) and set the selected value in main dialog frame. More...
 
void onUpdateViaCalcErrorText (wxUpdateUIEvent &event) override
 Update the Error message in via calculation panel. More...
 
void OnViaResetButtonClick (wxCommandEvent &event) override
 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)
 Display 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
 Called on new transmission line selection. More...
 
void OnTransLineResetButtonClick (wxCommandEvent &event) override
 Called when the user clicks the reset button; sets the parameters to their default values. More...
 
void OnTranslineAnalyse (wxCommandEvent &event) override
 Run a new analyze for the current transline with current parameters and displays the electrical parameters. More...
 
void OnTranslineSynthetize (wxCommandEvent &event) override
 Run a new synthesis for the current transline with current parameters and displays the geometrical parameters. More...
 
void OnTranslineEpsilonR_Button (wxCommandEvent &event) override
 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
 Show 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
 Show 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)
 Must be called after selection of a new transline. More...
 
void TransfDlgDataToTranslineParams ()
 Read values entered in dialog frame, and transfer 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 ()
 Update the regulator page dialog display. More...
 
void SelectLastSelectedRegulator ()
 If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate() More...
 
void RegulatorsSolve ()
 
void Regulators_WriteConfig (PCB_CALCULATOR_SETTINGS *aCfg)
 Write regulators parameters in configuration. 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

PCB calculator the main frame.

Definition at line 40 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 338 of file pcb_calculator_frame.h.

339  { // calculations:
340  TW_MASTER_CURRENT, // the maximum current,
341  TW_MASTER_EXT_WIDTH, // the external trace width,
342  TW_MASTER_INT_WIDTH // or the internal trace width?
343  } m_TWMode;
enum PCB_CALCULATOR_FRAME::@39 m_TWMode

◆ HOLDER_TYPE

enum KIWAY_HOLDER::HOLDER_TYPE
inherited
Enumerator
DIALOG 
FRAME 
PANEL 

Definition at line 39 of file kiway_holder.h.

◆ UNDO_REDO_LIST

Specifies whether we are interacting with the undo or redo stacks.

Enumerator
UNDO_LIST 
REDO_LIST 

Definition at line 109 of file eda_base_frame.h.

Constructor & Destructor Documentation

◆ PCB_CALCULATOR_FRAME()

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

Definition at line 34 of file pcb_calculator_frame.cpp.

34  :
35  PCB_CALCULATOR_FRAME_BASE( aParent ),
36  m_lastNotebookPage( -1 ),
37  m_macHack( true )
38 {
42 
43  SetKiway( this, aKiway );
44  m_currTransLine = nullptr;
46  m_currAttenuator = nullptr;
47  m_RegulatorListChanged = false;
49  m_TWNested = false;
50 
51  SHAPE_POLY_SET dummy; // A ugly trick to force the linker to include
52  // some methods in code and avoid link errors
53 
54  // Populate transline list ordered like in dialog menu list
55  const static TRANSLINE_TYPE_ID tltype_list[8] =
56  {
58  CPW_TYPE,
61  COAX_TYPE,
65  };
66 
67  for( int ii = 0; ii < 8; ii++ )
68  m_transline_list.push_back( new TRANSLINE_IDENT( tltype_list[ii] ) );
69 
70  // Populate attenuator list ordered like in dialog menu list
71  m_attenuator_list.push_back( new ATTENUATOR_PI() );
72  m_attenuator_list.push_back( new ATTENUATOR_TEE() );
73  m_attenuator_list.push_back( new ATTENUATOR_BRIDGE() );
74  m_attenuator_list.push_back( new ATTENUATOR_SPLITTER() );
76 
77  m_staticTextAttMsg->SetFont( KIUI::GetInfoFont( this ).Italic() );
78 
79  m_IadjUnitLabel->SetLabel( wxT( "µA" ) );
80 
81  m_attZinUnit->SetLabel( wxT( "Ω" ) );
82  m_attZoutUnit->SetLabel( wxT( "Ω" ) );
83  m_attR1Unit->SetLabel( wxT( "Ω" ) );
84  m_attR2Unit->SetLabel( wxT( "Ω" ) );
85  m_attR3Unit->SetLabel( wxT( "Ω" ) );
86 
87  m_r1Units->SetLabel( wxT( "kΩ" ) );
88  m_r2Units->SetLabel( wxT( "kΩ" ) );
89 
90  m_reqResUnits->SetLabel( wxT( "kΩ" ) );
91  m_exclude1Units->SetLabel( wxT( "kΩ" ) );
92  m_exclude2Units->SetLabel( wxT( "kΩ" ) );
93 
94  m_EpsilonR_label->SetLabel( wxT( "εr" ) );
95 
96  m_trackTempUnits->SetLabel( wxT( "°C" ) );
97  m_resistivityUnits->SetLabel( wxT( "Ω•m" ) );
98 
99  m_viaResistivityUnits->SetLabel( wxT( "Ω•m" ) );
100 
101  m_viaTempUnits->SetLabel( wxT( "°C" ) );
102  m_viaResUnits->SetLabel( wxT( "Ω" ) );
103  m_viaThermalResUnits->SetLabel( wxT( "°C/W" ) );
104  m_viaReactanceUnits->SetLabel( wxT( "Ω" ) );
105 
106  m_extTrackResUnits->SetLabel( wxT( "Ω" ) );
107  m_intTrackResUnits->SetLabel( wxT( "Ω" ) );
108 
109  LoadSettings( config() );
110 
111  ReadDataFile();
112 
114  m_TranslineSelection->SetSelection( m_currTransLineType );
115 
120 
121  SetAttenuator( m_AttenuatorsSelection->GetSelection() );
122 
123  ToleranceSelection( m_rbToleranceSelection->GetSelection() );
124 
126 
128 
131 
132  // Give an icon
133  wxIcon icon;
134  wxIconBundle icon_bundle;
135 
136  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbcalculator ) );
137  icon_bundle.AddIcon( icon );
138  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbcalculator_32 ) );
139  icon_bundle.AddIcon( icon );
140  icon.CopyFromBitmap( KiBitmap( BITMAPS::icon_pcbcalculator_16 ) );
141  icon_bundle.AddIcon( icon );
142 
143  SetIcons( icon_bundle );
144 
145  // Autosize the row label column to be sure label are not truncated
146  m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
147  m_gridElectricalSpacingValues->SetRowLabelSize( wxGRID_AUTOSIZE );
148 
149  GetSizer()->SetSizeHints( this );
150 
151  // Set previous size and position
152  SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
153 
154  if( m_framePos == wxDefaultPosition )
155  Centre();
156 }
void ToleranceSelection(int aSelection)
Definition: colorcode.cpp:42
void SetKiway(wxWindow *aDest, KIWAY *aKiway)
It is only used for debugging, since "this" is not a wxWindow*.
virtual APP_SETTINGS_BASE * config() const
Returns the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
void initViaSizePanel()
Definition: via.cpp:127
wxFont GetInfoFont(wxWindow *aWindow)
Definition: ui_common.cpp:141
A class to handle a list of parameters of a given transline.
enum PCB_CALCULATOR_FRAME::@39 m_TWMode
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
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"))
void initESeriesPanel()
Definition: eserie.cpp:390
void initTrackWidthPanel()
Panel-specific initializers.
Represent a set of closed polygons.
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:105
enum TRANSLINE_TYPE_ID m_currTransLineType
TRANSLINE_TYPE_ID
void TranslineTypeSelection(enum TRANSLINE_TYPE_ID aType)
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:43
std::vector< TRANSLINE_IDENT * > m_transline_list
UNIT_SELECTOR_LEN * m_ElectricalSpacingUnitsSelector
void SelectLastSelectedRegulator()
If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()
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(), KIUI::GetInfoFont(), REGULATOR_LIST::GetRegList(), UNIT_SELECTOR_LEN::GetUnitScale(), GROUNDED_CPW_TYPE, icon_pcbcalculator, icon_pcbcalculator_16, icon_pcbcalculator_32, initColorCodePanel(), initESeriesPanel(), initTrackWidthPanel(), initViaSizePanel(), KiBitmap(), LoadSettings(), m_attenuator_list, PCB_CALCULATOR_FRAME_BASE::m_AttenuatorsSelection, PCB_CALCULATOR_FRAME_BASE::m_attR1Unit, PCB_CALCULATOR_FRAME_BASE::m_attR2Unit, PCB_CALCULATOR_FRAME_BASE::m_attR3Unit, PCB_CALCULATOR_FRAME_BASE::m_attZinUnit, PCB_CALCULATOR_FRAME_BASE::m_attZoutUnit, PCB_CALCULATOR_FRAME_BASE::m_BoardClassesUnitsSelector, PCB_CALCULATOR_FRAME_BASE::m_bpButtonAnalyze, PCB_CALCULATOR_FRAME_BASE::m_bpButtonCalcAtt, PCB_CALCULATOR_FRAME_BASE::m_bpButtonSynthetize, PCB_CALCULATOR_FRAME_BASE::m_choiceRegulatorSelector, m_currAttenuator, m_currTransLine, m_currTransLineType, PCB_CALCULATOR_FRAME_BASE::m_ElectricalSpacingUnitsSelector, PCB_CALCULATOR_FRAME_BASE::m_EpsilonR_label, PCB_CALCULATOR_FRAME_BASE::m_exclude1Units, PCB_CALCULATOR_FRAME_BASE::m_exclude2Units, PCB_CALCULATOR_FRAME_BASE::m_extTrackResUnits, EDA_BASE_FRAME::m_framePos, EDA_BASE_FRAME::m_frameSize, PCB_CALCULATOR_FRAME_BASE::m_gridClassesValuesDisplay, PCB_CALCULATOR_FRAME_BASE::m_gridElectricalSpacingValues, PCB_CALCULATOR_FRAME_BASE::m_IadjUnitLabel, PCB_CALCULATOR_FRAME_BASE::m_intTrackResUnits, PCB_CALCULATOR_FRAME_BASE::m_r1Units, PCB_CALCULATOR_FRAME_BASE::m_r2Units, PCB_CALCULATOR_FRAME_BASE::m_rbToleranceSelection, m_RegulatorList, m_RegulatorListChanged, PCB_CALCULATOR_FRAME_BASE::m_reqResUnits, PCB_CALCULATOR_FRAME_BASE::m_resistivityUnits, PCB_CALCULATOR_FRAME_BASE::m_staticTextAttMsg, PCB_CALCULATOR_FRAME_BASE::m_trackTempUnits, m_transline_list, PCB_CALCULATOR_FRAME_BASE::m_TranslineSelection, m_TWMode, m_TWNested, PCB_CALCULATOR_FRAME_BASE::m_viaReactanceUnits, PCB_CALCULATOR_FRAME_BASE::m_viaResistivityUnits, PCB_CALCULATOR_FRAME_BASE::m_viaResUnits, PCB_CALCULATOR_FRAME_BASE::m_viaTempUnits, PCB_CALCULATOR_FRAME_BASE::m_viaThermalResUnits, MICROSTRIP_TYPE, ReadDataFile(), RECTWAVEGUIDE_TYPE, SelectLastSelectedRegulator(), SetAttenuator(), KIWAY_HOLDER::SetKiway(), small_down, small_up, STRIPLINE_TYPE, ToleranceSelection(), TranslineTypeSelection(), TW_MASTER_CURRENT, and TWISTEDPAIR_TYPE.

◆ ~PCB_CALCULATOR_FRAME()

PCB_CALCULATOR_FRAME::~PCB_CALCULATOR_FRAME ( )

Definition at line 159 of file pcb_calculator_frame.cpp.

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

441 {
442  COMMON_CONTROL* commonControl = m_toolManager->GetTool<COMMON_CONTROL>();
443  ACTION_MENU* helpMenu = new ACTION_MENU( false, commonControl );
444 
445  helpMenu->Add( ACTIONS::help );
446  helpMenu->Add( ACTIONS::gettingStarted );
447  helpMenu->Add( ACTIONS::listHotKeys );
448  helpMenu->Add( ACTIONS::getInvolved );
449  helpMenu->Add( ACTIONS::donate );
450  helpMenu->Add( ACTIONS::reportBug );
451 
452  helpMenu->AppendSeparator();
453  helpMenu->Add( _( "&About KiCad" ), "", wxID_ABOUT, BITMAPS::about );
454 
455  // Trailing space keeps OSX from hijacking our menu (and disabling everything in it).
456  aMenuBar->Append( helpMenu, _( "&Help" ) + wxS( " " ) );
457 }
static TOOL_ACTION listHotKeys
Definition: actions.h:178
Defines the structure of a menu based on ACTIONs.
Definition: action_menu.h:48
static TOOL_ACTION reportBug
Cursor control event types.
Definition: actions.h:181
static TOOL_ACTION donate
Definition: actions.h:179
#define _(s)
Handle actions that are shared between different applications.
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:158
static TOOL_ACTION help
Definition: actions.h:177
static TOOL_ACTION getInvolved
Definition: actions.h:180
static TOOL_ACTION gettingStarted
Definition: actions.h:176

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

Referenced by EDA_3D_VIEWER_FRAME::CreateMenuBar(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SYMBOL_VIEWER_FRAME::ReCreateMenuBar(), SYMBOL_EDIT_FRAME::ReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_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 1181 of file eda_base_frame.cpp.

1182 {
1183  SetUserUnits( aUnits );
1185 
1186  wxCommandEvent e( UNITS_CHANGED );
1187  ProcessEventLocally( e );
1188 }
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 1069 of file eda_base_frame.cpp.

1070 {
1071  wxCHECK_RET( aFileName.IsOk(), wxT( "Invalid file name!" ) );
1072 
1073  wxFileName autoSaveFileName = aFileName;
1074 
1075  // Check for auto save file.
1076  autoSaveFileName.SetName( GetAutoSaveFilePrefix() + aFileName.GetName() );
1077 
1078  wxLogTrace( traceAutoSave,
1079  wxT( "Checking for auto save file " ) + autoSaveFileName.GetFullPath() );
1080 
1081  if( !autoSaveFileName.FileExists() )
1082  return;
1083 
1084  wxString msg = wxString::Format( _(
1085  "Well this is potentially embarrassing!\n"
1086  "It appears that the last time you were editing the file\n"
1087  "\"%s\"\n"
1088  "it was not saved properly. Do you wish to restore the last saved edits you made?" ),
1089  aFileName.GetFullName()
1090  );
1091 
1092  int response = wxMessageBox( msg, Pgm().App().GetAppDisplayName(), wxYES_NO | wxICON_QUESTION,
1093  this );
1094 
1095  // Make a backup of the current file, delete the file, and rename the auto save file to
1096  // the file name.
1097  if( response == wxYES )
1098  {
1099  if( !wxRenameFile( autoSaveFileName.GetFullPath(), aFileName.GetFullPath() ) )
1100  {
1101  wxMessageBox( _( "The auto save file could not be renamed to the board file name." ),
1102  Pgm().App().GetAppDisplayName(), wxOK | wxICON_EXCLAMATION, this );
1103  }
1104  }
1105  else
1106  {
1107  wxLogTrace( traceAutoSave,
1108  wxT( "Removing auto save file " ) + autoSaveFileName.GetFullPath() );
1109 
1110  // Remove the auto save file when using the previous file as is.
1111  wxRemoveFile( autoSaveFileName.GetFullPath() );
1112  }
1113 }
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
#define _(s)
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()

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

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

◆ ClearFileHistory()

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

Removes all files from the file history.

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

Definition at line 956 of file eda_base_frame.cpp.

957 {
958  if( !aFileHistory )
959  aFileHistory = m_fileHistory;
960 
961  wxASSERT( aFileHistory );
962 
963  aFileHistory->ClearFileHistory();
964 
965  // Update the menubar to update the file history menu
966  if( GetMenuBar() )
967  {
968  ReCreateMenuBar();
969  GetMenuBar()->Refresh();
970  }
971 }
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

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.

Reimplemented in SCH_EDIT_FRAME, SYMBOL_EDIT_FRAME, PL_EDITOR_FRAME, and PCB_BASE_EDIT_FRAME.

Definition at line 544 of file eda_base_frame.h.

545  { }

Referenced by EDA_BASE_FRAME::ClearUndoRedoList(), EDA_BASE_FRAME::PushCommandToRedoList(), and EDA_BASE_FRAME::PushCommandToUndoList().

◆ ClearUndoRedoList()

void EDA_BASE_FRAME::ClearUndoRedoList ( )
virtualinherited

◆ 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, FOOTPRINT_VIEWER_FRAME, KICAD_MANAGER_FRAME, and PL_EDITOR_FRAME.

Definition at line 472 of file eda_base_frame.cpp.

473 {
474  TOOLS_HOLDER::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged );
475 
476  COMMON_SETTINGS* settings = Pgm().GetCommonSettings();
477 
478  if( m_fileHistory )
479  {
480  int historySize = settings->m_System.file_history_size;
481  m_fileHistory->SetMaxFiles( (unsigned) std::max( 0, historySize ) );
482  }
483 
485  ThemeChanged();
486 
487  if( GetMenuBar() )
488  {
489  // For icons in menus, icon scaling & hotkeys
490  ReCreateMenuBar();
491  GetMenuBar()->Refresh();
492  }
493 }
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Definition: single_top.cpp:106
void ThemeChanged()
Notifies the store that the icon theme has been changed by the user, so caches must be invalidated.
void SetMaxFiles(size_t aMaxFiles)
Update the number of files that will be contained inside the file history.
Definition: filehistory.cpp:85
virtual void ThemeChanged()
Process light/dark theme change.
virtual void CommonSettingsChanged(bool aEnvVarsChanged, bool aTextVarsChanged)
Notification event that some of the common (suite-wide) settings have changed.
FILE_HISTORY * m_fileHistory
virtual void ReCreateMenuBar()
Recreates the menu bar.
BITMAP_STORE * GetBitmapStore()
Definition: bitmap.cpp:93

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

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

◆ config()

APP_SETTINGS_BASE * EDA_BASE_FRAME::config ( ) const
virtualinherited

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

Reimplemented in SYMBOL_EDIT_FRAME, KICAD_MANAGER_FRAME, and FOOTPRINT_EDIT_FRAME.

Definition at line 796 of file eda_base_frame.cpp.

797 {
798  // KICAD_MANAGER_FRAME overrides this
799  return Kiface().KifaceSettings();
800 }
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
APP_SETTINGS_BASE * KifaceSettings() const
Definition: kiface_base.h:92

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

Referenced by PCB_BASE_FRAME::ActivateGalCanvas(), GERBVIEW_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(), 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(), GERBVIEW_FRAME::Read_EXCELLON_File(), DIALOG_GRID_SETTINGS::RebuildGridSizes(), EDA_DRAW_FRAME::resolveCanvasType(), PCB_BASE_EDIT_FRAME::SetBoard(), EDA_DRAW_FRAME::SetGridVisibility(), PL_EDITOR_FRAME::setupTools(), SYMBOL_VIEWER_FRAME::setupTools(), CVPCB_MAINFRAME::setupTools(), GERBVIEW_FRAME::setupTools(), SCH_EDIT_FRAME::setupTools(), SIM_PLOT_FRAME::SIM_PLOT_FRAME(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), PANEL_GERBVIEW_EXCELLON_SETTINGS::TransferDataFromWindow(), DIALOG_GRID_SETTINGS::TransferDataToWindow(), PANEL_GERBVIEW_EXCELLON_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 358 of file eda_base_frame.h.

359  {
360  wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
361  return baseCfgName;
362  }
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 821 of file eda_base_frame.cpp.

822 {
823 #if defined( __WXOSX_MAC__ )
825 #else
826  m_infoBar = new WX_INFOBAR( this, &m_auimgr );
827 
828  m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
829 #endif
830 }
wxAuiManager m_auimgr
virtual wxWindow * GetToolCanvas() const =0
Canvas access.
Specialization of the wxAuiPaneInfo class for KiCad panels.
A modified version of the wxInfoBar class that allows us to:
Definition: infobar.h:73
WX_INFOBAR * m_infoBar

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

◆ CreateServer()

void KIWAY_PLAYER::CreateServer ( int  service,
bool  local = true 
)
inherited

Definition at line 43 of file eda_dde.cpp.

44 {
45  wxIPV4address addr;
46 
47  // Set the port number
48  addr.Service( service );
49 
50  // Listen on localhost only if requested
51  if( local )
52  addr.Hostname( HOSTNAME );
53 
54  delete m_socketServer;
55  m_socketServer = new wxSocketServer( addr );
56 
57  m_socketServer->SetNotify( wxSOCKET_CONNECTION_FLAG );
58  m_socketServer->SetEventHandler( *this, ID_EDA_SOCKET_EVENT_SERV );
59  m_socketServer->Notify( true );
60 }
static const wxString HOSTNAME(wxT("localhost"))
wxSocketServer * m_socketServer
Definition: kiway_player.h:218

References HOSTNAME(), ID_EDA_SOCKET_EVENT_SERV, and KIWAY_PLAYER::m_socketServer.

Referenced by SCH::IFACE::CreateWindow().

◆ CurrentToolName()

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

Definition at line 100 of file tools_holder.cpp.

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

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

Referenced by TOOL_MANAGER::processEvent(), and TOOLS_HOLDER::ShowChangedLanguage().

◆ Destroy()

◆ DismissModal()

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

Definition at line 166 of file kiway_player.cpp.

167 {
168  m_modal_ret_val = aRetVal;
169  m_modal_string = aResult;
170 
171  if( m_modal_loop )
172  {
173  m_modal_loop->Exit();
174  m_modal_loop = nullptr; // this marks it as dismissed.
175  }
176 
177  Show( false );
178 }
bool m_modal_ret_val
Definition: kiway_player.h:216
wxString m_modal_string
Definition: kiway_player.h:215
WX_EVENT_LOOP * m_modal_loop
< Points to nested event_loop. NULL means not modal and dismissed.
Definition: kiway_player.h:213

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 121 of file tools_holder.h.

121 {};

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

◆ doAutoSave()

bool EDA_BASE_FRAME::doAutoSave ( )
protectedvirtualinherited

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

Returns
true if the auto save was successful otherwise false.

Reimplemented in SCH_EDIT_FRAME, and PCB_EDIT_FRAME.

Definition at line 323 of file eda_base_frame.cpp.

324 {
325  wxCHECK_MSG( false, true, wxT( "Auto save timer function not overridden. Bad programmer!" ) );
326 }

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().

◆ ensureWindowIsOnScreen()

void EDA_BASE_FRAME::ensureWindowIsOnScreen ( )
protectedinherited

Definition at line 637 of file eda_base_frame.cpp.

638 {
639  wxDisplay display( wxDisplay::GetFromWindow( this ) );
640  wxRect clientSize = display.GetClientArea();
641  wxPoint pos = GetPosition();
642  wxSize size = GetWindowSize();
643 
644  wxLogTrace( traceDisplayLocation,
645  "ensureWindowIsOnScreen: clientArea (%d, %d) w %d h %d", clientSize.x, clientSize.y,
646  clientSize.width, clientSize.height );
647 
648  if( pos.y < clientSize.y )
649  {
650  wxLogTrace( traceDisplayLocation,
651  "ensureWindowIsOnScreen: y pos %d below minimum, setting to %d", pos.y,
652  clientSize.y );
653  pos.y = clientSize.y;
654  }
655 
656  if( pos.x < clientSize.x )
657  {
658  wxLogTrace( traceDisplayLocation,
659  "ensureWindowIsOnScreen: x pos %d is off the client rect, setting to %d", pos.x,
660  clientSize.x );
661  pos.x = clientSize.x;
662  }
663 
664  if( pos.x + size.x - clientSize.x > clientSize.width )
665  {
666  int newWidth = clientSize.width - ( pos.x - clientSize.x );
667  wxLogTrace( traceDisplayLocation,
668  "ensureWindowIsOnScreen: effective width %d above available %d, setting to %d",
669  pos.x + size.x, clientSize.width, newWidth );
670  size.x = newWidth;
671  }
672 
673  if( pos.y + size.y - clientSize.y > clientSize.height )
674  {
675  int newHeight = clientSize.height - ( pos.y - clientSize.y );
676  wxLogTrace( traceDisplayLocation,
677  "ensureWindowIsOnScreen: effective height %d above available %d, setting to %d",
678  pos.y + size.y, clientSize.height, newHeight );
679  size.y = newHeight;
680  }
681 
682  wxLogTrace( traceDisplayLocation, "Updating window position (%d, %d) with size (%d, %d)",
683  pos.x, pos.y, size.x, size.y );
684 
685  SetSize( pos.x, pos.y, size.x, size.y );
686 }
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
wxSize GetWindowSize()
Get the undecorated window size that can be used for restoring the window size.

References EDA_BASE_FRAME::GetWindowSize(), and traceDisplayLocation.

Referenced by EDA_BASE_FRAME::OnSize().

◆ ExecuteRemoteCommand()

virtual void KIWAY_PLAYER::ExecuteRemoteCommand ( const char *  cmdline)
inlinevirtualinherited

Execute a remote command sent via socket (to port KICAD_PCB_PORT_SERVICE_NUMBER, currently 4242).

Subclasses should override to implement actual command handlers.

Reimplemented in SCH_EDIT_FRAME, and PCB_EDIT_FRAME.

Definition at line 196 of file kiway_player.h.

196 {}

Referenced by KIWAY_PLAYER::OnSockRequest().

◆ FinishAUIInitialization()

void EDA_BASE_FRAME::FinishAUIInitialization ( )
inherited

Definition at line 833 of file eda_base_frame.cpp.

834 {
835 #if defined( __WXOSX_MAC__ )
836  m_auimgr.Update();
837 #else
838  // Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
839  // hiding it.
840  m_auimgr.Update();
841 
842  // We don't want the infobar displayed right away
843  m_auimgr.GetPane( "InfoBar" ).Hide();
844  m_auimgr.Update();
845 #endif
846 }
wxAuiManager m_auimgr

References EDA_BASE_FRAME::m_auimgr.

◆ GetAboutTitle()

const wxString& EDA_BASE_FRAME::GetAboutTitle ( ) const
inlineinherited

◆ GetAutoSaveFilePrefix()

static wxString EDA_BASE_FRAME::GetAutoSaveFilePrefix ( )
inlinestaticprotectedinherited

◆ GetAutoSaveInterval()

int EDA_BASE_FRAME::GetAutoSaveInterval ( ) const
inlineinherited

Definition at line 204 of file eda_base_frame.h.

204 { 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 439 of file eda_base_frame.h.

439 { return wxEmptyString; }

Referenced by EDA_BASE_FRAME::SaveSettings().

◆ GetCurrentSelection()

virtual SELECTION& TOOLS_HOLDER::GetCurrentSelection ( )
inlinevirtualinherited

Get the current selection from the canvas area.

Returns
the current selection.

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

Definition at line 101 of file tools_holder.h.

102  {
103  return m_dummySelection;
104  }
SELECTION m_dummySelection
Definition: tools_holder.h:162

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 379 of file pcb_calculator_frame.cpp.

380 {
381  if( m_regulators_fileNameCtrl->GetValue().IsEmpty() )
382  return wxEmptyString;
383 
384  wxFileName fn( m_regulators_fileNameCtrl->GetValue() );
385  fn.SetExt( DataFileNameExt );
386  return fn.GetFullPath();
387 }
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 129 of file tools_holder.h.

129 { return m_immediateActions; }
bool m_immediateActions
Definition: tools_holder.h:171

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 135 of file tools_holder.h.

135 { return m_dragAction; }
MOUSE_DRAG_ACTION m_dragAction
Definition: tools_holder.h:175

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

918 {
919  if( !aFileHistory )
920  aFileHistory = m_fileHistory;
921 
922  wxASSERT( aFileHistory );
923 
924  int baseId = aFileHistory->GetBaseId();
925 
926  wxASSERT( cmdId >= baseId && cmdId < baseId + (int) aFileHistory->GetCount() );
927 
928  unsigned i = cmdId - baseId;
929 
930  if( i < aFileHistory->GetCount() )
931  {
932  wxString fn = aFileHistory->GetHistoryFile( i );
933 
934  if( wxFileName::FileExists( fn ) )
935  {
936  return fn;
937  }
938  else
939  {
940  DisplayErrorMessage( this, wxString::Format( _( "File '%s' was not found." ), fn ) );
941  aFileHistory->RemoveFileFromHistory( i );
942  }
943  }
944 
945  // Update the menubar to update the file history menu
946  if( GetMenuBar() )
947  {
948  ReCreateMenuBar();
949  GetMenuBar()->Refresh();
950  }
951 
952  return wxEmptyString;
953 }
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
Definition: confirm.cpp:284
#define _(s)
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
FILE_HISTORY * m_fileHistory
virtual void ReCreateMenuBar()
Recreates the menu bar.

References _, DisplayErrorMessage(), 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 423 of file eda_base_frame.h.

424  {
425  return *m_fileHistory;
426  }
FILE_HISTORY * m_fileHistory

References EDA_BASE_FRAME::m_fileHistory.

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

◆ GetFrameType()

FRAME_T EDA_BASE_FRAME::GetFrameType ( ) const
inlineinherited

Definition at line 207 of file eda_base_frame.h.

207 { return m_ident; }

References EDA_BASE_FRAME::m_ident.

◆ GetInfoBar()

◆ GetMaxUndoItems()

int EDA_BASE_FRAME::GetMaxUndoItems ( ) const
inlineinherited

Definition at line 581 of file eda_base_frame.h.

581 { 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 141 of file tools_holder.h.

141 { return m_moveWarpsCursor; }
bool m_moveWarpsCursor
Definition: tools_holder.h:177

References TOOLS_HOLDER::m_moveWarpsCursor.

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

◆ GetMruPath()

◆ GetPrmValue()

double PCB_CALCULATOR_FRAME::GetPrmValue ( enum PRMS_ID  aPrmId) const

Return a param value.

Function GetPrmValue Returns a param value.

Parameters
aPrmIdis the parameter id to write.
Returns
the value always in normalized unit (meter, Hz, Ohm, radian).
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
A class to handle one parameter of transline.
A class to handle a list of parameters of a given transline.
unsigned GetPrmsCount() const
enum TRANSLINE_TYPE_ID m_currTransLineType
TRANSLINE_PRM * GetPrm(unsigned aIdx) const
std::vector< TRANSLINE_IDENT * > m_transline_list

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

Referenced by GetPropertyInDialog().

◆ GetRedoCommandCount()

virtual int EDA_BASE_FRAME::GetRedoCommandCount ( ) const
inlinevirtualinherited

◆ GetSettingsManager()

SETTINGS_MANAGER* EDA_BASE_FRAME::GetSettingsManager ( ) const
inlineinherited

Definition at line 140 of file eda_base_frame.h.

140 { return m_settingsManager; }
SETTINGS_MANAGER * m_settingsManager

References EDA_BASE_FRAME::m_settingsManager.

Referenced by GERBVIEW_FRAME::applyDisplaySettingsToGAL(), KICAD_MANAGER_FRAME::canCloseWindow(), KICAD_MANAGER_FRAME::CreateNewProject(), PCB_EDIT_FRAME::doAutoSave(), SCH_EDIT_FRAME::doAutoSave(), PCB_BASE_EDIT_FRAME::doCloseWindow(), FOOTPRINT_EDIT_FRAME::doCloseWindow(), PCB_EDIT_FRAME::Files_io_from_id(), DIALOG_PLOT_SCHEMATIC::getColorSettings(), GetSettingsManager(), DIALOG_PLOT_SCHEMATIC::initDlg(), DIALOG_SCHEMATIC_SETUP::OnAuxiliaryAction(), DIALOG_BOARD_SETUP::OnAuxiliaryAction(), SCH_EDIT_FRAME::OnImportProject(), GERBER_LAYER_WIDGET::OnLayerColorChange(), GERBER_LAYER_WIDGET::OnRenderColorChange(), KICAD_MANAGER_FRAME::OnUnarchiveFiles(), PCB_EDIT_FRAME::OpenProjectFiles(), SCH_EDIT_FRAME::OpenProjectFiles(), PANEL_FP_EDITOR_COLOR_SETTINGS::PANEL_FP_EDITOR_COLOR_SETTINGS(), PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS(), PCB_EDIT_FRAME::SavePcbCopy(), PCB_EDIT_FRAME::SavePcbFile(), SCH_EDIT_FRAME::SaveProject(), SCH_EDIT_FRAME::SaveProjectSettings(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_EDIT_FRAME::SaveSettings(), PANEL_FP_EDITOR_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_SYM_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_PCBNEW_COLOR_SETTINGS::TransferDataFromWindow(), PANEL_SYM_COLOR_SETTINGS::TransferDataToWindow(), DIALOG_PRINT_PCBNEW::TransferDataToWindow(), and SCH_EDIT_FRAME::~SCH_EDIT_FRAME().

◆ GetSeverity()

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

Reimplemented in PCB_BASE_FRAME.

Definition at line 142 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 88 of file pcb_calculator_frame.h.

89  {
90  return nullptr;
91  }

◆ GetToolManager()

TOOL_MANAGER* TOOLS_HOLDER::GetToolManager ( ) const
inlineinherited

Return the MVC controller.

Definition at line 54 of file tools_holder.h.

54 { return m_toolManager; }
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:158

References TOOLS_HOLDER::m_toolManager.

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), APPEARANCE_CONTROLS::APPEARANCE_CONTROLS(), BOARD_COMMIT::BOARD_COMMIT(), FOOTPRINT_VIEWER_FRAME::ClickOnFootprintList(), TOOLS_HOLDER::CommonSettingsChanged(), DIALOG_FOOTPRINT_CHECKER::deleteAllMarkers(), DIALOG_ERC::deleteAllMarkers(), DIALOG_DRC::deleteAllMarkers(), DIALOG_BOARD_REANNOTATE::DIALOG_BOARD_REANNOTATE(), DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES(), PL_DRAW_PANEL_GAL::DisplayDrawingSheet(), DIALOG_CLEANUP_GRAPHICS::doCleanup(), DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup(), SIM_PLOT_FRAME::doCloseWindow(), DIALOG_GLOBAL_DELETION::DoGlobalDeletions(), SCH_FIELD::DoHypertextMenu(), DRAWING_TOOL::DrawVia(), TRACK_WIDTH_MENU::eventHandler(), DIFF_PAIR_MENU::eventHandler(), PCB_EDIT_FRAME::ExecuteRemoteCommand(), SCH_EDIT_FRAME::ExecuteRemoteCommand(), GERBVIEW_FRAME::GERBVIEW_FRAME(), FP_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), SYMBOL_TREE_SYNCHRONIZING_ADAPTER::GetContextMenuTool(), PL_EDITOR_FRAME::GetLayoutFromRedoList(), PL_EDITOR_FRAME::GetLayoutFromUndoList(), SCH_NAVIGATE_TOOL::HypertextCommand(), ROUTER_TOOL::InlineBreakTrack(), EDA_3D_VIEWER_FRAME::InstallPreferences(), 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(), PCB_EDIT_FRAME::LoadProjectSettings(), FOOTPRINT_EDIT_FRAME::LoadSettings(), SYMBOL_EDIT_FRAME::LoadSymbol(), PROPERTIES_FRAME::OnAcceptPrms(), DIALOG_DRC::OnActivateDlg(), DIALOG_FOOTPRINT_CHECKER::OnCancelClick(), DIALOG_DRC::OnCancelClick(), DIALOG_INSPECTOR::onCellClicked(), DIALOG_ERC::OnCloseErcDialog(), DIALOG_FOOTPRINT_CHECKER::OnDeleteOneClick(), DIALOG_DRC::OnDeleteOneClick(), DIALOG_DRC::OnDRCItemRClick(), DIALOG_ERC::OnERCItemSelected(), DIALOG_CONSTRAINTS_REPORTER::OnErrorLinkClicked(), KICAD_MANAGER_FRAME::OnIdle(), FOOTPRINTS_LISTBOX::OnLeftDClick(), APPEARANCE_CONTROLS::onNetclassContextMenu(), APPEARANCE_CONTROLS::onNetContextMenu(), PANEL_PCBNEW_ACTION_PLUGINS::OnOpenDirectoryButtonClick(), SIM_PLOT_FRAME::onProbe(), PANEL_PCBNEW_ACTION_PLUGINS::OnReloadButtonClick(), DIALOG_ABOUT::onReportBug(), DIALOG_PLOT::onRunDRC(), DIALOG_DRC::OnRunDRCClick(), HIERARCHY_NAVIG_DLG::onSelectSheetPath(), SCH_EDIT_FRAME::onSize(), SYMBOL_TREE_PANE::onSymbolSelected(), DIALOG_SYMBOL_FIELDS_TABLE::OnTableCellClick(), SIM_PLOT_FRAME::onTune(), PANEL_SELECTION_FILTER::PANEL_SELECTION_FILTER(), DIALOG_UPDATE_PCB::PerformUpdate(), DIALOG_PLOT::Plot(), TOOLS_HOLDER::PopTool(), FOOTPRINT_WIZARD_FRAME::PythonPluginsReload(), PL_EDITOR_FRAME::RollbackFromUndo(), FOOTPRINT_EDIT_FRAME::SaveFootprintToBoard(), PCB_EDIT_FRAME::SaveProjectSettings(), FOOTPRINT_EDIT_FRAME::SaveSettings(), EDA_3D_VIEWER_FRAME::SaveSettings(), DIALOG_FIND::search(), CVPCB_MAINFRAME::setupEventHandlers(), APPEARANCE_CONTROLS::showNetclass(), SYMBOL_VIEWER_FRAME::SYMBOL_VIEWER_FRAME(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), PANEL_3D_DISPLAY_OPTIONS::TransferDataFromWindow(), DIALOG_LIB_TEXT_PROPERTIES::TransferDataFromWindow(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataFromWindow(), DIALOG_SYMBOL_PROPERTIES::TransferDataFromWindow(), DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow(), PANEL_3D_DISPLAY_OPTIONS::TransferDataToWindow(), DIALOG_LIB_TEXT_PROPERTIES::TransferDataToWindow(), DIALOG_SYMBOL_FIELDS_TABLE::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 46 of file kiway_holder.h.

46 { return m_type; }
HOLDER_TYPE m_type
Definition: kiway_holder.h:76

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 126 of file eda_base_frame.h.

127  {
128  return m_userUnits;
129  }
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(), EE_INSPECTION_TOOL::CheckSymbol(), PANEL_SETUP_BOARD_STACKUP::computeBoardThickness(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EDA_DRAW_FRAME::DisplayGridMsg(), GERBER_FILE_IMAGE::DisplayImageInfo(), DIALOG_GROUP_PROPERTIES::DoAddMember(), PL_SELECTION_TOOL::doSelectionMenu(), EE_SELECTION_TOOL::doSelectionMenu(), PCB_SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawBoardCharacteristics(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawSegment(), DRAWING_TOOL::DrawSpecificationStackup(), EVT_GRID_CMD_CELL_CHANGED(), PCB_EDIT_FRAME::GenFootprintsReport(), PANEL_FP_EDITOR_DEFAULTS::getGridValue(), PANEL_SETUP_TEXT_AND_GRAPHICS::getGridValue(), BOARD_INSPECTION_TOOL::getItemDescription(), LIB_CIRCLE::GetMsgPanelInfo(), LIB_ARC::GetMsgPanelInfo(), LIB_RECTANGLE::GetMsgPanelInfo(), SCH_PIN::GetMsgPanelInfo(), LIB_POLYLINE::GetMsgPanelInfo(), PL_EDITOR_LAYOUT::GetMsgPanelInfo(), LIB_TEXT::GetMsgPanelInfo(), PCB_MARKER::GetMsgPanelInfo(), LIB_BEZIER::GetMsgPanelInfo(), PCB_TARGET::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), DS_DRAW_ITEM_BASE::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), LIB_FIELD::GetMsgPanelInfo(), SCH_BITMAP::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), LIB_PIN::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), FP_TEXT::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), PCB_SHAPE::GetMsgPanelInfo(), PCB_VIA::GetMsgPanelInfo(), PCB_DIM_ALIGNED::GetMsgPanelInfo(), PCB_DIM_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::onAdjustDielectricThickness(), PANEL_SETUP_BOARD_STACKUP::onThicknessChange(), DIALOG_NET_INSPECTOR::onUnitsChanged(), UNIT_BINDER::onUnitsChanged(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), PANEL_SETUP_BOARD_STACKUP::PANEL_SETUP_BOARD_STACKUP(), POSITION_RELATIVE_TOOL::PositionRelative(), DRC_TOOL::RunTests(), GERBVIEW_INSPECTION_TOOL::ShowDCodes(), COMMON_TOOLS::ToggleUnits(), PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow(), PANEL_SETUP_CONSTRAINTS::TransferDataToWindow(), UNIT_BINDER::UNIT_BINDER(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), EDITOR_CONDITIONS::unitsFunc(), VIA_SIZE_MENU::update(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), BOARD_NETLIST_UPDATER::updateCopperZoneNets(), GERBVIEW_FRAME::updateDCodeSelectBox(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), ROUTER_TOOL::updateMessagePanel(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), GERBVIEW_FRAME::UpdateStatusBar(), PL_EDITOR_FRAME::UpdateStatusBar(), SCH_BASE_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), and DRC_TOOL::userUnits().

◆ GetWindowSettings()

WINDOW_SETTINGS * EDA_BASE_FRAME::GetWindowSettings ( APP_SETTINGS_BASE aCfg)
virtualinherited

Return a pointer to the window settings for this frame.

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

Parameters
aCfgis this frame's config object

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

Definition at line 790 of file eda_base_frame.cpp.

791 {
792  return &aCfg->m_Window;
793 }
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 1215 of file eda_base_frame.cpp.

1216 {
1217 #ifdef __WXGTK__
1218  // GTK includes the window decorations in the normal GetSize call,
1219  // so we have to use a GTK-specific sizing call that returns the
1220  // non-decorated window size.
1221  int width = 0;
1222  int height = 0;
1223  GTKDoGetSize( &width, &height );
1224 
1225  wxSize winSize( width, height );
1226 #else
1227  wxSize winSize = GetSize();
1228 #endif
1229 
1230  return winSize;
1231 }

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

◆ HandleSystemColorChange()

void EDA_BASE_FRAME::HandleSystemColorChange ( )
virtualinherited

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

Definition at line 1234 of file eda_base_frame.cpp.

1235 {
1236  // Update the icon theme when the system theme changes and update the toolbars
1238  ThemeChanged();
1239 
1240  // This isn't handled by ThemeChanged()
1241  if( GetMenuBar() )
1242  {
1243  // For icons in menus, icon scaling & hotkeys
1244  ReCreateMenuBar();
1245  GetMenuBar()->Refresh();
1246  }
1247 }
void ThemeChanged()
Notifies the store that the icon theme has been changed by the user, so caches must be invalidated.
virtual void ThemeChanged()
Process light/dark theme change.
virtual void ReCreateMenuBar()
Recreates the menu bar.
BITMAP_STORE * GetBitmapStore()
Definition: bitmap.cpp:93

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

Referenced by EDA_BASE_FRAME::onSystemColorChange().

◆ HandleUpdateUIEvent()

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

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

enabled, checked, etc.).

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

Definition at line 372 of file eda_base_frame.cpp.

374 {
375  bool checkRes = false;
376  bool enableRes = true;
377  bool showRes = true;
378  SELECTION& selection = aFrame->GetCurrentSelection();
379 
380  try
381  {
382  checkRes = aCond.checkCondition( selection );
383  enableRes = aCond.enableCondition( selection );
384  showRes = aCond.showCondition( selection );
385  }
386  catch( std::exception& )
387  {
388  // Something broke with the conditions, just skip the event.
389  aEvent.Skip();
390  return;
391  }
392 
393  aEvent.Enable( enableRes );
394  aEvent.Show( showRes );
395 
396  // wxWidgets 3.1.5+ includes a field in the event that says if the event supports being
397  // checked, since wxMenuItems don't want to be checked unless they actually are checkable
398 #if wxCHECK_VERSION( 3, 1, 5 )
399  if( aEvent.IsCheckable() )
400  aEvent.Check( checkRes );
401 #else
402  bool canCheck = true;
403 
404  // wxMenuItems don't want to be checked unless they actually are checkable, so we have to
405  // check to see if they can be and can't just universally apply a check in this event.
406  if( auto menu = dynamic_cast<wxMenu*>( aEvent.GetEventObject() ) )
407  canCheck = menu->FindItem( aEvent.GetId() )->IsCheckable();
408 
409  if( canCheck )
410  aEvent.Check( checkRes );
411 #endif
412 }
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:101

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

810 {
811  return Kiface().GetHelpFileName();
812 }
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
const wxString & GetHelpFileName() const
Return just the basename portion of the current help file.
Definition: kiface_base.h:109

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

Referenced by COMMON_CONTROL::ShowHelp().

◆ ImportHotkeyConfigFromFile()

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

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

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

◆ initColorCodePanel()

◆ initESeriesPanel()

void PCB_CALCULATOR_FRAME::initESeriesPanel ( )
private

Definition at line 390 of file eserie.cpp.

391 {
392  wxString msg;
393 
394  // show markdown formula explanation in lower help panel
395  ConvertMarkdown2Html( wxGetTranslation( eseries_help ), msg );
396  m_panelESeriesHelp->SetPage( msg );
397 }
void ConvertMarkdown2Html(const wxString &aMarkdownInput, wxString &aHtmlOutput)
wxString eseries_help
Definition: eserie.cpp:35

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

1124 {
1125  wxAcceleratorEntry entries[1];
1126  entries[0].Set( wxACCEL_CTRL, int( 'Q' ), wxID_EXIT );
1127  wxAcceleratorTable accel( 1, entries );
1128  SetAcceleratorTable( accel );
1129 }

◆ 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 #if 0 // the IPC formula is valid for copper traces, so we do not currently adjust the resistivity
433  m_TWResistivity->SetValue( cfg->m_TrackWidth.resistivity );
434 #else
436 #endif
437  m_ExtTrackWidthValue->SetValue( cfg->m_TrackWidth.ext_track_width );
438  m_TW_ExtTrackWidth_choiceUnit->SetSelection( cfg->m_TrackWidth.ext_track_width_units );
439  m_ExtTrackThicknessValue->SetValue( cfg->m_TrackWidth.ext_track_thickness );
440  m_ExtTrackThicknessUnit->SetSelection( cfg->m_TrackWidth.ext_track_thickness_units );
441  m_IntTrackWidthValue->SetValue( cfg->m_TrackWidth.int_track_width );
442  m_TW_IntTrackWidth_choiceUnit->SetSelection( cfg->m_TrackWidth.int_track_width_units );
443  m_IntTrackThicknessValue->SetValue( cfg->m_TrackWidth.int_track_thickness );
444  m_IntTrackThicknessUnit->SetSelection( cfg->m_TrackWidth.int_track_thickness_units );
445 
446  if( tracks_width_versus_current_formula.StartsWith( "<!" ) )
448  else
449  {
450  wxString html_txt;
451  ConvertMarkdown2Html( wxGetTranslation( tracks_width_versus_current_formula ), html_txt );
452  m_htmlWinFormulas->SetPage( html_txt );
453  }
454 
455  // Make sure the correct master mode is displayed.
457 
458  // Enable calculations and perform the initial one.
459  m_TWNested = false;
460  wxCommandEvent dummy;
462 }
void OnTWParametersChanged(wxCommandEvent &event) override
Update the calculations the user changes the general parameters.
UNIT_SELECTOR_LEN * m_TW_ExtTrackWidth_choiceUnit
UNIT_SELECTOR_LEN * m_TW_IntTrackWidth_choiceUnit
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
void TWUpdateModeDisplay()
Update the fields to show whether the maximum current, external trace width, or internal trace width ...
static LIB_SYMBOL * dummy()
Used to draw a dummy shape when a LIB_SYMBOL is not found in library.
Definition: sch_symbol.cpp:72
const double copper_resistivity
void ConvertMarkdown2Html(const wxString &aMarkdownInput, wxString &aHtmlOutput)
wxString tracks_width_versus_current_formula
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200
UNIT_SELECTOR_THICKNESS * m_IntTrackThicknessUnit
UNIT_SELECTOR_LEN * m_TW_CuLength_choiceUnit
UNIT_SELECTOR_THICKNESS * m_ExtTrackThicknessUnit

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

Referenced by PCB_CALCULATOR_FRAME().

◆ initViaSizePanel()

void PCB_CALCULATOR_FRAME::initViaSizePanel ( )
private

Definition at line 127 of file via.cpp.

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

Definition at line 298 of file eda_base_frame.h.

298 { }

Referenced by EDA_BASE_FRAME::OnPreferences().

◆ isAutoSaveRequired()

virtual bool EDA_BASE_FRAME::isAutoSaveRequired ( ) const
inlineprotectedvirtualinherited

Return the auto save status of the application.

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

Reimplemented in SCH_EDIT_FRAME, and PCB_EDIT_FRAME.

Definition at line 616 of file eda_base_frame.h.

616 { return false; }

Referenced by EDA_BASE_FRAME::ProcessEvent().

◆ IsContentModified()

bool EDA_BASE_FRAME::IsContentModified ( ) const
virtualinherited

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

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

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

Definition at line 1116 of file eda_base_frame.cpp.

1117 {
1118  // This function should be overridden in child classes
1119  return false;
1120 }

Referenced by GERBVIEW_FRAME::Clear_DrawLayers(), and EDITOR_CONDITIONS::contentModifiedFunc().

◆ IsCurrentTool()

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

Definition at line 109 of file tools_holder.cpp.

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

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

Referenced by 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 160 of file kiway_player.cpp.

161 {
162  return !m_modal_loop;
163 }
WX_EVENT_LOOP * m_modal_loop
< Points to nested event_loop. NULL means not modal and dismissed.
Definition: kiway_player.h:213

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 173 of file kiway_player.h.

173 { return m_modal; }

References KIWAY_PLAYER::m_modal.

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

◆ IsPrmSelected()

bool PCB_CALCULATOR_FRAME::IsPrmSelected ( enum PRMS_ID  aPrmId) const

Function IsPrmSelected.

Returns
true if the parameter aPrmId is selected.
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 206 of file eda_base_frame.h.

206 { 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(), CONVERT_TOOL::CreatePolys(), 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_FIELD_PROPERTIES::init(), PCB_SELECTION_TOOL::Init(), DIALOG_PAD_PROPERTIES::initValues(), PCB_SELECTION_TOOL::Main(), APPEARANCE_CONTROLS::OnColorSwatchChanged(), SYMBOL_EDITOR_CONTROL::OnDeMorgan(), APPEARANCE_CONTROLS::onObjectVisibilityChanged(), PCB_CONTROL::Paste(), SYMBOL_EDITOR_CONTROL::PinLibrary(), PCB_CONTROL::placeBoardItems(), POSITION_RELATIVE_TOOL::RelativeItemSelectionMove(), SYMBOL_EDITOR_CONTROL::Revert(), SYMBOL_EDITOR_CONTROL::Save(), APPEARANCE_CONTROLS::setVisibleObjects(), EE_INSPECTION_TOOL::ShowDatasheet(), EE_INSPECTION_TOOL::ShowERCDialog(), SYMBOL_EDITOR_CONTROL::ToggleSymbolTree(), SYMBOL_EDITOR_CONTROL::UnpinLibrary(), and DIALOG_PAGES_SETTINGS::UpdateDrawingSheetExample().

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

1026 {
1027  wxString msg;
1028  wxFileName fn = aFileName;
1029 
1030  // Check for absence of a file path with a file name. Unfortunately KiCad
1031  // uses paths relative to the current project path without the ./ part which
1032  // confuses wxFileName. Making the file name path absolute may be less than
1033  // elegant but it solves the problem.
1034  if( fn.GetPath().IsEmpty() && fn.HasName() )
1035  fn.MakeAbsolute();
1036 
1037  wxCHECK_MSG( fn.IsOk(), false,
1038  wxT( "File name object is invalid. Bad programmer!" ) );
1039  wxCHECK_MSG( !fn.GetPath().IsEmpty(), false,
1040  wxT( "File name object path <" ) + fn.GetFullPath() +
1041  wxT( "> is not set. Bad programmer!" ) );
1042 
1043  if( fn.IsDir() && !fn.IsDirWritable() )
1044  {
1045  msg.Printf( _( "Insufficient permissions to folder '%s'." ),
1046  fn.GetPath() );
1047  }
1048  else if( !fn.FileExists() && !fn.IsDirWritable() )
1049  {
1050  msg.Printf( _( "Insufficient permissions to save file '%s'." ),
1051  fn.GetFullName(), fn.GetPath() );
1052  }
1053  else if( fn.FileExists() && !fn.IsFileWritable() )
1054  {
1055  msg.Printf( _( "Insufficient permissions to save file '%s'." ),
1056  fn.GetFullPath() );
1057  }
1058 
1059  if( !msg.IsEmpty() )
1060  {
1061  wxMessageBox( msg );
1062  return false;
1063  }
1064 
1065  return true;
1066 }
#define _(s)

References _.

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

◆ 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 53 of file kiway_holder.h.

54  {
55  wxASSERT( m_kiway ); // smoke out bugs in Debug build, then Release runs fine.
56  return *m_kiway;
57  }
KIWAY * m_kiway
Definition: kiway_holder.h:75

References KIWAY_HOLDER::m_kiway.

Referenced by PROJECT_TREE_ITEM::Activate(), FOOTPRINT_VIEWER_FRAME::AddFootprintToPCB(), PCB_BASE_EDIT_FRAME::AddLibrary(), SYMBOL_EDIT_FRAME::AddLibraryFile(), SYMBOL_EDITOR_CONTROL::AddSymbolToSchematic(), 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(), SCH_EDIT_FRAME::doCloseWindow(), FIELDS_GRID_TRICKS::doPopupSelection(), FIELDS_EDITOR_GRID_TRICKS::doPopupSelection(), BOARD_EDITOR_CONTROL::EditFpInFpEditor(), SCH_EDITOR_CONTROL::EditWithSymbolEditor(), BACK_ANNOTATE::FetchNetlistFromPCB(), KICAD_MANAGER_FRAME::ImportNonKiCadProject(), SCRIPTING_TOOL::Init(), EDA_DRAW_FRAME::IsScriptingConsoleVisible(), 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(), 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_FIELD_PROPERTIES::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(), FOOTPRINT_WIZARD_FRAME::PythonPluginsReload(), 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(), EDA_DRAW_FRAME::ScriptingConsoleEnableDisable(), 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::SetCurSymbol(), 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 181 of file kiway_player.cpp.

182 {
183  // logging support
184  KiwayMailIn( aEvent ); // call the virtual, override in derived.
185 }
virtual void KiwayMailIn(KIWAY_EXPRESS &aEvent)
Receive KIWAY_EXPRESS messages from other players.

References KIWAY_PLAYER::KiwayMailIn().

◆ KiwayMailIn()

void KIWAY_PLAYER::KiwayMailIn ( KIWAY_EXPRESS aEvent)
virtualinherited

Receive KIWAY_EXPRESS messages from other players.

Override it in derived classes.

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

Definition at line 71 of file kiway_player.cpp.

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

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 188 of file kiway_player.cpp.

189 {
190  int id = event.GetId();
191 
192  // tell all the KIWAY_PLAYERs about the language change.
193  Kiway().SetLanguage( id );
194 }
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
virtual void SetLanguage(int aLanguage)
Change the language and then calls ShowChangedLanguage() on all #KIWAY_PLAYERs.
Definition: kiway.cpp:485

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 279 of file pcb_calculator_frame.cpp.

280 {
281  if( aCfg == nullptr )
282  return;
283 
285 
286  PCB_CALCULATOR_SETTINGS* cfg = static_cast<PCB_CALCULATOR_SETTINGS*>( aCfg );
287 
288  m_currTransLineType = static_cast<TRANSLINE_TYPE_ID>( cfg->m_TransLine.type );
289  m_Notebook->ChangeSelection( cfg->m_LastPage );
290  m_rbToleranceSelection->SetSelection( cfg->m_ColorCodeTolerance );
291  m_AttenuatorsSelection->SetSelection( cfg->m_Attenuators.type );
292  m_BoardClassesUnitsSelector->SetSelection( cfg->m_BoardClassUnits );
293 
294  // Regul panel config:
295  m_RegulR1Value->SetValue( cfg->m_Regulators.r1 );
296  m_RegulR2Value->SetValue( cfg->m_Regulators.r2 );
297  m_RegulVrefValue->SetValue( cfg->m_Regulators.vref );
298  m_RegulVoutValue->SetValue( cfg->m_Regulators.vout );
301  m_choiceRegType->SetSelection( cfg->m_Regulators.type );
302 
303  wxRadioButton* regprms[3] = { m_rbRegulR1, m_rbRegulR2, m_rbRegulVout };
304 
305  if( cfg->m_Regulators.last_param >= 3 )
306  cfg->m_Regulators.last_param = 0;
307 
308  for( int ii = 0; ii < 3; ii++ )
309  regprms[ii]->SetValue( cfg->m_Regulators.last_param == ii );
310 
311  // Electrical panel config
314 
315  for( TRANSLINE_IDENT* transline : m_transline_list )
316  transline->ReadConfig();
317 
318  for( ATTENUATOR* attenuator : m_attenuator_list )
319  attenuator->ReadConfig();
320 }
A class to handle a list of parameters of a given transline.
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, 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 689 of file eda_base_frame.cpp.

690 {
691  LoadWindowState( aCfg->state );
692 
693  if( m_hasAutoSave )
694  m_autoSaveInterval = Pgm().GetCommonSettings()->m_System.autosave_interval;
695 
696  m_perspective = aCfg->perspective;
697  m_mruPath = aCfg->mru_path;
698 
699  TOOLS_HOLDER::CommonSettingsChanged( false, false );
700 }
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 529 of file eda_base_frame.cpp.

530 {
531  if( !Pgm().GetCommonSettings()->m_Session.remember_open_files )
532  return;
533 
534  const PROJECT_FILE_STATE* state = Prj().GetLocalSettings().GetFileState( aFileName );
535 
536  if( state != nullptr )
537  {
538  LoadWindowState( state->window );
539  }
540 }
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 543 of file eda_base_frame.cpp.

544 {
545  bool wasDefault = false;
546 
547  m_framePos.x = aState.pos_x;
548  m_framePos.y = aState.pos_y;
549  m_frameSize.x = aState.size_x;
550  m_frameSize.y = aState.size_y;
551 
552  wxLogTrace( traceDisplayLocation, "Config position (%d, %d) with size (%d, %d)",
554 
555  // Ensure minimum size is set if the stored config was zero-initialized
556  if( m_frameSize.x < minSize( m_ident ).x || m_frameSize.y < minSize( m_ident ).y )
557  {
559  wasDefault = true;
560 
561  wxLogTrace( traceDisplayLocation, "Using minimum size (%d, %d)",
562  m_frameSize.x, m_frameSize.y );
563  }
564 
565  wxLogTrace( traceDisplayLocation, "Number of displays: %d", wxDisplay::GetCount() );
566 
567  if( aState.display >= wxDisplay::GetCount() )
568  {
569  wxLogTrace( traceDisplayLocation, "Previous display not found" );
570 
571  // If it isn't attached, use the first display
572  // Warning wxDisplay has 2 ctor variants. the parameter needs a type:
573  const unsigned int index = 0;
574  wxDisplay display( index );
575  wxRect clientSize = display.GetGeometry();
576 
577  m_framePos = wxDefaultPosition;
578 
579  // Ensure the window fits on the display, since the other one could have been larger
580  if( m_frameSize.x > clientSize.width )
581  m_frameSize.x = clientSize.width;
582 
583  if( m_frameSize.y > clientSize.height )
584  m_frameSize.y = clientSize.height;
585  }
586  else
587  {
588  wxPoint upperRight( m_framePos.x + m_frameSize.x, m_framePos.y );
589  wxPoint upperLeft( m_framePos.x, m_framePos.y );
590 
591  wxDisplay display( aState.display );
592  wxRect clientSize = display.GetClientArea();
593 
594  int yLimTop = clientSize.y;
595  int yLimBottom = clientSize.y + clientSize.height;
596  int xLimLeft = clientSize.x;
597  int xLimRight = clientSize.x + clientSize.width;
598 
599  if( upperLeft.x > xLimRight || // Upper left corner too close to right edge of screen
600  upperRight.x < xLimLeft || // Upper right corner too close to left edge of screen
601  upperLeft.y < yLimTop || // Upper corner too close to the bottom of the screen
602  upperLeft.y > yLimBottom )
603  {
604  m_framePos = wxDefaultPosition;
605  wxLogTrace( traceDisplayLocation, "Resetting to default position" );
606  }
607  }
608 
609  wxLogTrace( traceDisplayLocation, "Final window position (%d, %d) with size (%d, %d)",
611 
612  SetSize( m_framePos.x, m_framePos.y, m_frameSize.x, m_frameSize.y );
613 
614  // Center the window if we reset to default
615  if( m_framePos.x == -1 )
616  {
617  wxLogTrace( traceDisplayLocation, "Centering window" );
618  Center();
619  m_framePos = GetPosition();
620  }
621 
622  // Record the frame sizes in an un-maximized state
625 
626  // Maximize if we were maximized before
627  if( aState.maximized || ( wasDefault && m_maximizeByDefault ) )
628  {
629  wxLogTrace( traceDisplayLocation, "Maximizing window" );
630  Maximize();
631  }
632 
633  m_displayIndex = wxDisplay::GetFromWindow( this );
634 }
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
wxPoint m_normalFramePos
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_displayIndex, 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, WINDOW_STATE::size_x, WINDOW_STATE::size_y, and traceDisplayLocation.

◆ NonUserClose()

bool EDA_BASE_FRAME::NonUserClose ( bool  aForce)
inlineinherited

Definition at line 583 of file eda_base_frame.h.

584  {
585  m_isNonUserClose = true;
586  return Close( aForce );
587  }

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 166 of file regulators_funct.cpp.

167 {
168  DIALOG_REGULATOR_FORM dlg( this, wxEmptyString );
169 
170  if( dlg.ShowModal() != wxID_OK )
171  return;
172 
173  REGULATOR_DATA* new_item = dlg.BuildRegulatorFromData();
174 
175  // Add new item, if not existing
176  if( m_RegulatorList.GetReg( new_item->m_Name ) == nullptr )
177  {
178  // Add item in list
179  m_RegulatorList.Add( new_item );
180  m_RegulatorListChanged = true;
181  m_choiceRegulatorSelector->Clear();
185  }
186  else
187  {
188  wxMessageBox( _("This regulator is already in list. Aborted") );
189  delete new_item;
190  }
191 }
REGULATOR_DATA * GetReg(const wxString &aName)
Subclass of DIALOG_REGULATOR_FORM_BASE, which is generated by wxFormBuilder.
wxArrayString GetRegList() const
void Add(REGULATOR_DATA *aItem)
#define _(s)
REGULATOR_LIST m_RegulatorList
void SelectLastSelectedRegulator()
If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()

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

◆ OnAttenuatorSelection()

void PCB_CALCULATOR_FRAME::OnAttenuatorSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 36 of file attenuators.cpp.

37 {
38  SetAttenuator( (unsigned) event.GetSelection() );
39  Refresh();
40 }
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:43

References Refresh(), and SetAttenuator().

◆ onAutoSaveTimer()

void EDA_BASE_FRAME::onAutoSaveTimer ( wxTimerEvent &  aEvent)
protectedinherited

Handle the auto save timer event.

Definition at line 316 of file eda_base_frame.cpp.

317 {
318  if( !doAutoSave() )
319  m_autoSaveTimer->Start( m_autoSaveInterval * 1000, wxTIMER_ONE_SHOT );
320 }
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::commonInit().

◆ 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 57 of file attenuators.cpp.

58 {
62 }
virtual bool Calculate()
Calculates the values of components in attenuator.
void TransfPanelDataToAttenuator()
Definition: attenuators.cpp:65
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 285 of file eserie.cpp.

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

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

◆ OnCharHook()

void EDA_BASE_FRAME::OnCharHook ( wxKeyEvent &  aKeyEvent)
virtualinherited

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

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

Reimplemented in FOOTPRINT_VIEWER_FRAME.

Definition at line 329 of file eda_base_frame.cpp.

330 {
331  wxLogTrace( kicadTraceKeyEvent, "EDA_BASE_FRAME::OnCharHook %s", dump( aKeyEvent ) );
332 
333  // Key events can be filtered here.
334  // Currently no filtering is made.
335  aKeyEvent.Skip();
336 }
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 246 of file pcb_calculator_frame.cpp.

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

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

◆ OnDataFileSelection()

void PCB_CALCULATOR_FRAME::OnDataFileSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 122 of file regulators_funct.cpp.

123 {
124  wxString fullfilename = GetDataFilename();
125 
126  wxString wildcard;
127  wildcard.Printf( _("PCB Calculator data file" ) + wxT( " (*.%s)|*.%s"),
129 
130  wxFileDialog dlg( m_panelRegulators, _("Select PCB Calculator Data File"),
131  wxEmptyString, fullfilename, wildcard, wxFD_OPEN );
132 
133  if (dlg.ShowModal() == wxID_CANCEL)
134  return;
135 
136  fullfilename = dlg.GetPath();
137 
138  if( fullfilename == GetDataFilename() )
139  return;
140 
141  SetDataFilename( fullfilename );
142 
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  else
158  {
159  wxString msg;
160  msg.Printf( _("Unable to read data file '%s'."), fullfilename );
161  wxMessageBox( msg );
162  }
163 }
const wxString DataFileNameExt
const wxString GetDataFilename()
wxArrayString GetRegList() const
#define _(s)
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
void SelectLastSelectedRegulator()
If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()

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 194 of file regulators_funct.cpp.

195 {
196  wxString name = m_choiceRegulatorSelector->GetStringSelection();
198 
199  if( item == nullptr )
200  return;
201 
202  DIALOG_REGULATOR_FORM dlg( this, name );
203 
204  dlg.CopyRegulatorDataToDialog( item );
205 
206  if( dlg.ShowModal() != wxID_OK )
207  return;
208 
209  REGULATOR_DATA * new_item = dlg.BuildRegulatorFromData();
210  m_RegulatorList.Replace( new_item );
211 
212  m_RegulatorListChanged = true;
213 
215 }
REGULATOR_DATA * GetReg(const wxString &aName)
Subclass of DIALOG_REGULATOR_FORM_BASE, which is generated by wxFormBuilder.
REGULATOR_LIST m_RegulatorList
const char * name
Definition: DXF_plotter.cpp:56
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()
If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()

References DIALOG_REGULATOR_FORM::BuildRegulatorFromData(), DIALOG_REGULATOR_FORM::CopyRegulatorDataToDialog(), REGULATOR_LIST::GetReg(), PCB_CALCULATOR_FRAME_BASE::m_choiceRegulatorSelector, m_RegulatorList, m_RegulatorListChanged, name, 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 378 of file eserie.cpp.

379 {
380  if( event.GetEventObject() == m_e1 )
381  r.SetSeries( E1 );
382  else if( event.GetEventObject() == m_e3 )
383  r.SetSeries( E3 );
384  else if( event.GetEventObject() == m_e12 )
385  r.SetSeries( E12 );
386  else
387  r.SetSeries( E6 );
388 }
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 974 of file eda_base_frame.cpp.

975 {
976  void ShowAboutDialog( EDA_BASE_FRAME * aParent ); // See AboutDialog_main.cpp
977  ShowAboutDialog( this );
978 }
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 1191 of file eda_base_frame.cpp.

1192 {
1193  // When we maximize the window, we want to save the old information
1194  // so that we can add it to the settings on next window load.
1195  // Contrary to the documentation, this event seems to be generated
1196  // when the window is also being unmaximized on OSX, so we only
1197  // capture the size information when we maximize the window when on OSX.
1198 #ifdef __WXOSX__
1199  if( !IsMaximized() )
1200 #endif
1201  {
1203  m_normalFramePos = GetPosition();
1204  wxLogTrace( traceDisplayLocation,
1205  "Maximizing window - Saving position (%d, %d) with size (%d, %d)",
1208  }
1209 
1210  // Skip event to actually maximize the window
1211  aEvent.Skip();
1212 }
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 339 of file eda_base_frame.cpp.

340 {
341  if( !m_toolDispatcher )
342  aEvent.Skip();
343  else
345 }
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:160

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 193 of file eda_base_frame.h.

194  {
195  aEvent.Skip();
196  }

◆ OnPreferences()

void EDA_BASE_FRAME::OnPreferences ( wxCommandEvent &  event)
inherited

Displays the preferences and settings of all opened editors paged dialog.

Definition at line 981 of file eda_base_frame.cpp.

982 {
983  PAGED_DIALOG dlg( this, _( "Preferences" ), true );
984  wxTreebook* book = dlg.GetTreebook();
985 
986  book->AddPage( new PANEL_COMMON_SETTINGS( &dlg, book ), _( "Common" ) );
987 
988  book->AddPage( new PANEL_MOUSE_SETTINGS( &dlg, book ), _( "Mouse and Touchpad" ) );
989 
990  PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false );
991  book->AddPage( hotkeysPanel, _( "Hotkeys" ) );
992 
993  wxWindow* viewer3D = nullptr;
994 
995  for( unsigned i = 0; i < KIWAY_PLAYER_COUNT; ++i )
996  {
997  KIWAY_PLAYER* frame = dlg.Kiway().Player( (FRAME_T) i, false );
998 
999  if( frame )
1000  {
1001  frame->InstallPreferences( &dlg, hotkeysPanel );
1002 
1003  if( !viewer3D )
1004  viewer3D = wxFindWindowByName( QUALIFIED_VIEWER3D_FRAMENAME( frame ) );
1005  }
1006  }
1007 
1008  if( viewer3D )
1009  static_cast<EDA_BASE_FRAME*>( viewer3D )->InstallPreferences( &dlg, hotkeysPanel );
1010 
1011  // The Kicad manager frame is not a player so we have to add it by hand
1012  wxWindow* manager = wxFindWindowByName( KICAD_MANAGER_FRAME_NAME );
1013 
1014  if( manager )
1015  static_cast<EDA_BASE_FRAME*>( manager )->InstallPreferences( &dlg, hotkeysPanel );
1016 
1017  for( size_t i = 0; i < book->GetPageCount(); ++i )
1018  book->GetPage( i )->Layout();
1019 
1020  if( dlg.ShowModal() == wxID_OK )
1021  dlg.Kiway().CommonSettingsChanged( false, false );
1022 }
A wxFrame capable of the OpenProjectFiles function, meaning it can load a portion of a KiCad project.
Definition: kiway_player.h:64
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
Definition: kiway_holder.h:53
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:382
#define _(s)
#define KICAD_MANAGER_FRAME_NAME
#define QUALIFIED_VIEWER3D_FRAMENAME(parent)
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, KIWAY::Player(), and QUALIFIED_VIEWER3D_FRAMENAME.

Referenced by APPEARANCE_CONTROLS::onReadOnlySwatch(), and COMMON_CONTROL::OpenPreferences().

◆ OnRegulatorCalcButtonClick()

void PCB_CALCULATOR_FRAME::OnRegulatorCalcButtonClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 42 of file regulators_funct.cpp.

43 {
45 }

References RegulatorsSolve().

◆ OnRegulatorResetButtonClick()

void PCB_CALCULATOR_FRAME::OnRegulatorResetButtonClick ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 48 of file regulators_funct.cpp.

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

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 100 of file regulators_funct.cpp.

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

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 94 of file regulators_funct.cpp.

95 {
97 }
void RegulatorPageUpdate()
Update the regulator page dialog display.

References RegulatorPageUpdate().

◆ OnRemoveRegulator()

void PCB_CALCULATOR_FRAME::OnRemoveRegulator ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 218 of file regulators_funct.cpp.

219 {
220  wxString name = wxGetSingleChoice( _("Remove Regulator"), wxEmptyString,
222  if( name.IsEmpty() )
223  return;
224 
226  m_RegulatorListChanged = true;
227  m_choiceRegulatorSelector->Clear();
229 
232 
234 }
wxArrayString GetRegList() const
#define _(s)
void Remove(const wxString &aRegName)
REGULATOR_LIST m_RegulatorList
const char * name
Definition: DXF_plotter.cpp:56
void SelectLastSelectedRegulator()
If m_lastSelectedRegulatorName is empty, just calls RegulatorPageUpdate()

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

◆ OnSize()

void EDA_BASE_FRAME::OnSize ( wxSizeEvent &  aEvent)
virtualinherited

Reimplemented in EDA_DRAW_FRAME, FOOTPRINT_VIEWER_FRAME, FOOTPRINT_WIZARD_FRAME, SYMBOL_VIEWER_FRAME, and KICAD_MANAGER_FRAME.

Definition at line 511 of file eda_base_frame.cpp.

512 {
513 #ifdef __WXMAC__
514  int currentDisplay = wxDisplay::GetFromWindow( this );
515 
516  if( m_displayIndex >= 0 && currentDisplay >= 0 && currentDisplay != m_displayIndex )
517  {
518  wxLogTrace( traceDisplayLocation, "OnSize: current display changed %d to %d",
519  m_displayIndex, currentDisplay );
520  m_displayIndex = currentDisplay;
522  }
523 #endif
524 
525  aEvent.Skip();
526 }
const wxChar *const traceDisplayLocation
Flag to enable debug output of display positioning logic.
void ensureWindowIsOnScreen()

References EDA_BASE_FRAME::ensureWindowIsOnScreen(), EDA_BASE_FRAME::m_displayIndex, and traceDisplayLocation.

Referenced by EDA_DRAW_FRAME::OnSize().

◆ OnSockRequest()

void KIWAY_PLAYER::OnSockRequest ( wxSocketEvent &  evt)
inherited

Definition at line 63 of file eda_dde.cpp.

64 {
65  size_t len;
66  wxSocketBase* sock = evt.GetSocket();
67 
68  switch( evt.GetSocketEvent() )
69  {
70  case wxSOCKET_INPUT:
71  sock->Read( client_ipc_buffer, 1 );
72 
73  if( sock->LastCount() == 0 )
74  break; // No data, occurs on opening connection
75 
76  sock->Read( client_ipc_buffer + 1, IPC_BUF_SIZE - 2 );
77  len = 1 + sock->LastCount();
78  client_ipc_buffer[len] = 0;
80  break;
81 
82  case wxSOCKET_LOST:
83  return;
84  break;
85 
86  default:
87  wxPrintf( wxT( "EDA_DRAW_FRAME::OnSockRequest() error: Invalid event !" ) );
88  break;
89  }
90 }
#define IPC_BUF_SIZE
Definition: eda_dde.cpp:39
static char client_ipc_buffer[IPC_BUF_SIZE]
Definition: eda_dde.cpp:40
virtual void ExecuteRemoteCommand(const char *cmdline)
Execute a remote command sent via socket (to port KICAD_PCB_PORT_SERVICE_NUMBER, currently 4242).
Definition: kiway_player.h:196

References client_ipc_buffer, KIWAY_PLAYER::ExecuteRemoteCommand(), and IPC_BUF_SIZE.

◆ OnSockRequestServer()

void KIWAY_PLAYER::OnSockRequestServer ( wxSocketEvent &  evt)
inherited

Definition at line 93 of file eda_dde.cpp.

94 {
95  wxSocketBase* socket;
96  wxSocketServer* server = (wxSocketServer*) evt.GetSocket();
97 
98  socket = server->Accept();
99 
100  if( socket == nullptr )
101  return;
102 
103  m_sockets.push_back( socket );
104 
105  socket->Notify( true );
106  socket->SetEventHandler( *this, ID_EDA_SOCKET_EVENT );
107  socket->SetNotify( wxSOCKET_INPUT_FLAG | wxSOCKET_LOST_FLAG );
108 }
std::vector< wxSocketBase * > m_sockets
interprocess communication
Definition: kiway_player.h:219

References ID_EDA_SOCKET_EVENT, and KIWAY_PLAYER::m_sockets.

◆ onSystemColorChange()

void EDA_BASE_FRAME::onSystemColorChange ( wxSysColourChangedEvent &  aEvent)
protectedinherited

Definition at line 1250 of file eda_base_frame.cpp.

1251 {
1252  // Call the handler to update the colors used in the frame
1254 
1255  // Skip the change event to ensure the rest of the window controls get it
1256  aEvent.Skip();
1257 }
virtual void HandleSystemColorChange()
Update the UI in response to a change in the system colors.

References EDA_BASE_FRAME::HandleSystemColorChange().

◆ OnToleranceSelection()

void PCB_CALCULATOR_FRAME::OnToleranceSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 36 of file colorcode.cpp.

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

References ToleranceSelection().

◆ OnTranslineAnalyse()

void PCB_CALCULATOR_FRAME::OnTranslineAnalyse ( wxCommandEvent &  event)
overrideprivatevirtual

Run a new analyze for the current transline with current parameters and displays the electrical parameters.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 359 of file pcb_calculator_frame.cpp.

360 {
361  if( m_currTransLine )
362  {
365  }
366 }
void analyze()
Definition: transline.cpp:206
void TransfDlgDataToTranslineParams()
Read values entered in dialog frame, and transfer these values in current transline parameters,...

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

◆ OnTranslineEpsilonR_Button()

void PCB_CALCULATOR_FRAME::OnTranslineEpsilonR_Button ( wxCommandEvent &  event)
overrideprivatevirtual

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

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

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

◆ OnTransLineResetButtonClick()

void PCB_CALCULATOR_FRAME::OnTransLineResetButtonClick ( wxCommandEvent &  event)
overrideprivatevirtual

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

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 433 of file transline_dlg_funct.cpp.

434 {
436  m_TranslineSelection->SetSelection( DEFAULT_TYPE );
437 
438  m_panelTransline->GetSizer()->Layout();
439  m_panelTransline->Refresh();
440 }
void TranslineTypeSelection(enum TRANSLINE_TYPE_ID aType)
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

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

148 {
149  wxArrayString list = StandardResistivityList();
150  list.Add( "" ); // Add an empty line for no selection
151 
152  // Find the previous choice index:
153  wxString prevChoiceStr = m_Value_Rho->GetValue();
154  int prevChoice = 0;
155  findMatch( list, prevChoiceStr, prevChoice );
156 
157  int index = wxGetSingleChoiceIndex( wxEmptyString, _( "Specific Resistance" ), list,
158  prevChoice, nullptr );
159 
160  if( index >= 0 && !list.Item( index ).IsEmpty() ) // i.e. non canceled.
161  m_Value_Rho->SetValue( list.Item( index ).BeforeFirst( ' ' ) );
162 }
static bool findMatch(wxArrayString &aList, const wxString &aValue, int &aIdx)
#define _(s)
wxArrayString StandardResistivityList()
Definition: common_data.cpp:84

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

◆ OnTranslineSelection()

void PCB_CALCULATOR_FRAME::OnTranslineSelection ( wxCommandEvent &  event)
overrideprivatevirtual

Called on new transmission line selection.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 420 of file transline_dlg_funct.cpp.

421 {
422  enum TRANSLINE_TYPE_ID id = (enum TRANSLINE_TYPE_ID) event.GetSelection();
423 
425 
426  // Texts and units choice widgets can have their size modified:
427  // The new size must be taken in account
428  m_panelTransline->GetSizer()->Layout();
429  m_panelTransline->Refresh();
430 }
TRANSLINE_TYPE_ID
void TranslineTypeSelection(enum TRANSLINE_TYPE_ID aType)
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

Run a new synthesis for the current transline with current parameters and displays the geometrical parameters.

Reimplemented from PCB_CALCULATOR_FRAME_BASE.

Definition at line 369 of file pcb_calculator_frame.cpp.

370 {
371  if( m_currTransLine )
372  {
375  }
376 }
void TransfDlgDataToTranslineParams()
Read values entered in dialog frame, and transfer these values in current transline parameters,...
virtual void synthesize()
Definition: transline.cpp:215

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

◆ OnTranslineTanD_Button()

void PCB_CALCULATOR_FRAME::OnTranslineTanD_Button ( wxCommandEvent &  event)
overrideprivatevirtual

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

130 {
131  wxArrayString list = StandardLossTangentList();
132  list.Add( "" ); // Add an empty line for no selection
133 
134  // Find the previous choice index:
135  wxString prevChoiceStr = m_Value_TanD->GetValue();
136  int prevChoice = 0;
137  findMatch( list, prevChoiceStr, prevChoice );
138 
139  int index = wxGetSingleChoiceIndex( wxEmptyString, _( "Dielectric Loss Factor" ), list,
140  prevChoice, nullptr );
141 
142  if( index >= 0 && !list.Item( index ).IsEmpty() ) // i.e. non canceled.
143  m_Value_TanD->SetValue( list.Item( index ).BeforeFirst( ' ' ) );
144 }
static bool findMatch(wxArrayString &aList, const wxString &aValue, int &aIdx)
wxArrayString StandardLossTangentList()
Definition: common_data.cpp:55
#define _(s)

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

◆ OnTWCalculateFromCurrent()

void PCB_CALCULATOR_FRAME::OnTWCalculateFromCurrent ( wxCommandEvent &  event)
overrideprivatevirtual

Update the calculations when the user changes the desired maximum current.

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 }