22 std::vector<IOControl*> ioList,
28 : ControlSystemTestBase(parent)
30 SetSize(GetBestSize());
32 for (
auto* io : ioList) {
33 if (io->GetType() == Node::NodeType::NODE_OUT) {
34 m_choiceInput->Append(io->GetName(), io);
38 m_inputType = inputType;
41 m_timeStep = timeStep;
44 m_choiceInput->SetSelection(*m_inputType);
47 m_textCtrlTimeStep->SetValue(wxString::FromDouble(*m_timeStep));
48 m_textCtrlSimTime->SetValue(wxString::FromDouble(*m_simTime));
53ControlSystemTest::~ControlSystemTest() {}
54void ControlSystemTest::OnRunButtonClick(wxCommandEvent& event)
57 double timeStep, simTime;
59 inputType = m_choiceInput->GetSelection();
75 if (!m_textCtrlTimeStep->GetValue().ToDouble(&timeStep)) {
76 wxMessageDialog msgDialog(
this, _(
"Value entered incorrectly in the field \"Time step\"."), _(
"Error"),
77 wxOK | wxCENTRE | wxICON_ERROR);
78 msgDialog.ShowModal();
82 if (!m_textCtrlSimTime->GetValue().ToDouble(&simTime)) {
83 wxMessageDialog msgDialog(
this, _(
"Value entered incorrectly in the field \"Simulation time\"."), _(
"Error"),
84 wxOK | wxCENTRE | wxICON_ERROR);
85 msgDialog.ShowModal();
89 *m_inputType = inputType;
92 *m_timeStep = timeStep;
98void ControlSystemTest::OnInputSelected(wxCommandEvent& event)
102void ControlSystemTest::OnPGValueChange(wxPropertyGridEvent& event)
104 IOControl* io =
static_cast<IOControl*
>(m_choiceInput->GetClientData(m_choiceInput->GetSelection()));
105 if (io ==
nullptr)
return;
108 if (event.GetProperty() == m_pgPropStartTime) {
109 simTestData.startTime = m_pgPropStartTime->GetValue();
111 else if (event.GetProperty() == m_pgPropInitialValue) {
112 simTestData.initialValue = m_pgPropInitialValue->GetValue();
114 else if (event.GetProperty() == m_pgPropSlope) {
115 simTestData.slope = m_pgPropSlope->GetValue();
117 else if (event.GetProperty() == m_pgPropInputType) {
118 simTestData.type = m_pgPropInputType->GetValue().GetInteger();
120 io->SetSimTestData(simTestData);
123void ControlSystemTest::UpdatePGValues()
125 IOControl* io =
static_cast<IOControl*
>(m_choiceInput->GetClientData(m_choiceInput->GetSelection()));
128 m_pgMgr->ChangePropertyValue(m_pgPropStartTime, wxString::FromDouble(simTestData.startTime));
129 m_pgMgr->ChangePropertyValue(m_pgPropInitialValue, wxString::FromDouble(simTestData.initialValue));
130 m_pgMgr->ChangePropertyValue(m_pgPropSlope, wxString::FromDouble(simTestData.slope));
131 m_pgMgr->ChangePropertyValue(m_pgPropInputType, simTestData.type);
Provides the communication with the power element.