Power System Platform  2026w11a-beta
Loading...
Searching...
No Matches
ProjectPropertiesForm Class Reference
Inheritance diagram for ProjectPropertiesForm:
Collaboration diagram for ProjectPropertiesForm:

Public Member Functions

 ProjectPropertiesForm (wxWindow *parent, Workspace *workspace)
 

Protected Member Functions

virtual void OnAutomaticLabelClick (wxCommandEvent &event)
 
virtual void OnCancelClick (wxCommandEvent &event)
 
virtual void OnOKClick (wxCommandEvent &event)
 
bool ValidateData ()
 
void EnableLabelLimits (const bool &enable)
 

Protected Attributes

Workspacem_workspace = nullptr
 

Detailed Description

Definition at line 7 of file ProjectPropertiesForm.h.

Constructor & Destructor Documentation

◆ ProjectPropertiesForm()

ProjectPropertiesForm::ProjectPropertiesForm ( wxWindow *  parent,
Workspace workspace 
)

Definition at line 5 of file ProjectPropertiesForm.cpp.

6 : ProjectPropertiesFormBase(parent), m_workspace(workspace)
7{
8 m_checkBoxAutomaticLabel->SetValue(m_workspace->IsHeatMapAutoLabelEnable());
9 m_textCtrlMaxVoltage->SetValue(wxString::Format("%f", m_workspace->GetHeatMap()->GetMaxLimit()));
10 m_textCtrlMinVoltage->SetValue(wxString::Format("%f", m_workspace->GetHeatMap()->GetMinLimit()));
11
12 EnableLabelLimits(!m_checkBoxAutomaticLabel->GetValue());
13}

◆ ~ProjectPropertiesForm()

virtual ProjectPropertiesForm::~ProjectPropertiesForm ( )
inlinevirtual

Definition at line 11 of file ProjectPropertiesForm.h.

11{ }

Member Function Documentation

◆ EnableLabelLimits()

void ProjectPropertiesForm::EnableLabelLimits ( const bool &  enable)
protected

Definition at line 41 of file ProjectPropertiesForm.cpp.

42{
43 m_textCtrlMaxVoltage->Enable(enable);
44 m_textCtrlMinVoltage->Enable(enable);
45 m_staticTextMaxVoltage->Enable(enable);
46 m_staticTextMinVoltage->Enable(enable);
47 m_staticTextPU_1->Enable(enable);
48 m_staticTextPU_2->Enable(enable);
49}

◆ OnAutomaticLabelClick()

void ProjectPropertiesForm::OnAutomaticLabelClick ( wxCommandEvent &  event)
protectedvirtual

Definition at line 15 of file ProjectPropertiesForm.cpp.

16{
17 EnableLabelLimits(!m_checkBoxAutomaticLabel->GetValue());
18}

◆ OnCancelClick()

virtual void ProjectPropertiesForm::OnCancelClick ( wxCommandEvent &  event)
inlineprotectedvirtual

Definition at line 15 of file ProjectPropertiesForm.h.

15{ EndModal(wxID_CANCEL); }

◆ OnOKClick()

virtual void ProjectPropertiesForm::OnOKClick ( wxCommandEvent &  event)
inlineprotectedvirtual

Definition at line 16 of file ProjectPropertiesForm.h.

16{ if (ValidateData()) EndModal(wxID_OK); }

◆ ValidateData()

bool ProjectPropertiesForm::ValidateData ( )
protected

Definition at line 20 of file ProjectPropertiesForm.cpp.

21{
22 if(m_checkBoxAutomaticLabel->GetValue()) {
23 m_workspace->EnableAutoHeatMapLabel();
24 }
25 else {
26 m_workspace->EnableAutoHeatMapLabel(false);
27 double maxVoltage, minVoltage;
28
29 if (!Element::DoubleFromString(this, m_textCtrlMaxVoltage->GetValue(), maxVoltage,
30 _("Value entered incorrectly in the field \"Label max voltage\".")))
31 return false;
32 if (!Element::DoubleFromString(this, m_textCtrlMinVoltage->GetValue(), minVoltage,
33 _("Value entered incorrectly in the field \"Label min voltage\".")))
34 return false;
35
36 m_workspace->GetHeatMap()->SetLabelLimits(static_cast<float>(minVoltage), static_cast<float>(maxVoltage));
37 }
38 return true;
39}
static bool DoubleFromString(wxWindow *parent, wxString strValue, double &value, wxString errorMsg)
Get a double value from a string. Show a error message if the conversion fail.
Definition Element.cpp:433

Member Data Documentation

◆ m_workspace

Workspace* ProjectPropertiesForm::m_workspace = nullptr
protected

Definition at line 21 of file ProjectPropertiesForm.h.


The documentation for this class was generated from the following files: