1#include "ProjectPropertiesForm.h"
2#include "../utils/HMPlane.h"
3#include "../editors/Workspace.h"
5ProjectPropertiesForm::ProjectPropertiesForm(wxWindow* parent,
Workspace* workspace)
6 : ProjectPropertiesFormBase(parent), m_workspace(workspace)
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()));
12 EnableLabelLimits(!m_checkBoxAutomaticLabel->GetValue());
15void ProjectPropertiesForm::OnAutomaticLabelClick(wxCommandEvent& event)
17 EnableLabelLimits(!m_checkBoxAutomaticLabel->GetValue());
20bool ProjectPropertiesForm::ValidateData()
22 if(m_checkBoxAutomaticLabel->GetValue()) {
23 m_workspace->EnableAutoHeatMapLabel();
26 m_workspace->EnableAutoHeatMapLabel(
false);
27 double maxVoltage, minVoltage;
30 _(
"Value entered incorrectly in the field \"Label max voltage\".")))
33 _(
"Value entered incorrectly in the field \"Label min voltage\".")))
36 m_workspace->GetHeatMap()->SetLabelLimits(
static_cast<float>(minVoltage),
static_cast<float>(maxVoltage));
41void ProjectPropertiesForm::EnableLabelLimits(
const bool& enable)
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);
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.
This class manages the graphical and power elements. It is responsible for handling the user's intera...