Power System Platform  2026w34a-beta
Loading...
Searching...
No Matches
BusFormArcFlashProtection.h
1#ifndef BUSFORMARCFLASHPROTECTION_H
2#define BUSFORMARCFLASHPROTECTION_H
3#include "ElementFormBase.h"
4#include <wx/popupwin.h>
5
7class Bus;
8class TCCPopup;
9
10class BusFormArcFlashProtection : public BusFormArcFlashProtectionBase
11{
12public:
13 BusFormArcFlashProtection(wxWindow* parent, Bus* bus, double basePower);
14 ~BusFormArcFlashProtection() override;
15
16private:
17 void EnableFields();
18protected:
19 void OnChoiceFuseClass(wxCommandEvent& event) override;
20 void OnNominalCurrentUpdated(wxCommandEvent& event) override;
21 void OnRadioI1Selected(wxCommandEvent& event) override;
22 void OnChoiceCBCurrent(wxCommandEvent& event) override;
23 void OnChoiceCBTrip(wxCommandEvent& event) override;
24 void OnChoiceCBType(wxCommandEvent& event) override;
25 void OnAddButtonClick(wxCommandEvent& event) override;
26 void OnDeviceChanged(wxDataViewEvent& event) override;
27 void OnImportButtonClick(wxCommandEvent& event) override;
28 void OnMethodSelected(wxCommandEvent& event) override;
29 void OnOKButtonClick(wxCommandEvent& event) override;
30 void OnRemoveButtonClick(wxCommandEvent& event) override;
31 void OnTypeSelected(wxCommandEvent& event) override;
32 void OnnCancelButtonClick(wxCommandEvent& event) override;
33 void OnGridKeyDown(wxKeyEvent& event);
34 void OnGridCornerPaint(wxPaintEvent& event);
35 bool ParseDouble(const wxString& text, double& value);
36 void InitializeCBChoices();
37 void UpdateCBCurrentChoices();
38 void UpdateCBTripChoices();
39 void UpdateCBChoices();
40 void UpdateRadioI1Selection();
41 void UpdateFuseCurrentChoices();
42 void LoadProtectionData(const ArcFlashProtectionData& data);
43 bool ValidateAndGetProtectionData(ArcFlashProtectionData& data);
44
45 Bus* m_bus = nullptr;
46 double m_basePower = 100e6; // Default base power is 100 MVA
47 TCCPopup* m_tccPopup = nullptr;
48 bool m_gridCornerHover = false;
49 wxDataViewItem m_previousDeviceSelection;
50 bool m_restoringDeviceSelection = false;
51};
52
53class TCCPopup : public wxPopupTransientWindow
54{
55public:
56 TCCPopup(wxWindow* parent, wxGrid* grid);
57 ~TCCPopup();
58
59 void UpdateGraph();
60
61private:
62 void OnPaint(wxPaintEvent& event);
63 bool GetCellDouble(int row, int col, double& value) const;
64
65 wxGrid* m_grid = nullptr;
66};
67
68#endif // BUSFORMARCFLASHPROTECTION_H
Node for power elements. All others power elements are connected through this.
Definition Bus.h:135