From a1f4db48d5632a5a9daa8f4429cc290b108efbe5 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Fri, 22 Sep 2023 18:34:49 -0300 Subject: [PATCH] Major bugfixes and harmonic data calculation Fix program close suddenly on delete bus; Fix problems related to disconnected buses; Added harmonic voltages and currents calculation; Added harmonic data in data form; Minor bugfixes --- Project/AboutForm.cpp | 2 +- Project/Branch.cpp | 27 +- Project/Bus.cpp | 610 +-- Project/DataReport.cpp | 2318 +++++++----- Project/DataReport.h | 10 +- Project/DataReport.wxcp | 1201 +++++- Project/DataReportBase.cpp | 439 ++- Project/DataReportBase.h | 69 +- Project/DataReportBitmaps.cpp | 4 +- Project/ElementForm.wxcp | 1526 +++++++- Project/ElementFormBase.cpp | 6527 ++++++++++++++------------------ Project/ElementFormBase.h | 316 +- Project/ElementFormBitmaps.cpp | 4 +- Project/Line.cpp | 1271 ++++--- Project/Line.h | 4 + Project/PSP-UFU.vcxproj | 6 +- Project/PSP-UFU.vcxproj.user | 5 + Project/PowerFlow.cpp | 46 +- Project/PowerFlow.h | 3 + Project/PowerQuality.cpp | 685 ++-- Project/PowerQuality.h | 62 +- Project/Transformer.cpp | 14 + Project/Transformer.h | 5 + Project/Workspace.cpp | 11 +- 24 files changed, 8678 insertions(+), 6487 deletions(-) diff --git a/Project/AboutForm.cpp b/Project/AboutForm.cpp index 2fea1ecd..768a7314 100644 --- a/Project/AboutForm.cpp +++ b/Project/AboutForm.cpp @@ -22,7 +22,7 @@ AboutForm::~AboutForm() {} void AboutForm::Init() { // Set program version. Format: (Alpha/Beta/Release) (YEAR)w(WEEK)(a/b/c/...) - m_staticTextVersion->SetLabel("2020w31a-beta"); + m_staticTextVersion->SetLabel("2023w38a-beta"); // Create developers table m_gridCredits->EnableGridLines(false); diff --git a/Project/Branch.cpp b/Project/Branch.cpp index b86ff02f..bee9f5cb 100644 --- a/Project/Branch.cpp +++ b/Project/Branch.cpp @@ -104,7 +104,7 @@ bool Branch::SetNodeParent(Element* parent) void Branch::RemoveParent(Element* parent) { - for(int i = 0; i < 2; i++) { + for(unsigned int i = 0; i < m_parentList.size(); i++) { if(parent == m_parentList[i]) { m_parentList[i] = nullptr; m_online = false; @@ -155,16 +155,23 @@ void Branch::RotateNode(Element* parent, bool clockwise) void Branch::UpdateSwitchesPosition() { - if(m_parentList[0]) { - m_pointList[1] = GetSwitchPoint(m_parentList[0], m_pointList[0], m_pointList[2]); - } else { - m_pointList[1] = m_pointList[0]; + if (m_parentList.size() >= 1) { + if (m_parentList[0]) { + m_pointList[1] = GetSwitchPoint(m_parentList[0], m_pointList[0], m_pointList[2]); + } + else { + m_pointList[1] = m_pointList[0]; + } } - if(m_parentList[1]) { - m_pointList[m_pointList.size() - 2] = - GetSwitchPoint(m_parentList[1], m_pointList[m_pointList.size() - 1], m_pointList[m_pointList.size() - 3]); - } else { - m_pointList[m_pointList.size() - 2] = m_pointList[m_pointList.size() - 1]; + + if (m_parentList.size() >= 2) { + if (m_parentList[1]) { + m_pointList[m_pointList.size() - 2] = + GetSwitchPoint(m_parentList[1], m_pointList[m_pointList.size() - 1], m_pointList[m_pointList.size() - 3]); + } + else { + m_pointList[m_pointList.size() - 2] = m_pointList[m_pointList.size() - 1]; + } } UpdateSwitches(); } diff --git a/Project/Bus.cpp b/Project/Bus.cpp index f766ef06..70c3d4a7 100644 --- a/Project/Bus.cpp +++ b/Project/Bus.cpp @@ -23,109 +23,109 @@ Bus::Bus() : PowerElement() {} Bus::Bus(wxPoint2DDouble position) : PowerElement() { - m_width = 100.0; - m_height = 5.0; - SetPosition(position); + m_width = 100.0; + m_height = 5.0; + SetPosition(position); } Bus::Bus(wxPoint2DDouble position, wxString name) { - m_width = 100.0; - m_height = 5.0; - SetPosition(position); + m_width = 100.0; + m_height = 5.0; + SetPosition(position); - m_electricalData.name = name; + m_electricalData.name = name; } Bus::~Bus() {} void Bus::Draw(wxPoint2DDouble translation, double scale) const { - // Draw selection (layer 1) - if(m_selected) { - // If the object is selected, the matrix is reset to remove scale effects applied to it, thus keeping the - // edges with fixed sizes for all zoom levels. - glPushMatrix(); - glLoadIdentity(); - // The matrix was reset, so we must use screen coordinates (WorldToScreen). - wxPoint2DDouble screenPt = WorldToScreen(translation, scale); - glTranslated(screenPt.m_x, screenPt.m_y, 0.0); - glRotated(m_angle, 0.0, 0.0, 1.0); - glTranslated(-screenPt.m_x, -screenPt.m_y, 0.0); - - glColor4dv(m_selectionColour.GetRGBA()); - - wxPoint2DDouble pts[4] = {WorldToScreen(translation, scale, -(m_width / 2.0), -(m_height / 2.0)) - - wxPoint2DDouble(m_borderSize, m_borderSize), - WorldToScreen(translation, scale, -(m_width / 2.0), (m_height / 2.0)) - - wxPoint2DDouble(m_borderSize, -m_borderSize), - WorldToScreen(translation, scale, (m_width / 2.0), (m_height / 2.0)) - - wxPoint2DDouble(-m_borderSize, -m_borderSize), - WorldToScreen(translation, scale, (m_width / 2.0), -(m_height / 2.0)) - - wxPoint2DDouble(-m_borderSize, m_borderSize)}; - DrawRectangle(pts); - glPopMatrix(); - } - // Draw bus (layer 2) - // Push the current matrix on stack. - glPushMatrix(); - // Rotate the matrix around the object position. - glTranslated(m_position.m_x, m_position.m_y, 0.0); - glRotated(m_angle, 0.0, 0.0, 1.0); - glTranslated(-m_position.m_x, -m_position.m_y, 0.0); - - - if (!m_electricalData.isConnected) - glColor4dv(m_offlineElementColour.GetRGBA()); - else if (m_dynEvent) - glColor4dv(m_dynamicEventColour.GetRGBA()); - else - glColor4dv(m_busColour.GetRGBA()); - - - DrawRectangle(m_position, m_width, m_height); - // Pop the old matrix back. - glPopMatrix(); - - // Draw pickbox (layer 3) - if(m_showPickbox) { - glPushMatrix(); - glLoadIdentity(); - - wxPoint2DDouble screenPt = WorldToScreen(translation, scale); - glTranslated(screenPt.m_x, screenPt.m_y, 0.0); - glRotated(m_angle, 0.0, 0.0, 1.0); - glTranslated(-screenPt.m_x, -screenPt.m_y, 0.0); - - wxPoint2DDouble pbPosition[2] = {WorldToScreen(translation, scale, m_width / 2.0), - WorldToScreen(translation, scale, -m_width / 2.0)}; - DrawPickbox(pbPosition[0]); - DrawPickbox(pbPosition[1]); - - glPopMatrix(); - } + // Draw selection (layer 1) + if (m_selected) { + // If the object is selected, the matrix is reset to remove scale effects applied to it, thus keeping the + // edges with fixed sizes for all zoom levels. + glPushMatrix(); + glLoadIdentity(); + // The matrix was reset, so we must use screen coordinates (WorldToScreen). + wxPoint2DDouble screenPt = WorldToScreen(translation, scale); + glTranslated(screenPt.m_x, screenPt.m_y, 0.0); + glRotated(m_angle, 0.0, 0.0, 1.0); + glTranslated(-screenPt.m_x, -screenPt.m_y, 0.0); + + glColor4dv(m_selectionColour.GetRGBA()); + + wxPoint2DDouble pts[4] = { WorldToScreen(translation, scale, -(m_width / 2.0), -(m_height / 2.0)) - + wxPoint2DDouble(m_borderSize, m_borderSize), + WorldToScreen(translation, scale, -(m_width / 2.0), (m_height / 2.0)) - + wxPoint2DDouble(m_borderSize, -m_borderSize), + WorldToScreen(translation, scale, (m_width / 2.0), (m_height / 2.0)) - + wxPoint2DDouble(-m_borderSize, -m_borderSize), + WorldToScreen(translation, scale, (m_width / 2.0), -(m_height / 2.0)) - + wxPoint2DDouble(-m_borderSize, m_borderSize) }; + DrawRectangle(pts); + glPopMatrix(); + } + // Draw bus (layer 2) + // Push the current matrix on stack. + glPushMatrix(); + // Rotate the matrix around the object position. + glTranslated(m_position.m_x, m_position.m_y, 0.0); + glRotated(m_angle, 0.0, 0.0, 1.0); + glTranslated(-m_position.m_x, -m_position.m_y, 0.0); + + + if (!m_electricalData.isConnected) + glColor4dv(m_offlineElementColour.GetRGBA()); + else if (m_dynEvent) + glColor4dv(m_dynamicEventColour.GetRGBA()); + else + glColor4dv(m_busColour.GetRGBA()); + + + DrawRectangle(m_position, m_width, m_height); + // Pop the old matrix back. + glPopMatrix(); + + // Draw pickbox (layer 3) + if (m_showPickbox) { + glPushMatrix(); + glLoadIdentity(); + + wxPoint2DDouble screenPt = WorldToScreen(translation, scale); + glTranslated(screenPt.m_x, screenPt.m_y, 0.0); + glRotated(m_angle, 0.0, 0.0, 1.0); + glTranslated(-screenPt.m_x, -screenPt.m_y, 0.0); + + wxPoint2DDouble pbPosition[2] = { WorldToScreen(translation, scale, m_width / 2.0), + WorldToScreen(translation, scale, -m_width / 2.0) }; + DrawPickbox(pbPosition[0]); + DrawPickbox(pbPosition[1]); + + glPopMatrix(); + } } void Bus::DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* gc) const { - wxPoint2DDouble gcPosition = m_position - wxPoint2DDouble(m_width / 2.0, m_height / 2.0); - wxGraphicsMatrix identityMatrix = gc->GetTransform(); - identityMatrix.Set(); // Set to identity + wxPoint2DDouble gcPosition = m_position - wxPoint2DDouble(m_width / 2.0, m_height / 2.0); + wxGraphicsMatrix identityMatrix = gc->GetTransform(); + identityMatrix.Set(); // Set to identity - gc->SetPen(*wxTRANSPARENT_PEN); + gc->SetPen(*wxTRANSPARENT_PEN); // Draw selection (layer 1) if (m_selected) { // If the object is selected, the matrix is reset to remove scale effects applied to it, thus keeping the // edges with fixed sizes for all zoom levels. - gc->PushState(); - gc->SetTransform(identityMatrix); + gc->PushState(); + gc->SetTransform(identityMatrix); // The matrix was reset, so we must use screen coordinates (WorldToScreen). wxPoint2DDouble screenPt = WorldToScreen(translation, scale); - gc->Translate(screenPt.m_x, screenPt.m_y); - gc->Rotate(wxDegToRad(m_angle)); - gc->Translate(-screenPt.m_x, -screenPt.m_y); + gc->Translate(screenPt.m_x, screenPt.m_y); + gc->Rotate(wxDegToRad(m_angle)); + gc->Translate(-screenPt.m_x, -screenPt.m_y); - gc->SetBrush(wxBrush(m_selectionColour.GetDcRGBA())); + gc->SetBrush(wxBrush(m_selectionColour.GetDcRGBA())); wxPoint2DDouble pts[4] = { WorldToScreen(translation, scale, -(m_width / 2.0), -(m_height / 2.0)) - wxPoint2DDouble(m_borderSize, m_borderSize), @@ -135,303 +135,313 @@ void Bus::DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* g wxPoint2DDouble(-m_borderSize, -m_borderSize), WorldToScreen(translation, scale, (m_width / 2.0), -(m_height / 2.0)) - wxPoint2DDouble(-m_borderSize, m_borderSize) }; - gc->DrawLines(4, pts); - gc->PopState(); + gc->DrawLines(4, pts); + gc->PopState(); } - gc->PushState(); - gc->Translate(m_position.m_x, m_position.m_y); - gc->Rotate(wxDegToRad(m_angle)); - gc->Translate(-m_position.m_x, -m_position.m_y); + gc->PushState(); + gc->Translate(m_position.m_x, m_position.m_y); + gc->Rotate(wxDegToRad(m_angle)); + gc->Translate(-m_position.m_x, -m_position.m_y); + - - if(!m_electricalData.isConnected) - gc->SetBrush(wxBrush(m_offlineElementColour.GetDcRGBA())); - else if (m_dynEvent) - gc->SetBrush(wxBrush(m_dynamicEventColour.GetDcRGBA())); - else - gc->SetBrush(wxBrush(m_busColour.GetDcRGBA())); + if (!m_electricalData.isConnected) + gc->SetBrush(wxBrush(m_offlineElementColour.GetDcRGBA())); + else if (m_dynEvent) + gc->SetBrush(wxBrush(m_dynamicEventColour.GetDcRGBA())); + else + gc->SetBrush(wxBrush(m_busColour.GetDcRGBA())); - gc->DrawRectangle(gcPosition.m_x, gcPosition.m_y, m_width, m_height); + gc->DrawRectangle(gcPosition.m_x, gcPosition.m_y, m_width, m_height); - gc->PopState(); + gc->PopState(); // Draw pickbox (layer 3) if (m_showPickbox) { - gc->PushState(); - gc->SetTransform(identityMatrix); + gc->PushState(); + gc->SetTransform(identityMatrix); wxPoint2DDouble screenPt = WorldToScreen(translation, scale); - gc->Translate(screenPt.m_x, screenPt.m_y); - gc->Rotate(wxDegToRad(m_angle)); - gc->Translate(-screenPt.m_x, -screenPt.m_y); + gc->Translate(screenPt.m_x, screenPt.m_y); + gc->Rotate(wxDegToRad(m_angle)); + gc->Translate(-screenPt.m_x, -screenPt.m_y); wxPoint2DDouble pbPosition[2] = { WorldToScreen(translation, scale, m_width / 2.0) - wxPoint2DDouble(4, 4), - WorldToScreen(translation, scale, -m_width / 2.0) - wxPoint2DDouble(4, 4)}; + WorldToScreen(translation, scale, -m_width / 2.0) - wxPoint2DDouble(4, 4) }; DrawDCPickbox(pbPosition[0], gc); DrawDCPickbox(pbPosition[1], gc); - gc->PopState(); + gc->PopState(); } } bool Bus::Contains(wxPoint2DDouble position) const { - wxPoint2DDouble ptR = RotateAtPosition(position, -m_angle); - return m_rect.Contains(ptR); + wxPoint2DDouble ptR = RotateAtPosition(position, -m_angle); + return m_rect.Contains(ptR); } bool Bus::Intersects(wxRect2DDouble rect) const { - if(m_angle == 0.0 || m_angle == 180.0) return m_rect.Intersects(rect); + if (m_angle == 0.0 || m_angle == 180.0) return m_rect.Intersects(rect); - return RotatedRectanglesIntersects(m_rect, rect, m_angle, 0.0); + return RotatedRectanglesIntersects(m_rect, rect, m_angle, 0.0); } bool Bus::PickboxContains(wxPoint2DDouble position) { - m_activePickboxID = ID_PB_NONE; + m_activePickboxID = ID_PB_NONE; - wxPoint2DDouble ptR = RotateAtPosition(position, -m_angle); + wxPoint2DDouble ptR = RotateAtPosition(position, -m_angle); - wxPoint2DDouble center(m_position.m_x + m_width / 2.0, m_position.m_y); - wxRect2DDouble rectRight(center.m_x - 5.0, center.m_y - 5.0, 10.0, 10.0); + wxPoint2DDouble center(m_position.m_x + m_width / 2.0, m_position.m_y); + wxRect2DDouble rectRight(center.m_x - 5.0, center.m_y - 5.0, 10.0, 10.0); - center = wxPoint2DDouble(m_position.m_x - m_width / 2.0, m_position.m_y); - wxRect2DDouble rectLeft(center.m_x - 5.0, center.m_y - 5.0, 10.0, 10.0); + center = wxPoint2DDouble(m_position.m_x - m_width / 2.0, m_position.m_y); + wxRect2DDouble rectLeft(center.m_x - 5.0, center.m_y - 5.0, 10.0, 10.0); - if(rectRight.Contains(ptR)) { - m_activePickboxID = ID_PB_RIGHT; - return true; - } - if(rectLeft.Contains(ptR)) { - m_activePickboxID = ID_PB_LEFT; - return true; - } + if (rectRight.Contains(ptR)) { + m_activePickboxID = ID_PB_RIGHT; + return true; + } + if (rectLeft.Contains(ptR)) { + m_activePickboxID = ID_PB_LEFT; + return true; + } - return false; + return false; } wxCursor Bus::GetBestPickboxCursor() const { - double angle = m_angle; - while(angle >= 157.5) angle -= 180.0; - - if(angle >= -22.5 && angle < 22.5) - return wxCursor(wxCURSOR_SIZEWE); - else if(angle >= 22.5 && angle < 67.5) - return wxCursor(wxCURSOR_SIZENWSE); - else if(angle >= 67.5 && angle < 112.5) - return wxCursor(wxCURSOR_SIZENS); - else if(angle >= 112.5 && angle < 157.5) - return wxCursor(wxCURSOR_SIZENESW); - - return wxCursor(wxCURSOR_ARROW); + double angle = m_angle; + while (angle >= 157.5) angle -= 180.0; + + if (angle >= -22.5 && angle < 22.5) + return wxCursor(wxCURSOR_SIZEWE); + else if (angle >= 22.5 && angle < 67.5) + return wxCursor(wxCURSOR_SIZENWSE); + else if (angle >= 67.5 && angle < 112.5) + return wxCursor(wxCURSOR_SIZENS); + else if (angle >= 112.5 && angle < 157.5) + return wxCursor(wxCURSOR_SIZENESW); + + return wxCursor(wxCURSOR_ARROW); } void Bus::MovePickbox(wxPoint2DDouble position) { - if(m_activePickboxID == ID_PB_NONE) return; + if (m_activePickboxID == ID_PB_NONE) return; - wxPoint2DDouble ptR = RotateAtPosition(position, -m_angle); + wxPoint2DDouble ptR = RotateAtPosition(position, -m_angle); - double dx = 0.0; - if(m_activePickboxID == ID_PB_RIGHT) - dx = ptR.m_x - m_position.m_x - m_width / 2.0; - else if(m_activePickboxID == ID_PB_LEFT) - dx = m_position.m_x - m_width / 2.0 - ptR.m_x; + double dx = 0.0; + if (m_activePickboxID == ID_PB_RIGHT) + dx = ptR.m_x - m_position.m_x - m_width / 2.0; + else if (m_activePickboxID == ID_PB_LEFT) + dx = m_position.m_x - m_width / 2.0 - ptR.m_x; - if(m_width + dx < 20.0) return; + if (m_width + dx < 20.0) return; - if(m_activePickboxID == ID_PB_RIGHT) { - m_position.m_x += (dx / 2.0) * std::cos(wxDegToRad(m_angle)); - m_position.m_y += (dx / 2.0) * std::sin(wxDegToRad(m_angle)); - } else if(m_activePickboxID == ID_PB_LEFT) { - m_position.m_x -= (dx / 2.0) * std::cos(wxDegToRad(m_angle)); - m_position.m_y -= (dx / 2.0) * std::sin(wxDegToRad(m_angle)); - } - m_width += dx; + if (m_activePickboxID == ID_PB_RIGHT) { + m_position.m_x += (dx / 2.0) * std::cos(wxDegToRad(m_angle)); + m_position.m_y += (dx / 2.0) * std::sin(wxDegToRad(m_angle)); + } + else if (m_activePickboxID == ID_PB_LEFT) { + m_position.m_x -= (dx / 2.0) * std::cos(wxDegToRad(m_angle)); + m_position.m_y -= (dx / 2.0) * std::sin(wxDegToRad(m_angle)); + } + m_width += dx; - SetPosition(m_position); + SetPosition(m_position); } void Bus::Rotate(bool clockwise) { - double rotAngle = m_rotationAngle; - if(!clockwise) rotAngle = -m_rotationAngle; + double rotAngle = m_rotationAngle; + if (!clockwise) rotAngle = -m_rotationAngle; - m_angle += rotAngle; - if(m_angle >= 360 || m_angle <= -360) m_angle = 0.0; + m_angle += rotAngle; + if (m_angle >= 360 || m_angle <= -360) m_angle = 0.0; } bool Bus::GetContextMenu(wxMenu& menu) { - menu.Append(ID_EDIT_ELEMENT, _("Edit bus")); - GeneralMenuItens(menu); - return true; + menu.Append(ID_EDIT_ELEMENT, _("Edit bus")); + GeneralMenuItens(menu); + return true; } bool Bus::ShowForm(wxWindow* parent, Element* element) { - BusForm* busForm = new BusForm(parent, this); - if(busForm->ShowModal() == wxID_OK) { - busForm->Destroy(); - return true; - } - - busForm->Destroy(); - return false; + BusForm* busForm = new BusForm(parent, this); + if (busForm->ShowModal() == wxID_OK) { + busForm->Destroy(); + return true; + } + + busForm->Destroy(); + return false; } Element* Bus::GetCopy() { - Bus* copy = new Bus(); - *copy = *this; - return copy; + Bus* copy = new Bus(); + *copy = *this; + return copy; } wxString Bus::GetTipText() const { - wxString tipText = m_electricalData.name; - tipText += wxString::Format(" (%d)", m_electricalData.number + 1); - tipText += "\n"; - tipText += StringFromDouble(m_electricalData.nominalVoltage, 1) + - (m_electricalData.nominalVoltageUnit == ElectricalUnit::UNIT_V - ? _(" V") - : _(" kV")); - tipText += "\n"; - tipText += _("\nV = ") + wxString::FromDouble(std::abs(m_electricalData.voltage), 5) + _(" p.u."); - tipText += "\n"; - tipText += wxString(L'\u03B8') + " = " + wxString::FromDouble(wxRadToDeg(std::arg(m_electricalData.voltage)), 5) + - " " + wxString(L'\u00B0'); - - tipText += _("\n\nFault info:"); - tipText += _("\nVa = ") + wxString::FromDouble(std::abs(m_electricalData.faultVoltage[0]), 5) + _(" p.u."); - tipText += _("\nVb = ") + wxString::FromDouble(std::abs(m_electricalData.faultVoltage[1]), 5) + _(" p.u."); - tipText += _("\nVc = ") + wxString::FromDouble(std::abs(m_electricalData.faultVoltage[2]), 5) + _(" p.u."); - if(m_electricalData.hasFault) { - tipText += _("\nIa = ") + wxString::FromDouble(std::abs(m_electricalData.faultCurrent[0]), 5) + _(" p.u."); - tipText += _("\nIb = ") + wxString::FromDouble(std::abs(m_electricalData.faultCurrent[1]), 5) + _(" p.u."); - tipText += _("\nIc = ") + wxString::FromDouble(std::abs(m_electricalData.faultCurrent[2]), 5) + _(" p.u."); - } - - tipText += _("\n\nSsc = ") + wxString::FromDouble(std::abs(m_electricalData.scPower), 5) + _(" p.u."); - tipText += _("\n\nTHD = ") + wxString::FromDouble(std::abs(m_electricalData.thd), 5) + wxT("%"); - - return tipText; + wxString tipText = m_electricalData.name; + tipText += wxString::Format(" (%d)", m_electricalData.number + 1); + tipText += "\n"; + tipText += StringFromDouble(m_electricalData.nominalVoltage, 1) + + (m_electricalData.nominalVoltageUnit == ElectricalUnit::UNIT_V + ? _(" V") + : _(" kV")); + tipText += "\n"; + tipText += _("\nV = ") + wxString::FromDouble(std::abs(m_electricalData.voltage), 5) + _(" p.u."); + tipText += "\n"; + tipText += wxString(L'\u03B8') + " = " + wxString::FromDouble(wxRadToDeg(std::arg(m_electricalData.voltage)), 5) + + wxString(L'\u00B0'); + + tipText += _("\n\nFault info:"); + tipText += _("\nVa = ") + wxString::FromDouble(std::abs(m_electricalData.faultVoltage[0]), 5) + _(" p.u."); + tipText += _("\nVb = ") + wxString::FromDouble(std::abs(m_electricalData.faultVoltage[1]), 5) + _(" p.u."); + tipText += _("\nVc = ") + wxString::FromDouble(std::abs(m_electricalData.faultVoltage[2]), 5) + _(" p.u."); + if (m_electricalData.hasFault) { + tipText += _("\nIa = ") + wxString::FromDouble(std::abs(m_electricalData.faultCurrent[0]), 5) + _(" p.u."); + tipText += _("\nIb = ") + wxString::FromDouble(std::abs(m_electricalData.faultCurrent[1]), 5) + _(" p.u."); + tipText += _("\nIc = ") + wxString::FromDouble(std::abs(m_electricalData.faultCurrent[2]), 5) + _(" p.u."); + } + + tipText += _("\n\nSsc = ") + wxString::FromDouble(std::abs(m_electricalData.scPower), 5) + _(" p.u."); + tipText += _("\n\nTHD = ") + wxString::FromDouble(std::abs(m_electricalData.thd), 5) + wxT("%"); + int i = 0; + for (auto& hVoltage : m_electricalData.harmonicVoltage) { + wxString hVoltageStr; + hVoltageStr.Printf(_("\nVh(%d) = %.5e%s%.2f%s p.u."), m_electricalData.harmonicOrder[i], std::abs(hVoltage), wxString(L'\u2220'), wxRadToDeg(std::arg(hVoltage)), wxString(L'\u00B0')); + tipText += hVoltageStr; + i++; + } + + + return tipText; } bool Bus::GetPlotData(ElementPlotData& plotData, PlotStudy study) { - if(study == PlotStudy::STABILITY) { - if(!m_electricalData.plotBus) return false; - plotData.SetName(m_electricalData.name); - plotData.SetCurveType(ElementPlotData::CurveType::CT_BUS); - - std::vector absVoltage, argVoltage; - for(unsigned int i = 0; i < m_electricalData.stabVoltageVector.size(); ++i) { - absVoltage.push_back(std::abs(m_electricalData.stabVoltageVector[i])); - argVoltage.push_back(wxRadToDeg(std::arg(m_electricalData.stabVoltageVector[i]))); - } - plotData.AddData(absVoltage, _("Voltage")); - plotData.AddData(argVoltage, _("Angle")); - } else if (study == PlotStudy::FREQRESPONSE) { - if(!m_electricalData.plotPQData) return false; - plotData.SetName(m_electricalData.name); - plotData.SetCurveType(ElementPlotData::CurveType::CT_BUS); - plotData.AddData(m_electricalData.absImpedanceVector, _("Impedance")); - } - return true; + if (study == PlotStudy::STABILITY) { + if (!m_electricalData.plotBus) return false; + plotData.SetName(m_electricalData.name); + plotData.SetCurveType(ElementPlotData::CurveType::CT_BUS); + + std::vector absVoltage, argVoltage; + for (unsigned int i = 0; i < m_electricalData.stabVoltageVector.size(); ++i) { + absVoltage.push_back(std::abs(m_electricalData.stabVoltageVector[i])); + argVoltage.push_back(wxRadToDeg(std::arg(m_electricalData.stabVoltageVector[i]))); + } + plotData.AddData(absVoltage, _("Voltage")); + plotData.AddData(argVoltage, _("Angle")); + } + else if (study == PlotStudy::FREQRESPONSE) { + if (!m_electricalData.plotPQData) return false; + plotData.SetName(m_electricalData.name); + plotData.SetCurveType(ElementPlotData::CurveType::CT_BUS); + plotData.AddData(m_electricalData.absImpedanceVector, _("Impedance")); + } + return true; } rapidxml::xml_node<>* Bus::SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode) { - m_electricalData.number = m_elementID; - - auto elementNode = XMLParser::AppendNode(doc, elementListNode, "Bus"); - XMLParser::SetNodeAttribute(doc, elementNode, "ID", m_elementID); - - Element::SaveCADProperties(doc, elementNode); - - auto electricalProp = XMLParser::AppendNode(doc, elementNode, "ElectricalProperties"); - auto name = XMLParser::AppendNode(doc, electricalProp, "Name"); - XMLParser::SetNodeValue(doc, name, m_electricalData.name); - auto nominalVoltage = XMLParser::AppendNode(doc, electricalProp, "NominalVoltage"); - XMLParser::SetNodeValue(doc, nominalVoltage, m_electricalData.nominalVoltage); - XMLParser::SetNodeAttribute(doc, nominalVoltage, "UnitID", static_cast(m_electricalData.nominalVoltageUnit)); - auto isVoltageControlled = XMLParser::AppendNode(doc, electricalProp, "IsVoltageControlled"); - XMLParser::SetNodeValue(doc, isVoltageControlled, m_electricalData.isVoltageControlled); - auto controlledVoltage = XMLParser::AppendNode(doc, electricalProp, "ControlledVoltage"); - XMLParser::SetNodeValue(doc, controlledVoltage, m_electricalData.controlledVoltage); - XMLParser::SetNodeAttribute(doc, controlledVoltage, "Choice", m_electricalData.controlledVoltageUnitChoice); - auto slackBus = XMLParser::AppendNode(doc, electricalProp, "SlackBus"); - XMLParser::SetNodeValue(doc, slackBus, m_electricalData.slackBus); - - auto fault = XMLParser::AppendNode(doc, electricalProp, "Fault"); - auto hasFault = XMLParser::AppendNode(doc, fault, "HasFault"); - XMLParser::SetNodeValue(doc, hasFault, m_electricalData.hasFault); - auto faultType = XMLParser::AppendNode(doc, fault, "Type"); - XMLParser::SetNodeValue(doc, faultType, static_cast(m_electricalData.faultType)); - auto faultLocation = XMLParser::AppendNode(doc, fault, "Location"); - XMLParser::SetNodeValue(doc, faultLocation, static_cast(m_electricalData.faultLocation)); - auto faultResistance = XMLParser::AppendNode(doc, fault, "Resistance"); - XMLParser::SetNodeValue(doc, faultResistance, m_electricalData.faultResistance); - auto faultReactance = XMLParser::AppendNode(doc, fault, "Reactance"); - XMLParser::SetNodeValue(doc, faultReactance, m_electricalData.faultReactance); - - auto stability = XMLParser::AppendNode(doc, electricalProp, "Stability"); - auto plotBus = XMLParser::AppendNode(doc, stability, "Plot"); - XMLParser::SetNodeValue(doc, plotBus, m_electricalData.plotBus); - auto stabHasFault = XMLParser::AppendNode(doc, stability, "HasFault"); - XMLParser::SetNodeValue(doc, stabHasFault, m_electricalData.stabHasFault); - auto stabFaultTime = XMLParser::AppendNode(doc, stability, "FaultTime"); - XMLParser::SetNodeValue(doc, stabFaultTime, m_electricalData.stabFaultTime); - auto stabFaultLength = XMLParser::AppendNode(doc, stability, "FaultLength"); - XMLParser::SetNodeValue(doc, stabFaultLength, m_electricalData.stabFaultLength); - auto stabFaultResistance = XMLParser::AppendNode(doc, stability, "FaultResistance"); - XMLParser::SetNodeValue(doc, stabFaultResistance, m_electricalData.stabFaultResistance); - auto stabFaultReactance = XMLParser::AppendNode(doc, stability, "FaultReactance"); - XMLParser::SetNodeValue(doc, stabFaultReactance, m_electricalData.stabFaultReactance); - - auto powerQuality = XMLParser::AppendNode(doc, electricalProp, "PowerQuality"); - auto plotPQData = XMLParser::AppendNode(doc, powerQuality, "Plot"); - XMLParser::SetNodeValue(doc, plotPQData, m_electricalData.plotPQData); - - return elementNode; + m_electricalData.number = m_elementID; + + auto elementNode = XMLParser::AppendNode(doc, elementListNode, "Bus"); + XMLParser::SetNodeAttribute(doc, elementNode, "ID", m_elementID); + + Element::SaveCADProperties(doc, elementNode); + + auto electricalProp = XMLParser::AppendNode(doc, elementNode, "ElectricalProperties"); + auto name = XMLParser::AppendNode(doc, electricalProp, "Name"); + XMLParser::SetNodeValue(doc, name, m_electricalData.name); + auto nominalVoltage = XMLParser::AppendNode(doc, electricalProp, "NominalVoltage"); + XMLParser::SetNodeValue(doc, nominalVoltage, m_electricalData.nominalVoltage); + XMLParser::SetNodeAttribute(doc, nominalVoltage, "UnitID", static_cast(m_electricalData.nominalVoltageUnit)); + auto isVoltageControlled = XMLParser::AppendNode(doc, electricalProp, "IsVoltageControlled"); + XMLParser::SetNodeValue(doc, isVoltageControlled, m_electricalData.isVoltageControlled); + auto controlledVoltage = XMLParser::AppendNode(doc, electricalProp, "ControlledVoltage"); + XMLParser::SetNodeValue(doc, controlledVoltage, m_electricalData.controlledVoltage); + XMLParser::SetNodeAttribute(doc, controlledVoltage, "Choice", m_electricalData.controlledVoltageUnitChoice); + auto slackBus = XMLParser::AppendNode(doc, electricalProp, "SlackBus"); + XMLParser::SetNodeValue(doc, slackBus, m_electricalData.slackBus); + + auto fault = XMLParser::AppendNode(doc, electricalProp, "Fault"); + auto hasFault = XMLParser::AppendNode(doc, fault, "HasFault"); + XMLParser::SetNodeValue(doc, hasFault, m_electricalData.hasFault); + auto faultType = XMLParser::AppendNode(doc, fault, "Type"); + XMLParser::SetNodeValue(doc, faultType, static_cast(m_electricalData.faultType)); + auto faultLocation = XMLParser::AppendNode(doc, fault, "Location"); + XMLParser::SetNodeValue(doc, faultLocation, static_cast(m_electricalData.faultLocation)); + auto faultResistance = XMLParser::AppendNode(doc, fault, "Resistance"); + XMLParser::SetNodeValue(doc, faultResistance, m_electricalData.faultResistance); + auto faultReactance = XMLParser::AppendNode(doc, fault, "Reactance"); + XMLParser::SetNodeValue(doc, faultReactance, m_electricalData.faultReactance); + + auto stability = XMLParser::AppendNode(doc, electricalProp, "Stability"); + auto plotBus = XMLParser::AppendNode(doc, stability, "Plot"); + XMLParser::SetNodeValue(doc, plotBus, m_electricalData.plotBus); + auto stabHasFault = XMLParser::AppendNode(doc, stability, "HasFault"); + XMLParser::SetNodeValue(doc, stabHasFault, m_electricalData.stabHasFault); + auto stabFaultTime = XMLParser::AppendNode(doc, stability, "FaultTime"); + XMLParser::SetNodeValue(doc, stabFaultTime, m_electricalData.stabFaultTime); + auto stabFaultLength = XMLParser::AppendNode(doc, stability, "FaultLength"); + XMLParser::SetNodeValue(doc, stabFaultLength, m_electricalData.stabFaultLength); + auto stabFaultResistance = XMLParser::AppendNode(doc, stability, "FaultResistance"); + XMLParser::SetNodeValue(doc, stabFaultResistance, m_electricalData.stabFaultResistance); + auto stabFaultReactance = XMLParser::AppendNode(doc, stability, "FaultReactance"); + XMLParser::SetNodeValue(doc, stabFaultReactance, m_electricalData.stabFaultReactance); + + auto powerQuality = XMLParser::AppendNode(doc, electricalProp, "PowerQuality"); + auto plotPQData = XMLParser::AppendNode(doc, powerQuality, "Plot"); + XMLParser::SetNodeValue(doc, plotPQData, m_electricalData.plotPQData); + + return elementNode; } bool Bus::OpenElement(rapidxml::xml_node<>* elementNode) { - if(!Element::OpenCADProperties(elementNode)) return false; - - auto electricalProp = elementNode->first_node("ElectricalProperties"); - if(!electricalProp) return false; - - m_electricalData.name = electricalProp->first_node("Name")->value(); - m_electricalData.nominalVoltage = XMLParser::GetNodeValueDouble(electricalProp, "NominalVoltage"); - m_electricalData.nominalVoltageUnit = - (ElectricalUnit)XMLParser::GetAttributeValueInt(electricalProp, "NominalVoltage", "UnitID"); - m_electricalData.isVoltageControlled = XMLParser::GetNodeValueInt(electricalProp, "IsVoltageControlled"); - m_electricalData.controlledVoltage = XMLParser::GetNodeValueDouble(electricalProp, "ControlledVoltage"); - m_electricalData.controlledVoltageUnitChoice = - XMLParser::GetAttributeValueInt(electricalProp, "ControlledVoltage", "Choice"); - m_electricalData.slackBus = XMLParser::GetNodeValueInt(electricalProp, "SlackBus"); - auto fault = electricalProp->first_node("Fault"); - m_electricalData.hasFault = XMLParser::GetNodeValueInt(fault, "HasFault"); - m_electricalData.faultType = (FaultData)XMLParser::GetNodeValueInt(fault, "Type"); - m_electricalData.faultLocation = (FaultData)XMLParser::GetNodeValueInt(fault, "Location"); - m_electricalData.faultResistance = XMLParser::GetNodeValueDouble(fault, "Resistance"); - m_electricalData.faultReactance = XMLParser::GetNodeValueDouble(fault, "Reactance"); - auto stability = electricalProp->first_node("Stability"); - m_electricalData.plotBus = XMLParser::GetNodeValueInt(stability, "Plot"); - m_electricalData.stabHasFault = XMLParser::GetNodeValueInt(stability, "HasFault"); - m_electricalData.stabFaultTime = XMLParser::GetNodeValueDouble(stability, "FaultTime"); - m_electricalData.stabFaultLength = XMLParser::GetNodeValueDouble(stability, "FaultLength"); - m_electricalData.stabFaultResistance = XMLParser::GetNodeValueDouble(stability, "FaultResistance"); - m_electricalData.stabFaultReactance = XMLParser::GetNodeValueDouble(stability, "FaultReactance"); - - auto powerQuality = electricalProp->first_node("PowerQuality"); - if(powerQuality) m_electricalData.plotPQData = XMLParser::GetNodeValueInt(powerQuality, "Plot"); - - if(m_electricalData.stabHasFault) SetDynamicEvent(true); - return true; + if (!Element::OpenCADProperties(elementNode)) return false; + + auto electricalProp = elementNode->first_node("ElectricalProperties"); + if (!electricalProp) return false; + + m_electricalData.name = electricalProp->first_node("Name")->value(); + m_electricalData.nominalVoltage = XMLParser::GetNodeValueDouble(electricalProp, "NominalVoltage"); + m_electricalData.nominalVoltageUnit = + (ElectricalUnit)XMLParser::GetAttributeValueInt(electricalProp, "NominalVoltage", "UnitID"); + m_electricalData.isVoltageControlled = XMLParser::GetNodeValueInt(electricalProp, "IsVoltageControlled"); + m_electricalData.controlledVoltage = XMLParser::GetNodeValueDouble(electricalProp, "ControlledVoltage"); + m_electricalData.controlledVoltageUnitChoice = + XMLParser::GetAttributeValueInt(electricalProp, "ControlledVoltage", "Choice"); + m_electricalData.slackBus = XMLParser::GetNodeValueInt(electricalProp, "SlackBus"); + auto fault = electricalProp->first_node("Fault"); + m_electricalData.hasFault = XMLParser::GetNodeValueInt(fault, "HasFault"); + m_electricalData.faultType = (FaultData)XMLParser::GetNodeValueInt(fault, "Type"); + m_electricalData.faultLocation = (FaultData)XMLParser::GetNodeValueInt(fault, "Location"); + m_electricalData.faultResistance = XMLParser::GetNodeValueDouble(fault, "Resistance"); + m_electricalData.faultReactance = XMLParser::GetNodeValueDouble(fault, "Reactance"); + auto stability = electricalProp->first_node("Stability"); + m_electricalData.plotBus = XMLParser::GetNodeValueInt(stability, "Plot"); + m_electricalData.stabHasFault = XMLParser::GetNodeValueInt(stability, "HasFault"); + m_electricalData.stabFaultTime = XMLParser::GetNodeValueDouble(stability, "FaultTime"); + m_electricalData.stabFaultLength = XMLParser::GetNodeValueDouble(stability, "FaultLength"); + m_electricalData.stabFaultResistance = XMLParser::GetNodeValueDouble(stability, "FaultResistance"); + m_electricalData.stabFaultReactance = XMLParser::GetNodeValueDouble(stability, "FaultReactance"); + + auto powerQuality = electricalProp->first_node("PowerQuality"); + if (powerQuality) m_electricalData.plotPQData = XMLParser::GetNodeValueInt(powerQuality, "Plot"); + + if (m_electricalData.stabHasFault) SetDynamicEvent(true); + return true; } diff --git a/Project/DataReport.cpp b/Project/DataReport.cpp index 49572b7b..3aea4694 100644 --- a/Project/DataReport.cpp +++ b/Project/DataReport.cpp @@ -21,1023 +21,1387 @@ DataReport::DataReport(wxWindow* parent, Workspace* workspace) : DataReportBase(parent) { - m_workspace = workspace; - - m_headerColour = wxColour(150, 150, 150); - m_offlineColour = wxColour(100, 100, 100); - m_oddRowColour = wxColour(220, 220, 220); - m_evenRowColour = wxColour(255, 255, 255); - - CreateGrids(); - SetHeaders(); - FillValues(); - - SetRowsColours(m_gridPowerFlow); - SetRowsColours(m_gridPFBuses); - SetRowsColours(m_gridPFBranches); - SetRowsColours(m_gridFault, 2); - SetRowsColours(m_gridFaultBuses, 2); - SetRowsColours(m_gridFaultBranches, 2); - SetRowsColours(m_gridFaultGenerators, 2); - - Layout(); + m_workspace = workspace; + + m_headerColour = wxColour(150, 150, 150); + m_offlineColour = wxColour(100, 100, 100); + m_oddRowColour = wxColour(220, 220, 220); + m_evenRowColour = wxColour(255, 255, 255); + + CreateGrids(); + SetHeaders(); + FillValues(); + + SetRowsColours(m_gridPowerFlow); + SetRowsColours(m_gridPFBuses); + SetRowsColours(m_gridPFBranches); + SetRowsColours(m_gridFault, 2); + SetRowsColours(m_gridFaultBuses, 2); + SetRowsColours(m_gridFaultBranches, 2); + SetRowsColours(m_gridFaultGenerators, 2); + SetRowsColours(m_gridHarmCurrents, 1, 2); + SetRowsColours(m_gridHarmBuses, 1, 2); + SetRowsColours(m_gridHarmBranches, 1, 4, 1); + + //SetSize(GetBestSize()); } DataReport::~DataReport() {} void DataReport::CreateGrids() { - wxFont headerFont = m_gridPowerFlow->GetLabelFont(); - headerFont.SetWeight(wxFONTWEIGHT_BOLD); - - ElectricCalculation eCalc; - eCalc.GetElementsFromList(m_workspace->GetElementList()); - auto lineList = eCalc.GetLineList(); - auto transformerList = eCalc.GetTransformerList(); - auto busList = eCalc.GetBusList(); - auto generatorList = eCalc.GetSyncGeneratorList(); - - // Power Flow - // Header - m_gridPowerFlow->AppendCols(7); - m_gridPowerFlow->AppendRows(); - m_gridPowerFlow->HideColLabels(); - m_gridPowerFlow->HideRowLabels(); - for(int i = 0; i < 7; ++i) { - m_gridPowerFlow->SetCellBackgroundColour(0, i, m_headerColour); - m_gridPowerFlow->SetCellFont(0, i, headerFont); - } - m_gridPowerFlow->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); - // Values - m_gridPowerFlow->AppendRows((lineList.size() + transformerList.size()) * 2); - m_gridPowerFlow->AutoSize(); - - // Power Flow buses - // Header - m_gridPFBuses->AppendCols(6); - m_gridPFBuses->AppendRows(); - m_gridPFBuses->HideColLabels(); - m_gridPFBuses->HideRowLabels(); - for(int i = 0; i < 6; ++i) { - m_gridPFBuses->SetCellBackgroundColour(0, i, m_headerColour); - m_gridPFBuses->SetCellFont(0, i, headerFont); - } - m_gridPFBuses->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); - // Values - m_gridPFBuses->AppendRows(busList.size()); - m_gridPFBuses->AutoSize(); - - // Power flow branches - // Header - m_gridPFBranches->AppendCols(10); - m_gridPFBranches->AppendRows(1); - m_gridPFBranches->HideColLabels(); - m_gridPFBranches->HideRowLabels(); - for(int i = 0; i < 10; ++i) { - m_gridPFBranches->SetCellBackgroundColour(0, i, m_headerColour); - m_gridPFBranches->SetCellFont(0, i, headerFont); - } - m_gridPFBranches->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); - // Values - m_gridPFBranches->AppendRows(lineList.size() + transformerList.size()); - m_gridPFBranches->AutoSize(); - - // Fault - // Header - m_gridFault->AppendCols(7); - m_gridFault->AppendRows(2); - m_gridFault->HideColLabels(); - m_gridFault->HideRowLabels(); - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 7; ++j) { - m_gridFault->SetCellBackgroundColour(i, j, m_headerColour); - m_gridFault->SetCellFont(i, j, headerFont); - } - } - m_gridFault->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); - m_gridFault->SetCellSize(0, 0, 2, 1); - m_gridFault->SetCellSize(0, 1, 1, 2); - m_gridFault->SetCellSize(0, 3, 1, 2); - m_gridFault->SetCellSize(0, 5, 1, 2); - // Values - for(auto it = busList.begin(), itEnd = busList.end(); it != itEnd; ++it) { - Bus* bus = *it; - if(bus->GetElectricalData().hasFault) m_gridFault->AppendRows(); - } - m_gridFault->AutoSize(); - - // Fault buses - // Header - m_gridFaultBuses->AppendCols(7); - m_gridFaultBuses->AppendRows(2); - m_gridFaultBuses->HideColLabels(); - m_gridFaultBuses->HideRowLabels(); - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 7; ++j) { - m_gridFaultBuses->SetCellBackgroundColour(i, j, m_headerColour); - m_gridFaultBuses->SetCellFont(i, j, headerFont); - } - } - m_gridFaultBuses->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); - m_gridFaultBuses->SetCellSize(0, 0, 2, 1); - m_gridFaultBuses->SetCellSize(0, 1, 1, 2); - m_gridFaultBuses->SetCellSize(0, 3, 1, 2); - m_gridFaultBuses->SetCellSize(0, 5, 1, 2); - // Values - m_gridFaultBuses->AppendRows(busList.size()); - m_gridFaultBuses->AutoSize(); - - // Fault branches - // Header - m_gridFaultBranches->AppendCols(11); - m_gridFaultBranches->AppendRows(2); - m_gridFaultBranches->HideColLabels(); - m_gridFaultBranches->HideRowLabels(); - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 11; ++j) { - m_gridFaultBranches->SetCellBackgroundColour(i, j, m_headerColour); - m_gridFaultBranches->SetCellFont(i, j, headerFont); - } - } - m_gridFaultBranches->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); - m_gridFaultBranches->SetCellSize(0, 0, 2, 1); - m_gridFaultBranches->SetCellSize(0, 1, 2, 1); - m_gridFaultBranches->SetCellSize(0, 2, 2, 1); - m_gridFaultBranches->SetCellSize(0, 3, 2, 1); - m_gridFaultBranches->SetCellSize(0, 10, 2, 1); - m_gridFaultBranches->SetCellSize(0, 4, 1, 2); - m_gridFaultBranches->SetCellSize(0, 6, 1, 2); - m_gridFaultBranches->SetCellSize(0, 8, 1, 2); - // Values - m_gridFaultBranches->AppendRows((lineList.size() + transformerList.size()) * 2); - m_gridFaultBranches->AutoSize(); - - // Fault generators - // Header - m_gridFaultGenerators->AppendCols(7); - m_gridFaultGenerators->AppendRows(2); - m_gridFaultGenerators->HideColLabels(); - m_gridFaultGenerators->HideRowLabels(); - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 7; ++j) { - m_gridFaultGenerators->SetCellBackgroundColour(i, j, m_headerColour); - m_gridFaultGenerators->SetCellFont(i, j, headerFont); - } - } - m_gridFaultGenerators->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); - m_gridFaultGenerators->SetCellSize(0, 0, 2, 1); - m_gridFaultGenerators->SetCellSize(0, 1, 1, 2); - m_gridFaultGenerators->SetCellSize(0, 3, 1, 2); - m_gridFaultGenerators->SetCellSize(0, 5, 1, 2); - // Values - m_gridFaultGenerators->AppendRows(generatorList.size()); - m_gridFaultGenerators->AutoSize(); + wxFont headerFont = m_gridPowerFlow->GetLabelFont(); + headerFont.SetWeight(wxFONTWEIGHT_BOLD); + + ElectricCalculation eCalc; + eCalc.GetElementsFromList(m_workspace->GetElementList()); + auto lineList = eCalc.GetLineList(); + auto transformerList = eCalc.GetTransformerList(); + auto busList = eCalc.GetBusList(); + auto generatorList = eCalc.GetSyncGeneratorList(); + auto harmCurrentSourceList = eCalc.GetHarmCurrentList(); + + // Power Flow + // Header + m_gridPowerFlow->AppendCols(7); + m_gridPowerFlow->AppendRows(); + m_gridPowerFlow->HideColLabels(); + m_gridPowerFlow->HideRowLabels(); + for (int i = 0; i < 7; ++i) { + m_gridPowerFlow->SetCellBackgroundColour(0, i, m_headerColour); + m_gridPowerFlow->SetCellFont(0, i, headerFont); + } + m_gridPowerFlow->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + // Values + m_gridPowerFlow->AppendRows((lineList.size() + transformerList.size()) * 2); + m_gridPowerFlow->AutoSize(); + + // Power Flow buses + // Header + m_gridPFBuses->AppendCols(6); + m_gridPFBuses->AppendRows(); + m_gridPFBuses->HideColLabels(); + m_gridPFBuses->HideRowLabels(); + for (int i = 0; i < 6; ++i) { + m_gridPFBuses->SetCellBackgroundColour(0, i, m_headerColour); + m_gridPFBuses->SetCellFont(0, i, headerFont); + } + m_gridPFBuses->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + // Values + m_gridPFBuses->AppendRows(busList.size()); + m_gridPFBuses->AutoSize(); + + // Power flow branches + // Header + m_gridPFBranches->AppendCols(10); + m_gridPFBranches->AppendRows(1); + m_gridPFBranches->HideColLabels(); + m_gridPFBranches->HideRowLabels(); + for (int i = 0; i < 10; ++i) { + m_gridPFBranches->SetCellBackgroundColour(0, i, m_headerColour); + m_gridPFBranches->SetCellFont(0, i, headerFont); + } + m_gridPFBranches->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + // Values + m_gridPFBranches->AppendRows(lineList.size() + transformerList.size()); + m_gridPFBranches->AutoSize(); + + // Fault + // Header + m_gridFault->AppendCols(7); + m_gridFault->AppendRows(2); + m_gridFault->HideColLabels(); + m_gridFault->HideRowLabels(); + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 7; ++j) { + m_gridFault->SetCellBackgroundColour(i, j, m_headerColour); + m_gridFault->SetCellFont(i, j, headerFont); + } + } + m_gridFault->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + m_gridFault->SetCellSize(0, 0, 2, 1); + m_gridFault->SetCellSize(0, 1, 1, 2); + m_gridFault->SetCellSize(0, 3, 1, 2); + m_gridFault->SetCellSize(0, 5, 1, 2); + // Values + for (auto it = busList.begin(), itEnd = busList.end(); it != itEnd; ++it) { + Bus* bus = *it; + if (bus->GetElectricalData().hasFault) m_gridFault->AppendRows(); + } + m_gridFault->AutoSize(); + + // Fault buses + // Header + m_gridFaultBuses->AppendCols(7); + m_gridFaultBuses->AppendRows(2); + m_gridFaultBuses->HideColLabels(); + m_gridFaultBuses->HideRowLabels(); + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 7; ++j) { + m_gridFaultBuses->SetCellBackgroundColour(i, j, m_headerColour); + m_gridFaultBuses->SetCellFont(i, j, headerFont); + } + } + m_gridFaultBuses->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + m_gridFaultBuses->SetCellSize(0, 0, 2, 1); + m_gridFaultBuses->SetCellSize(0, 1, 1, 2); + m_gridFaultBuses->SetCellSize(0, 3, 1, 2); + m_gridFaultBuses->SetCellSize(0, 5, 1, 2); + // Values + m_gridFaultBuses->AppendRows(busList.size()); + m_gridFaultBuses->AutoSize(); + + // Fault branches + // Header + m_gridFaultBranches->AppendCols(11); + m_gridFaultBranches->AppendRows(2); + m_gridFaultBranches->HideColLabels(); + m_gridFaultBranches->HideRowLabels(); + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 11; ++j) { + m_gridFaultBranches->SetCellBackgroundColour(i, j, m_headerColour); + m_gridFaultBranches->SetCellFont(i, j, headerFont); + } + } + m_gridFaultBranches->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + m_gridFaultBranches->SetCellSize(0, 0, 2, 1); + m_gridFaultBranches->SetCellSize(0, 1, 2, 1); + m_gridFaultBranches->SetCellSize(0, 2, 2, 1); + m_gridFaultBranches->SetCellSize(0, 3, 2, 1); + m_gridFaultBranches->SetCellSize(0, 10, 2, 1); + m_gridFaultBranches->SetCellSize(0, 4, 1, 2); + m_gridFaultBranches->SetCellSize(0, 6, 1, 2); + m_gridFaultBranches->SetCellSize(0, 8, 1, 2); + // Values + m_gridFaultBranches->AppendRows((lineList.size() + transformerList.size()) * 2); + m_gridFaultBranches->AutoSize(); + + // Fault generators + // Header + m_gridFaultGenerators->AppendCols(7); + m_gridFaultGenerators->AppendRows(2); + m_gridFaultGenerators->HideColLabels(); + m_gridFaultGenerators->HideRowLabels(); + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 7; ++j) { + m_gridFaultGenerators->SetCellBackgroundColour(i, j, m_headerColour); + m_gridFaultGenerators->SetCellFont(i, j, headerFont); + } + } + m_gridFaultGenerators->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + m_gridFaultGenerators->SetCellSize(0, 0, 2, 1); + m_gridFaultGenerators->SetCellSize(0, 1, 1, 2); + m_gridFaultGenerators->SetCellSize(0, 3, 1, 2); + m_gridFaultGenerators->SetCellSize(0, 5, 1, 2); + // Values + m_gridFaultGenerators->AppendRows(generatorList.size()); + m_gridFaultGenerators->AutoSize(); + + // Harmonics currents + // Header + m_gridHarmCurrents->AppendCols(5); + m_gridHarmCurrents->AppendRows(); + m_gridHarmCurrents->HideColLabels(); + m_gridHarmCurrents->HideRowLabels(); + for (int i = 0; i < 5; ++i) { + m_gridHarmCurrents->SetCellBackgroundColour(0, i, m_headerColour); + m_gridHarmCurrents->SetCellFont(0, i, headerFont); + } + m_gridHarmCurrents->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + // Values + int numRowDataHarmCurrent = 0; + for (auto* hSource : harmCurrentSourceList) { + numRowDataHarmCurrent += hSource->GetElectricalData().harmonicOrder.size(); + } + m_gridHarmCurrents->AppendRows(numRowDataHarmCurrent); + m_gridHarmCurrents->AutoSize(); + + // Harmonics buses + // Header + m_gridHarmBuses->AppendCols(5); + m_gridHarmBuses->AppendRows(); + m_gridHarmBuses->HideColLabels(); + m_gridHarmBuses->HideRowLabels(); + for (int i = 0; i < 5; ++i) { + m_gridHarmBuses->SetCellBackgroundColour(0, i, m_headerColour); + m_gridHarmBuses->SetCellFont(0, i, headerFont); + } + m_gridHarmBuses->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + // Values + int numRowDataHarmBuses = 0; + for (auto* bus : busList) { + numRowDataHarmBuses += bus->GetElectricalData().harmonicOrder.size(); + } + m_gridHarmBuses->AppendRows(numRowDataHarmBuses); + m_gridHarmBuses->AutoSize(); + + // Harmonics branches currents + // Header + m_gridHarmBranches->AppendCols(8); + m_gridHarmBranches->AppendRows(); + m_gridHarmBranches->HideColLabels(); + m_gridHarmBranches->HideRowLabels(); + for (int i = 0; i < 8; ++i) { + m_gridHarmBranches->SetCellBackgroundColour(0, i, m_headerColour); + m_gridHarmBranches->SetCellFont(0, i, headerFont); + } + m_gridHarmBranches->SetDefaultCellAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + // Values + int numRowDataHarmBranches = 0; + for (auto* line : lineList) { + numRowDataHarmBranches += line->GetElectricalData().harmonicOrder.size(); + } + for (auto* transformer : transformerList) { + numRowDataHarmBranches += transformer->GetElectricalData().harmonicOrder.size(); + } + m_gridHarmBranches->AppendRows(numRowDataHarmBranches * 2.0); + m_gridHarmBranches->AutoSize(); + } void DataReport::SetHeaders() { - // Headers choices fill - wxString omega = static_cast(L'\u03A9'); - - m_voltageChoices.Add(_("Voltage (p.u.)")); - m_voltageChoices.Add(_("Voltage (V)")); - m_voltageChoices.Add(_("Voltage (kV)")); - - m_activePowerChoices.Add(_("Active Power (p.u.)")); - m_activePowerChoices.Add(_("Active Power (W)")); - m_activePowerChoices.Add(_("Active Power (kW)")); - m_activePowerChoices.Add(_("Active Power (MW)")); - - m_reactivePowerChoices.Add(_("Reactive Power (p.u.)")); - m_reactivePowerChoices.Add(_("Reactive Power (VAr)")); - m_reactivePowerChoices.Add(_("Reactive Power (kVAr)")); - m_reactivePowerChoices.Add(_("Reactive Power (MVAr)")); - - m_resistanceChoices.Add(_("R (p.u.)")); - m_resistanceChoices.Add(_("R (") + omega + wxT(")")); - - m_indReactanceChoices.Add(_("XL (p.u.)")); - m_indReactanceChoices.Add(_("XL (") + omega + wxT(")")); - - m_capSusceptanceChoices.Add(_("B (p.u.)")); - m_capSusceptanceChoices.Add(_("B (S)")); - - m_currentChoices.Add(_("Current (p.u.)")); - m_currentChoices.Add(_("Current (A)")); - m_currentChoices.Add(_("Current (kA)")); - - // Power flow - m_gridPowerFlow->SetCellValue(0, 0, _("Type")); - m_gridPowerFlow->SetCellValue(0, 1, _("Name")); - m_gridPowerFlow->SetCellValue(0, 2, _("From")); - m_gridPowerFlow->SetCellValue(0, 3, _("To")); - m_gridPowerFlow->SetCellEditor(0, 4, new wxGridCellChoiceEditor(m_activePowerChoices)); - m_gridPowerFlow->SetCellValue(0, 4, m_activePowerChoices[3]); - m_gridPowerFlow->SetCellEditor(0, 5, new wxGridCellChoiceEditor(m_reactivePowerChoices)); - m_gridPowerFlow->SetCellValue(0, 5, m_reactivePowerChoices[3]); - m_gridPowerFlow->SetCellValue(0, 6, _("Online")); - - // Power flow buses - m_gridPFBuses->SetCellValue(0, 0, _("Name")); - m_gridPFBuses->SetCellValue(0, 1, _("Type")); - m_gridPFBuses->SetCellEditor(0, 2, new wxGridCellChoiceEditor(m_voltageChoices)); - m_gridPFBuses->SetCellValue(0, 2, m_voltageChoices[0]); - m_gridPFBuses->SetCellValue(0, 3, _("Angle")); - m_gridPFBuses->SetCellEditor(0, 4, new wxGridCellChoiceEditor(m_activePowerChoices)); - m_gridPFBuses->SetCellValue(0, 4, m_activePowerChoices[3]); - m_gridPFBuses->SetCellEditor(0, 5, new wxGridCellChoiceEditor(m_reactivePowerChoices)); - m_gridPFBuses->SetCellValue(0, 5, m_reactivePowerChoices[3]); - - // Power flow branches - m_gridPFBranches->SetCellValue(0, 0, _("Type")); - m_gridPFBranches->SetCellValue(0, 1, _("Name")); - m_gridPFBranches->SetCellValue(0, 2, _("From")); - m_gridPFBranches->SetCellValue(0, 3, _("To")); - m_gridPFBranches->SetCellEditor(0, 4, new wxGridCellChoiceEditor(m_resistanceChoices)); - m_gridPFBranches->SetCellValue(0, 4, m_resistanceChoices[0]); - m_gridPFBranches->SetCellEditor(0, 5, new wxGridCellChoiceEditor(m_indReactanceChoices)); - m_gridPFBranches->SetCellValue(0, 5, m_indReactanceChoices[0]); - m_gridPFBranches->SetCellEditor(0, 6, new wxGridCellChoiceEditor(m_capSusceptanceChoices)); - m_gridPFBranches->SetCellValue(0, 6, m_capSusceptanceChoices[0]); - m_gridPFBranches->SetCellValue(0, 7, _("TAP")); - m_gridPFBranches->SetCellValue(0, 8, _("Phase Shift")); - m_gridPFBranches->SetCellValue(0, 9, _("Online")); - - // Fault - m_gridFault->SetCellValue(0, 0, _("Fault bus name")); - m_gridFault->SetCellValue(0, 1, _("Phase A")); - m_gridFault->SetCellValue(0, 3, _("Phase B")); - m_gridFault->SetCellValue(0, 5, _("Phase C")); - m_gridFault->SetCellEditor(1, 1, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFault->SetCellValue(1, 1, m_currentChoices[1]); - m_gridFault->SetCellValue(1, 2, _("Angle")); - m_gridFault->SetCellEditor(1, 3, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFault->SetCellValue(1, 3, m_currentChoices[1]); - m_gridFault->SetCellValue(1, 4, _("Angle")); - m_gridFault->SetCellEditor(1, 5, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFault->SetCellValue(1, 5, m_currentChoices[1]); - m_gridFault->SetCellValue(1, 6, _("Angle")); - - // Fault buses - m_gridFaultBuses->SetCellValue(0, 0, _("Name")); - m_gridFaultBuses->SetCellValue(0, 1, _("Phase A")); - m_gridFaultBuses->SetCellValue(0, 3, _("Phase B")); - m_gridFaultBuses->SetCellValue(0, 5, _("Phase C")); - m_gridFaultBuses->SetCellEditor(1, 1, new wxGridCellChoiceEditor(m_voltageChoices)); - m_gridFaultBuses->SetCellValue(1, 1, m_voltageChoices[0]); - m_gridFaultBuses->SetCellValue(1, 2, _("Angle")); - m_gridFaultBuses->SetCellEditor(1, 3, new wxGridCellChoiceEditor(m_voltageChoices)); - m_gridFaultBuses->SetCellValue(1, 3, m_voltageChoices[0]); - m_gridFaultBuses->SetCellValue(1, 4, _("Angle")); - m_gridFaultBuses->SetCellEditor(1, 5, new wxGridCellChoiceEditor(m_voltageChoices)); - m_gridFaultBuses->SetCellValue(1, 5, m_voltageChoices[0]); - m_gridFaultBuses->SetCellValue(1, 6, _("Angle")); - - // Fault branches - m_gridFaultBranches->SetCellValue(0, 0, _("Type")); - m_gridFaultBranches->SetCellValue(0, 1, _("Name")); - m_gridFaultBranches->SetCellValue(0, 2, _("From")); - m_gridFaultBranches->SetCellValue(0, 3, _("To")); - m_gridFaultBranches->SetCellValue(0, 4, _("Phase A")); - m_gridFaultBranches->SetCellValue(0, 6, _("Phase B")); - m_gridFaultBranches->SetCellValue(0, 8, _("Phase C")); - m_gridFaultBranches->SetCellValue(0, 10, _("Online")); - m_gridFaultBranches->SetCellEditor(1, 4, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFaultBranches->SetCellValue(1, 4, m_currentChoices[1]); - m_gridFaultBranches->SetCellValue(1, 5, _("Angle")); - m_gridFaultBranches->SetCellEditor(1, 6, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFaultBranches->SetCellValue(1, 6, m_currentChoices[1]); - m_gridFaultBranches->SetCellValue(1, 7, _("Angle")); - m_gridFaultBranches->SetCellEditor(1, 8, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFaultBranches->SetCellValue(1, 8, m_currentChoices[1]); - m_gridFaultBranches->SetCellValue(1, 9, _("Angle")); - - // Fault generators - m_gridFaultGenerators->SetCellValue(0, 0, _("Name")); - m_gridFaultGenerators->SetCellValue(0, 1, _("Phase A")); - m_gridFaultGenerators->SetCellValue(0, 3, _("Phase B")); - m_gridFaultGenerators->SetCellValue(0, 5, _("Phase C")); - m_gridFaultGenerators->SetCellEditor(1, 1, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFaultGenerators->SetCellValue(1, 1, m_currentChoices[1]); - m_gridFaultGenerators->SetCellValue(1, 2, _("Angle")); - m_gridFaultGenerators->SetCellEditor(1, 3, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFaultGenerators->SetCellValue(1, 3, m_currentChoices[1]); - m_gridFaultGenerators->SetCellValue(1, 4, _("Angle")); - m_gridFaultGenerators->SetCellEditor(1, 5, new wxGridCellChoiceEditor(m_currentChoices)); - m_gridFaultGenerators->SetCellValue(1, 5, m_currentChoices[1]); - m_gridFaultGenerators->SetCellValue(1, 6, _("Angle")); + // Headers choices fill + wxString omega = static_cast(L'\u03A9'); + + m_voltageChoices.Add(_("Voltage (p.u.)")); + m_voltageChoices.Add(_("Voltage (V)")); + m_voltageChoices.Add(_("Voltage (kV)")); + + m_activePowerChoices.Add(_("Active Power (p.u.)")); + m_activePowerChoices.Add(_("Active Power (W)")); + m_activePowerChoices.Add(_("Active Power (kW)")); + m_activePowerChoices.Add(_("Active Power (MW)")); + + m_reactivePowerChoices.Add(_("Reactive Power (p.u.)")); + m_reactivePowerChoices.Add(_("Reactive Power (VAr)")); + m_reactivePowerChoices.Add(_("Reactive Power (kVAr)")); + m_reactivePowerChoices.Add(_("Reactive Power (MVAr)")); + + m_resistanceChoices.Add(_("R (p.u.)")); + m_resistanceChoices.Add(_("R (") + omega + wxT(")")); + + m_indReactanceChoices.Add(_("XL (p.u.)")); + m_indReactanceChoices.Add(_("XL (") + omega + wxT(")")); + + m_capSusceptanceChoices.Add(_("B (p.u.)")); + m_capSusceptanceChoices.Add(_("B (S)")); + + m_currentChoices.Add(_("Current (p.u.)")); + m_currentChoices.Add(_("Current (A)")); + m_currentChoices.Add(_("Current (kA)")); + + // Power flow + m_gridPowerFlow->SetCellValue(0, 0, _("Type")); + m_gridPowerFlow->SetCellValue(0, 1, _("Name")); + m_gridPowerFlow->SetCellValue(0, 2, _("From")); + m_gridPowerFlow->SetCellValue(0, 3, _("To")); + m_gridPowerFlow->SetCellEditor(0, 4, new wxGridCellChoiceEditor(m_activePowerChoices)); + m_gridPowerFlow->SetCellValue(0, 4, m_activePowerChoices[3]); + m_gridPowerFlow->SetCellEditor(0, 5, new wxGridCellChoiceEditor(m_reactivePowerChoices)); + m_gridPowerFlow->SetCellValue(0, 5, m_reactivePowerChoices[3]); + m_gridPowerFlow->SetCellValue(0, 6, _("Online")); + + // Power flow buses + m_gridPFBuses->SetCellValue(0, 0, _("Name")); + m_gridPFBuses->SetCellValue(0, 1, _("Type")); + m_gridPFBuses->SetCellEditor(0, 2, new wxGridCellChoiceEditor(m_voltageChoices)); + m_gridPFBuses->SetCellValue(0, 2, m_voltageChoices[0]); + m_gridPFBuses->SetCellValue(0, 3, _("Angle")); + m_gridPFBuses->SetCellEditor(0, 4, new wxGridCellChoiceEditor(m_activePowerChoices)); + m_gridPFBuses->SetCellValue(0, 4, m_activePowerChoices[3]); + m_gridPFBuses->SetCellEditor(0, 5, new wxGridCellChoiceEditor(m_reactivePowerChoices)); + m_gridPFBuses->SetCellValue(0, 5, m_reactivePowerChoices[3]); + + // Power flow branches + m_gridPFBranches->SetCellValue(0, 0, _("Type")); + m_gridPFBranches->SetCellValue(0, 1, _("Name")); + m_gridPFBranches->SetCellValue(0, 2, _("From")); + m_gridPFBranches->SetCellValue(0, 3, _("To")); + m_gridPFBranches->SetCellEditor(0, 4, new wxGridCellChoiceEditor(m_resistanceChoices)); + m_gridPFBranches->SetCellValue(0, 4, m_resistanceChoices[0]); + m_gridPFBranches->SetCellEditor(0, 5, new wxGridCellChoiceEditor(m_indReactanceChoices)); + m_gridPFBranches->SetCellValue(0, 5, m_indReactanceChoices[0]); + m_gridPFBranches->SetCellEditor(0, 6, new wxGridCellChoiceEditor(m_capSusceptanceChoices)); + m_gridPFBranches->SetCellValue(0, 6, m_capSusceptanceChoices[0]); + m_gridPFBranches->SetCellValue(0, 7, _("TAP")); + m_gridPFBranches->SetCellValue(0, 8, _("Phase Shift")); + m_gridPFBranches->SetCellValue(0, 9, _("Online")); + + // Fault + m_gridFault->SetCellValue(0, 0, _("Fault bus name")); + m_gridFault->SetCellValue(0, 1, _("Phase A")); + m_gridFault->SetCellValue(0, 3, _("Phase B")); + m_gridFault->SetCellValue(0, 5, _("Phase C")); + m_gridFault->SetCellEditor(1, 1, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFault->SetCellValue(1, 1, m_currentChoices[1]); + m_gridFault->SetCellValue(1, 2, _("Angle")); + m_gridFault->SetCellEditor(1, 3, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFault->SetCellValue(1, 3, m_currentChoices[1]); + m_gridFault->SetCellValue(1, 4, _("Angle")); + m_gridFault->SetCellEditor(1, 5, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFault->SetCellValue(1, 5, m_currentChoices[1]); + m_gridFault->SetCellValue(1, 6, _("Angle")); + + // Fault buses + m_gridFaultBuses->SetCellValue(0, 0, _("Name")); + m_gridFaultBuses->SetCellValue(0, 1, _("Phase A")); + m_gridFaultBuses->SetCellValue(0, 3, _("Phase B")); + m_gridFaultBuses->SetCellValue(0, 5, _("Phase C")); + m_gridFaultBuses->SetCellEditor(1, 1, new wxGridCellChoiceEditor(m_voltageChoices)); + m_gridFaultBuses->SetCellValue(1, 1, m_voltageChoices[0]); + m_gridFaultBuses->SetCellValue(1, 2, _("Angle")); + m_gridFaultBuses->SetCellEditor(1, 3, new wxGridCellChoiceEditor(m_voltageChoices)); + m_gridFaultBuses->SetCellValue(1, 3, m_voltageChoices[0]); + m_gridFaultBuses->SetCellValue(1, 4, _("Angle")); + m_gridFaultBuses->SetCellEditor(1, 5, new wxGridCellChoiceEditor(m_voltageChoices)); + m_gridFaultBuses->SetCellValue(1, 5, m_voltageChoices[0]); + m_gridFaultBuses->SetCellValue(1, 6, _("Angle")); + + // Fault branches + m_gridFaultBranches->SetCellValue(0, 0, _("Type")); + m_gridFaultBranches->SetCellValue(0, 1, _("Name")); + m_gridFaultBranches->SetCellValue(0, 2, _("From")); + m_gridFaultBranches->SetCellValue(0, 3, _("To")); + m_gridFaultBranches->SetCellValue(0, 4, _("Phase A")); + m_gridFaultBranches->SetCellValue(0, 6, _("Phase B")); + m_gridFaultBranches->SetCellValue(0, 8, _("Phase C")); + m_gridFaultBranches->SetCellValue(0, 10, _("Online")); + m_gridFaultBranches->SetCellEditor(1, 4, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFaultBranches->SetCellValue(1, 4, m_currentChoices[1]); + m_gridFaultBranches->SetCellValue(1, 5, _("Angle")); + m_gridFaultBranches->SetCellEditor(1, 6, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFaultBranches->SetCellValue(1, 6, m_currentChoices[1]); + m_gridFaultBranches->SetCellValue(1, 7, _("Angle")); + m_gridFaultBranches->SetCellEditor(1, 8, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFaultBranches->SetCellValue(1, 8, m_currentChoices[1]); + m_gridFaultBranches->SetCellValue(1, 9, _("Angle")); + + // Fault generators + m_gridFaultGenerators->SetCellValue(0, 0, _("Name")); + m_gridFaultGenerators->SetCellValue(0, 1, _("Phase A")); + m_gridFaultGenerators->SetCellValue(0, 3, _("Phase B")); + m_gridFaultGenerators->SetCellValue(0, 5, _("Phase C")); + m_gridFaultGenerators->SetCellEditor(1, 1, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFaultGenerators->SetCellValue(1, 1, m_currentChoices[1]); + m_gridFaultGenerators->SetCellValue(1, 2, _("Angle")); + m_gridFaultGenerators->SetCellEditor(1, 3, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFaultGenerators->SetCellValue(1, 3, m_currentChoices[1]); + m_gridFaultGenerators->SetCellValue(1, 4, _("Angle")); + m_gridFaultGenerators->SetCellEditor(1, 5, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridFaultGenerators->SetCellValue(1, 5, m_currentChoices[1]); + m_gridFaultGenerators->SetCellValue(1, 6, _("Angle")); + + // Harmonic Currents + m_gridHarmCurrents->SetCellValue(0, 0, _("Name")); + m_gridHarmCurrents->SetCellValue(0, 1, _("Bus")); + m_gridHarmCurrents->SetCellValue(0, 2, _("Harmonic")); + m_gridHarmCurrents->SetCellEditor(0, 3, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridHarmCurrents->SetCellValue(0, 3, m_currentChoices[1]); + m_gridHarmCurrents->SetCellValue(0, 4, _("Angle")); + + // Harmonic Buses + m_gridHarmBuses->SetCellValue(0, 0, _("Name")); + m_gridHarmBuses->SetCellValue(0, 1, _("THD")); + m_gridHarmBuses->SetCellValue(0, 2, _("Harmonic")); + m_gridHarmBuses->SetCellEditor(0, 3, new wxGridCellChoiceEditor(m_voltageChoices)); + m_gridHarmBuses->SetCellValue(0, 3, m_voltageChoices[0]); + m_gridHarmBuses->SetCellValue(0, 4, _("Angle")); + + // Harmonic branches currents + m_gridHarmBranches->SetCellValue(0, 0, _("Type")); + m_gridHarmBranches->SetCellValue(0, 1, _("Name")); + m_gridHarmBranches->SetCellValue(0, 2, _("From")); + m_gridHarmBranches->SetCellValue(0, 3, _("To")); + m_gridHarmBranches->SetCellValue(0, 4, _("Harmonic")); + m_gridHarmBranches->SetCellEditor(0, 5, new wxGridCellChoiceEditor(m_currentChoices)); + m_gridHarmBranches->SetCellValue(0, 5, m_currentChoices[1]); + m_gridHarmBranches->SetCellValue(0, 6, _("Angle")); + m_gridHarmBranches->SetCellValue(0, 7, _("Online")); } void DataReport::FillValues(GridSelection gridToFill) { - m_changingValues = true; - ElectricCalculation eCalc; - eCalc.GetElementsFromList(m_workspace->GetElementList()); - - double basePower = m_workspace->GetProperties()->GetSimulationPropertiesData().basePower; - switch(m_workspace->GetProperties()->GetSimulationPropertiesData().basePowerUnit) { - case ElectricalUnit::UNIT_kVA: { - basePower *= 1e3; - } break; - case ElectricalUnit::UNIT_MVA: { - basePower *= 1e6; - } break; - default: - break; - } - - int rowNumber = 1; - auto lineList = eCalc.GetLineList(); - auto transformerList = eCalc.GetTransformerList(); - auto busList = eCalc.GetBusList(); - auto generatorList = eCalc.GetSyncGeneratorList(); - - // Power Flow - if(gridToFill == GRID_ALL || gridToFill == GRID_PF) { - double kActivePower = 1.0; - if(m_gridPowerFlow->GetCellValue(0, 4) == m_activePowerChoices[1]) - kActivePower = basePower; - else if(m_gridPowerFlow->GetCellValue(0, 4) == m_activePowerChoices[2]) - kActivePower = basePower / 1e3; - else if(m_gridPowerFlow->GetCellValue(0, 4) == m_activePowerChoices[3]) - kActivePower = basePower / 1e6; - - double kReactivePower = 1.0; - if(m_gridPowerFlow->GetCellValue(0, 5) == m_reactivePowerChoices[1]) - kReactivePower = basePower; - else if(m_gridPowerFlow->GetCellValue(0, 5) == m_reactivePowerChoices[2]) - kReactivePower = basePower / 1e3; - else if(m_gridPowerFlow->GetCellValue(0, 5) == m_reactivePowerChoices[3]) - kReactivePower = basePower / 1e6; - - for(auto it = lineList.begin(), itEnd = lineList.end(); it != itEnd; ++it) { - Line* line = *it; - - wxString busName1 = "-"; - if(line->GetParentList()[0]) - busName1 = static_cast(line->GetParentList()[0])->GetElectricalData().name; - wxString busName2 = "-"; - if(line->GetParentList()[1]) - busName2 = static_cast(line->GetParentList()[1])->GetElectricalData().name; - - wxString isOnline = _("Yes"); - wxColour textColour = m_gridPowerFlow->GetDefaultCellTextColour(); - if(!line->IsOnline()) { - isOnline = _("No"); - textColour = m_offlineColour; - } - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 7; ++j) { m_gridPowerFlow->SetCellTextColour(rowNumber + i, j, textColour); } - } - - m_gridPowerFlow->SetCellValue(rowNumber, 9, isOnline); - auto data = line->GetPUElectricalData(basePower); - - m_gridPowerFlow->SetCellValue(rowNumber, 0, _("Line")); - m_gridPowerFlow->SetCellValue(rowNumber, 1, data.name); - m_gridPowerFlow->SetCellValue(rowNumber, 2, busName1); - m_gridPowerFlow->SetCellValue(rowNumber, 3, busName2); - m_gridPowerFlow->SetCellValue(rowNumber, 4, - line->StringFromDouble(std::real(data.powerFlow[0]) * kActivePower)); - m_gridPowerFlow->SetCellValue(rowNumber, 5, - line->StringFromDouble(std::imag(data.powerFlow[0]) * kReactivePower)); - m_gridPowerFlow->SetCellValue(rowNumber, 6, isOnline); - rowNumber++; - - m_gridPowerFlow->SetCellValue(rowNumber, 0, _("Line")); - m_gridPowerFlow->SetCellValue(rowNumber, 1, data.name); - m_gridPowerFlow->SetCellValue(rowNumber, 2, busName2); - m_gridPowerFlow->SetCellValue(rowNumber, 3, busName1); - m_gridPowerFlow->SetCellValue(rowNumber, 4, - line->StringFromDouble(std::real(data.powerFlow[1]) * kActivePower)); - m_gridPowerFlow->SetCellValue(rowNumber, 5, - line->StringFromDouble(std::imag(data.powerFlow[1]) * kReactivePower)); - m_gridPowerFlow->SetCellValue(rowNumber, 6, isOnline); - rowNumber++; - } - - for(auto it = transformerList.begin(), itEnd = transformerList.end(); it != itEnd; ++it) { - Transformer* transformer = *it; - auto data = transformer->GetPUElectricalData(basePower); - - wxString busName1 = "-"; - if(transformer->GetParentList()[0]) - busName1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().name; - wxString busName2 = "-"; - if(transformer->GetParentList()[1]) - busName2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().name; - - wxString isOnline = _("Yes"); - wxColour textColour = m_gridPowerFlow->GetDefaultCellTextColour(); - if(!transformer->IsOnline()) { - isOnline = _("No"); - textColour = m_offlineColour; - } - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 7; ++j) { m_gridPowerFlow->SetCellTextColour(rowNumber + i, j, textColour); } - } - - m_gridPowerFlow->SetCellValue(rowNumber, 0, _("Transformer")); - m_gridPowerFlow->SetCellValue(rowNumber, 1, data.name); - m_gridPowerFlow->SetCellValue(rowNumber, 2, busName1); - m_gridPowerFlow->SetCellValue(rowNumber, 3, busName2); - m_gridPowerFlow->SetCellValue(rowNumber, 4, - transformer->StringFromDouble(std::real(data.powerFlow[0]) * kActivePower)); - m_gridPowerFlow->SetCellValue(rowNumber, 5, - transformer->StringFromDouble(std::imag(data.powerFlow[0]) * kReactivePower)); - m_gridPowerFlow->SetCellValue(rowNumber, 6, isOnline); - rowNumber++; - - m_gridPowerFlow->SetCellValue(rowNumber, 0, _("Transformer")); - m_gridPowerFlow->SetCellValue(rowNumber, 1, data.name); - m_gridPowerFlow->SetCellValue(rowNumber, 2, busName2); - m_gridPowerFlow->SetCellValue(rowNumber, 3, busName1); - m_gridPowerFlow->SetCellValue(rowNumber, 4, - transformer->StringFromDouble(std::real(data.powerFlow[1]) * kActivePower)); - m_gridPowerFlow->SetCellValue(rowNumber, 5, - transformer->StringFromDouble(std::imag(data.powerFlow[1]) * kReactivePower)); - m_gridPowerFlow->SetCellValue(rowNumber, 6, isOnline); - rowNumber++; - } - m_gridPowerFlow->AutoSize(); - } - - // Power Flow buses - if(gridToFill == GRID_ALL || gridToFill == GRID_PFBUSES) { - double kActivePower = 1.0; - if(m_gridPFBuses->GetCellValue(0, 4) == m_activePowerChoices[1]) - kActivePower = basePower; - else if(m_gridPFBuses->GetCellValue(0, 4) == m_activePowerChoices[2]) - kActivePower = basePower / 1e3; - else if(m_gridPFBuses->GetCellValue(0, 4) == m_activePowerChoices[3]) - kActivePower = basePower / 1e6; - - double kReactivePower = 1.0; - if(m_gridPFBuses->GetCellValue(0, 5) == m_reactivePowerChoices[1]) - kReactivePower = basePower; - else if(m_gridPFBuses->GetCellValue(0, 5) == m_reactivePowerChoices[2]) - kReactivePower = basePower / 1e3; - else if(m_gridPFBuses->GetCellValue(0, 5) == m_reactivePowerChoices[3]) - kReactivePower = basePower / 1e6; - - rowNumber = 1; - for(auto it = busList.begin(), itEnd = busList.end(); it != itEnd; ++it) { - Bus* bus = *it; - auto data = bus->GetElectricalData(); - - double vb = std::abs(data.nominalVoltage); - if(data.nominalVoltageUnit == ElectricalUnit::UNIT_kV) vb *= 1e3; - double kVoltage = 1.0; - if(m_gridPFBuses->GetCellValue(0, 2) == m_voltageChoices[1]) - kVoltage = vb; - else if(m_gridPFBuses->GetCellValue(0, 2) == m_voltageChoices[2]) - kVoltage = vb / 1e3; - - m_gridPFBuses->SetCellValue(rowNumber, 0, data.name); - wxString busTypeString = ""; - switch(data.busType) { - case BUS_SLACK: { - busTypeString = _("Slack"); - } break; - case BUS_PV: { - busTypeString = _("PV"); - } break; - case BUS_PQ: { - busTypeString = _("PQ"); - } break; - } - m_gridPFBuses->SetCellValue(rowNumber, 1, busTypeString); - m_gridPFBuses->SetCellValue(rowNumber, 2, bus->StringFromDouble(std::abs(data.voltage) * kVoltage)); - m_gridPFBuses->SetCellValue(rowNumber, 3, bus->StringFromDouble(wxRadToDeg(std::arg(data.voltage)))); - m_gridPFBuses->SetCellValue(rowNumber, 4, bus->StringFromDouble(std::real(data.power) * kActivePower)); - m_gridPFBuses->SetCellValue(rowNumber, 5, bus->StringFromDouble(std::imag(data.power) * kReactivePower)); - rowNumber++; - } - m_gridPFBuses->AutoSize(); - } - - // Power flow branches - if(gridToFill == GRID_ALL || gridToFill == GRID_PFBRANCHES) { - rowNumber = 1; - for(auto it = lineList.begin(), itEnd = lineList.end(); it != itEnd; ++it) { - Line* line = *it; - auto data = line->GetPUElectricalData(basePower); - - double vb = data.nominalVoltage; - if(data.nominalVoltageUnit == ElectricalUnit::UNIT_kV) vb *= 1e3; - double zb = (vb * vb) / basePower; - - wxString busName1 = "-"; - if(line->GetParentList()[0]) - busName1 = static_cast(line->GetParentList()[0])->GetElectricalData().name; - wxString busName2 = "-"; - if(line->GetParentList()[1]) - busName2 = static_cast(line->GetParentList()[1])->GetElectricalData().name; - wxString isOnline = _("Yes"); - wxColour textColour = m_gridPFBranches->GetDefaultCellTextColour(); - if(!line->IsOnline()) { - isOnline = _("No"); - textColour = m_offlineColour; - } - for(int j = 0; j < 10; ++j) { m_gridPFBranches->SetCellTextColour(rowNumber, j, textColour); } - - m_gridPFBranches->SetCellValue(rowNumber, 0, _("Line")); - m_gridPFBranches->SetCellValue(rowNumber, 1, data.name); - - m_gridPFBranches->SetCellValue(rowNumber, 2, busName1); - m_gridPFBranches->SetCellValue(rowNumber, 3, busName2); - - double k = 1.0; - if(m_gridPFBranches->GetCellValue(0, 4) == m_resistanceChoices[1]) k = zb; - m_gridPFBranches->SetCellValue(rowNumber, 4, line->StringFromDouble(data.resistance * k)); - k = 1.0; - if(m_gridPFBranches->GetCellValue(0, 5) == m_indReactanceChoices[1]) k = zb; - m_gridPFBranches->SetCellValue(rowNumber, 5, line->StringFromDouble(data.indReactance * k)); - k = 1.0; - if(m_gridPFBranches->GetCellValue(0, 6) == m_capSusceptanceChoices[1]) k = zb; - m_gridPFBranches->SetCellValue(rowNumber, 6, line->StringFromDouble(data.capSusceptance / k)); - m_gridPFBranches->SetCellValue(rowNumber, 7, "-"); - m_gridPFBranches->SetCellValue(rowNumber, 8, "-"); - m_gridPFBranches->SetCellValue(rowNumber, 9, isOnline); - rowNumber++; - } - for(auto it = transformerList.begin(), itEnd = transformerList.end(); it != itEnd; ++it) { - Transformer* transformer = *it; - auto data = transformer->GetPUElectricalData(basePower); - - double vb = 0.0; - if(data.baseVoltage == 0) { - vb = data.primaryNominalVoltage; - if(data.primaryNominalVoltageUnit == ElectricalUnit::UNIT_kV) vb *= 1e3; - } else { - vb = data.secondaryNominalVoltage; - if(data.secondaryNominalVoltageUnit == ElectricalUnit::UNIT_kV) vb *= 1e3; - } - double zb = (vb * vb) / basePower; - - wxString busName1 = "-"; - if(transformer->GetParentList()[0]) - busName1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().name; - wxString busName2 = "-"; - if(transformer->GetParentList()[1]) - busName2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().name; - - wxString isOnline = _("Yes"); - wxColour textColour = m_gridPFBranches->GetDefaultCellTextColour(); - if(!transformer->IsOnline()) { - isOnline = _("No"); - textColour = m_offlineColour; - } - for(int j = 0; j < 10; ++j) { m_gridPFBranches->SetCellTextColour(rowNumber, j, textColour); } - - m_gridPFBranches->SetCellValue(rowNumber, 0, _("Transformer")); - m_gridPFBranches->SetCellValue(rowNumber, 1, data.name); - m_gridPFBranches->SetCellValue(rowNumber, 2, busName1); - m_gridPFBranches->SetCellValue(rowNumber, 3, busName2); - - double k = 1.0; - if(m_gridPFBranches->GetCellValue(0, 4) == m_resistanceChoices[1]) k = zb; - m_gridPFBranches->SetCellValue(rowNumber, 4, transformer->StringFromDouble(data.resistance * k)); - k = 1.0; - if(m_gridPFBranches->GetCellValue(0, 5) == m_indReactanceChoices[1]) k = zb; - m_gridPFBranches->SetCellValue(rowNumber, 5, transformer->StringFromDouble(data.indReactance * k)); - m_gridPFBranches->SetCellValue(rowNumber, 6, "-"); - m_gridPFBranches->SetCellValue(rowNumber, 7, transformer->StringFromDouble(data.turnsRatio)); - m_gridPFBranches->SetCellValue(rowNumber, 8, transformer->StringFromDouble(data.phaseShift)); - m_gridPFBranches->SetCellValue(rowNumber, 9, isOnline); - rowNumber++; - } - m_gridPFBranches->AutoSize(); - } - - // Fault - if(gridToFill == GRID_ALL || gridToFill == GRID_FAULT) { - rowNumber = 2; - for(auto it = busList.begin(), itEnd = busList.end(); it != itEnd; ++it) { - Bus* bus = *it; - auto data = bus->GetElectricalData(); - if(data.hasFault) { - double vb = bus->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); - double ib = basePower / (std::sqrt(3.0) * vb); - - m_gridFault->SetCellValue(rowNumber, 0, data.name); - - double kCurrent = 1.0; - if(m_gridFault->GetCellValue(1, 1) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFault->GetCellValue(1, 1) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFault->SetCellValue(rowNumber, 1, - bus->StringFromDouble(std::abs(data.faultCurrent[0]) * kCurrent)); - - m_gridFault->SetCellValue(rowNumber, 2, - bus->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0])))); - - kCurrent = 1.0; - if(m_gridFault->GetCellValue(1, 3) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFault->GetCellValue(1, 3) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFault->SetCellValue(rowNumber, 3, - bus->StringFromDouble(std::abs(data.faultCurrent[1]) * kCurrent)); - - m_gridFault->SetCellValue(rowNumber, 4, - bus->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1])))); - - kCurrent = 1.0; - if(m_gridFault->GetCellValue(1, 5) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFault->GetCellValue(1, 5) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFault->SetCellValue(rowNumber, 5, - bus->StringFromDouble(std::abs(data.faultCurrent[2]) * kCurrent)); - - m_gridFault->SetCellValue(rowNumber, 6, - bus->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[2])))); - - rowNumber++; - } - } - m_gridFault->AutoSize(); - } - - // Fault buses - if(gridToFill == GRID_ALL || gridToFill == GRID_FAULTBUSES) { - rowNumber = 2; - for(auto it = busList.begin(), itEnd = busList.end(); it != itEnd; ++it) { - Bus* bus = *it; - auto data = bus->GetElectricalData(); - double vb = bus->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); - - m_gridFaultBuses->SetCellValue(rowNumber, 0, data.name); - double kVoltage = 1.0; - if(m_gridFaultBuses->GetCellValue(1, 1) == m_voltageChoices[1]) { - kVoltage = vb; - } else if(m_gridFaultBuses->GetCellValue(1, 1) == m_voltageChoices[2]) { - kVoltage = vb / 1e3; - } - m_gridFaultBuses->SetCellValue(rowNumber, 1, - bus->StringFromDouble(std::abs(data.faultVoltage[0]) * kVoltage)); - m_gridFaultBuses->SetCellValue(rowNumber, 2, - bus->StringFromDouble(wxRadToDeg(std::arg(data.faultVoltage[0])))); - - kVoltage = 1.0; - if(m_gridFaultBuses->GetCellValue(1, 3) == m_voltageChoices[1]) { - kVoltage = vb; - } else if(m_gridFaultBuses->GetCellValue(1, 3) == m_voltageChoices[2]) { - kVoltage = vb / 1e3; - } - m_gridFaultBuses->SetCellValue(rowNumber, 3, - bus->StringFromDouble(std::abs(data.faultVoltage[1]) * kVoltage)); - m_gridFaultBuses->SetCellValue(rowNumber, 4, - bus->StringFromDouble(wxRadToDeg(std::arg(data.faultVoltage[1])))); - - kVoltage = 1.0; - if(m_gridFaultBuses->GetCellValue(1, 5) == m_voltageChoices[1]) { - kVoltage = vb; - } else if(m_gridFaultBuses->GetCellValue(1, 5) == m_voltageChoices[2]) { - kVoltage = vb / 1e3; - } - m_gridFaultBuses->SetCellValue(rowNumber, 5, - bus->StringFromDouble(std::abs(data.faultVoltage[2]) * kVoltage)); - m_gridFaultBuses->SetCellValue(rowNumber, 6, - bus->StringFromDouble(wxRadToDeg(std::arg(data.faultVoltage[2])))); - - rowNumber++; - } - m_gridFaultBuses->AutoSize(); - } - - // Fault branches - if(gridToFill == GRID_ALL || gridToFill == GRID_FAULTBRANCHES) { - rowNumber = 2; - for(auto it = lineList.begin(), itEnd = lineList.end(); it != itEnd; ++it) { - Line* line = *it; - auto data = line->GetPUElectricalData(basePower); - - double vb = line->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); - double ib = basePower / (std::sqrt(3.0) * vb); - - wxString busName1 = "-"; - if(line->GetParentList()[0]) - busName1 = static_cast(line->GetParentList()[0])->GetElectricalData().name; - wxString busName2 = "-"; - if(line->GetParentList()[1]) - busName2 = static_cast(line->GetParentList()[1])->GetElectricalData().name; - - wxString isOnline = _("Yes"); - wxColour textColour = m_gridFaultBranches->GetDefaultCellTextColour(); - if(!line->IsOnline()) { - isOnline = _("No"); - textColour = m_offlineColour; - } - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 11; ++j) { m_gridFaultBranches->SetCellTextColour(rowNumber + i, j, textColour); } - } - - m_gridFaultBranches->SetCellValue(rowNumber, 0, _("Line")); - m_gridFaultBranches->SetCellValue(rowNumber, 1, data.name); - m_gridFaultBranches->SetCellValue(rowNumber, 2, busName1); - m_gridFaultBranches->SetCellValue(rowNumber, 3, busName2); - - double kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFaultBranches->SetCellValue(rowNumber, 4, - line->StringFromDouble(std::abs(data.faultCurrent[0][0]) * kCurrent)); - m_gridFaultBranches->SetCellValue(rowNumber, 5, - line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][0])))); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFaultBranches->SetCellValue(rowNumber, 6, - line->StringFromDouble(std::abs(data.faultCurrent[0][1]) * kCurrent)); - m_gridFaultBranches->SetCellValue(rowNumber, 7, - line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][1])))); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFaultBranches->SetCellValue(rowNumber, 8, - line->StringFromDouble(std::abs(data.faultCurrent[0][2]) * kCurrent)); - m_gridFaultBranches->SetCellValue(rowNumber, 9, - line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][2])))); - m_gridFaultBranches->SetCellValue(rowNumber, 10, isOnline); - rowNumber++; - - m_gridFaultBranches->SetCellValue(rowNumber, 0, _("Line")); - m_gridFaultBranches->SetCellValue(rowNumber, 1, data.name); - m_gridFaultBranches->SetCellValue(rowNumber, 2, busName2); - m_gridFaultBranches->SetCellValue(rowNumber, 3, busName1); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFaultBranches->SetCellValue(rowNumber, 4, - line->StringFromDouble(std::abs(data.faultCurrent[1][0]) * kCurrent)); - m_gridFaultBranches->SetCellValue(rowNumber, 5, - line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][0])))); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFaultBranches->SetCellValue(rowNumber, 6, - line->StringFromDouble(std::abs(data.faultCurrent[1][1]) * kCurrent)); - m_gridFaultBranches->SetCellValue(rowNumber, 7, - line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][1])))); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[1]) { - kCurrent = ib; - } else if(m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[2]) { - kCurrent = ib / 1e3; - } - m_gridFaultBranches->SetCellValue(rowNumber, 8, - line->StringFromDouble(std::abs(data.faultCurrent[1][2]) * kCurrent)); - m_gridFaultBranches->SetCellValue(rowNumber, 9, - line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][2])))); - m_gridFaultBranches->SetCellValue(rowNumber, 10, isOnline); - rowNumber++; - } - - for(auto it = transformerList.begin(), itEnd = transformerList.end(); it != itEnd; ++it) { - Transformer* transformer = *it; - auto data = transformer->GetPUElectricalData(basePower); - - double vb = transformer->GetValueFromUnit(data.primaryNominalVoltage, data.primaryNominalVoltageUnit); - double ibp = basePower / (std::sqrt(3.0) * vb); - vb = transformer->GetValueFromUnit(data.secondaryNominalVoltage, data.secondaryNominalVoltageUnit); - double ibs = basePower / (std::sqrt(3.0) * vb); - - wxString busName1 = "-"; - if(transformer->GetParentList()[0]) - busName1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().name; - wxString busName2 = "-"; - if(transformer->GetParentList()[1]) - busName2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().name; - - wxString isOnline = _("Yes"); - wxColour textColour = m_gridFaultBranches->GetDefaultCellTextColour(); - if(!transformer->IsOnline()) { - isOnline = _("No"); - textColour = m_offlineColour; - } - for(int i = 0; i < 2; ++i) { - for(int j = 0; j < 11; ++j) { m_gridFaultBranches->SetCellTextColour(rowNumber + i, j, textColour); } - } - - m_gridFaultBranches->SetCellValue(rowNumber, 0, _("Transformer")); - m_gridFaultBranches->SetCellValue(rowNumber, 1, data.name); - m_gridFaultBranches->SetCellValue(rowNumber, 2, busName1); - m_gridFaultBranches->SetCellValue(rowNumber, 3, busName2); - - double kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[1]) { - kCurrent = ibp; - } else if(m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[2]) { - kCurrent = ibp / 1e3; - } - m_gridFaultBranches->SetCellValue( - rowNumber, 4, transformer->StringFromDouble(std::abs(data.faultCurrent[0][0]) * kCurrent)); - m_gridFaultBranches->SetCellValue( - rowNumber, 5, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][0])))); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[1]) { - kCurrent = ibp; - } else if(m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[2]) { - kCurrent = ibp / 1e3; - } - m_gridFaultBranches->SetCellValue( - rowNumber, 6, transformer->StringFromDouble(std::abs(data.faultCurrent[0][1]) * kCurrent)); - m_gridFaultBranches->SetCellValue( - rowNumber, 7, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][1])))); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[1]) { - kCurrent = ibp; - } else if(m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[2]) { - kCurrent = ibp / 1e3; - } - m_gridFaultBranches->SetCellValue( - rowNumber, 8, transformer->StringFromDouble(std::abs(data.faultCurrent[0][2]) * kCurrent)); - m_gridFaultBranches->SetCellValue( - rowNumber, 9, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][2])))); - m_gridFaultBranches->SetCellValue(rowNumber, 10, isOnline); - rowNumber++; - - m_gridFaultBranches->SetCellValue(rowNumber, 0, _("Transformer")); - m_gridFaultBranches->SetCellValue(rowNumber, 1, data.name); - m_gridFaultBranches->SetCellValue(rowNumber, 2, busName2); - m_gridFaultBranches->SetCellValue(rowNumber, 3, busName1); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[1]) { - kCurrent = ibs; - } else if(m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[2]) { - kCurrent = ibs / 1e3; - } - m_gridFaultBranches->SetCellValue( - rowNumber, 4, transformer->StringFromDouble(std::abs(data.faultCurrent[1][0]) * kCurrent)); - m_gridFaultBranches->SetCellValue( - rowNumber, 5, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][0])))); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[1]) { - kCurrent = ibs; - } else if(m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[2]) { - kCurrent = ibs / 1e3; - } - m_gridFaultBranches->SetCellValue( - rowNumber, 6, transformer->StringFromDouble(std::abs(data.faultCurrent[1][1]) * kCurrent)); - m_gridFaultBranches->SetCellValue( - rowNumber, 7, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][1])))); - kCurrent = 1.0; - if(m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[1]) { - kCurrent = ibs; - } else if(m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[2]) { - kCurrent = ibs / 1e3; - } - m_gridFaultBranches->SetCellValue( - rowNumber, 8, transformer->StringFromDouble(std::abs(data.faultCurrent[1][2]) * kCurrent)); - m_gridFaultBranches->SetCellValue( - rowNumber, 9, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][2])))); - m_gridFaultBranches->SetCellValue(rowNumber, 10, isOnline); - rowNumber++; - } - - m_gridFaultBranches->AutoSize(); - } - - // Fault generators - if(gridToFill == GRID_ALL || gridToFill == GRID_FAULTGENERATORS) { - rowNumber = 2; - for(auto it = generatorList.begin(), itEnd = generatorList.end(); it != itEnd; ++it) { - SyncGenerator* generator = *it; - auto data = generator->GetPUElectricalData(basePower); - double vb = generator->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); - double ib = basePower / (std::sqrt(3.0) * vb); - - m_gridFaultGenerators->SetCellValue(rowNumber, 0, data.name); - - double kCurrent = 1.0; - if(m_gridFaultGenerators->GetCellValue(1, 1) == m_currentChoices[1]) - kCurrent = ib; - else if(m_gridFaultGenerators->GetCellValue(1, 1) == m_currentChoices[2]) - kCurrent = ib / 1e3; - m_gridFaultGenerators->SetCellValue(rowNumber, 1, - generator->StringFromDouble(std::abs(data.faultCurrent[0]) * kCurrent)); - m_gridFaultGenerators->SetCellValue( - rowNumber, 2, generator->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0])))); - - kCurrent = 1.0; - if(m_gridFaultGenerators->GetCellValue(1, 3) == m_currentChoices[1]) - kCurrent = ib; - else if(m_gridFaultGenerators->GetCellValue(1, 3) == m_currentChoices[2]) - kCurrent = ib / 1e3; - m_gridFaultGenerators->SetCellValue(rowNumber, 3, - generator->StringFromDouble(std::abs(data.faultCurrent[1]) * kCurrent)); - m_gridFaultGenerators->SetCellValue( - rowNumber, 4, generator->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1])))); - - kCurrent = 1.0; - if(m_gridFaultGenerators->GetCellValue(1, 5) == m_currentChoices[1]) - kCurrent = ib; - else if(m_gridFaultGenerators->GetCellValue(1, 5) == m_currentChoices[2]) - kCurrent = ib / 1e3; - m_gridFaultGenerators->SetCellValue(rowNumber, 5, - generator->StringFromDouble(std::abs(data.faultCurrent[2]) * kCurrent)); - m_gridFaultGenerators->SetCellValue( - rowNumber, 6, generator->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[2])))); - - rowNumber++; - } - m_gridFaultGenerators->AutoSize(); - } - m_changingValues = false; + m_changingValues = true; + ElectricCalculation eCalc; + eCalc.GetElementsFromList(m_workspace->GetElementList()); + + double basePower = m_workspace->GetProperties()->GetSimulationPropertiesData().basePower; + switch (m_workspace->GetProperties()->GetSimulationPropertiesData().basePowerUnit) { + case ElectricalUnit::UNIT_kVA: { + basePower *= 1e3; + } break; + case ElectricalUnit::UNIT_MVA: { + basePower *= 1e6; + } break; + default: + break; + } + + int rowNumber = 1; + auto lineList = eCalc.GetLineList(); + auto transformerList = eCalc.GetTransformerList(); + auto busList = eCalc.GetBusList(); + auto generatorList = eCalc.GetSyncGeneratorList(); + auto harmCurrentList = eCalc.GetHarmCurrentList(); + + // Power Flow + if (gridToFill == GRID_ALL || gridToFill == GRID_PF) { + double kActivePower = 1.0; + if (m_gridPowerFlow->GetCellValue(0, 4) == m_activePowerChoices[1]) + kActivePower = basePower; + else if (m_gridPowerFlow->GetCellValue(0, 4) == m_activePowerChoices[2]) + kActivePower = basePower / 1e3; + else if (m_gridPowerFlow->GetCellValue(0, 4) == m_activePowerChoices[3]) + kActivePower = basePower / 1e6; + + double kReactivePower = 1.0; + if (m_gridPowerFlow->GetCellValue(0, 5) == m_reactivePowerChoices[1]) + kReactivePower = basePower; + else if (m_gridPowerFlow->GetCellValue(0, 5) == m_reactivePowerChoices[2]) + kReactivePower = basePower / 1e3; + else if (m_gridPowerFlow->GetCellValue(0, 5) == m_reactivePowerChoices[3]) + kReactivePower = basePower / 1e6; + + for (auto it = lineList.begin(), itEnd = lineList.end(); it != itEnd; ++it) { + Line* line = *it; + + wxString busName1 = "-"; + if (line->GetParentList()[0]) + busName1 = static_cast(line->GetParentList()[0])->GetElectricalData().name; + wxString busName2 = "-"; + if (line->GetParentList()[1]) + busName2 = static_cast(line->GetParentList()[1])->GetElectricalData().name; + + wxString isOnline = _("Yes"); + wxColour textColour = m_gridPowerFlow->GetDefaultCellTextColour(); + if (!line->IsOnline()) { + isOnline = _("No"); + textColour = m_offlineColour; + } + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 7; ++j) { m_gridPowerFlow->SetCellTextColour(rowNumber + i, j, textColour); } + } + + auto data = line->GetPUElectricalData(basePower); + + m_gridPowerFlow->SetCellValue(rowNumber, 0, _("Line")); + m_gridPowerFlow->SetCellValue(rowNumber, 1, data.name); + m_gridPowerFlow->SetCellValue(rowNumber, 2, busName1); + m_gridPowerFlow->SetCellValue(rowNumber, 3, busName2); + m_gridPowerFlow->SetCellValue(rowNumber, 4, + line->StringFromDouble(std::real(data.powerFlow[0]) * kActivePower)); + m_gridPowerFlow->SetCellValue(rowNumber, 5, + line->StringFromDouble(std::imag(data.powerFlow[0]) * kReactivePower)); + m_gridPowerFlow->SetCellValue(rowNumber, 6, isOnline); + rowNumber++; + + m_gridPowerFlow->SetCellValue(rowNumber, 0, _("Line")); + m_gridPowerFlow->SetCellValue(rowNumber, 1, data.name); + m_gridPowerFlow->SetCellValue(rowNumber, 2, busName2); + m_gridPowerFlow->SetCellValue(rowNumber, 3, busName1); + m_gridPowerFlow->SetCellValue(rowNumber, 4, + line->StringFromDouble(std::real(data.powerFlow[1]) * kActivePower)); + m_gridPowerFlow->SetCellValue(rowNumber, 5, + line->StringFromDouble(std::imag(data.powerFlow[1]) * kReactivePower)); + m_gridPowerFlow->SetCellValue(rowNumber, 6, isOnline); + rowNumber++; + } + + for (auto it = transformerList.begin(), itEnd = transformerList.end(); it != itEnd; ++it) { + Transformer* transformer = *it; + auto data = transformer->GetPUElectricalData(basePower); + + wxString busName1 = "-"; + if (transformer->GetParentList()[0]) + busName1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().name; + wxString busName2 = "-"; + if (transformer->GetParentList()[1]) + busName2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().name; + + wxString isOnline = _("Yes"); + wxColour textColour = m_gridPowerFlow->GetDefaultCellTextColour(); + if (!transformer->IsOnline()) { + isOnline = _("No"); + textColour = m_offlineColour; + } + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 7; ++j) { m_gridPowerFlow->SetCellTextColour(rowNumber + i, j, textColour); } + } + + m_gridPowerFlow->SetCellValue(rowNumber, 0, _("Transformer")); + m_gridPowerFlow->SetCellValue(rowNumber, 1, data.name); + m_gridPowerFlow->SetCellValue(rowNumber, 2, busName1); + m_gridPowerFlow->SetCellValue(rowNumber, 3, busName2); + m_gridPowerFlow->SetCellValue(rowNumber, 4, + transformer->StringFromDouble(std::real(data.powerFlow[0]) * kActivePower)); + m_gridPowerFlow->SetCellValue(rowNumber, 5, + transformer->StringFromDouble(std::imag(data.powerFlow[0]) * kReactivePower)); + m_gridPowerFlow->SetCellValue(rowNumber, 6, isOnline); + rowNumber++; + + m_gridPowerFlow->SetCellValue(rowNumber, 0, _("Transformer")); + m_gridPowerFlow->SetCellValue(rowNumber, 1, data.name); + m_gridPowerFlow->SetCellValue(rowNumber, 2, busName2); + m_gridPowerFlow->SetCellValue(rowNumber, 3, busName1); + m_gridPowerFlow->SetCellValue(rowNumber, 4, + transformer->StringFromDouble(std::real(data.powerFlow[1]) * kActivePower)); + m_gridPowerFlow->SetCellValue(rowNumber, 5, + transformer->StringFromDouble(std::imag(data.powerFlow[1]) * kReactivePower)); + m_gridPowerFlow->SetCellValue(rowNumber, 6, isOnline); + rowNumber++; + } + m_gridPowerFlow->AutoSize(); + m_gridPowerFlow->GetContainingSizer()->Layout(); + } + + // Power Flow buses + if (gridToFill == GRID_ALL || gridToFill == GRID_PFBUSES) { + double kActivePower = 1.0; + if (m_gridPFBuses->GetCellValue(0, 4) == m_activePowerChoices[1]) + kActivePower = basePower; + else if (m_gridPFBuses->GetCellValue(0, 4) == m_activePowerChoices[2]) + kActivePower = basePower / 1e3; + else if (m_gridPFBuses->GetCellValue(0, 4) == m_activePowerChoices[3]) + kActivePower = basePower / 1e6; + + double kReactivePower = 1.0; + if (m_gridPFBuses->GetCellValue(0, 5) == m_reactivePowerChoices[1]) + kReactivePower = basePower; + else if (m_gridPFBuses->GetCellValue(0, 5) == m_reactivePowerChoices[2]) + kReactivePower = basePower / 1e3; + else if (m_gridPFBuses->GetCellValue(0, 5) == m_reactivePowerChoices[3]) + kReactivePower = basePower / 1e6; + + rowNumber = 1; + for (auto it = busList.begin(), itEnd = busList.end(); it != itEnd; ++it) { + Bus* bus = *it; + auto data = bus->GetElectricalData(); + + double vb = std::abs(data.nominalVoltage); + if (data.nominalVoltageUnit == ElectricalUnit::UNIT_kV) vb *= 1e3; + double kVoltage = 1.0; + if (m_gridPFBuses->GetCellValue(0, 2) == m_voltageChoices[1]) + kVoltage = vb; + else if (m_gridPFBuses->GetCellValue(0, 2) == m_voltageChoices[2]) + kVoltage = vb / 1e3; + + m_gridPFBuses->SetCellValue(rowNumber, 0, data.name); + wxString busTypeString = ""; + switch (data.busType) { + case BUS_SLACK: { + busTypeString = _("Slack"); + } break; + case BUS_PV: { + busTypeString = _("PV"); + } break; + case BUS_PQ: { + busTypeString = _("PQ"); + } break; + } + m_gridPFBuses->SetCellValue(rowNumber, 1, busTypeString); + m_gridPFBuses->SetCellValue(rowNumber, 2, bus->StringFromDouble(std::abs(data.voltage) * kVoltage)); + m_gridPFBuses->SetCellValue(rowNumber, 3, bus->StringFromDouble(wxRadToDeg(std::arg(data.voltage)))); + m_gridPFBuses->SetCellValue(rowNumber, 4, bus->StringFromDouble(std::real(data.power) * kActivePower)); + m_gridPFBuses->SetCellValue(rowNumber, 5, bus->StringFromDouble(std::imag(data.power) * kReactivePower)); + rowNumber++; + } + m_gridPFBuses->AutoSize(); + m_gridPFBuses->GetContainingSizer()->Layout(); + } + + // Power flow branches + if (gridToFill == GRID_ALL || gridToFill == GRID_PFBRANCHES) { + rowNumber = 1; + for (auto it = lineList.begin(), itEnd = lineList.end(); it != itEnd; ++it) { + Line* line = *it; + auto data = line->GetPUElectricalData(basePower); + + double vb = data.nominalVoltage; + if (data.nominalVoltageUnit == ElectricalUnit::UNIT_kV) vb *= 1e3; + double zb = (vb * vb) / basePower; + + wxString busName1 = "-"; + if (line->GetParentList()[0]) + busName1 = static_cast(line->GetParentList()[0])->GetElectricalData().name; + wxString busName2 = "-"; + if (line->GetParentList()[1]) + busName2 = static_cast(line->GetParentList()[1])->GetElectricalData().name; + wxString isOnline = _("Yes"); + wxColour textColour = m_gridPFBranches->GetDefaultCellTextColour(); + if (!line->IsOnline()) { + isOnline = _("No"); + textColour = m_offlineColour; + } + for (int j = 0; j < 10; ++j) { m_gridPFBranches->SetCellTextColour(rowNumber, j, textColour); } + + m_gridPFBranches->SetCellValue(rowNumber, 0, _("Line")); + m_gridPFBranches->SetCellValue(rowNumber, 1, data.name); + + m_gridPFBranches->SetCellValue(rowNumber, 2, busName1); + m_gridPFBranches->SetCellValue(rowNumber, 3, busName2); + + double k = 1.0; + if (m_gridPFBranches->GetCellValue(0, 4) == m_resistanceChoices[1]) k = zb; + m_gridPFBranches->SetCellValue(rowNumber, 4, line->StringFromDouble(data.resistance * k)); + k = 1.0; + if (m_gridPFBranches->GetCellValue(0, 5) == m_indReactanceChoices[1]) k = zb; + m_gridPFBranches->SetCellValue(rowNumber, 5, line->StringFromDouble(data.indReactance * k)); + k = 1.0; + if (m_gridPFBranches->GetCellValue(0, 6) == m_capSusceptanceChoices[1]) k = zb; + m_gridPFBranches->SetCellValue(rowNumber, 6, line->StringFromDouble(data.capSusceptance / k)); + m_gridPFBranches->SetCellValue(rowNumber, 7, "-"); + m_gridPFBranches->SetCellValue(rowNumber, 8, "-"); + m_gridPFBranches->SetCellValue(rowNumber, 9, isOnline); + rowNumber++; + } + for (auto it = transformerList.begin(), itEnd = transformerList.end(); it != itEnd; ++it) { + Transformer* transformer = *it; + auto data = transformer->GetPUElectricalData(basePower); + + double vb = 0.0; + if (data.baseVoltage == 0) { + vb = data.primaryNominalVoltage; + if (data.primaryNominalVoltageUnit == ElectricalUnit::UNIT_kV) vb *= 1e3; + } + else { + vb = data.secondaryNominalVoltage; + if (data.secondaryNominalVoltageUnit == ElectricalUnit::UNIT_kV) vb *= 1e3; + } + double zb = (vb * vb) / basePower; + + wxString busName1 = "-"; + if (transformer->GetParentList()[0]) + busName1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().name; + wxString busName2 = "-"; + if (transformer->GetParentList()[1]) + busName2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().name; + + wxString isOnline = _("Yes"); + wxColour textColour = m_gridPFBranches->GetDefaultCellTextColour(); + if (!transformer->IsOnline()) { + isOnline = _("No"); + textColour = m_offlineColour; + } + for (int j = 0; j < 10; ++j) { m_gridPFBranches->SetCellTextColour(rowNumber, j, textColour); } + + m_gridPFBranches->SetCellValue(rowNumber, 0, _("Transformer")); + m_gridPFBranches->SetCellValue(rowNumber, 1, data.name); + m_gridPFBranches->SetCellValue(rowNumber, 2, busName1); + m_gridPFBranches->SetCellValue(rowNumber, 3, busName2); + + double k = 1.0; + if (m_gridPFBranches->GetCellValue(0, 4) == m_resistanceChoices[1]) k = zb; + m_gridPFBranches->SetCellValue(rowNumber, 4, transformer->StringFromDouble(data.resistance * k)); + k = 1.0; + if (m_gridPFBranches->GetCellValue(0, 5) == m_indReactanceChoices[1]) k = zb; + m_gridPFBranches->SetCellValue(rowNumber, 5, transformer->StringFromDouble(data.indReactance * k)); + m_gridPFBranches->SetCellValue(rowNumber, 6, "-"); + m_gridPFBranches->SetCellValue(rowNumber, 7, transformer->StringFromDouble(data.turnsRatio)); + m_gridPFBranches->SetCellValue(rowNumber, 8, transformer->StringFromDouble(data.phaseShift)); + m_gridPFBranches->SetCellValue(rowNumber, 9, isOnline); + rowNumber++; + } + m_gridPFBranches->AutoSize(); + m_gridPFBranches->GetContainingSizer()->Layout(); + } + + // Fault + if (gridToFill == GRID_ALL || gridToFill == GRID_FAULT) { + rowNumber = 2; + for (auto it = busList.begin(), itEnd = busList.end(); it != itEnd; ++it) { + Bus* bus = *it; + auto data = bus->GetElectricalData(); + if (data.hasFault) { + double vb = bus->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); + double ib = basePower / (std::sqrt(3.0) * vb); + + m_gridFault->SetCellValue(rowNumber, 0, data.name); + + double kCurrent = 1.0; + if (m_gridFault->GetCellValue(1, 1) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFault->GetCellValue(1, 1) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFault->SetCellValue(rowNumber, 1, + bus->StringFromDouble(std::abs(data.faultCurrent[0]) * kCurrent)); + + m_gridFault->SetCellValue(rowNumber, 2, + bus->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0])))); + + kCurrent = 1.0; + if (m_gridFault->GetCellValue(1, 3) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFault->GetCellValue(1, 3) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFault->SetCellValue(rowNumber, 3, + bus->StringFromDouble(std::abs(data.faultCurrent[1]) * kCurrent)); + + m_gridFault->SetCellValue(rowNumber, 4, + bus->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1])))); + + kCurrent = 1.0; + if (m_gridFault->GetCellValue(1, 5) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFault->GetCellValue(1, 5) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFault->SetCellValue(rowNumber, 5, + bus->StringFromDouble(std::abs(data.faultCurrent[2]) * kCurrent)); + + m_gridFault->SetCellValue(rowNumber, 6, + bus->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[2])))); + + rowNumber++; + } + } + m_gridFault->AutoSize(); + m_gridFault->GetContainingSizer()->Layout(); + } + + // Fault buses + if (gridToFill == GRID_ALL || gridToFill == GRID_FAULTBUSES) { + rowNumber = 2; + for (auto it = busList.begin(), itEnd = busList.end(); it != itEnd; ++it) { + Bus* bus = *it; + auto data = bus->GetElectricalData(); + double vb = bus->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); + + m_gridFaultBuses->SetCellValue(rowNumber, 0, data.name); + double kVoltage = 1.0; + if (m_gridFaultBuses->GetCellValue(1, 1) == m_voltageChoices[1]) { + kVoltage = vb; + } + else if (m_gridFaultBuses->GetCellValue(1, 1) == m_voltageChoices[2]) { + kVoltage = vb / 1e3; + } + m_gridFaultBuses->SetCellValue(rowNumber, 1, + bus->StringFromDouble(std::abs(data.faultVoltage[0]) * kVoltage)); + m_gridFaultBuses->SetCellValue(rowNumber, 2, + bus->StringFromDouble(wxRadToDeg(std::arg(data.faultVoltage[0])))); + + kVoltage = 1.0; + if (m_gridFaultBuses->GetCellValue(1, 3) == m_voltageChoices[1]) { + kVoltage = vb; + } + else if (m_gridFaultBuses->GetCellValue(1, 3) == m_voltageChoices[2]) { + kVoltage = vb / 1e3; + } + m_gridFaultBuses->SetCellValue(rowNumber, 3, + bus->StringFromDouble(std::abs(data.faultVoltage[1]) * kVoltage)); + m_gridFaultBuses->SetCellValue(rowNumber, 4, + bus->StringFromDouble(wxRadToDeg(std::arg(data.faultVoltage[1])))); + + kVoltage = 1.0; + if (m_gridFaultBuses->GetCellValue(1, 5) == m_voltageChoices[1]) { + kVoltage = vb; + } + else if (m_gridFaultBuses->GetCellValue(1, 5) == m_voltageChoices[2]) { + kVoltage = vb / 1e3; + } + m_gridFaultBuses->SetCellValue(rowNumber, 5, + bus->StringFromDouble(std::abs(data.faultVoltage[2]) * kVoltage)); + m_gridFaultBuses->SetCellValue(rowNumber, 6, + bus->StringFromDouble(wxRadToDeg(std::arg(data.faultVoltage[2])))); + + rowNumber++; + } + m_gridFaultBuses->AutoSize(); + m_gridFaultBuses->GetContainingSizer()->Layout(); + } + + // Fault branches + if (gridToFill == GRID_ALL || gridToFill == GRID_FAULTBRANCHES) { + rowNumber = 2; + for (auto it = lineList.begin(), itEnd = lineList.end(); it != itEnd; ++it) { + Line* line = *it; + auto data = line->GetPUElectricalData(basePower); + + double vb = line->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); + double ib = basePower / (std::sqrt(3.0) * vb); + + wxString busName1 = "-"; + if (line->GetParentList()[0]) + busName1 = static_cast(line->GetParentList()[0])->GetElectricalData().name; + wxString busName2 = "-"; + if (line->GetParentList()[1]) + busName2 = static_cast(line->GetParentList()[1])->GetElectricalData().name; + + wxString isOnline = _("Yes"); + wxColour textColour = m_gridFaultBranches->GetDefaultCellTextColour(); + if (!line->IsOnline()) { + isOnline = _("No"); + textColour = m_offlineColour; + } + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 11; ++j) { m_gridFaultBranches->SetCellTextColour(rowNumber + i, j, textColour); } + } + + m_gridFaultBranches->SetCellValue(rowNumber, 0, _("Line")); + m_gridFaultBranches->SetCellValue(rowNumber, 1, data.name); + m_gridFaultBranches->SetCellValue(rowNumber, 2, busName1); + m_gridFaultBranches->SetCellValue(rowNumber, 3, busName2); + + double kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFaultBranches->SetCellValue(rowNumber, 4, + line->StringFromDouble(std::abs(data.faultCurrent[0][0]) * kCurrent)); + m_gridFaultBranches->SetCellValue(rowNumber, 5, + line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][0])))); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFaultBranches->SetCellValue(rowNumber, 6, + line->StringFromDouble(std::abs(data.faultCurrent[0][1]) * kCurrent)); + m_gridFaultBranches->SetCellValue(rowNumber, 7, + line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][1])))); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFaultBranches->SetCellValue(rowNumber, 8, + line->StringFromDouble(std::abs(data.faultCurrent[0][2]) * kCurrent)); + m_gridFaultBranches->SetCellValue(rowNumber, 9, + line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][2])))); + m_gridFaultBranches->SetCellValue(rowNumber, 10, isOnline); + rowNumber++; + + m_gridFaultBranches->SetCellValue(rowNumber, 0, _("Line")); + m_gridFaultBranches->SetCellValue(rowNumber, 1, data.name); + m_gridFaultBranches->SetCellValue(rowNumber, 2, busName2); + m_gridFaultBranches->SetCellValue(rowNumber, 3, busName1); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFaultBranches->SetCellValue(rowNumber, 4, + line->StringFromDouble(std::abs(data.faultCurrent[1][0]) * kCurrent)); + m_gridFaultBranches->SetCellValue(rowNumber, 5, + line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][0])))); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFaultBranches->SetCellValue(rowNumber, 6, + line->StringFromDouble(std::abs(data.faultCurrent[1][1]) * kCurrent)); + m_gridFaultBranches->SetCellValue(rowNumber, 7, + line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][1])))); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridFaultBranches->SetCellValue(rowNumber, 8, + line->StringFromDouble(std::abs(data.faultCurrent[1][2]) * kCurrent)); + m_gridFaultBranches->SetCellValue(rowNumber, 9, + line->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][2])))); + m_gridFaultBranches->SetCellValue(rowNumber, 10, isOnline); + rowNumber++; + } + + for (auto it = transformerList.begin(), itEnd = transformerList.end(); it != itEnd; ++it) { + Transformer* transformer = *it; + auto data = transformer->GetPUElectricalData(basePower); + + double vb = transformer->GetValueFromUnit(data.primaryNominalVoltage, data.primaryNominalVoltageUnit); + double ibp = basePower / (std::sqrt(3.0) * vb); + vb = transformer->GetValueFromUnit(data.secondaryNominalVoltage, data.secondaryNominalVoltageUnit); + double ibs = basePower / (std::sqrt(3.0) * vb); + + wxString busName1 = "-"; + if (transformer->GetParentList()[0]) + busName1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().name; + wxString busName2 = "-"; + if (transformer->GetParentList()[1]) + busName2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().name; + + wxString isOnline = _("Yes"); + wxColour textColour = m_gridFaultBranches->GetDefaultCellTextColour(); + if (!transformer->IsOnline()) { + isOnline = _("No"); + textColour = m_offlineColour; + } + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 11; ++j) { m_gridFaultBranches->SetCellTextColour(rowNumber + i, j, textColour); } + } + + m_gridFaultBranches->SetCellValue(rowNumber, 0, _("Transformer")); + m_gridFaultBranches->SetCellValue(rowNumber, 1, data.name); + m_gridFaultBranches->SetCellValue(rowNumber, 2, busName1); + m_gridFaultBranches->SetCellValue(rowNumber, 3, busName2); + + double kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[1]) { + kCurrent = ibp; + } + else if (m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[2]) { + kCurrent = ibp / 1e3; + } + m_gridFaultBranches->SetCellValue( + rowNumber, 4, transformer->StringFromDouble(std::abs(data.faultCurrent[0][0]) * kCurrent)); + m_gridFaultBranches->SetCellValue( + rowNumber, 5, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][0])))); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[1]) { + kCurrent = ibp; + } + else if (m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[2]) { + kCurrent = ibp / 1e3; + } + m_gridFaultBranches->SetCellValue( + rowNumber, 6, transformer->StringFromDouble(std::abs(data.faultCurrent[0][1]) * kCurrent)); + m_gridFaultBranches->SetCellValue( + rowNumber, 7, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][1])))); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[1]) { + kCurrent = ibp; + } + else if (m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[2]) { + kCurrent = ibp / 1e3; + } + m_gridFaultBranches->SetCellValue( + rowNumber, 8, transformer->StringFromDouble(std::abs(data.faultCurrent[0][2]) * kCurrent)); + m_gridFaultBranches->SetCellValue( + rowNumber, 9, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0][2])))); + m_gridFaultBranches->SetCellValue(rowNumber, 10, isOnline); + rowNumber++; + + m_gridFaultBranches->SetCellValue(rowNumber, 0, _("Transformer")); + m_gridFaultBranches->SetCellValue(rowNumber, 1, data.name); + m_gridFaultBranches->SetCellValue(rowNumber, 2, busName2); + m_gridFaultBranches->SetCellValue(rowNumber, 3, busName1); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[1]) { + kCurrent = ibs; + } + else if (m_gridFaultBranches->GetCellValue(1, 4) == m_currentChoices[2]) { + kCurrent = ibs / 1e3; + } + m_gridFaultBranches->SetCellValue( + rowNumber, 4, transformer->StringFromDouble(std::abs(data.faultCurrent[1][0]) * kCurrent)); + m_gridFaultBranches->SetCellValue( + rowNumber, 5, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][0])))); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[1]) { + kCurrent = ibs; + } + else if (m_gridFaultBranches->GetCellValue(1, 6) == m_currentChoices[2]) { + kCurrent = ibs / 1e3; + } + m_gridFaultBranches->SetCellValue( + rowNumber, 6, transformer->StringFromDouble(std::abs(data.faultCurrent[1][1]) * kCurrent)); + m_gridFaultBranches->SetCellValue( + rowNumber, 7, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][1])))); + kCurrent = 1.0; + if (m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[1]) { + kCurrent = ibs; + } + else if (m_gridFaultBranches->GetCellValue(1, 8) == m_currentChoices[2]) { + kCurrent = ibs / 1e3; + } + m_gridFaultBranches->SetCellValue( + rowNumber, 8, transformer->StringFromDouble(std::abs(data.faultCurrent[1][2]) * kCurrent)); + m_gridFaultBranches->SetCellValue( + rowNumber, 9, transformer->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1][2])))); + m_gridFaultBranches->SetCellValue(rowNumber, 10, isOnline); + rowNumber++; + } + + m_gridFaultBranches->AutoSize(); + m_gridFaultBranches->GetContainingSizer()->Layout(); + } + + // Fault generators + if (gridToFill == GRID_ALL || gridToFill == GRID_FAULTGENERATORS) { + rowNumber = 2; + for (auto it = generatorList.begin(), itEnd = generatorList.end(); it != itEnd; ++it) { + SyncGenerator* generator = *it; + auto data = generator->GetPUElectricalData(basePower); + double vb = generator->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); + double ib = basePower / (std::sqrt(3.0) * vb); + + m_gridFaultGenerators->SetCellValue(rowNumber, 0, data.name); + + double kCurrent = 1.0; + if (m_gridFaultGenerators->GetCellValue(1, 1) == m_currentChoices[1]) + kCurrent = ib; + else if (m_gridFaultGenerators->GetCellValue(1, 1) == m_currentChoices[2]) + kCurrent = ib / 1e3; + m_gridFaultGenerators->SetCellValue(rowNumber, 1, + generator->StringFromDouble(std::abs(data.faultCurrent[0]) * kCurrent)); + m_gridFaultGenerators->SetCellValue( + rowNumber, 2, generator->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[0])))); + + kCurrent = 1.0; + if (m_gridFaultGenerators->GetCellValue(1, 3) == m_currentChoices[1]) + kCurrent = ib; + else if (m_gridFaultGenerators->GetCellValue(1, 3) == m_currentChoices[2]) + kCurrent = ib / 1e3; + m_gridFaultGenerators->SetCellValue(rowNumber, 3, + generator->StringFromDouble(std::abs(data.faultCurrent[1]) * kCurrent)); + m_gridFaultGenerators->SetCellValue( + rowNumber, 4, generator->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[1])))); + + kCurrent = 1.0; + if (m_gridFaultGenerators->GetCellValue(1, 5) == m_currentChoices[1]) + kCurrent = ib; + else if (m_gridFaultGenerators->GetCellValue(1, 5) == m_currentChoices[2]) + kCurrent = ib / 1e3; + m_gridFaultGenerators->SetCellValue(rowNumber, 5, + generator->StringFromDouble(std::abs(data.faultCurrent[2]) * kCurrent)); + m_gridFaultGenerators->SetCellValue( + rowNumber, 6, generator->StringFromDouble(wxRadToDeg(std::arg(data.faultCurrent[2])))); + + rowNumber++; + } + m_gridFaultGenerators->AutoSize(); + m_gridFaultGenerators->GetContainingSizer()->Layout(); + } + + // Harmonic Currents + if (gridToFill == GRID_ALL || gridToFill == GRID_HARMCURRENT) { + rowNumber = 1; + for (auto* hCurrent : harmCurrentList) { + if (hCurrent->GetParentList()[0]) { + auto busData = static_cast(hCurrent->GetParentList()[0])->GetElectricalData(); + double vb = hCurrent->GetValueFromUnit(busData.nominalVoltage, busData.nominalVoltageUnit); + double ib = basePower / (std::sqrt(3.0) * vb); + + auto data = hCurrent->GetPUElectricalData(basePower, vb); + m_gridHarmCurrents->SetCellSize(rowNumber, 0, data.harmonicOrder.size(), 1); + m_gridHarmCurrents->SetCellValue(rowNumber, 0, data.name); + m_gridHarmCurrents->SetCellSize(rowNumber, 1, data.harmonicOrder.size(), 1); + m_gridHarmCurrents->SetCellValue(rowNumber, 1, busData.name); + int i = 0; + for (auto& order : data.harmonicOrder) { + m_gridHarmCurrents->SetCellValue(rowNumber, 2, wxString::Format(wxT("%d%s"), order, wxString(L'\u00BA'))); + double kCurrent = 1.0; + if (m_gridHarmCurrents->GetCellValue(0, 3) == m_currentChoices[1]) { + kCurrent = ib; + } + else if (m_gridHarmCurrents->GetCellValue(0, 3) == m_currentChoices[2]) { + kCurrent = ib / 1e3; + } + m_gridHarmCurrents->SetCellValue(rowNumber, 3, hCurrent->StringFromDouble(data.injHarmCurrent[i] * kCurrent)); + m_gridHarmCurrents->SetCellValue(rowNumber, 4, hCurrent->StringFromDouble(data.injHarmAngle[i]) + wxString(L'\u00B0')); + i++; + rowNumber++; + } + } + else { + auto data = hCurrent->GetElectricalData(); + m_gridHarmCurrents->SetCellSize(rowNumber, 0, data.harmonicOrder.size(), 1); + m_gridHarmCurrents->SetCellValue(rowNumber, 0, data.name); + m_gridHarmCurrents->SetCellSize(rowNumber, 1, data.harmonicOrder.size(), 1); + m_gridHarmCurrents->SetCellValue(rowNumber, 1, "-"); + int i = 0; + for (auto& order : data.harmonicOrder) { + m_gridHarmCurrents->SetCellValue(rowNumber, 2, wxString::Format(wxT("%d%s"), order, wxString(L'\u00BA'))); + m_gridHarmCurrents->SetCellValue(rowNumber, 3, "?"); + m_gridHarmCurrents->SetCellValue(rowNumber, 4, hCurrent->StringFromDouble(data.injHarmAngle[i]) + wxString(L'\u00B0')); + i++; + rowNumber++; + } + + } + } + m_gridHarmCurrents->AutoSize(); + m_gridHarmCurrents->GetContainingSizer()->Layout(); + } + + // Harmonic Buses/Voltages + if (gridToFill == GRID_ALL || gridToFill == GRID_HARMBUSES) { + rowNumber = 1; + for (auto* bus : busList) { + auto data = bus->GetElectricalData(); + double vb = bus->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); + + m_gridHarmBuses->SetCellSize(rowNumber, 0, data.harmonicOrder.size(), 1); + m_gridHarmBuses->SetCellValue(rowNumber, 0, data.name); + m_gridHarmBuses->SetCellSize(rowNumber, 1, data.harmonicOrder.size(), 1); + m_gridHarmBuses->SetCellValue(rowNumber, 1, bus->StringFromDouble(data.thd) + wxT("%")); + int i = 0; + for (auto& order : data.harmonicOrder) { + m_gridHarmBuses->SetCellValue(rowNumber, 2, wxString::Format(wxT("%d%s"), order, wxString(L'\u00BA'))); + wxString voltageStr = ""; + if (m_gridHarmBuses->GetCellValue(0, 3) == m_voltageChoices[0]) { + voltageStr.Printf(wxT("%.10e"), std::abs(data.harmonicVoltage[i])); + } + else if (m_gridHarmBuses->GetCellValue(0, 3) == m_voltageChoices[1]) { + voltageStr = bus->StringFromDouble(std::abs(data.harmonicVoltage[i]) * vb); + } + else if (m_gridHarmBuses->GetCellValue(0, 3) == m_voltageChoices[2]) { + voltageStr = bus->StringFromDouble(std::abs(data.harmonicVoltage[i]) * vb / 1e3); + } + m_gridHarmBuses->SetCellValue(rowNumber, 3, voltageStr); + m_gridHarmBuses->SetCellValue(rowNumber, 4, bus->StringFromDouble(wxRadToDeg(std::arg(data.harmonicVoltage[i]))) + wxString(L'\u00B0')); + + i++; + rowNumber++; + } + } + m_gridHarmBuses->AutoSize(); + m_gridHarmBuses->GetContainingSizer()->Layout(); + } + + // Fault branches + if (gridToFill == GRID_ALL || gridToFill == GRID_HARMBRANCHES) { + rowNumber = 1; + for (auto* line : lineList) { + auto data = line->GetPUElectricalData(basePower); + + double vb = line->GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); + double ib = basePower / (std::sqrt(3.0) * vb); + + wxString busName1 = "-"; + if (line->GetParentList()[0]) + busName1 = static_cast(line->GetParentList()[0])->GetElectricalData().name; + wxString busName2 = "-"; + if (line->GetParentList()[1]) + busName2 = static_cast(line->GetParentList()[1])->GetElectricalData().name; + + wxString isOnline = _("Yes"); + wxColour textColour = m_gridHarmBranches->GetDefaultCellTextColour(); + if (!line->IsOnline()) { + isOnline = _("No"); + textColour = m_offlineColour; + } + for (int side = 0; side < 2; ++side) { + for (unsigned int i = 0; i < data.harmonicOrder.size(); ++i) { + for (int j = 0; j < 8; ++j) { m_gridHarmBranches->SetCellTextColour(rowNumber + i, j, textColour); } + } + + m_gridHarmBranches->SetCellSize(rowNumber, 0, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 0, _("Line")); + m_gridHarmBranches->SetCellSize(rowNumber, 1, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 1, data.name); + m_gridHarmBranches->SetCellSize(rowNumber, 2, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 2, side == 0 ? busName1 : busName2); + m_gridHarmBranches->SetCellSize(rowNumber, 3, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 3, side == 0 ? busName2 : busName1); + m_gridHarmBranches->SetCellSize(rowNumber, 7, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 7, isOnline); + + int i = 0; + for (auto& order : data.harmonicOrder) { + m_gridHarmBranches->SetCellValue(rowNumber, 4, wxString::Format(wxT("%d%s"), order, wxString(L'\u00BA'))); + wxString currentStr = ""; + wxString angleStr = ""; + if (line->IsOnline()) { + if (m_gridHarmBranches->GetCellValue(0, 5) == m_currentChoices[0]) { + currentStr.Printf(wxT("%.10e"), std::abs(data.harmonicCurrent[side][i])); + } + else if (m_gridHarmBranches->GetCellValue(0, 5) == m_currentChoices[1]) { + currentStr = line->StringFromDouble(std::abs(data.harmonicCurrent[side][i]) * ib); + } + else if (m_gridHarmBranches->GetCellValue(0, 5) == m_currentChoices[2]) { + currentStr = line->StringFromDouble(std::abs(data.harmonicCurrent[side][i]) * ib / 1e3); + } + angleStr = line->StringFromDouble(wxRadToDeg(std::arg(data.harmonicCurrent[side][i]))) + wxString(L'\u00B0'); + } + else { + currentStr = line->StringFromDouble(0.0); + angleStr = line->StringFromDouble(0.0); + } + + m_gridHarmBranches->SetCellValue(rowNumber, 5, currentStr); + m_gridHarmBranches->SetCellValue(rowNumber, 6, angleStr); + + i++; + rowNumber++; + } + } + } + + for (auto* transformer : transformerList) { + auto data = transformer->GetPUElectricalData(basePower); + + double vb = transformer->GetValueFromUnit(data.primaryNominalVoltage, data.primaryNominalVoltageUnit); + double ibp = basePower / (std::sqrt(3.0) * vb); + vb = transformer->GetValueFromUnit(data.secondaryNominalVoltage, data.secondaryNominalVoltageUnit); + double ibs = basePower / (std::sqrt(3.0) * vb); + + wxString busName1 = "-"; + if (transformer->GetParentList()[0]) + busName1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().name; + wxString busName2 = "-"; + if (transformer->GetParentList()[1]) + busName2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().name; + + wxString isOnline = _("Yes"); + wxColour textColour = m_gridHarmBranches->GetDefaultCellTextColour(); + if (!transformer->IsOnline()) { + isOnline = _("No"); + textColour = m_offlineColour; + } + for (int side = 0; side < 2; ++side) { + for (unsigned int i = 0; i < data.harmonicOrder.size(); ++i) { + for (int j = 0; j < 8; ++j) { m_gridHarmBranches->SetCellTextColour(rowNumber + i, j, textColour); } + } + double ib = side == 0 ? ibp : ibs; + + m_gridHarmBranches->SetCellSize(rowNumber, 0, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 0, _("Transformer")); + m_gridHarmBranches->SetCellSize(rowNumber, 1, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 1, data.name); + m_gridHarmBranches->SetCellSize(rowNumber, 2, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 2, side == 0 ? busName1 : busName2); + m_gridHarmBranches->SetCellSize(rowNumber, 3, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 3, side == 0 ? busName2 : busName1); + m_gridHarmBranches->SetCellSize(rowNumber, 7, data.harmonicOrder.size(), 1); + m_gridHarmBranches->SetCellValue(rowNumber, 7, isOnline); + + int i = 0; + for (auto& order : data.harmonicOrder) { + m_gridHarmBranches->SetCellValue(rowNumber, 4, wxString::Format(wxT("%d%s"), order, wxString(L'\u00BA'))); + wxString currentStr = ""; + wxString angleStr = ""; + if (transformer->IsOnline()) { + if (m_gridHarmBranches->GetCellValue(0, 5) == m_currentChoices[0]) { + currentStr.Printf(wxT("%.10e"), std::abs(data.harmonicCurrent[side][i])); + } + else if (m_gridHarmBranches->GetCellValue(0, 5) == m_currentChoices[1]) { + currentStr = transformer->StringFromDouble(std::abs(data.harmonicCurrent[side][i]) * ib); + } + else if (m_gridHarmBranches->GetCellValue(0, 5) == m_currentChoices[2]) { + currentStr = transformer->StringFromDouble(std::abs(data.harmonicCurrent[side][i]) * ib / 1e3); + } + angleStr = transformer->StringFromDouble(wxRadToDeg(std::arg(data.harmonicCurrent[side][i]))) + wxString(L'\u00B0'); + } + else { + currentStr = transformer->StringFromDouble(0.0); + angleStr = transformer->StringFromDouble(0.0); + } + + m_gridHarmBranches->SetCellValue(rowNumber, 5, currentStr); + m_gridHarmBranches->SetCellValue(rowNumber, 6, angleStr); + + i++; + rowNumber++; + } + } + } + + m_gridHarmBranches->AutoSize(); + m_gridHarmBranches->GetContainingSizer()->Layout(); + } + + m_changingValues = false; } -void DataReport::SetRowsColours(wxGrid* grid, int rowStart) +void DataReport::SetRowsColours(wxGrid* grid, int rowStart, int colStart, int colEndTrim) { - for(int i = rowStart; i < grid->GetNumberRows(); ++i) { - wxGridCellAttr* attr = grid->GetOrCreateCellAttr(i, 0); - if((i - rowStart) % 2 == 0) - attr->SetBackgroundColour(m_evenRowColour); - else - attr->SetBackgroundColour(m_oddRowColour); - grid->SetRowAttr(i, attr); - } + for (int i = rowStart; i < grid->GetNumberRows(); ++i) { + wxGridCellAttr* attr = grid->GetOrCreateCellAttr(i, colStart); + if ((i - rowStart) % 2 == 0) + attr->SetBackgroundColour(m_evenRowColour); + else + attr->SetBackgroundColour(m_oddRowColour); + //grid->SetRowAttr(i, attr); + for (int j = colStart; j < (grid->GetNumberCols() - colEndTrim); ++j) { + grid->SetAttr(i, j, attr); + } + } } void DataReport::OnPFBusGridChanged(wxGridEvent& event) { - if(!m_changingValues) FillValues(GRID_PFBUSES); + if (!m_changingValues) FillValues(GRID_PFBUSES); } void DataReport::OnFaulrGridChanged(wxGridEvent& event) { - if(!m_changingValues) FillValues(GRID_FAULT); + if (!m_changingValues) FillValues(GRID_FAULT); } void DataReport::OnFaultBranchesGridChanged(wxGridEvent& event) { - if(!m_changingValues) FillValues(GRID_FAULTBRANCHES); + if (!m_changingValues) FillValues(GRID_FAULTBRANCHES); } void DataReport::OnFaultBusesGridChanged(wxGridEvent& event) { - if(!m_changingValues) FillValues(GRID_FAULTBUSES); + if (!m_changingValues) FillValues(GRID_FAULTBUSES); } void DataReport::OnFaultGeneratorsGridChanged(wxGridEvent& event) { - if(!m_changingValues) FillValues(GRID_FAULTGENERATORS); + if (!m_changingValues) FillValues(GRID_FAULTGENERATORS); } void DataReport::OnPFBranchesGridChanged(wxGridEvent& event) { - if(!m_changingValues) FillValues(GRID_PFBRANCHES); + if (!m_changingValues) FillValues(GRID_PFBRANCHES); } void DataReport::OnPowerFlowGridChanged(wxGridEvent& event) { - if(!m_changingValues) FillValues(GRID_PF); + if (!m_changingValues) FillValues(GRID_PF); } void DataReport::GridKeyHandler(wxGrid* grid, wxKeyEvent& event) { - if(event.GetKeyCode() == 'C' && event.GetModifiers() == wxMOD_CONTROL) { // Copy selection - // [Ref.] https://forums.wxwidgets.org/viewtopic.php?t=2200 - wxString copyData = ""; - bool lineNotEmpty; - - for(int i = 0; i < grid->GetNumberRows(); i++) { - lineNotEmpty = false; - for(int j = 0; j < grid->GetNumberCols(); j++) { - if(grid->IsInSelection(i, j)) { - if(lineNotEmpty == false) { - if(copyData.IsEmpty() == false) { - copyData.Append(wxT("\r\n")); // In Windows if copy to notepad need \r\n to new line. - } - lineNotEmpty = true; - } else { - copyData.Append(wxT("\t")); - } - copyData = copyData + grid->GetCellValue(i, j); - } - } - } - - if (wxTheClipboard->Open()) - { - wxTheClipboard->SetData(new wxTextDataObject(copyData)); - wxTheClipboard->Close(); - } - } else if(event.GetKeyCode() == 'A' && event.GetModifiers() == wxMOD_CONTROL) { // Select all - grid->SelectAll(); - } - event.Skip(); + if (event.GetKeyCode() == 'C' && event.GetModifiers() == wxMOD_CONTROL) { // Copy selection + // [Ref.] https://forums.wxwidgets.org/viewtopic.php?t=2200 + wxString copyData = ""; + bool lineNotEmpty; + + for (int i = 0; i < grid->GetNumberRows(); i++) { + lineNotEmpty = false; + for (int j = 0; j < grid->GetNumberCols(); j++) { + if (grid->IsInSelection(i, j)) { + if (lineNotEmpty == false) { + if (copyData.IsEmpty() == false) { + copyData.Append(wxT("\r\n")); // In Windows if copy to notepad need \r\n to new line. + } + lineNotEmpty = true; + } + else { + copyData.Append(wxT("\t")); + } + copyData = copyData + grid->GetCellValue(i, j); + } + } + } + + if (wxTheClipboard->Open()) + { + wxTheClipboard->SetData(new wxTextDataObject(copyData)); + wxTheClipboard->Close(); + } + } + else if (event.GetKeyCode() == 'A' && event.GetModifiers() == wxMOD_CONTROL) { // Select all + grid->SelectAll(); + } + event.Skip(); +} +void DataReport::OnHarmCurrentGridChanged(wxGridEvent& event) +{ + if (!m_changingValues) FillValues(GRID_HARMCURRENT); +} +void DataReport::OnHarmBusesGridChanged(wxGridEvent& event) +{ + if (!m_changingValues) FillValues(GRID_HARMBUSES); +} +void DataReport::OnHarmBranchesGridChanged(wxGridEvent& event) +{ + if (!m_changingValues) FillValues(GRID_HARMBRANCHES); } diff --git a/Project/DataReport.h b/Project/DataReport.h index 2da028d2..320a5c75 100644 --- a/Project/DataReport.h +++ b/Project/DataReport.h @@ -42,6 +42,9 @@ class DataReport : public DataReportBase GRID_FAULTBUSES, GRID_FAULTBRANCHES, GRID_FAULTGENERATORS, + GRID_HARMCURRENT, + GRID_HARMBUSES, + GRID_HARMBRANCHES, }; DataReport(wxWindow* parent, Workspace* workspace); @@ -50,10 +53,13 @@ class DataReport : public DataReportBase virtual void SetHeaders(); virtual void CreateGrids(); virtual void FillValues(GridSelection gridToFill = GRID_ALL); - virtual void SetRowsColours(wxGrid* grid, int rowStart = 1); + virtual void SetRowsColours(wxGrid* grid, int rowStart = 1, int colStart = 0, int colEndTrim = 0); virtual void GridKeyHandler(wxGrid* grid, wxKeyEvent& event); protected: + virtual void OnHarmBranchesGridChanged(wxGridEvent& event); + virtual void OnHarmBusesGridChanged(wxGridEvent& event); + virtual void OnHarmCurrentGridChanged(wxGridEvent& event); virtual void OnFaulrGridChanged(wxGridEvent& event); virtual void OnFaultBranchesGridChanged(wxGridEvent& event); virtual void OnFaultBusesGridChanged(wxGridEvent& event); @@ -86,4 +92,4 @@ class DataReport : public DataReportBase wxColour m_oddRowColour; wxColour m_evenRowColour; }; -#endif // DATAREPORT_H +#endif // DATAREPORT_H \ No newline at end of file diff --git a/Project/DataReport.wxcp b/Project/DataReport.wxcp index 62438a4a..d7cd171a 100644 --- a/Project/DataReport.wxcp +++ b/Project/DataReport.wxcp @@ -1,7 +1,7 @@ { "metadata": { "m_generatedFilesDir": ".", - "m_objCounter": 93, + "m_objCounter": 138, "m_includeFiles": [], "m_bitmapFunction": "wxC6A63InitBitmapResources", "m_bitmapsFile": "DataReportBitmaps.cpp", @@ -149,6 +149,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -176,6 +180,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -351,6 +359,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -526,6 +538,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -641,14 +657,12 @@ "m_events": [{ "m_eventName": "wxEVT_GRID_CELL_CHANGED", "m_eventClass": "wxGridEvent", - "m_eventHandler": "wxGridEventHandler", "m_functionNameAndSignature": "OnPowerFlowGridChanged(wxGridEvent& event)", "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", "m_noBody": false }, { "m_eventName": "wxEVT_KEY_DOWN", "m_eventClass": "wxKeyEvent", - "m_eventHandler": "wxKeyEventHandler", "m_functionNameAndSignature": "OnGridPFKeyDown(wxKeyEvent& event)", "m_description": "Process a wxEVT_KEY_DOWN event (any key has been pressed)", "m_noBody": false @@ -758,6 +772,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -873,14 +891,12 @@ "m_events": [{ "m_eventName": "wxEVT_GRID_CELL_CHANGED", "m_eventClass": "wxGridEvent", - "m_eventHandler": "wxGridEventHandler", "m_functionNameAndSignature": "OnPFBusGridChanged(wxGridEvent& event)", "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", "m_noBody": false }, { "m_eventName": "wxEVT_KEY_DOWN", "m_eventClass": "wxKeyEvent", - "m_eventHandler": "wxKeyEventHandler", "m_functionNameAndSignature": "OnGridPFBusesKeyDown(wxKeyEvent& event)", "m_description": "Process a wxEVT_KEY_DOWN event (any key has been pressed)", "m_noBody": false @@ -990,6 +1006,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1105,14 +1125,12 @@ "m_events": [{ "m_eventName": "wxEVT_GRID_CELL_CHANGED", "m_eventClass": "wxGridEvent", - "m_eventHandler": "wxGridEventHandler", "m_functionNameAndSignature": "OnPFBranchesGridChanged(wxGridEvent& event)", "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", "m_noBody": false }, { "m_eventName": "wxEVT_KEY_DOWN", "m_eventClass": "wxKeyEvent", - "m_eventHandler": "wxKeyEventHandler", "m_functionNameAndSignature": "OnGridPFBranchesKeyDown(wxKeyEvent& event)", "m_description": "Process a wxEVT_KEY_DOWN event (any key has been pressed)", "m_noBody": false @@ -1225,6 +1243,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1400,6 +1422,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1515,14 +1541,12 @@ "m_events": [{ "m_eventName": "wxEVT_GRID_CELL_CHANGED", "m_eventClass": "wxGridEvent", - "m_eventHandler": "wxGridEventHandler", "m_functionNameAndSignature": "OnFaulrGridChanged(wxGridEvent& event)", "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", "m_noBody": false }, { "m_eventName": "wxEVT_KEY_DOWN", "m_eventClass": "wxKeyEvent", - "m_eventHandler": "wxKeyEventHandler", "m_functionNameAndSignature": "OnGridFaultKeyDown(wxKeyEvent& event)", "m_description": "Process a wxEVT_KEY_DOWN event (any key has been pressed)", "m_noBody": false @@ -1632,6 +1656,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1747,14 +1775,12 @@ "m_events": [{ "m_eventName": "wxEVT_GRID_CELL_CHANGED", "m_eventClass": "wxGridEvent", - "m_eventHandler": "wxGridEventHandler", "m_functionNameAndSignature": "OnFaultBusesGridChanged(wxGridEvent& event)", "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", "m_noBody": false }, { "m_eventName": "wxEVT_KEY_DOWN", "m_eventClass": "wxKeyEvent", - "m_eventHandler": "wxKeyEventHandler", "m_functionNameAndSignature": "OnGridFaultBusesKeyDown(wxKeyEvent& event)", "m_description": "Process a wxEVT_KEY_DOWN event (any key has been pressed)", "m_noBody": false @@ -1864,6 +1890,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1979,14 +2009,12 @@ "m_events": [{ "m_eventName": "wxEVT_GRID_CELL_CHANGED", "m_eventClass": "wxGridEvent", - "m_eventHandler": "wxGridEventHandler", "m_functionNameAndSignature": "OnFaultBranchesGridChanged(wxGridEvent& event)", "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", "m_noBody": false }, { "m_eventName": "wxEVT_KEY_DOWN", "m_eventClass": "wxKeyEvent", - "m_eventHandler": "wxKeyEventHandler", "m_functionNameAndSignature": "OnGridFaultBranchesKeyDown(wxKeyEvent& event)", "m_description": "Process a wxEVT_KEY_DOWN event (any key has been pressed)", "m_noBody": false @@ -2096,6 +2124,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -2211,14 +2243,12 @@ "m_events": [{ "m_eventName": "wxEVT_GRID_CELL_CHANGED", "m_eventClass": "wxGridEvent", - "m_eventHandler": "wxGridEventHandler", "m_functionNameAndSignature": "OnFaultGeneratorsGridChanged(wxGridEvent& event)", "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", "m_noBody": false }, { "m_eventName": "wxEVT_KEY_DOWN", "m_eventClass": "wxKeyEvent", - "m_eventHandler": "wxKeyEventHandler", "m_functionNameAndSignature": "OnGridFaultGeneratorsKeyDown(wxKeyEvent& event)", "m_description": "Process a wxEVT_KEY_DOWN event (any key has been pressed)", "m_noBody": false @@ -2229,141 +2259,1011 @@ }] }] }] - }] - }] - }] - }] - }, { - "m_type": 4421, - "proportion": 0, - "border": 5, - "gbSpan": "1,1", - "gbPosition": "0,0", - "m_styles": ["wxDEFAULT_DIALOG_STYLE"], - "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"], - "m_properties": [{ - "type": "string", - "m_label": "Size:", - "m_value": "500,300" - }, { - "type": "string", - "m_label": "Minimum Size:", - "m_value": "-1,-1" - }, { - "type": "string", - "m_label": "Name:", - "m_value": "StabilityEventListBase" - }, { - "type": "multi-string", - "m_label": "Tooltip:", - "m_value": "" - }, { - "type": "colour", - "m_label": "Bg Colour:", - "colour": "" - }, { - "type": "colour", - "m_label": "Fg Colour:", - "colour": "" - }, { - "type": "font", - "m_label": "Font:", - "m_value": "" - }, { - "type": "bool", - "m_label": "Hidden", - "m_value": false - }, { - "type": "bool", - "m_label": "Disabled", - "m_value": false - }, { - "type": "bool", - "m_label": "Focused", - "m_value": false - }, { - "type": "string", - "m_label": "Class Name:", - "m_value": "" - }, { - "type": "string", - "m_label": "Include File:", - "m_value": "" - }, { - "type": "string", - "m_label": "Style:", - "m_value": "" - }, { - "type": "bool", - "m_label": "Enable Window Persistency:", - "m_value": true - }, { - "type": "string", - "m_label": "Title:", - "m_value": "Stability event list" - }, { - "type": "virtualFolderPicker", - "m_label": "Virtual Folder:", - "m_path": "Project:wxcrafter:base" - }, { - "type": "choice", - "m_label": "Centre:", - "m_selection": 1, - "m_options": ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"] - }, { - "type": "string", - "m_label": "Inherited Class", - "m_value": "StabilityEventList" - }, { - "type": "string", - "m_label": "File:", - "m_value": "StabilityEventList" - }, { - "type": "string", - "m_label": "Class Decorator", - "m_value": "" - }, { - "type": "bitmapPicker", - "m_label": "Bitmap File (16x16) :", - "m_path": "" - }, { - "type": "bitmapPicker", - "m_label": "Bitmap File (32x32) :", - "m_path": "" - }, { - "type": "bitmapPicker", - "m_label": "Bitmap File (64x64) :", - "m_path": "" - }, { - "type": "bitmapPicker", - "m_label": "Bitmap File (128x128):", - "m_path": "" - }, { - "type": "bitmapPicker", - "m_label": "Bitmap File (256x256):", - "m_path": "" - }], - "m_events": [], - "m_children": [{ - "m_type": 4401, - "proportion": 1, - "border": 5, - "gbSpan": "1,1", - "gbPosition": "0,0", - "m_styles": [], - "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], - "m_properties": [{ - "type": "string", - "m_label": "Minimum Size:", - "m_value": "-1,-1" - }, { - "type": "string", - "m_label": "Name:", - "m_value": "boxSizerLvl1_1" - }, { - "type": "string", - "m_label": "Style:", - "m_value": "" + }, { + "m_type": 4441, + "proportion": 0, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxTAB_TRAVERSAL"], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_panelHarmonicsData" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "string", + "m_label": "Label:", + "m_value": "Harmonics data" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File:", + "m_path": "" + }, { + "type": "bool", + "m_label": "Selected", + "m_value": false + }, { + "type": "bool", + "m_label": "Null Page", + "m_value": false + }], + "m_events": [], + "m_children": [{ + "m_type": 4401, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], + "m_properties": [{ + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "boxSizerLvl3_22" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false + }, { + "type": "choice", + "m_label": "Orientation:", + "m_selection": 0, + "m_options": ["wxVERTICAL", "wxHORIZONTAL"] + }], + "m_events": [], + "m_children": [{ + "m_type": 4442, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxBK_LEFT", "wxBK_DEFAULT"], + "m_sizerFlags": ["wxEXPAND"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_notebookHarmCurrents" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }], + "m_events": [], + "m_children": [{ + "m_type": 4441, + "proportion": 0, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxTAB_TRAVERSAL"], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_panelHarmCurrents" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "string", + "m_label": "Label:", + "m_value": "Sources" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File:", + "m_path": "" + }, { + "type": "bool", + "m_label": "Selected", + "m_value": false + }, { + "type": "bool", + "m_label": "Null Page", + "m_value": false + }], + "m_events": [], + "m_children": [{ + "m_type": 4401, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], + "m_properties": [{ + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "boxSizerLvl4_45" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false + }, { + "type": "choice", + "m_label": "Orientation:", + "m_selection": 0, + "m_options": ["wxVERTICAL", "wxHORIZONTAL"] + }], + "m_events": [], + "m_children": [{ + "m_type": 4426, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxWANTS_CHARS"], + "m_sizerFlags": ["wxEXPAND"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_gridHarmCurrents" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Fit Content to Columns", + "m_value": true + }, { + "type": "bool", + "m_label": "Use Native Header", + "m_value": true + }, { + "type": "integer", + "m_label": "Height:", + "m_value": -1 + }, { + "type": "choice", + "m_label": "Col Label Horizontal Align", + "m_selection": 1, + "m_options": ["wxALIGN_LEFT", "wxALIGN_CENTRE", "wxALIGN_RIGHT"] + }, { + "type": "choice", + "m_label": "Col Label Vertical Align", + "m_selection": 1, + "m_options": ["wxALIGN_TOP", "wxALIGN_CENTRE", "wxALIGN_BOTTOM"] + }, { + "type": "integer", + "m_label": "Width:", + "m_value": -1 + }, { + "type": "choice", + "m_label": "Row Label Horizontal Align", + "m_selection": 2, + "m_options": ["wxALIGN_LEFT", "wxALIGN_CENTRE", "wxALIGN_RIGHT"] + }, { + "type": "choice", + "m_label": "Row Label Vertical Align", + "m_selection": 1, + "m_options": ["wxALIGN_TOP", "wxALIGN_CENTRE", "wxALIGN_BOTTOM"] + }, { + "type": "bool", + "m_label": "Allow Cell Editing", + "m_value": true + }], + "m_events": [{ + "m_eventName": "wxEVT_GRID_CELL_CHANGED", + "m_eventClass": "wxGridEvent", + "m_functionNameAndSignature": "OnHarmCurrentGridChanged(wxGridEvent& event)", + "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", + "m_noBody": false + }], + "m_children": [] + }] + }] + }, { + "m_type": 4441, + "proportion": 0, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxTAB_TRAVERSAL"], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_panelHarmBuses" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "string", + "m_label": "Label:", + "m_value": "Voltages" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File:", + "m_path": "" + }, { + "type": "bool", + "m_label": "Selected", + "m_value": false + }, { + "type": "bool", + "m_label": "Null Page", + "m_value": false + }], + "m_events": [], + "m_children": [{ + "m_type": 4401, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], + "m_properties": [{ + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "boxSizerLvl4_58" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false + }, { + "type": "choice", + "m_label": "Orientation:", + "m_selection": 0, + "m_options": ["wxVERTICAL", "wxHORIZONTAL"] + }], + "m_events": [], + "m_children": [{ + "m_type": 4426, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxWANTS_CHARS"], + "m_sizerFlags": ["wxEXPAND"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_gridHarmBuses" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Fit Content to Columns", + "m_value": true + }, { + "type": "bool", + "m_label": "Use Native Header", + "m_value": true + }, { + "type": "integer", + "m_label": "Height:", + "m_value": -1 + }, { + "type": "choice", + "m_label": "Col Label Horizontal Align", + "m_selection": 1, + "m_options": ["wxALIGN_LEFT", "wxALIGN_CENTRE", "wxALIGN_RIGHT"] + }, { + "type": "choice", + "m_label": "Col Label Vertical Align", + "m_selection": 1, + "m_options": ["wxALIGN_TOP", "wxALIGN_CENTRE", "wxALIGN_BOTTOM"] + }, { + "type": "integer", + "m_label": "Width:", + "m_value": -1 + }, { + "type": "choice", + "m_label": "Row Label Horizontal Align", + "m_selection": 2, + "m_options": ["wxALIGN_LEFT", "wxALIGN_CENTRE", "wxALIGN_RIGHT"] + }, { + "type": "choice", + "m_label": "Row Label Vertical Align", + "m_selection": 1, + "m_options": ["wxALIGN_TOP", "wxALIGN_CENTRE", "wxALIGN_BOTTOM"] + }, { + "type": "bool", + "m_label": "Allow Cell Editing", + "m_value": true + }], + "m_events": [{ + "m_eventName": "wxEVT_GRID_CELL_CHANGED", + "m_eventClass": "wxGridEvent", + "m_functionNameAndSignature": "OnHarmBusesGridChanged(wxGridEvent& event)", + "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", + "m_noBody": false + }], + "m_children": [] + }] + }] + }, { + "m_type": 4441, + "proportion": 0, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxTAB_TRAVERSAL"], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_panelHarmBranches" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "string", + "m_label": "Label:", + "m_value": "Currents" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File:", + "m_path": "" + }, { + "type": "bool", + "m_label": "Selected", + "m_value": false + }, { + "type": "bool", + "m_label": "Null Page", + "m_value": false + }], + "m_events": [], + "m_children": [{ + "m_type": 4401, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], + "m_properties": [{ + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "boxSizerLvl4_611" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false + }, { + "type": "choice", + "m_label": "Orientation:", + "m_selection": 0, + "m_options": ["wxVERTICAL", "wxHORIZONTAL"] + }], + "m_events": [], + "m_children": [{ + "m_type": 4426, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxWANTS_CHARS"], + "m_sizerFlags": ["wxEXPAND"], + "m_properties": [{ + "type": "winid", + "m_label": "ID:", + "m_winid": "wxID_ANY" + }, { + "type": "string", + "m_label": "Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "m_gridHarmBranches" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Fit Content to Columns", + "m_value": true + }, { + "type": "bool", + "m_label": "Use Native Header", + "m_value": true + }, { + "type": "integer", + "m_label": "Height:", + "m_value": -1 + }, { + "type": "choice", + "m_label": "Col Label Horizontal Align", + "m_selection": 1, + "m_options": ["wxALIGN_LEFT", "wxALIGN_CENTRE", "wxALIGN_RIGHT"] + }, { + "type": "choice", + "m_label": "Col Label Vertical Align", + "m_selection": 1, + "m_options": ["wxALIGN_TOP", "wxALIGN_CENTRE", "wxALIGN_BOTTOM"] + }, { + "type": "integer", + "m_label": "Width:", + "m_value": -1 + }, { + "type": "choice", + "m_label": "Row Label Horizontal Align", + "m_selection": 2, + "m_options": ["wxALIGN_LEFT", "wxALIGN_CENTRE", "wxALIGN_RIGHT"] + }, { + "type": "choice", + "m_label": "Row Label Vertical Align", + "m_selection": 1, + "m_options": ["wxALIGN_TOP", "wxALIGN_CENTRE", "wxALIGN_BOTTOM"] + }, { + "type": "bool", + "m_label": "Allow Cell Editing", + "m_value": true + }], + "m_events": [{ + "m_eventName": "wxEVT_GRID_CELL_CHANGED", + "m_eventClass": "wxGridEvent", + "m_functionNameAndSignature": "OnHarmBranchesGridChanged(wxGridEvent& event)", + "m_description": "The user changed the data in a cell. The old cell value as string is available from GetString() event object method. Notice that vetoing this event still works for backwards compatibility reasons but any new code should only veto EVT_GRID_CELL_CHANGING event and not this one. Processes a wxEVT_GRID_CELL_CHANGED event type.", + "m_noBody": false + }], + "m_children": [] + }] + }] + }] + }] + }] + }] + }] + }] + }] + }, { + "m_type": 4421, + "proportion": 0, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": ["wxDEFAULT_DIALOG_STYLE"], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"], + "m_properties": [{ + "type": "string", + "m_label": "Size:", + "m_value": "500,300" + }, { + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "StabilityEventListBase" + }, { + "type": "multi-string", + "m_label": "Tooltip:", + "m_value": "" + }, { + "type": "colour", + "m_label": "Bg Colour:", + "colour": "" + }, { + "type": "colour", + "m_label": "Fg Colour:", + "colour": "" + }, { + "type": "font", + "m_label": "Font:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Hidden", + "m_value": false + }, { + "type": "bool", + "m_label": "Disabled", + "m_value": false + }, { + "type": "bool", + "m_label": "Focused", + "m_value": false + }, { + "type": "string", + "m_label": "Class Name:", + "m_value": "" + }, { + "type": "string", + "m_label": "Include File:", + "m_value": "" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Enable Window Persistency:", + "m_value": true + }, { + "type": "string", + "m_label": "Title:", + "m_value": "Stability event list" + }, { + "type": "virtualFolderPicker", + "m_label": "Virtual Folder:", + "m_path": "Project:wxcrafter:base" + }, { + "type": "choice", + "m_label": "Centre:", + "m_selection": 1, + "m_options": ["", "wxBOTH", "wxVERTICAL", "wxHORIZONTAL"] + }, { + "type": "string", + "m_label": "Inherited Class", + "m_value": "StabilityEventList" + }, { + "type": "string", + "m_label": "File:", + "m_value": "StabilityEventList" + }, { + "type": "string", + "m_label": "Class Decorator", + "m_value": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (16x16) :", + "m_path": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (32x32) :", + "m_path": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (64x64) :", + "m_path": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (128x128):", + "m_path": "" + }, { + "type": "bitmapPicker", + "m_label": "Bitmap File (256x256):", + "m_path": "" + }], + "m_events": [], + "m_children": [{ + "m_type": 4401, + "proportion": 1, + "border": 5, + "gbSpan": "1,1", + "gbPosition": "0,0", + "m_styles": [], + "m_sizerFlags": ["wxALL", "wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM", "wxEXPAND"], + "m_properties": [{ + "type": "string", + "m_label": "Minimum Size:", + "m_value": "-1,-1" + }, { + "type": "string", + "m_label": "Name:", + "m_value": "boxSizerLvl1_1" + }, { + "type": "string", + "m_label": "Style:", + "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -2567,7 +3467,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false diff --git a/Project/DataReportBase.cpp b/Project/DataReportBase.cpp index 5b3737af..6047838c 100644 --- a/Project/DataReportBase.cpp +++ b/Project/DataReportBase.cpp @@ -6,20 +6,28 @@ #include "DataReportBase.h" + // Declare the bitmap loading function extern void wxC6A63InitBitmapResources(); -static bool bBitmapLoaded = false; -DataReportBase::DataReportBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +namespace { +// return the wxBORDER_SIMPLE that matches the current application theme +wxBorder get_border_simple_theme_aware_bit() { +#if wxVERSION_NUMBER >= 3300 && defined(__WXMSW__) + return wxSystemSettings::GetAppearance().IsDark() ? wxBORDER_SIMPLE : wxBORDER_STATIC; +#else + return wxBORDER_DEFAULT; +#endif +} // DoGetBorderSimpleBit +bool bBitmapLoaded = false; +} // namespace + + +DataReportBase::DataReportBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC6A63InitBitmapResources(); @@ -31,355 +39,392 @@ DataReportBase::DataReportBase(wxWindow* parent, wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("chart16")); wxIcon icn; icn.CopyFromBitmap(iconBmp); - app_icons.AddIcon(icn); + app_icons.AddIcon( icn ); } { wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("chart32")); wxIcon icn; icn.CopyFromBitmap(iconBmp); - app_icons.AddIcon(icn); + app_icons.AddIcon( icn ); } { wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("chart64")); wxIcon icn; icn.CopyFromBitmap(iconBmp); - app_icons.AddIcon(icn); + app_icons.AddIcon( icn ); } { wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("chart128")); wxIcon icn; icn.CopyFromBitmap(iconBmp); - app_icons.AddIcon(icn); + app_icons.AddIcon( icn ); } { wxBitmap iconBmp = wxXmlResource::Get()->LoadBitmap(wxT("chart256")); wxIcon icn; icn.CopyFromBitmap(iconBmp); - app_icons.AddIcon(icn); + app_icons.AddIcon( icn ); } - SetIcons(app_icons); + SetIcons( app_icons ); + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl1_1->Add(boxSizerLvl2_1, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_notebookDataReport = - new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebookDataReport = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebookDataReport->SetName(wxT("m_notebookDataReport")); - + boxSizerLvl2_1->Add(m_notebookDataReport, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelPowerFlowData = new wxPanel(m_notebookDataReport, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookDataReport, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelPowerFlowData = new wxPanel(m_notebookDataReport, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookDataReport, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookDataReport->AddPage(m_panelPowerFlowData, _("Power flow data"), false); - + wxBoxSizer* boxSizerLvl3_1 = new wxBoxSizer(wxVERTICAL); m_panelPowerFlowData->SetSizer(boxSizerLvl3_1); - - m_notebookPowerFlow = new wxNotebook(m_panelPowerFlowData, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelPowerFlowData, wxSize(-1, -1)), wxBK_LEFT | wxBK_DEFAULT); + + m_notebookPowerFlow = new wxNotebook(m_panelPowerFlowData, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelPowerFlowData, wxSize(-1,-1)), wxBK_LEFT|wxBK_DEFAULT); m_notebookPowerFlow->SetName(wxT("m_notebookPowerFlow")); - + boxSizerLvl3_1->Add(m_notebookPowerFlow, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelPowerFlow = new wxPanel(m_notebookPowerFlow, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookPowerFlow, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelPowerFlow = new wxPanel(m_notebookPowerFlow, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookPowerFlow, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookPowerFlow->AddPage(m_panelPowerFlow, _("Power flow"), false); - + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); m_panelPowerFlow->SetSizer(boxSizerLvl4_1); - - m_gridPowerFlow = new wxGrid(m_panelPowerFlow, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelPowerFlow, wxSize(-1, -1)), wxWANTS_CHARS); + + m_gridPowerFlow = new wxGrid(m_panelPowerFlow, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelPowerFlow, wxSize(-1,-1)), wxWANTS_CHARS); m_gridPowerFlow->CreateGrid(0, 0); m_gridPowerFlow->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); m_gridPowerFlow->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); -#if wxVERSION_NUMBER >= 2904 + #if wxVERSION_NUMBER >= 2904 m_gridPowerFlow->UseNativeColHeader(true); -#endif + #endif m_gridPowerFlow->EnableEditing(true); - + boxSizerLvl4_1->Add(m_gridPowerFlow, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelPFBuses = new wxPanel(m_notebookPowerFlow, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookPowerFlow, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelPFBuses = new wxPanel(m_notebookPowerFlow, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookPowerFlow, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookPowerFlow->AddPage(m_panelPFBuses, _("Buses"), false); - + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); m_panelPFBuses->SetSizer(boxSizerLvl4_2); - - m_gridPFBuses = new wxGrid(m_panelPFBuses, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelPFBuses, wxSize(-1, -1)), - wxWANTS_CHARS); + + m_gridPFBuses = new wxGrid(m_panelPFBuses, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelPFBuses, wxSize(-1,-1)), wxWANTS_CHARS); m_gridPFBuses->CreateGrid(0, 0); m_gridPFBuses->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); m_gridPFBuses->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); -#if wxVERSION_NUMBER >= 2904 + #if wxVERSION_NUMBER >= 2904 m_gridPFBuses->UseNativeColHeader(true); -#endif + #endif m_gridPFBuses->EnableEditing(true); - + boxSizerLvl4_2->Add(m_gridPFBuses, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelPFBranches = new wxPanel(m_notebookPowerFlow, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookPowerFlow, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelPFBranches = new wxPanel(m_notebookPowerFlow, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookPowerFlow, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookPowerFlow->AddPage(m_panelPFBranches, _("Branches"), false); - + wxBoxSizer* boxSizerLvl4_3 = new wxBoxSizer(wxVERTICAL); m_panelPFBranches->SetSizer(boxSizerLvl4_3); - - m_gridPFBranches = new wxGrid(m_panelPFBranches, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelPFBranches, wxSize(-1, -1)), wxWANTS_CHARS); + + m_gridPFBranches = new wxGrid(m_panelPFBranches, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelPFBranches, wxSize(-1,-1)), wxWANTS_CHARS); m_gridPFBranches->CreateGrid(0, 0); m_gridPFBranches->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); m_gridPFBranches->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); -#if wxVERSION_NUMBER >= 2904 + #if wxVERSION_NUMBER >= 2904 m_gridPFBranches->UseNativeColHeader(true); -#endif + #endif m_gridPFBranches->EnableEditing(true); - + boxSizerLvl4_3->Add(m_gridPFBranches, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelFaultData = new wxPanel(m_notebookDataReport, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookDataReport, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelFaultData = new wxPanel(m_notebookDataReport, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookDataReport, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookDataReport->AddPage(m_panelFaultData, _("Fault data"), false); - + wxBoxSizer* boxSizerLvl3_2 = new wxBoxSizer(wxVERTICAL); m_panelFaultData->SetSizer(boxSizerLvl3_2); - - m_notebookFault = new wxNotebook(m_panelFaultData, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelFaultData, wxSize(-1, -1)), wxBK_LEFT | wxBK_DEFAULT); + + m_notebookFault = new wxNotebook(m_panelFaultData, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelFaultData, wxSize(-1,-1)), wxBK_LEFT|wxBK_DEFAULT); m_notebookFault->SetName(wxT("m_notebookFault")); - + boxSizerLvl3_2->Add(m_notebookFault, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelFault = new wxPanel(m_notebookFault, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookFault, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelFault = new wxPanel(m_notebookFault, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookFault, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookFault->AddPage(m_panelFault, _("Fault"), false); - + wxBoxSizer* boxSizerLvl4_4 = new wxBoxSizer(wxVERTICAL); m_panelFault->SetSizer(boxSizerLvl4_4); - - m_gridFault = - new wxGrid(m_panelFault, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), wxWANTS_CHARS); + + m_gridFault = new wxGrid(m_panelFault, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), wxWANTS_CHARS); m_gridFault->CreateGrid(0, 0); m_gridFault->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); m_gridFault->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); -#if wxVERSION_NUMBER >= 2904 + #if wxVERSION_NUMBER >= 2904 m_gridFault->UseNativeColHeader(true); -#endif + #endif m_gridFault->EnableEditing(true); - + boxSizerLvl4_4->Add(m_gridFault, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelFaultBuses = new wxPanel(m_notebookFault, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookFault, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelFaultBuses = new wxPanel(m_notebookFault, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookFault, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookFault->AddPage(m_panelFaultBuses, _("Buses"), false); - + wxBoxSizer* boxSizerLvl4_5 = new wxBoxSizer(wxVERTICAL); m_panelFaultBuses->SetSizer(boxSizerLvl4_5); - - m_gridFaultBuses = new wxGrid(m_panelFaultBuses, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelFaultBuses, wxSize(-1, -1)), wxWANTS_CHARS); + + m_gridFaultBuses = new wxGrid(m_panelFaultBuses, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelFaultBuses, wxSize(-1,-1)), wxWANTS_CHARS); m_gridFaultBuses->CreateGrid(0, 0); m_gridFaultBuses->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); m_gridFaultBuses->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); -#if wxVERSION_NUMBER >= 2904 + #if wxVERSION_NUMBER >= 2904 m_gridFaultBuses->UseNativeColHeader(true); -#endif + #endif m_gridFaultBuses->EnableEditing(true); - + boxSizerLvl4_5->Add(m_gridFaultBuses, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelFaultBranches = new wxPanel(m_notebookFault, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookFault, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelFaultBranches = new wxPanel(m_notebookFault, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookFault, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookFault->AddPage(m_panelFaultBranches, _("Branches"), false); - + wxBoxSizer* boxSizerLvl4_6 = new wxBoxSizer(wxVERTICAL); m_panelFaultBranches->SetSizer(boxSizerLvl4_6); - - m_gridFaultBranches = new wxGrid(m_panelFaultBranches, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelFaultBranches, wxSize(-1, -1)), wxWANTS_CHARS); + + m_gridFaultBranches = new wxGrid(m_panelFaultBranches, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelFaultBranches, wxSize(-1,-1)), wxWANTS_CHARS); m_gridFaultBranches->CreateGrid(0, 0); m_gridFaultBranches->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); m_gridFaultBranches->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); -#if wxVERSION_NUMBER >= 2904 + #if wxVERSION_NUMBER >= 2904 m_gridFaultBranches->UseNativeColHeader(true); -#endif + #endif m_gridFaultBranches->EnableEditing(true); - + boxSizerLvl4_6->Add(m_gridFaultBranches, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelFaultGenerators = new wxPanel(m_notebookFault, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_notebookFault, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelFaultGenerators = new wxPanel(m_notebookFault, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookFault, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebookFault->AddPage(m_panelFaultGenerators, _("Generators"), false); - + wxBoxSizer* boxSizerLvl4_118 = new wxBoxSizer(wxVERTICAL); m_panelFaultGenerators->SetSizer(boxSizerLvl4_118); - - m_gridFaultGenerators = new wxGrid(m_panelFaultGenerators, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelFaultGenerators, wxSize(-1, -1)), wxWANTS_CHARS); + + m_gridFaultGenerators = new wxGrid(m_panelFaultGenerators, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelFaultGenerators, wxSize(-1,-1)), wxWANTS_CHARS); m_gridFaultGenerators->CreateGrid(0, 0); m_gridFaultGenerators->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); m_gridFaultGenerators->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); -#if wxVERSION_NUMBER >= 2904 + #if wxVERSION_NUMBER >= 2904 m_gridFaultGenerators->UseNativeColHeader(true); -#endif + #endif m_gridFaultGenerators->EnableEditing(true); - + boxSizerLvl4_118->Add(m_gridFaultGenerators, 1, wxEXPAND, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebookDataReport)) { + + m_panelHarmonicsData = new wxPanel(m_notebookDataReport, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookDataReport, wxSize(-1,-1)), wxTAB_TRAVERSAL); + m_notebookDataReport->AddPage(m_panelHarmonicsData, _("Harmonics data"), false); + + wxBoxSizer* boxSizerLvl3_22 = new wxBoxSizer(wxVERTICAL); + m_panelHarmonicsData->SetSizer(boxSizerLvl3_22); + + m_notebookHarmCurrents = new wxNotebook(m_panelHarmonicsData, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelHarmonicsData, wxSize(-1,-1)), wxBK_LEFT|wxBK_DEFAULT); + m_notebookHarmCurrents->SetName(wxT("m_notebookHarmCurrents")); + + boxSizerLvl3_22->Add(m_notebookHarmCurrents, 1, wxEXPAND, WXC_FROM_DIP(5)); + + m_panelHarmCurrents = new wxPanel(m_notebookHarmCurrents, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookHarmCurrents, wxSize(-1,-1)), wxTAB_TRAVERSAL); + m_notebookHarmCurrents->AddPage(m_panelHarmCurrents, _("Sources"), false); + + wxBoxSizer* boxSizerLvl4_45 = new wxBoxSizer(wxVERTICAL); + m_panelHarmCurrents->SetSizer(boxSizerLvl4_45); + + m_gridHarmCurrents = new wxGrid(m_panelHarmCurrents, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelHarmCurrents, wxSize(-1,-1)), wxWANTS_CHARS); + m_gridHarmCurrents->CreateGrid(0, 0); + m_gridHarmCurrents->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); + m_gridHarmCurrents->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + #if wxVERSION_NUMBER >= 2904 + m_gridHarmCurrents->UseNativeColHeader(true); + #endif + m_gridHarmCurrents->EnableEditing(true); + + boxSizerLvl4_45->Add(m_gridHarmCurrents, 1, wxEXPAND, WXC_FROM_DIP(5)); + + m_panelHarmBuses = new wxPanel(m_notebookHarmCurrents, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookHarmCurrents, wxSize(-1,-1)), wxTAB_TRAVERSAL); + m_notebookHarmCurrents->AddPage(m_panelHarmBuses, _("Voltages"), false); + + wxBoxSizer* boxSizerLvl4_58 = new wxBoxSizer(wxVERTICAL); + m_panelHarmBuses->SetSizer(boxSizerLvl4_58); + + m_gridHarmBuses = new wxGrid(m_panelHarmBuses, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelHarmBuses, wxSize(-1,-1)), wxWANTS_CHARS); + m_gridHarmBuses->CreateGrid(0, 0); + m_gridHarmBuses->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); + m_gridHarmBuses->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + #if wxVERSION_NUMBER >= 2904 + m_gridHarmBuses->UseNativeColHeader(true); + #endif + m_gridHarmBuses->EnableEditing(true); + + boxSizerLvl4_58->Add(m_gridHarmBuses, 1, wxEXPAND, WXC_FROM_DIP(5)); + + m_panelHarmBranches = new wxPanel(m_notebookHarmCurrents, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebookHarmCurrents, wxSize(-1,-1)), wxTAB_TRAVERSAL); + m_notebookHarmCurrents->AddPage(m_panelHarmBranches, _("Currents"), false); + + wxBoxSizer* boxSizerLvl4_611 = new wxBoxSizer(wxVERTICAL); + m_panelHarmBranches->SetSizer(boxSizerLvl4_611); + + m_gridHarmBranches = new wxGrid(m_panelHarmBranches, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelHarmBranches, wxSize(-1,-1)), wxWANTS_CHARS); + m_gridHarmBranches->CreateGrid(0, 0); + m_gridHarmBranches->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); + m_gridHarmBranches->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); + #if wxVERSION_NUMBER >= 2904 + m_gridHarmBranches->UseNativeColHeader(true); + #endif + m_gridHarmBranches->EnableEditing(true); + + boxSizerLvl4_611->Add(m_gridHarmBranches, 1, wxEXPAND, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebookDataReport)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebookDataReport); } else { wxPersistenceManager::Get().Restore(m_notebookDataReport); } -#endif - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebookPowerFlow)) { + #endif + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebookPowerFlow)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebookPowerFlow); } else { wxPersistenceManager::Get().Restore(m_notebookPowerFlow); } -#endif - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebookFault)) { + #endif + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebookFault)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebookFault); } else { wxPersistenceManager::Get().Restore(m_notebookFault); } -#endif - + #endif + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebookHarmCurrents)){ + wxPersistenceManager::Get().RegisterAndRestore(m_notebookHarmCurrents); + } else { + wxPersistenceManager::Get().Restore(m_notebookHarmCurrents); + } + #endif + SetName(wxT("DataReportBase")); - SetMinClientSize(wxSize(500, 300)); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetMinClientSize(wxSize(500,300)); + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_gridPowerFlow->Connect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnPowerFlowGridChanged), NULL, - this); - m_gridPowerFlow->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridPFKeyDown), NULL, this); - m_gridPFBuses->Connect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnPFBusGridChanged), NULL, this); - m_gridPFBuses->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridPFBusesKeyDown), NULL, this); - m_gridPFBranches->Connect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnPFBranchesGridChanged), - NULL, this); - m_gridPFBranches->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridPFBranchesKeyDown), NULL, this); - m_gridFault->Connect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnFaulrGridChanged), NULL, this); - m_gridFault->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridFaultKeyDown), NULL, this); - m_gridFaultBuses->Connect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnFaultBusesGridChanged), - NULL, this); - m_gridFaultBuses->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridFaultBusesKeyDown), NULL, this); - m_gridFaultBranches->Connect(wxEVT_GRID_CELL_CHANGED, - wxGridEventHandler(DataReportBase::OnFaultBranchesGridChanged), NULL, this); - m_gridFaultBranches->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridFaultBranchesKeyDown), NULL, - this); - m_gridFaultGenerators->Connect(wxEVT_GRID_CELL_CHANGED, - wxGridEventHandler(DataReportBase::OnFaultGeneratorsGridChanged), NULL, this); - m_gridFaultGenerators->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridFaultGeneratorsKeyDown), - NULL, this); + m_gridPowerFlow->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnPowerFlowGridChanged, this); + m_gridPowerFlow->Bind(wxEVT_KEY_DOWN, &DataReportBase::OnGridPFKeyDown, this); + m_gridPFBuses->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnPFBusGridChanged, this); + m_gridPFBuses->Bind(wxEVT_KEY_DOWN, &DataReportBase::OnGridPFBusesKeyDown, this); + m_gridPFBranches->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnPFBranchesGridChanged, this); + m_gridPFBranches->Bind(wxEVT_KEY_DOWN, &DataReportBase::OnGridPFBranchesKeyDown, this); + m_gridFault->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnFaulrGridChanged, this); + m_gridFault->Bind(wxEVT_KEY_DOWN, &DataReportBase::OnGridFaultKeyDown, this); + m_gridFaultBuses->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnFaultBusesGridChanged, this); + m_gridFaultBuses->Bind(wxEVT_KEY_DOWN, &DataReportBase::OnGridFaultBusesKeyDown, this); + m_gridFaultBranches->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnFaultBranchesGridChanged, this); + m_gridFaultBranches->Bind(wxEVT_KEY_DOWN, &DataReportBase::OnGridFaultBranchesKeyDown, this); + m_gridFaultGenerators->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnFaultGeneratorsGridChanged, this); + m_gridFaultGenerators->Bind(wxEVT_KEY_DOWN, &DataReportBase::OnGridFaultGeneratorsKeyDown, this); + m_gridHarmCurrents->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnHarmCurrentGridChanged, this); + m_gridHarmBuses->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnHarmBusesGridChanged, this); + m_gridHarmBranches->Bind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnHarmBranchesGridChanged, this); + } DataReportBase::~DataReportBase() { - m_gridPowerFlow->Disconnect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnPowerFlowGridChanged), - NULL, this); - m_gridPowerFlow->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridPFKeyDown), NULL, this); - m_gridPFBuses->Disconnect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnPFBusGridChanged), NULL, - this); - m_gridPFBuses->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridPFBusesKeyDown), NULL, this); - m_gridPFBranches->Disconnect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnPFBranchesGridChanged), - NULL, this); - m_gridPFBranches->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridPFBranchesKeyDown), NULL, - this); - m_gridFault->Disconnect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnFaulrGridChanged), NULL, - this); - m_gridFault->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridFaultKeyDown), NULL, this); - m_gridFaultBuses->Disconnect(wxEVT_GRID_CELL_CHANGED, wxGridEventHandler(DataReportBase::OnFaultBusesGridChanged), - NULL, this); - m_gridFaultBuses->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridFaultBusesKeyDown), NULL, - this); - m_gridFaultBranches->Disconnect(wxEVT_GRID_CELL_CHANGED, - wxGridEventHandler(DataReportBase::OnFaultBranchesGridChanged), NULL, this); - m_gridFaultBranches->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridFaultBranchesKeyDown), NULL, - this); - m_gridFaultGenerators->Disconnect(wxEVT_GRID_CELL_CHANGED, - wxGridEventHandler(DataReportBase::OnFaultGeneratorsGridChanged), NULL, this); - m_gridFaultGenerators->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(DataReportBase::OnGridFaultGeneratorsKeyDown), - NULL, this); + m_gridPowerFlow->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnPowerFlowGridChanged, this); + m_gridPowerFlow->Unbind(wxEVT_KEY_DOWN, &DataReportBase::OnGridPFKeyDown, this); + m_gridPFBuses->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnPFBusGridChanged, this); + m_gridPFBuses->Unbind(wxEVT_KEY_DOWN, &DataReportBase::OnGridPFBusesKeyDown, this); + m_gridPFBranches->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnPFBranchesGridChanged, this); + m_gridPFBranches->Unbind(wxEVT_KEY_DOWN, &DataReportBase::OnGridPFBranchesKeyDown, this); + m_gridFault->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnFaulrGridChanged, this); + m_gridFault->Unbind(wxEVT_KEY_DOWN, &DataReportBase::OnGridFaultKeyDown, this); + m_gridFaultBuses->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnFaultBusesGridChanged, this); + m_gridFaultBuses->Unbind(wxEVT_KEY_DOWN, &DataReportBase::OnGridFaultBusesKeyDown, this); + m_gridFaultBranches->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnFaultBranchesGridChanged, this); + m_gridFaultBranches->Unbind(wxEVT_KEY_DOWN, &DataReportBase::OnGridFaultBranchesKeyDown, this); + m_gridFaultGenerators->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnFaultGeneratorsGridChanged, this); + m_gridFaultGenerators->Unbind(wxEVT_KEY_DOWN, &DataReportBase::OnGridFaultGeneratorsKeyDown, this); + m_gridHarmCurrents->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnHarmCurrentGridChanged, this); + m_gridHarmBuses->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnHarmBusesGridChanged, this); + m_gridHarmBranches->Unbind(wxEVT_GRID_CELL_CHANGED, &DataReportBase::OnHarmBranchesGridChanged, this); + } -StabilityEventListBase::StabilityEventListBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +StabilityEventListBase::StabilityEventListBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC6A63InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_gridStabEventList = - new wxGrid(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxWANTS_CHARS); + + m_gridStabEventList = new wxGrid(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxWANTS_CHARS); m_gridStabEventList->CreateGrid(0, 0); m_gridStabEventList->SetRowLabelAlignment(wxALIGN_RIGHT, wxALIGN_CENTRE); m_gridStabEventList->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); -#if wxVERSION_NUMBER >= 2904 + #if wxVERSION_NUMBER >= 2904 m_gridStabEventList->UseNativeColHeader(true); -#endif + #endif m_gridStabEventList->EnableEditing(true); - + boxSizerLvl1_1->Add(m_gridStabEventList, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl1_1->Add(m_buttonOK, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5)); - + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl1_1->Add(m_buttonOK, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5)); + SetName(wxT("StabilityEventListBase")); - SetSize(wxDLG_UNIT(this, wxSize(500, 300))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(500,300))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StabilityEventListBase::OnOKButtonClick), - NULL, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &StabilityEventListBase::OnOKButtonClick, this); + } StabilityEventListBase::~StabilityEventListBase() { - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(StabilityEventListBase::OnOKButtonClick), - NULL, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &StabilityEventListBase::OnOKButtonClick, this); + } diff --git a/Project/DataReportBase.h b/Project/DataReportBase.h index 324a3331..b9711c05 100644 --- a/Project/DataReportBase.h +++ b/Project/DataReportBase.h @@ -7,23 +7,24 @@ #ifndef _PSP_PROJECT_DATAREPORT_BASE_CLASSES_H #define _PSP_PROJECT_DATAREPORT_BASE_CLASSES_H -#include -#include -#include +// clang-format off +#include +#include +#include #include -#include #include -#include +#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #if wxVERSION_NUMBER >= 2900 #include -#include #include +#include #include #endif @@ -36,9 +37,11 @@ #define WXC_FROM_DIP(x) x #endif +// clang-format on + class DataReportBase : public wxFrame { - protected: +protected: wxNotebook* m_notebookDataReport; wxPanel* m_panelPowerFlowData; wxNotebook* m_notebookPowerFlow; @@ -58,8 +61,16 @@ class DataReportBase : public wxFrame wxGrid* m_gridFaultBranches; wxPanel* m_panelFaultGenerators; wxGrid* m_gridFaultGenerators; + wxPanel* m_panelHarmonicsData; + wxNotebook* m_notebookHarmCurrents; + wxPanel* m_panelHarmCurrents; + wxGrid* m_gridHarmCurrents; + wxPanel* m_panelHarmBuses; + wxGrid* m_gridHarmBuses; + wxPanel* m_panelHarmBranches; + wxGrid* m_gridHarmBranches; - protected: +protected: virtual void OnPowerFlowGridChanged(wxGridEvent& event) { event.Skip(); } virtual void OnGridPFKeyDown(wxKeyEvent& event) { event.Skip(); } virtual void OnPFBusGridChanged(wxGridEvent& event) { event.Skip(); } @@ -74,8 +85,11 @@ class DataReportBase : public wxFrame virtual void OnGridFaultBranchesKeyDown(wxKeyEvent& event) { event.Skip(); } virtual void OnFaultGeneratorsGridChanged(wxGridEvent& event) { event.Skip(); } virtual void OnGridFaultGeneratorsKeyDown(wxKeyEvent& event) { event.Skip(); } + virtual void OnHarmCurrentGridChanged(wxGridEvent& event) { event.Skip(); } + virtual void OnHarmBusesGridChanged(wxGridEvent& event) { event.Skip(); } + virtual void OnHarmBranchesGridChanged(wxGridEvent& event) { event.Skip(); } - public: +public: wxGrid* GetGridPowerFlow() { return m_gridPowerFlow; } wxPanel* GetPanelPowerFlow() { return m_panelPowerFlow; } wxGrid* GetGridPFBuses() { return m_gridPFBuses; } @@ -94,34 +108,33 @@ class DataReportBase : public wxFrame wxPanel* GetPanelFaultGenerators() { return m_panelFaultGenerators; } wxNotebook* GetNotebookFault() { return m_notebookFault; } wxPanel* GetPanelFaultData() { return m_panelFaultData; } + wxGrid* GetGridHarmCurrents() { return m_gridHarmCurrents; } + wxPanel* GetPanelHarmCurrents() { return m_panelHarmCurrents; } + wxGrid* GetGridHarmBuses() { return m_gridHarmBuses; } + wxPanel* GetPanelHarmBuses() { return m_panelHarmBuses; } + wxGrid* GetGridHarmBranches() { return m_gridHarmBranches; } + wxPanel* GetPanelHarmBranches() { return m_panelHarmBranches; } + wxNotebook* GetNotebookHarmCurrents() { return m_notebookHarmCurrents; } + wxPanel* GetPanelHarmonicsData() { return m_panelHarmonicsData; } wxNotebook* GetNotebookDataReport() { return m_notebookDataReport; } - DataReportBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Data report"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_FRAME_STYLE); + DataReportBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Data report"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_FRAME_STYLE); virtual ~DataReportBase(); }; + class StabilityEventListBase : public wxDialog { - protected: +protected: wxGrid* m_gridStabEventList; wxButton* m_buttonOK; - protected: +protected: virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxGrid* GetGridStabEventList() { return m_gridStabEventList; } wxButton* GetButtonOK() { return m_buttonOK; } - StabilityEventListBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Stability event list"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(500, 300), - long style = wxDEFAULT_DIALOG_STYLE); + StabilityEventListBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Stability event list"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(500,300), long style = wxDEFAULT_DIALOG_STYLE); virtual ~StabilityEventListBase(); }; diff --git a/Project/DataReportBitmaps.cpp b/Project/DataReportBitmaps.cpp index 7bd6f1d8..487beaf2 100644 --- a/Project/DataReportBitmaps.cpp +++ b/Project/DataReportBitmaps.cpp @@ -719,6 +719,6 @@ void wxC6A63InitBitmapResources() XRC_ADD_FILE(wxT("XRC_resource/DataReportBitmaps.cpp$data_images_chart256.png"), xml_res_file_2, xml_res_size_2, wxT("image/png")); XRC_ADD_FILE(wxT("XRC_resource/DataReportBitmaps.cpp$data_images_chart32.png"), xml_res_file_3, xml_res_size_3, wxT("image/png")); XRC_ADD_FILE(wxT("XRC_resource/DataReportBitmaps.cpp$data_images_chart64.png"), xml_res_file_4, xml_res_size_4, wxT("image/png")); - XRC_ADD_FILE(wxT("XRC_resource/DataReportBitmaps.cpp$C__Users_thale_Documents_GitHub_PSP_Project_DataReportBitmaps.xrc"), xml_res_file_5, xml_res_size_5, wxT("text/xml")); - wxXmlResource::Get()->Load(wxT("memory:XRC_resource/DataReportBitmaps.cpp$C__Users_thale_Documents_GitHub_PSP_Project_DataReportBitmaps.xrc")); + XRC_ADD_FILE(wxT("XRC_resource/DataReportBitmaps.cpp$C__Users_Pichau_Documents_GitHub_PSP_Project_DataReportBitmaps.xrc"), xml_res_file_5, xml_res_size_5, wxT("text/xml")); + wxXmlResource::Get()->Load(wxT("memory:XRC_resource/DataReportBitmaps.cpp$C__Users_Pichau_Documents_GitHub_PSP_Project_DataReportBitmaps.xrc")); } diff --git a/Project/ElementForm.wxcp b/Project/ElementForm.wxcp index a53c5978..8c025f31 100644 --- a/Project/ElementForm.wxcp +++ b/Project/ElementForm.wxcp @@ -144,6 +144,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -319,6 +323,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -477,6 +485,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -508,6 +520,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -546,6 +562,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -648,6 +668,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -731,6 +755,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -818,7 +846,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHOICE_SELECTED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnNominalVoltageChoice(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.", "m_noBody": false @@ -846,6 +873,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -929,7 +960,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnControlledVoltageClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -955,6 +985,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1038,6 +1072,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -1306,6 +1344,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1389,7 +1431,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnInsertFaultClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -1415,6 +1456,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -1453,6 +1498,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1611,7 +1660,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHOICE_SELECTED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnFaultTypeChoice(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.", "m_noBody": false @@ -1638,6 +1686,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1816,6 +1868,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -1918,6 +1974,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -2001,6 +2061,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -2109,6 +2173,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -2211,6 +2279,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -2294,6 +2366,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -2487,6 +2563,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -2645,7 +2725,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnInsertStabFaultClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -2671,6 +2750,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -2709,6 +2792,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -2811,6 +2898,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -2894,6 +2985,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -3002,6 +3097,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -3104,6 +3203,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -3187,6 +3290,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -3295,6 +3402,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -3397,6 +3508,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -3480,6 +3595,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -3588,6 +3707,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -3690,6 +3813,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -3773,6 +3900,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -3966,6 +4097,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -4071,6 +4206,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -4167,7 +4306,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnButtonOKClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -4262,7 +4400,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnButtonCancelClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -4402,6 +4539,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -4577,6 +4718,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -4735,6 +4880,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -4766,6 +4915,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -4804,6 +4957,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -4906,6 +5063,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -4989,6 +5150,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -5116,6 +5281,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -5218,6 +5387,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -5301,6 +5474,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -5409,6 +5586,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -5511,6 +5692,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -5594,6 +5779,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -5702,6 +5891,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -5785,7 +5978,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCheckMaxReactive(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -5811,6 +6003,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -5894,6 +6090,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -6002,6 +6202,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -6085,7 +6289,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCheckMinReactive(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -6111,6 +6314,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -6194,6 +6401,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -6462,6 +6673,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -6489,6 +6704,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -6520,6 +6739,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -6558,6 +6781,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -6716,6 +6943,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -6748,6 +6979,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -6906,6 +7141,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -6938,6 +7177,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -7096,6 +7339,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -7128,6 +7375,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -7286,6 +7537,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -7318,6 +7573,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -7476,6 +7735,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -7508,6 +7771,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -7666,6 +7933,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -7700,6 +7971,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -7738,6 +8013,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -7896,6 +8175,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -7928,6 +8211,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -8086,6 +8373,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -8197,6 +8488,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -8293,7 +8588,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnStabilityButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -8407,7 +8701,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -8502,7 +8795,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -8642,6 +8934,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -8669,6 +8965,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -8771,6 +9071,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -8809,6 +9113,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -8911,6 +9219,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -8994,6 +9306,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -9102,6 +9418,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -9204,6 +9524,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -9287,6 +9611,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -9395,6 +9723,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -9478,7 +9810,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "UseAVRClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -9573,7 +9904,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnEditAVRButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -9600,6 +9930,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -9683,7 +10017,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "UseSGClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -9778,7 +10111,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnSpeedGovernorButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -9873,6 +10205,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -9911,6 +10247,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -10013,6 +10353,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -10096,6 +10440,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -10204,6 +10552,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -10306,6 +10658,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -10389,6 +10745,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -10497,6 +10857,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -10599,6 +10963,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -10682,6 +11050,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -10790,6 +11162,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -10892,6 +11268,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -10975,6 +11355,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -11084,6 +11468,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -11115,6 +11503,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -11153,6 +11545,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -11255,6 +11651,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -11338,6 +11738,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -11446,6 +11850,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -11548,6 +11956,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -11631,6 +12043,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -11741,6 +12157,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -11772,6 +12192,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -11810,6 +12234,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -11912,6 +12340,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -11995,6 +12427,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -12103,6 +12539,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -12205,6 +12645,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -12288,6 +12732,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -12396,6 +12844,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -12498,6 +12950,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -12581,6 +13037,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -12689,6 +13149,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -12791,6 +13255,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -12874,6 +13342,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -12984,6 +13456,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -13015,6 +13491,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -13053,6 +13533,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -13155,6 +13639,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -13238,6 +13726,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -13346,6 +13838,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -13448,6 +13944,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -13531,6 +14031,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -13639,6 +14143,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -13741,6 +14249,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -13824,6 +14336,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -13932,6 +14448,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -14034,6 +14554,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -14117,6 +14641,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -14227,6 +14755,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -14254,6 +14786,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -14282,6 +14818,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -14312,6 +14852,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -14408,7 +14952,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnSwitchingButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -14522,7 +15065,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -14617,7 +15159,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -14757,6 +15298,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -14932,6 +15477,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -15090,6 +15639,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -15121,6 +15674,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -15159,6 +15716,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -15337,6 +15898,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -15439,6 +16004,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -15522,6 +16091,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -15630,6 +16203,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -15732,6 +16309,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -15815,6 +16396,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -15923,6 +16508,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -16025,6 +16614,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -16108,6 +16701,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -16216,6 +16813,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -16318,6 +16919,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -16401,6 +17006,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -16509,6 +17118,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -16611,6 +17224,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -16694,6 +17311,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -16962,6 +17583,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -16989,6 +17614,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -17020,6 +17649,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -17058,6 +17691,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -17216,6 +17853,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -17248,6 +17889,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -17406,6 +18051,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -17438,6 +18087,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -17596,6 +18249,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -17633,6 +18290,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -17729,7 +18390,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnStabilityButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -17843,7 +18503,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -17938,7 +18597,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -18078,6 +18736,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -18253,6 +18915,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -18411,6 +19077,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -18442,6 +19112,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -18480,6 +19154,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -18658,6 +19336,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -18836,6 +19518,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -18938,6 +19624,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -19021,6 +19711,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -19148,6 +19842,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -19250,6 +19948,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -19333,6 +20035,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -19441,6 +20147,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -19543,6 +20253,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -19626,6 +20340,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -19802,6 +20520,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -19980,6 +20702,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -20018,6 +20744,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -20176,6 +20906,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -20208,6 +20942,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -20310,6 +21048,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -20393,6 +21135,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -20661,6 +21407,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -20688,6 +21438,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -20719,6 +21473,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -20757,6 +21515,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -20915,6 +21677,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -20947,6 +21713,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -21105,6 +21875,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -21139,6 +21913,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -21170,6 +21948,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -21208,6 +21990,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -21366,6 +22152,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -21398,6 +22188,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -21556,6 +22350,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -21588,6 +22386,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -21746,6 +22548,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -21778,6 +22584,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -21936,6 +22746,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -21973,6 +22787,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -22069,7 +22887,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnStabilityButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -22183,7 +23000,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -22278,7 +23094,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -22418,6 +23233,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -22593,6 +23412,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -22751,6 +23574,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -22782,6 +23609,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -22820,6 +23651,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -22922,6 +23757,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -23005,6 +23844,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -23113,6 +23956,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -23215,6 +24062,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -23298,6 +24149,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -23641,6 +24496,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -23799,7 +24658,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCheckBoxCompLoadClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -23825,6 +24683,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -23863,6 +24725,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -23894,6 +24760,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -23996,6 +24866,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -24079,6 +24953,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -24187,6 +25065,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -24289,6 +25171,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -24372,6 +25258,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -24480,6 +25370,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -24582,6 +25476,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -24665,6 +25563,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -24774,6 +25676,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -24805,6 +25711,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -24907,6 +25817,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -24990,6 +25904,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -25098,6 +26016,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -25200,6 +26122,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -25283,6 +26209,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -25391,6 +26321,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -25493,6 +26427,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -25576,6 +26514,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -25689,6 +26631,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -25785,7 +26731,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnStabilityButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -25899,7 +26844,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOnButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -25994,7 +26938,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -26134,6 +27077,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -26309,6 +27256,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -26467,6 +27418,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -26498,6 +27453,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -26536,6 +27495,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -26638,6 +27601,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -26721,6 +27688,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -26833,6 +27804,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -26929,7 +27904,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnStabilityButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -27043,7 +28017,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -27138,7 +28111,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -27278,6 +28250,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -27305,6 +28281,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -27332,6 +28312,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -27415,7 +28399,6 @@ "m_events": [{ "m_eventName": "wxEVT_PG_CHANGED", "m_eventClass": "wxPropertyGridEvent", - "m_eventHandler": "wxPropertyGridEventHandler", "m_functionNameAndSignature": "OnChangeProperties(wxPropertyGridEvent& event)", "m_description": "Respond to wxEVT_PG_CHANGED event, generated when property value has been changed by the user", "m_noBody": false @@ -27637,6 +28620,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -27733,7 +28720,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnInsertButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -27828,7 +28814,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnRemoveButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -27923,7 +28908,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnUpButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -28018,7 +29002,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnDownButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -28045,6 +29028,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -28195,7 +29182,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_LIST_ITEM_SELECTED", "m_eventClass": "wxListEvent", - "m_eventHandler": "wxListEventHandler", "m_functionNameAndSignature": "OnSelectItem(wxListEvent& event)", "m_description": "The item has been selected", "m_noBody": false @@ -28223,6 +29209,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -28319,7 +29309,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -28414,7 +29403,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -28554,6 +29542,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -28729,6 +29721,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -28887,6 +29883,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -28918,6 +29918,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -28956,6 +29960,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -29058,6 +30066,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -29141,6 +30153,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -29268,6 +30284,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -29370,6 +30390,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -29453,6 +30477,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -29561,6 +30589,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -29663,6 +30695,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -29746,6 +30782,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -29911,7 +30951,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCalcQInPFClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -30096,6 +31135,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -30198,6 +31241,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -30236,6 +31283,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -30338,6 +31389,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -30421,6 +31476,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -30548,6 +31607,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -30650,6 +31713,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -30733,6 +31800,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -30841,6 +31912,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -30943,6 +32018,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -31026,6 +32105,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -31134,6 +32217,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -31236,6 +32323,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -31319,6 +32410,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -31427,6 +32522,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -31529,6 +32628,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -31612,6 +32715,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -31720,6 +32827,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -31822,6 +32933,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -31905,6 +33020,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -32013,6 +33132,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -32096,7 +33219,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCheckboxUseCageFactorClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -32178,6 +33300,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -32211,6 +33337,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -32313,6 +33443,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -32351,6 +33485,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -32434,6 +33572,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -32541,6 +33683,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -32624,6 +33770,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -32731,6 +33881,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -32814,6 +33968,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -32926,6 +34084,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -33022,7 +34184,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnStabilityButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -33136,7 +34297,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -33231,7 +34391,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -33371,6 +34530,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -33546,6 +34709,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -33573,6 +34740,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "string", "m_label": "# Columns:", @@ -33611,6 +34782,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -33769,7 +34944,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHOICE_SELECTED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnElementChoiceSelected(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.", "m_noBody": false @@ -33796,6 +34970,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -33954,7 +35132,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHOICE_SELECTED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnNameChoiceSelected(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.", "m_noBody": false @@ -33981,6 +35158,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -34139,7 +35320,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHOICE_SELECTED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnTypeChoiceSelected(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.", "m_noBody": false @@ -34166,6 +35346,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -34324,7 +35508,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHOICE_SELECTED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnFromBusChoiceSelected(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.", "m_noBody": false @@ -34351,6 +35534,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -34509,7 +35696,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHOICE_SELECTED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnToBusChoiceSelected(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.", "m_noBody": false @@ -34536,6 +35722,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -34694,7 +35884,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHOICE_SELECTED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnUnitChoiceSelected(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHOICE_SELECTED event, when an item on the list is selected.", "m_noBody": false @@ -34722,6 +35911,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -34880,6 +36073,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -34892,7 +36089,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_TEXT_ENTER", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnTextEnter(wxCommandEvent& event)", "m_description": "Respond to a wxEVT_COMMAND_TEXT_ENTER event, generated when enter is pressed in a text control\n(which must have wxTE_PROCESS_ENTER style for this event to be generated).", "m_noBody": false @@ -35068,6 +36264,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -35103,6 +36303,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -35218,7 +36422,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -35313,7 +36516,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -35453,6 +36655,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -35628,6 +36834,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -35786,6 +36996,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -35948,6 +37162,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -35982,6 +37200,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -36097,7 +37319,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -36192,7 +37413,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -36332,6 +37552,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -36507,6 +37731,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -36665,6 +37893,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -36699,6 +37931,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -36814,7 +38050,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -36909,7 +38144,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -37049,6 +38283,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -37224,6 +38462,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -37382,6 +38624,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -37544,6 +38790,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -37578,6 +38828,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -37693,7 +38947,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -37788,7 +39041,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -37928,6 +39180,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -38103,6 +39359,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -38261,6 +39521,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -38423,6 +39687,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -38457,6 +39725,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -38572,7 +39844,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -38667,7 +39938,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -38807,6 +40077,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -38982,6 +40256,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -39215,6 +40493,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -39377,6 +40659,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -39411,6 +40697,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -39526,7 +40816,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -39621,7 +40910,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -39761,6 +41049,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -39936,6 +41228,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -40094,6 +41390,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -40128,6 +41428,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -40243,7 +41547,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -40338,7 +41641,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -40478,6 +41780,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -40653,6 +41959,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -40811,6 +42121,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -40845,6 +42159,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -40960,7 +42278,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -41055,7 +42372,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -41195,6 +42511,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -41370,6 +42690,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -41453,7 +42777,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnInputChecked(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -41610,7 +42933,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_CHECKBOX_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOutputChecked(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_CHECKBOX_CLICKED event, when the checkbox is clicked.", "m_noBody": false @@ -41714,6 +43036,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -41829,7 +43155,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -41924,7 +43249,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -42064,6 +43388,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -42239,6 +43567,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -42397,6 +43729,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -42409,14 +43745,12 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_TEXT_UPDATED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnTextUpdate(wxCommandEvent& event)", "m_description": "Respond to a wxEVT_COMMAND_TEXT_UPDATED event, generated when the text changes.\nNotice that this event will be sent when the text controls contents changes\n - whether this is due to user input or comes from the program itself\n(for example, if SetValue() is called); see ChangeValue() for a function which does not send this event.", "m_noBody": false }, { "m_eventName": "wxEVT_COMMAND_TEXT_ENTER", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnTextEnter(wxCommandEvent& event)", "m_description": "Respond to a wxEVT_COMMAND_TEXT_ENTER event, generated when enter is pressed in a text control\n(which must have wxTE_PROCESS_ENTER style for this event to be generated).", "m_noBody": false @@ -42542,7 +43876,6 @@ "m_events": [{ "m_eventName": "wxEVT_LEFT_DOWN", "m_eventClass": "wxMouseEvent", - "m_eventHandler": "wxMouseEventHandler", "m_functionNameAndSignature": "OnLeftClickDown(wxMouseEvent& event)", "m_description": "Process a wxEVT_LEFT_DOWN event. The handler of this event should normally call event.Skip() to allow the default processing to take place as otherwise the window under mouse wouldn't get the focus.", "m_noBody": false @@ -42646,6 +43979,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -42742,7 +44079,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCheckButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -42856,7 +44192,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -42951,7 +44286,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -43091,6 +44425,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -43118,6 +44456,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -43276,6 +44618,10 @@ "type": "string", "m_label": "Max Length:", "m_value": "0" + }, { + "type": "bool", + "m_label": "Enable Spell Checking", + "m_value": false }, { "type": "bool", "m_label": "Auto Complete Directories:", @@ -43308,6 +44654,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -43335,6 +44685,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -43763,6 +45117,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -43859,7 +45217,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnAddButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -43954,7 +45311,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnRemoveButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -43981,6 +45337,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -44152,6 +45512,10 @@ "type": "string", "m_label": "Style:", "m_value": "" + }, { + "type": "bool", + "m_label": "Keep as a class member", + "m_value": false }, { "type": "choice", "m_label": "Orientation:", @@ -44248,7 +45612,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnOKButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false @@ -44343,7 +45706,6 @@ "m_events": [{ "m_eventName": "wxEVT_COMMAND_BUTTON_CLICKED", "m_eventClass": "wxCommandEvent", - "m_eventHandler": "wxCommandEventHandler", "m_functionNameAndSignature": "OnCancelButtonClick(wxCommandEvent& event)", "m_description": "Process a wxEVT_COMMAND_BUTTON_CLICKED event, when the button is clicked.", "m_noBody": false diff --git a/Project/ElementFormBase.cpp b/Project/ElementFormBase.cpp index 25fc6228..2893409b 100644 --- a/Project/ElementFormBase.cpp +++ b/Project/ElementFormBase.cpp @@ -6,4730 +6,4091 @@ #include "ElementFormBase.h" + // Declare the bitmap loading function extern void wxC9EE9InitBitmapResources(); -static bool bBitmapLoaded = false; -BusFormBase::BusFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +namespace { +// return the wxBORDER_SIMPLE that matches the current application theme +wxBorder get_border_simple_theme_aware_bit() { +#if wxVERSION_NUMBER >= 3300 && defined(__WXMSW__) + return wxSystemSettings::GetAppearance().IsDark() ? wxBORDER_SIMPLE : wxBORDER_STATIC; +#else + return wxBORDER_DEFAULT; +#endif +} // DoGetBorderSimpleBit +bool bBitmapLoaded = false; +} // namespace + + +BusFormBase::BusFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlName->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlName->SetMinSize(wxSize(300,-1)); + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNomVoltage = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated voltage"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_1->Add(m_staticTextNomVoltage, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextNomVoltage = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated voltage"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_1->Add(m_staticTextNomVoltage, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_1->Add(boxSizerLvl5_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlNomVoltage = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlNomVoltage = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlNomVoltage->SetHint(wxT("")); -#endif - - boxSizerLvl5_1->Add(m_textCtrlNomVoltage, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_1->Add(m_textCtrlNomVoltage, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceNomVoltageArr; - m_choiceNomVoltageArr.Add(wxT("V")); - m_choiceNomVoltageArr.Add(wxT("kV")); - m_choiceNomVoltage = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceNomVoltageArr, 0); + m_choiceNomVoltageArr.Add(_("V")); + m_choiceNomVoltageArr.Add(_("kV")); + m_choiceNomVoltage = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceNomVoltageArr, 0); m_choiceNomVoltage->SetSelection(1); - - boxSizerLvl5_1->Add(m_choiceNomVoltage, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_1->Add(m_choiceNomVoltage, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_checkBoxCtrlVoltage = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Controlled voltage"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + m_checkBoxCtrlVoltage = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Controlled voltage"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxCtrlVoltage->SetValue(false); - - boxSizerLvl4_2->Add(m_checkBoxCtrlVoltage, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + boxSizerLvl4_2->Add(m_checkBoxCtrlVoltage, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_2->Add(boxSizerLvl5_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlCtrlVoltage = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlCtrlVoltage = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlCtrlVoltage->SetHint(wxT("")); -#endif - - boxSizerLvl5_2->Add(m_textCtrlCtrlVoltage, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_2->Add(m_textCtrlCtrlVoltage, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceCtrlVoltageArr; - m_choiceCtrlVoltageArr.Add(wxT("p.u.")); - m_choiceCtrlVoltageArr.Add(wxT("kV")); - m_choiceCtrlVoltage = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceCtrlVoltageArr, 0); + m_choiceCtrlVoltageArr.Add(_("p.u.")); + m_choiceCtrlVoltageArr.Add(_("kV")); + m_choiceCtrlVoltage = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceCtrlVoltageArr, 0); m_choiceCtrlVoltage->SetSelection(0); - - boxSizerLvl5_2->Add(m_choiceCtrlVoltage, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - - m_checkBoxSlackBus = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Slack Bus"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + boxSizerLvl5_2->Add(m_choiceCtrlVoltage, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + + m_checkBoxSlackBus = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Slack Bus"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxSlackBus->SetValue(false); - - boxSizerLvl2_1->Add(m_checkBoxSlackBus, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_panelFault = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + boxSizerLvl2_1->Add(m_checkBoxSlackBus, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_panelFault = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelFault, _("Fault"), false); - + wxBoxSizer* boxSizerLvl2_2 = new wxBoxSizer(wxVERTICAL); m_panelFault->SetSizer(boxSizerLvl2_2); - - m_checkBoxFault = new wxCheckBox(m_panelFault, wxID_ANY, _("Insert fault in the bus"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); + + m_checkBoxFault = new wxCheckBox(m_panelFault, wxID_ANY, _("Insert fault in the bus"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); m_checkBoxFault->SetValue(false); - - boxSizerLvl2_2->Add(m_checkBoxFault, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + boxSizerLvl2_2->Add(m_checkBoxFault, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_2 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_2->Add(gridSizerLvl3_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_3 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextFaultType = new wxStaticText(m_panelFault, wxID_ANY, _("Fault type"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_3->Add(m_staticTextFaultType, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextFaultType = new wxStaticText(m_panelFault, wxID_ANY, _("Fault type"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_3->Add(m_staticTextFaultType, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceFaultTypeArr; - m_choiceFaultTypeArr.Add(wxT("Three-phase")); - m_choiceFaultTypeArr.Add(wxT("Line-to-line")); - m_choiceFaultTypeArr.Add(wxT("Double line-to-ground")); - m_choiceFaultTypeArr.Add(wxT("Line-to-ground")); - m_choiceFaultType = new wxChoice(m_panelFault, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), m_choiceFaultTypeArr, 0); + m_choiceFaultTypeArr.Add(_("Three-phase")); + m_choiceFaultTypeArr.Add(_("Line-to-line")); + m_choiceFaultTypeArr.Add(_("Double line-to-ground")); + m_choiceFaultTypeArr.Add(_("Line-to-ground")); + m_choiceFaultType = new wxChoice(m_panelFault, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), m_choiceFaultTypeArr, 0); m_choiceFaultType->SetSelection(0); - - boxSizerLvl4_3->Add(m_choiceFaultType, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + boxSizerLvl4_3->Add(m_choiceFaultType, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_4 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextFaultPlace = new wxStaticText(m_panelFault, wxID_ANY, _("Fault place"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_4->Add(m_staticTextFaultPlace, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextFaultPlace = new wxStaticText(m_panelFault, wxID_ANY, _("Fault place"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_4->Add(m_staticTextFaultPlace, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceFaultPlaceArr; - m_choiceFaultPlaceArr.Add(wxT("Line A")); - m_choiceFaultPlaceArr.Add(wxT("Line B")); - m_choiceFaultPlaceArr.Add(wxT("Line C")); - m_choiceFaultPlace = new wxChoice(m_panelFault, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), m_choiceFaultPlaceArr, 0); + m_choiceFaultPlaceArr.Add(_("Line A")); + m_choiceFaultPlaceArr.Add(_("Line B")); + m_choiceFaultPlaceArr.Add(_("Line C")); + m_choiceFaultPlace = new wxChoice(m_panelFault, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), m_choiceFaultPlaceArr, 0); m_choiceFaultPlace->SetSelection(0); - - boxSizerLvl4_4->Add(m_choiceFaultPlace, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + boxSizerLvl4_4->Add(m_choiceFaultPlace, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_5 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextFaultResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Fault resistance (R)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_5->Add(m_staticTextFaultResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextFaultResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Fault resistance (R)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_5->Add(m_staticTextFaultResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_3 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_5->Add(boxSizerLvl5_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlFaultResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlFaultResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlFaultResistance->SetHint(wxT("")); -#endif - - boxSizerLvl5_3->Add(m_textCtrlFaultResistance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_1 = new wxStaticText(m_panelFault, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl5_3->Add(m_staticTextPU_1, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_3->Add(m_textCtrlFaultResistance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_1 = new wxStaticText(m_panelFault, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl5_3->Add(m_staticTextPU_1, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_6 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Fault reactance (Xl)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_6->Add(m_staticTextReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Fault reactance (Xl)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_6->Add(m_staticTextReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_4 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_6->Add(boxSizerLvl5_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlFaultReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlFaultReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlFaultReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_4->Add(m_textCtrlFaultReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_2 = new wxStaticText(m_panelFault, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl5_4->Add(m_staticTextPU_2, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_panelStability = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + #endif + + boxSizerLvl5_4->Add(m_textCtrlFaultReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_2 = new wxStaticText(m_panelFault, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl5_4->Add(m_staticTextPU_2, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_panelStability = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelStability, _("Stability"), false); - + wxBoxSizer* boxSizerLvl2_3 = new wxBoxSizer(wxVERTICAL); m_panelStability->SetSizer(boxSizerLvl2_3); - - m_checkBoxPlotData = new wxCheckBox(m_panelStability, wxID_ANY, _("Plot bus data"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); + + m_checkBoxPlotData = new wxCheckBox(m_panelStability, wxID_ANY, _("Plot bus data"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); m_checkBoxPlotData->SetValue(false); - - boxSizerLvl2_3->Add(m_checkBoxPlotData, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_checkBoxStabFault = new wxCheckBox(m_panelStability, wxID_ANY, _("Insert fault in the bus"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); + + boxSizerLvl2_3->Add(m_checkBoxPlotData, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_checkBoxStabFault = new wxCheckBox(m_panelStability, wxID_ANY, _("Insert fault in the bus"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); m_checkBoxStabFault->SetValue(false); - - boxSizerLvl2_3->Add(m_checkBoxStabFault, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + boxSizerLvl2_3->Add(m_checkBoxStabFault, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_3 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_3->Add(gridSizerLvl3_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_7 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_3->Add(boxSizerLvl4_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextStabFaultTime = new wxStaticText(m_panelStability, wxID_ANY, _("Time"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_7->Add(m_staticTextStabFaultTime, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextStabFaultTime = new wxStaticText(m_panelStability, wxID_ANY, _("Time"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_7->Add(m_staticTextStabFaultTime, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_5 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_7->Add(boxSizerLvl5_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlStabFaultTime = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlStabFaultTime = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlStabFaultTime->SetHint(wxT("")); -#endif - - boxSizerLvl5_5->Add(m_textCtrlStabFaultTime, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextS_1 = new wxStaticText(m_panelStability, wxID_ANY, _("s"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_5->Add(m_staticTextS_1, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_5->Add(m_textCtrlStabFaultTime, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextS_1 = new wxStaticText(m_panelStability, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_5->Add(m_staticTextS_1, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_8 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_3->Add(boxSizerLvl4_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextStabFaultLength = new wxStaticText(m_panelStability, wxID_ANY, _("Fault length"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_8->Add(m_staticTextStabFaultLength, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextStabFaultLength = new wxStaticText(m_panelStability, wxID_ANY, _("Fault length"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_8->Add(m_staticTextStabFaultLength, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_6 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_8->Add(boxSizerLvl5_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlStabFaultLength = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlStabFaultLength = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlStabFaultLength->SetHint(wxT("")); -#endif - - boxSizerLvl5_6->Add(m_textCtrlStabFaultLength, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextS_2 = new wxStaticText(m_panelStability, wxID_ANY, _("s"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_6->Add(m_staticTextS_2, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_6->Add(m_textCtrlStabFaultLength, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextS_2 = new wxStaticText(m_panelStability, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_6->Add(m_staticTextS_2, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_9 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_3->Add(boxSizerLvl4_9, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextStabFaultResistance = - new wxStaticText(m_panelStability, wxID_ANY, _("Fault resistance (R)"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_9->Add(m_staticTextStabFaultResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextStabFaultResistance = new wxStaticText(m_panelStability, wxID_ANY, _("Fault resistance (R)"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_9->Add(m_staticTextStabFaultResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_7 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_9->Add(boxSizerLvl5_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlStabFaultResistance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlStabFaultResistance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlStabFaultResistance->SetHint(wxT("")); -#endif - - boxSizerLvl5_7->Add(m_textCtrlStabFaultResistance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_3 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_7->Add(m_staticTextPU_3, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_7->Add(m_textCtrlStabFaultResistance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_3 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_7->Add(m_staticTextPU_3, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_10 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_3->Add(boxSizerLvl4_10, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextStabFaultReactance = - new wxStaticText(m_panelStability, wxID_ANY, _("Fault reactance (Xl)"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_10->Add(m_staticTextStabFaultReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextStabFaultReactance = new wxStaticText(m_panelStability, wxID_ANY, _("Fault reactance (Xl)"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_10->Add(m_staticTextStabFaultReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_8 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_10->Add(boxSizerLvl5_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlStabFaultReactance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlStabFaultReactance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlStabFaultReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_8->Add(m_textCtrlStabFaultReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_4 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_8->Add(m_staticTextPU_4, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_panelPowerQuality = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + #endif + + boxSizerLvl5_8->Add(m_textCtrlStabFaultReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_4 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_8->Add(m_staticTextPU_4, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_panelPowerQuality = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelPowerQuality, _("Power Quality"), false); - + wxBoxSizer* boxSizerLvl2_4 = new wxBoxSizer(wxVERTICAL); m_panelPowerQuality->SetSizer(boxSizerLvl2_4); - - m_checkBoxPlotPQData = new wxCheckBox(m_panelPowerQuality, wxID_ANY, _("Plot harmonic bus impedance"), - wxDefaultPosition, wxDLG_UNIT(m_panelPowerQuality, wxSize(-1, -1)), 0); + + m_checkBoxPlotPQData = new wxCheckBox(m_panelPowerQuality, wxID_ANY, _("Plot harmonic bus impedance"), wxDefaultPosition, wxDLG_UNIT(m_panelPowerQuality, wxSize(-1,-1)), 0); m_checkBoxPlotPQData->SetValue(false); - - boxSizerLvl2_4->Add(m_checkBoxPlotPQData, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + boxSizerLvl2_4->Add(m_checkBoxPlotPQData, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerOkCancel = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerOkCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerOkCancel->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerOkCancel->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + boxSizerLvl1_1->Add(boxSizerOkCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerOkCancel->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerOkCancel->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("BusFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxVERTICAL); } else { CentreOnScreen(wxVERTICAL); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_choiceNomVoltage->Connect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(BusFormBase::OnNominalVoltageChoice), NULL, this); - m_checkBoxCtrlVoltage->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(BusFormBase::OnControlledVoltageClick), NULL, this); - m_checkBoxFault->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(BusFormBase::OnInsertFaultClick), - NULL, this); - m_choiceFaultType->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(BusFormBase::OnFaultTypeChoice), - NULL, this); - m_checkBoxStabFault->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(BusFormBase::OnInsertStabFaultClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BusFormBase::OnButtonOKClick), NULL, this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BusFormBase::OnButtonCancelClick), NULL, - this); + m_choiceNomVoltage->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &BusFormBase::OnNominalVoltageChoice, this); + m_checkBoxCtrlVoltage->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &BusFormBase::OnControlledVoltageClick, this); + m_checkBoxFault->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &BusFormBase::OnInsertFaultClick, this); + m_choiceFaultType->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &BusFormBase::OnFaultTypeChoice, this); + m_checkBoxStabFault->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &BusFormBase::OnInsertStabFaultClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &BusFormBase::OnButtonOKClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &BusFormBase::OnButtonCancelClick, this); + } BusFormBase::~BusFormBase() { - m_choiceNomVoltage->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(BusFormBase::OnNominalVoltageChoice), NULL, this); - m_checkBoxCtrlVoltage->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(BusFormBase::OnControlledVoltageClick), NULL, this); - m_checkBoxFault->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(BusFormBase::OnInsertFaultClick), - NULL, this); - m_choiceFaultType->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(BusFormBase::OnFaultTypeChoice), - NULL, this); - m_checkBoxStabFault->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(BusFormBase::OnInsertStabFaultClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BusFormBase::OnButtonOKClick), NULL, - this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BusFormBase::OnButtonCancelClick), - NULL, this); + m_choiceNomVoltage->Unbind(wxEVT_COMMAND_CHOICE_SELECTED, &BusFormBase::OnNominalVoltageChoice, this); + m_checkBoxCtrlVoltage->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &BusFormBase::OnControlledVoltageClick, this); + m_checkBoxFault->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &BusFormBase::OnInsertFaultClick, this); + m_choiceFaultType->Unbind(wxEVT_COMMAND_CHOICE_SELECTED, &BusFormBase::OnFaultTypeChoice, this); + m_checkBoxStabFault->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &BusFormBase::OnInsertStabFaultClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &BusFormBase::OnButtonOKClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &BusFormBase::OnButtonCancelClick, this); + } -SyncMachineFormBase::SyncMachineFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +SyncMachineFormBase::SyncMachineFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlName->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlName->SetMinSize(wxSize(300,-1)); + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_5 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNominalPower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_5->Add(m_staticTextNominalPower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextNominalPower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_5->Add(m_staticTextNominalPower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_5 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_5->Add(boxSizerLvl5_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlnominalPower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlnominalPower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlnominalPower->SetHint(wxT("")); -#endif - - boxSizerLvl5_5->Add(m_textCtrlnominalPower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_5->Add(m_textCtrlnominalPower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceNominalPowerArr; - m_choiceNominalPowerArr.Add(wxT("VA")); - m_choiceNominalPowerArr.Add(wxT("kVA")); - m_choiceNominalPowerArr.Add(wxT("MVA")); - m_choiceNominalPower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceNominalPowerArr, 0); + m_choiceNominalPowerArr.Add(_("VA")); + m_choiceNominalPowerArr.Add(_("kVA")); + m_choiceNominalPowerArr.Add(_("MVA")); + m_choiceNominalPower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceNominalPowerArr, 0); m_choiceNominalPower->SetSelection(2); - - boxSizerLvl5_5->Add(m_choiceNominalPower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - - gridSizerLvl3_1->Add(0, 0, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl5_5->Add(m_choiceNominalPower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + + gridSizerLvl3_1->Add(0, 0, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextActivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Active power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_1->Add(m_staticTextActivePower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextActivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Active power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_1->Add(m_staticTextActivePower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_1->Add(boxSizerLvl5_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlActivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlActivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlActivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_1->Add(m_textCtrlActivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_1->Add(m_textCtrlActivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceActivePowerArr; - m_choiceActivePowerArr.Add(wxT("p.u.")); - m_choiceActivePowerArr.Add(wxT("W")); - m_choiceActivePowerArr.Add(wxT("kW")); - m_choiceActivePowerArr.Add(wxT("MW")); - m_choiceActivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceActivePowerArr, 0); + m_choiceActivePowerArr.Add(_("p.u.")); + m_choiceActivePowerArr.Add(_("W")); + m_choiceActivePowerArr.Add(_("kW")); + m_choiceActivePowerArr.Add(_("MW")); + m_choiceActivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceActivePowerArr, 0); m_choiceActivePower->SetSelection(3); - - boxSizerLvl5_1->Add(m_choiceActivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_1->Add(m_choiceActivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Reactive power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_2->Add(m_staticTextReactivePower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextReactivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Reactive power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_2->Add(m_staticTextReactivePower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_2->Add(boxSizerLvl5_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_2->Add(m_textCtrlReactivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_2->Add(m_textCtrlReactivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceReactivePowerArr; - m_choiceReactivePowerArr.Add(wxT("p.u.")); - m_choiceReactivePowerArr.Add(wxT("VAr")); - m_choiceReactivePowerArr.Add(wxT("kVAr")); - m_choiceReactivePowerArr.Add(wxT("MVAr")); - m_choiceReactivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceReactivePowerArr, 0); + m_choiceReactivePowerArr.Add(_("p.u.")); + m_choiceReactivePowerArr.Add(_("VAr")); + m_choiceReactivePowerArr.Add(_("kVAr")); + m_choiceReactivePowerArr.Add(_("MVAr")); + m_choiceReactivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceReactivePowerArr, 0); m_choiceReactivePower->SetSelection(3); - - boxSizerLvl5_2->Add(m_choiceReactivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_2->Add(m_choiceReactivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_3 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_checkBoxMaxReactive = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Max reactive power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + m_checkBoxMaxReactive = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Max reactive power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxMaxReactive->SetValue(false); - + boxSizerLvl4_3->Add(m_checkBoxMaxReactive, 0, wxALL, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl5_3 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_3->Add(boxSizerLvl5_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlMaxRectivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlMaxRectivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlMaxRectivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_3->Add(m_textCtrlMaxRectivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_3->Add(m_textCtrlMaxRectivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceMaxRectivePowerArr; - m_choiceMaxRectivePowerArr.Add(wxT("p.u.")); - m_choiceMaxRectivePowerArr.Add(wxT("VAr")); - m_choiceMaxRectivePowerArr.Add(wxT("kVAr")); - m_choiceMaxRectivePowerArr.Add(wxT("MVAr")); - m_choiceMaxRectivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceMaxRectivePowerArr, 0); + m_choiceMaxRectivePowerArr.Add(_("p.u.")); + m_choiceMaxRectivePowerArr.Add(_("VAr")); + m_choiceMaxRectivePowerArr.Add(_("kVAr")); + m_choiceMaxRectivePowerArr.Add(_("MVAr")); + m_choiceMaxRectivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceMaxRectivePowerArr, 0); m_choiceMaxRectivePower->SetSelection(3); - - boxSizerLvl5_3->Add(m_choiceMaxRectivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_3->Add(m_choiceMaxRectivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_4 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_checkBoxMinReactive = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Min reactive power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + m_checkBoxMinReactive = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Min reactive power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxMinReactive->SetValue(false); - + boxSizerLvl4_4->Add(m_checkBoxMinReactive, 0, wxALL, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl5_4 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_4->Add(boxSizerLvl5_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlMinRectivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlMinRectivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlMinRectivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_4->Add(m_textCtrlMinRectivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_4->Add(m_textCtrlMinRectivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceMinRectivePowerArr; - m_choiceMinRectivePowerArr.Add(wxT("p.u.")); - m_choiceMinRectivePowerArr.Add(wxT("VAr")); - m_choiceMinRectivePowerArr.Add(wxT("kVAr")); - m_choiceMinRectivePowerArr.Add(wxT("MVAr")); - m_choiceMinRectivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceMinRectivePowerArr, 0); + m_choiceMinRectivePowerArr.Add(_("p.u.")); + m_choiceMinRectivePowerArr.Add(_("VAr")); + m_choiceMinRectivePowerArr.Add(_("kVAr")); + m_choiceMinRectivePowerArr.Add(_("MVAr")); + m_choiceMinRectivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceMinRectivePowerArr, 0); m_choiceMinRectivePower->SetSelection(3); - - boxSizerLvl5_4->Add(m_choiceMinRectivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - - m_checkBoxUseMachinePower = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Use machine rated power as base"), - wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + boxSizerLvl5_4->Add(m_choiceMinRectivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + + m_checkBoxUseMachinePower = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Use machine rated power as base"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxUseMachinePower->SetValue(false); - - boxSizerLvl2_1->Add(m_checkBoxUseMachinePower, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_panelFault = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + boxSizerLvl2_1->Add(m_checkBoxUseMachinePower, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_panelFault = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelFault, _("Fault"), false); - + wxBoxSizer* boxSizerLvl2_2 = new wxBoxSizer(wxVERTICAL); m_panelFault->SetSizer(boxSizerLvl2_2); - - wxStaticBoxSizer* staticBoxSizerLvl3_1 = - new wxStaticBoxSizer(new wxStaticBox(m_panelFault, wxID_ANY, _("Sequence impedances (p.u.)")), wxVERTICAL); - - boxSizerLvl2_2->Add(staticBoxSizerLvl3_1, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + wxStaticBoxSizer* staticBoxSizerLvl3_1 = new wxStaticBoxSizer( new wxStaticBox(m_panelFault, wxID_ANY, _("Sequence impedances (p.u.)")), wxVERTICAL); + + boxSizerLvl2_2->Add(staticBoxSizerLvl3_1, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl4_2 = new wxGridSizer(0, 2, 0, 0); - + staticBoxSizerLvl3_1->Add(gridSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl5_6 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_2->Add(boxSizerLvl5_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextPosResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Positive resistance (R1)"), - wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl5_6->Add(m_staticTextPosResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlPosResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextPosResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Positive resistance (R1)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl5_6->Add(m_staticTextPosResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlPosResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlPosResistance->SetHint(wxT("")); -#endif - - boxSizerLvl5_6->Add(m_textCtrlPosResistance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_6->Add(m_textCtrlPosResistance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_7 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_2->Add(boxSizerLvl5_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextPosReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Positive reactance (X1)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl5_7->Add(m_staticTextPosReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlPosReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextPosReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Positive reactance (X1)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl5_7->Add(m_staticTextPosReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlPosReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlPosReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_7->Add(m_textCtrlPosReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_7->Add(m_textCtrlPosReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_8 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_2->Add(boxSizerLvl5_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNegResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Negative resistance (R2)"), - wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl5_8->Add(m_staticTextNegResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlNegResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextNegResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Negative resistance (R2)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl5_8->Add(m_staticTextNegResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlNegResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlNegResistance->SetHint(wxT("")); -#endif - - boxSizerLvl5_8->Add(m_textCtrlNegResistance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_8->Add(m_textCtrlNegResistance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_9 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_2->Add(boxSizerLvl5_9, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNegReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Negative reactance (X2)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl5_9->Add(m_staticTextNegReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlNegReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextNegReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Negative reactance (X2)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl5_9->Add(m_staticTextNegReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlNegReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlNegReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_9->Add(m_textCtrlNegReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_9->Add(m_textCtrlNegReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_10 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_2->Add(boxSizerLvl5_10, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextZeroResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Zero resistance (R0)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl5_10->Add(m_staticTextZeroResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlZeroResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextZeroResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Zero resistance (R0)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl5_10->Add(m_staticTextZeroResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlZeroResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlZeroResistance->SetHint(wxT("")); -#endif - - boxSizerLvl5_10->Add(m_textCtrlZeroResistance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_10->Add(m_textCtrlZeroResistance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_11 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_2->Add(boxSizerLvl5_11, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextZeroReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Zero reactance (X0)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl5_11->Add(m_staticTextZeroReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlZeroReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextZeroReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Zero reactance (X0)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl5_11->Add(m_staticTextZeroReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlZeroReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlZeroReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_11->Add(m_textCtrlZeroReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_11->Add(m_textCtrlZeroReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_3 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_2->Add(gridSizerLvl3_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_12 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_3->Add(boxSizerLvl4_12, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextGrdResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Ground resistance (p.u.)"), - wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_12->Add(m_staticTextGrdResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlGrdResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextGrdResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Ground resistance (p.u.)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_12->Add(m_staticTextGrdResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlGrdResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlGrdResistance->SetHint(wxT("")); -#endif - - boxSizerLvl4_12->Add(m_textCtrlGrdResistance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_12->Add(m_textCtrlGrdResistance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_13 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_3->Add(boxSizerLvl4_13, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextGrdReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Ground reactance (p.u.)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_13->Add(m_staticTextGrdReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlGrdReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextGrdReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Ground reactance (p.u.)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_13->Add(m_staticTextGrdReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlGrdReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlGrdReactance->SetHint(wxT("")); -#endif - - boxSizerLvl4_13->Add(m_textCtrlGrdReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_checkBoxGroundNeutral = new wxCheckBox(m_panelFault, wxID_ANY, _("Grounded neutral"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); + #endif + + boxSizerLvl4_13->Add(m_textCtrlGrdReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_checkBoxGroundNeutral = new wxCheckBox(m_panelFault, wxID_ANY, _("Grounded neutral"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); m_checkBoxGroundNeutral->SetValue(true); - + boxSizerLvl2_2->Add(m_checkBoxGroundNeutral, 0, wxALL, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonStab = new wxButton(this, wxID_ANY, _("Stability"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonStab, 0, wxALL | wxALIGN_LEFT, WXC_FROM_DIP(5)); - - boxSizerBottomButtons->Add(0, 0, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonStab = new wxButton(this, wxID_ANY, _("Stability"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonStab, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); + + boxSizerBottomButtons->Add(0, 0, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("SyncMachineFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_checkBoxMaxReactive->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(SyncMachineFormBase::OnCheckMaxReactive), NULL, this); - m_checkBoxMinReactive->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(SyncMachineFormBase::OnCheckMinReactive), NULL, this); - m_buttonStab->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(SyncMachineFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SyncMachineFormBase::OnOKButtonClick), NULL, - this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(SyncMachineFormBase::OnCancelButtonClick), NULL, this); + m_checkBoxMaxReactive->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &SyncMachineFormBase::OnCheckMaxReactive, this); + m_checkBoxMinReactive->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &SyncMachineFormBase::OnCheckMinReactive, this); + m_buttonStab->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SyncMachineFormBase::OnStabilityButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SyncMachineFormBase::OnOKButtonClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SyncMachineFormBase::OnCancelButtonClick, this); + } SyncMachineFormBase::~SyncMachineFormBase() { - m_checkBoxMaxReactive->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(SyncMachineFormBase::OnCheckMaxReactive), NULL, this); - m_checkBoxMinReactive->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(SyncMachineFormBase::OnCheckMinReactive), NULL, this); - m_buttonStab->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(SyncMachineFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SyncMachineFormBase::OnOKButtonClick), - NULL, this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(SyncMachineFormBase::OnCancelButtonClick), NULL, this); + m_checkBoxMaxReactive->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &SyncMachineFormBase::OnCheckMaxReactive, this); + m_checkBoxMinReactive->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &SyncMachineFormBase::OnCheckMinReactive, this); + m_buttonStab->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SyncMachineFormBase::OnStabilityButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SyncMachineFormBase::OnOKButtonClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SyncMachineFormBase::OnCancelButtonClick, this); + } -GeneratorStabFormBase::GeneratorStabFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +GeneratorStabFormBase::GeneratorStabFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); - - boxSizerLvl1_1->Add(boxSizerLvl2_1, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_checkBoxPlotSyncMachine = new wxCheckBox(this, wxID_ANY, _("Plot synchronous machine data"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); + + boxSizerLvl1_1->Add(boxSizerLvl2_1, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_checkBoxPlotSyncMachine = new wxCheckBox(this, wxID_ANY, _("Plot synchronous machine data"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); m_checkBoxPlotSyncMachine->SetValue(false); - - boxSizerLvl2_1->Add(m_checkBoxPlotSyncMachine, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + boxSizerLvl2_1->Add(m_checkBoxPlotSyncMachine, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextInertia = - new wxStaticText(this, wxID_ANY, _("Inertia (H)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl4_1->Add(m_staticTextInertia, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextInertia = new wxStaticText(this, wxID_ANY, _("Inertia (H)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl4_1->Add(m_staticTextInertia, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_1->Add(boxSizerLvl5_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlInertia = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlInertia = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlInertia->SetHint(wxT("")); -#endif - - boxSizerLvl5_1->Add(m_textCtrlInertia, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextS_1 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_1->Add(m_staticTextS_1, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_1->Add(m_textCtrlInertia, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextS_1 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_1->Add(m_staticTextS_1, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextDamping = - new wxStaticText(this, wxID_ANY, _("Damping factor"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl4_2->Add(m_staticTextDamping, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextDamping = new wxStaticText(this, wxID_ANY, _("Damping factor"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl4_2->Add(m_staticTextDamping, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_2->Add(boxSizerLvl5_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlDamping = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlDamping = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlDamping->SetHint(wxT("")); -#endif - - boxSizerLvl5_2->Add(m_textCtrlDamping, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_1 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_2->Add(m_staticTextPU_1, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_2->Add(m_textCtrlDamping, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_1 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_2->Add(m_staticTextPU_1, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_3 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_checkBoxUseAVR = - new wxCheckBox(this, wxID_ANY, _("Use AVR"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); + + m_checkBoxUseAVR = new wxCheckBox(this, wxID_ANY, _("Use AVR"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); m_checkBoxUseAVR->SetValue(false); - - boxSizerLvl4_3->Add(m_checkBoxUseAVR, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_buttonEditAVR = - new wxButton(this, wxID_ANY, _("Edit AVR"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl4_3->Add(m_buttonEditAVR, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + boxSizerLvl4_3->Add(m_checkBoxUseAVR, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_buttonEditAVR = new wxButton(this, wxID_ANY, _("Edit AVR"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl4_3->Add(m_buttonEditAVR, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_4 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_checkBoxUseSG = - new wxCheckBox(this, wxID_ANY, _("Use speed governor"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); + + m_checkBoxUseSG = new wxCheckBox(this, wxID_ANY, _("Use speed governor"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); m_checkBoxUseSG->SetValue(false); - - boxSizerLvl4_4->Add(m_checkBoxUseSG, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_buttonEditSG = - new wxButton(this, wxID_ANY, _("Edit speed governor"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl4_4->Add(m_buttonEditSG, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticLine_1 = - new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxLI_HORIZONTAL); - - boxSizerLvl2_1->Add(m_staticLine_1, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl4_4->Add(m_checkBoxUseSG, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_buttonEditSG = new wxButton(this, wxID_ANY, _("Edit speed governor"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl4_4->Add(m_buttonEditSG, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticLine_1 = new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxLI_HORIZONTAL); + + boxSizerLvl2_1->Add(m_staticLine_1, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_2 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_2, 1, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_5 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextRa = new wxStaticText(this, wxID_ANY, _("Armature resistance (Ra)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl4_5->Add(m_staticTextRa, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextRa = new wxStaticText(this, wxID_ANY, _("Armature resistance (Ra)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl4_5->Add(m_staticTextRa, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_3 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_5->Add(boxSizerLvl5_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlRa = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlRa = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlRa->SetHint(wxT("")); -#endif - - boxSizerLvl5_3->Add(m_textCtrlRa, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_2 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_3->Add(m_staticTextPU_2, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_3->Add(m_textCtrlRa, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_2 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_3->Add(m_staticTextPU_2, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_6 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextXp = new wxStaticText(this, wxID_ANY, _("Potier reactance (Xp)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl4_6->Add(m_staticTextXp, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextXp = new wxStaticText(this, wxID_ANY, _("Potier reactance (Xp)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl4_6->Add(m_staticTextXp, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_14 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_6->Add(boxSizerLvl5_14, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlXp = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlXp = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlXp->SetHint(wxT("")); -#endif - - boxSizerLvl5_14->Add(m_textCtrlXp, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_9 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_14->Add(m_staticTextPU_9, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_14->Add(m_textCtrlXp, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_9 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_14->Add(m_staticTextPU_9, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_7 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSat = new wxStaticText(this, wxID_ANY, _("Saturation factor"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl4_7->Add(m_staticTextSat, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextSat = new wxStaticText(this, wxID_ANY, _("Saturation factor"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl4_7->Add(m_staticTextSat, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_15 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_7->Add(boxSizerLvl5_15, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlSat = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlSat = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSat->SetHint(wxT("")); -#endif - - boxSizerLvl5_15->Add(m_textCtrlSat, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_10 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_15->Add(m_staticTextPU_10, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_15->Add(m_textCtrlSat, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_10 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_15->Add(m_staticTextPU_10, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_8 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextOCFreq = new wxStaticText(this, wxID_ANY, _("Open-circuit Frequency"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl4_8->Add(m_staticTextOCFreq, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextOCFreq = new wxStaticText(this, wxID_ANY, _("Open-circuit Frequency"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl4_8->Add(m_staticTextOCFreq, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_16 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_8->Add(boxSizerLvl5_16, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlOCFreq = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlOCFreq = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlOCFreq->SetHint(wxT("")); -#endif - - boxSizerLvl5_16->Add(m_textCtrlOCFreq, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextHz_1 = - new wxStaticText(this, wxID_ANY, _("Hz"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_16->Add(m_staticTextHz_1, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - wxStaticBoxSizer* staticBoxSizerSyncronous = - new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Syncronous")), wxVERTICAL); - - boxSizerLvl2_1->Add(staticBoxSizerSyncronous, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_16->Add(m_textCtrlOCFreq, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextHz_1 = new wxStaticText(this, wxID_ANY, _("Hz"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_16->Add(m_staticTextHz_1, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + wxStaticBoxSizer* staticBoxSizerSyncronous = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Syncronous")), wxVERTICAL); + + boxSizerLvl2_1->Add(staticBoxSizerSyncronous, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl4_3 = new wxGridSizer(0, 2, 0, 0); - + staticBoxSizerSyncronous->Add(gridSizerLvl4_3, 1, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl5_4 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_3->Add(boxSizerLvl5_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSyncXd = new wxStaticText(this, wxID_ANY, _("Direct-axis reactance (Xd)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_4->Add(m_staticTextSyncXd, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextSyncXd = new wxStaticText(this, wxID_ANY, _("Direct-axis reactance (Xd)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_4->Add(m_staticTextSyncXd, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_4->Add(boxSizerLvl6_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlSyncXd = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlSyncXd = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSyncXd->SetHint(wxT("")); -#endif - - boxSizerLvl6_1->Add(m_textCtrlSyncXd, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_3 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_1->Add(m_staticTextPU_3, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_1->Add(m_textCtrlSyncXd, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_3 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_1->Add(m_staticTextPU_3, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_5 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_3->Add(boxSizerLvl5_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSyncXq = new wxStaticText(this, wxID_ANY, _("Quadrature-axis reactance (Xq)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_5->Add(m_staticTextSyncXq, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextSyncXq = new wxStaticText(this, wxID_ANY, _("Quadrature-axis reactance (Xq)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_5->Add(m_staticTextSyncXq, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_5->Add(boxSizerLvl6_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlSyncXq = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlSyncXq = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSyncXq->SetHint(wxT("")); -#endif - - boxSizerLvl6_2->Add(m_textCtrlSyncXq, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_4 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_2->Add(m_staticTextPU_4, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - wxStaticBoxSizer* staticBoxSizerTransient = - new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Transient")), wxVERTICAL); - - boxSizerLvl2_1->Add(staticBoxSizerTransient, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_2->Add(m_textCtrlSyncXq, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_4 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_2->Add(m_staticTextPU_4, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + wxStaticBoxSizer* staticBoxSizerTransient = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Transient")), wxVERTICAL); + + boxSizerLvl2_1->Add(staticBoxSizerTransient, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl4_4 = new wxGridSizer(0, 2, 0, 0); - + staticBoxSizerTransient->Add(gridSizerLvl4_4, 1, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl5_6 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_4->Add(boxSizerLvl5_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextTranXd = new wxStaticText(this, wxID_ANY, _("Direct-axis reactance (X'd)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_6->Add(m_staticTextTranXd, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextTranXd = new wxStaticText(this, wxID_ANY, _("Direct-axis reactance (X'd)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_6->Add(m_staticTextTranXd, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_3 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_6->Add(boxSizerLvl6_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlTranXd = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlTranXd = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlTranXd->SetHint(wxT("")); -#endif - - boxSizerLvl6_3->Add(m_textCtrlTranXd, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_5 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_3->Add(m_staticTextPU_5, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_3->Add(m_textCtrlTranXd, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_5 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_3->Add(m_staticTextPU_5, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_7 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_4->Add(boxSizerLvl5_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextTranXq = new wxStaticText(this, wxID_ANY, _("Quadrature-axis reactance (X'q)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_7->Add(m_staticTextTranXq, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextTranXq = new wxStaticText(this, wxID_ANY, _("Quadrature-axis reactance (X'q)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_7->Add(m_staticTextTranXq, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_4 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_7->Add(boxSizerLvl6_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlTranXq = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlTranXq = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlTranXq->SetHint(wxT("")); -#endif - - boxSizerLvl6_4->Add(m_textCtrlTranXq, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_6 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_4->Add(m_staticTextPU_6, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_4->Add(m_textCtrlTranXq, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_6 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_4->Add(m_staticTextPU_6, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_8 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_4->Add(boxSizerLvl5_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextTranTd0 = new wxStaticText(this, wxID_ANY, _("Direct-axis time constant (T'd0)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_8->Add(m_staticTextTranTd0, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextTranTd0 = new wxStaticText(this, wxID_ANY, _("Direct-axis time constant (T'd0)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_8->Add(m_staticTextTranTd0, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_5 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_8->Add(boxSizerLvl6_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlTranTd0 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlTranTd0 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlTranTd0->SetHint(wxT("")); -#endif - - boxSizerLvl6_5->Add(m_textCtrlTranTd0, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextS_2 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_5->Add(m_staticTextS_2, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_5->Add(m_textCtrlTranTd0, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextS_2 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_5->Add(m_staticTextS_2, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_9 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_4->Add(boxSizerLvl5_9, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextTranTq0 = new wxStaticText(this, wxID_ANY, _("Quadrature-axis time constant (T'q0)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_9->Add(m_staticTextTranTq0, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextTranTq0 = new wxStaticText(this, wxID_ANY, _("Quadrature-axis time constant (T'q0)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_9->Add(m_staticTextTranTq0, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_6 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_9->Add(boxSizerLvl6_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlTranTq0 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlTranTq0 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlTranTq0->SetHint(wxT("")); -#endif - - boxSizerLvl6_6->Add(m_textCtrlTranTq0, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextS_3 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_6->Add(m_staticTextS_3, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - wxStaticBoxSizer* staticBoxSizerSubtransient = - new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Sub-transient")), wxVERTICAL); - - boxSizerLvl2_1->Add(staticBoxSizerSubtransient, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_6->Add(m_textCtrlTranTq0, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextS_3 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_6->Add(m_staticTextS_3, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + wxStaticBoxSizer* staticBoxSizerSubtransient = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Sub-transient")), wxVERTICAL); + + boxSizerLvl2_1->Add(staticBoxSizerSubtransient, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl4_5 = new wxGridSizer(0, 2, 0, 0); - + staticBoxSizerSubtransient->Add(gridSizerLvl4_5, 1, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl5_10 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_5->Add(boxSizerLvl5_10, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSubXd = new wxStaticText(this, wxID_ANY, _("Direct-axis reactance (X''d)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_10->Add(m_staticTextSubXd, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextSubXd = new wxStaticText(this, wxID_ANY, _("Direct-axis reactance (X''d)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_10->Add(m_staticTextSubXd, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_7 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_10->Add(boxSizerLvl6_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlSubXd = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlSubXd = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSubXd->SetHint(wxT("")); -#endif - - boxSizerLvl6_7->Add(m_textCtrlSubXd, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_7 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_7->Add(m_staticTextPU_7, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_7->Add(m_textCtrlSubXd, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_7 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_7->Add(m_staticTextPU_7, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_11 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_5->Add(boxSizerLvl5_11, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSubXq = new wxStaticText(this, wxID_ANY, _("Quadrature-axis reactance (X''q)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_11->Add(m_staticTextSubXq, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextSubXq = new wxStaticText(this, wxID_ANY, _("Quadrature-axis reactance (X''q)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_11->Add(m_staticTextSubXq, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_8 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_11->Add(boxSizerLvl6_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlSubXq = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlSubXq = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSubXq->SetHint(wxT("")); -#endif - - boxSizerLvl6_8->Add(m_textCtrlSubXq, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextPU_8 = - new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_8->Add(m_staticTextPU_8, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_8->Add(m_textCtrlSubXq, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_8 = new wxStaticText(this, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_8->Add(m_staticTextPU_8, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_12 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_5->Add(boxSizerLvl5_12, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSubTd0 = new wxStaticText(this, wxID_ANY, _("Direct-axis time constant (T''d0)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_12->Add(m_staticTextSubTd0, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextSubTd0 = new wxStaticText(this, wxID_ANY, _("Direct-axis time constant (T''d0)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_12->Add(m_staticTextSubTd0, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_9 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_12->Add(boxSizerLvl6_9, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlSubTd0 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlSubTd0 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSubTd0->SetHint(wxT("")); -#endif - - boxSizerLvl6_9->Add(m_textCtrlSubTd0, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextS_4 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_9->Add(m_staticTextS_4, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_9->Add(m_textCtrlSubTd0, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextS_4 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_9->Add(m_staticTextS_4, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_13 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl4_5->Add(boxSizerLvl5_13, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSubTq0 = new wxStaticText(this, wxID_ANY, _("Quadrature-axis time constant (T''q0)"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl5_13->Add(m_staticTextSubTq0, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextSubTq0 = new wxStaticText(this, wxID_ANY, _("Quadrature-axis time constant (T''q0)"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl5_13->Add(m_staticTextSubTq0, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_10 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_13->Add(boxSizerLvl6_10, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlSubTq0 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlSubTq0 = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSubTq0->SetHint(wxT("")); -#endif - - boxSizerLvl6_10->Add(m_textCtrlSubTq0, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextS_5 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl6_10->Add(m_staticTextS_5, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_10->Add(m_textCtrlSubTq0, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextS_5 = new wxStaticText(this, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl6_10->Add(m_staticTextS_5, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerVDivider = new wxBoxSizer(wxVERTICAL); - - boxSizerLvl2_1->Add(boxSizerVDivider, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl2_1->Add(boxSizerVDivider, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerSection_2 = new wxBoxSizer(wxVERTICAL); - - boxSizerVDivider->Add(boxSizerSection_2, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerVDivider->Add(boxSizerSection_2, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerSection_1 = new wxBoxSizer(wxVERTICAL); - - boxSizerVDivider->Add(boxSizerSection_1, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerVDivider->Add(boxSizerSection_1, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonSwitching = - new wxButton(this, wxID_ANY, _("Switching"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonSwitching, 0, wxALL | wxALIGN_LEFT, WXC_FROM_DIP(5)); - - boxSizerBottomButtons->Add(0, 0, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonSwitching = new wxButton(this, wxID_ANY, _("Switching"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonSwitching, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); + + boxSizerBottomButtons->Add(0, 0, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + SetName(wxT("GeneratorStabFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_checkBoxUseAVR->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(GeneratorStabFormBase::UseAVRClick), - NULL, this); - m_buttonEditAVR->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::OnEditAVRButtonClick), NULL, this); - m_checkBoxUseSG->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(GeneratorStabFormBase::UseSGClick), - NULL, this); - m_buttonEditSG->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::OnSpeedGovernorButtonClick), NULL, this); - m_buttonSwitching->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::OnSwitchingButtonClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(GeneratorStabFormBase::OnOKButtonClick), - NULL, this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::OnCancelButtonClick), NULL, this); + m_checkBoxUseAVR->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &GeneratorStabFormBase::UseAVRClick, this); + m_buttonEditAVR->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnEditAVRButtonClick, this); + m_checkBoxUseSG->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &GeneratorStabFormBase::UseSGClick, this); + m_buttonEditSG->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnSpeedGovernorButtonClick, this); + m_buttonSwitching->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnSwitchingButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnOKButtonClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnCancelButtonClick, this); + } GeneratorStabFormBase::~GeneratorStabFormBase() { - m_checkBoxUseAVR->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::UseAVRClick), NULL, this); - m_buttonEditAVR->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::OnEditAVRButtonClick), NULL, this); - m_checkBoxUseSG->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::UseSGClick), NULL, this); - m_buttonEditSG->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::OnSpeedGovernorButtonClick), NULL, this); - m_buttonSwitching->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::OnSwitchingButtonClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(GeneratorStabFormBase::OnOKButtonClick), - NULL, this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(GeneratorStabFormBase::OnCancelButtonClick), NULL, this); + m_checkBoxUseAVR->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &GeneratorStabFormBase::UseAVRClick, this); + m_buttonEditAVR->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnEditAVRButtonClick, this); + m_checkBoxUseSG->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &GeneratorStabFormBase::UseSGClick, this); + m_buttonEditSG->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnSpeedGovernorButtonClick, this); + m_buttonSwitching->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnSwitchingButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnOKButtonClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &GeneratorStabFormBase::OnCancelButtonClick, this); + } -LineFormBase::LineFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +LineFormBase::LineFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlName->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlName->SetMinSize(wxSize(300,-1)); + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_9 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_9, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNominalVoltage = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated voltage"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_9->Add(m_staticTextNominalVoltage, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextNominalVoltageValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("138 kV"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + m_staticTextNominalVoltage = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated voltage"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_9->Add(m_staticTextNominalVoltage, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextNominalVoltageValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("138 kV"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); wxFont m_staticTextNominalVoltageValueFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); m_staticTextNominalVoltageValueFont.SetWeight(wxFONTWEIGHT_BOLD); m_staticTextNominalVoltageValue->SetFont(m_staticTextNominalVoltageValueFont); - - boxSizerLvl4_9->Add(m_staticTextNominalVoltageValue, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + boxSizerLvl4_9->Add(m_staticTextNominalVoltageValue, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_8 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNominalPower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_8->Add(m_staticTextNominalPower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextNominalPower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_8->Add(m_staticTextNominalPower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_5 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_8->Add(boxSizerLvl5_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlNominalPower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlNominalPower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlNominalPower->SetHint(wxT("")); -#endif - - boxSizerLvl5_5->Add(m_textCtrlNominalPower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_5->Add(m_textCtrlNominalPower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceNominalPowerArr; - m_choiceNominalPowerArr.Add(wxT("VA")); - m_choiceNominalPowerArr.Add(wxT("kVA")); - m_choiceNominalPowerArr.Add(wxT("MVA")); - m_choiceNominalPower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceNominalPowerArr, 0); + m_choiceNominalPowerArr.Add(_("VA")); + m_choiceNominalPowerArr.Add(_("kVA")); + m_choiceNominalPowerArr.Add(_("MVA")); + m_choiceNominalPower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceNominalPowerArr, 0); m_choiceNominalPower->SetSelection(2); - - boxSizerLvl5_5->Add(m_choiceNominalPower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_5->Add(m_choiceNominalPower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextResistance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Resistance (R)"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_1->Add(m_staticTextResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextResistance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Resistance (R)"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_1->Add(m_staticTextResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_1->Add(boxSizerLvl5_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlResistance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlResistance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlResistance->SetHint(wxT("")); -#endif - - boxSizerLvl5_1->Add(m_textCtrlResistance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_1->Add(m_textCtrlResistance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceResistanceArr; - m_choiceResistanceArr.Add(wxT("p.u.")); - m_choiceResistanceArr.Add(wxT("Ohm")); - m_choiceResistanceArr.Add(wxT("Ohm/km")); - m_choiceResistance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceResistanceArr, 0); + m_choiceResistanceArr.Add(_("p.u.")); + m_choiceResistanceArr.Add(_("Ohm")); + m_choiceResistanceArr.Add(_("Ohm/km")); + m_choiceResistance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceResistanceArr, 0); m_choiceResistance->SetSelection(0); - - boxSizerLvl5_1->Add(m_choiceResistance, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_1->Add(m_choiceResistance, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Indutive reactance (XL)"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_2->Add(m_staticTextReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextReactance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Indutive reactance (XL)"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_2->Add(m_staticTextReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_2->Add(boxSizerLvl5_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_2->Add(m_textCtrlReactance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_2->Add(m_textCtrlReactance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceReactanceArr; - m_choiceReactanceArr.Add(wxT("p.u.")); - m_choiceReactanceArr.Add(wxT("Ohm")); - m_choiceReactanceArr.Add(wxT("Ohm/km")); - m_choiceReactance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceReactanceArr, 0); + m_choiceReactanceArr.Add(_("p.u.")); + m_choiceReactanceArr.Add(_("Ohm")); + m_choiceReactanceArr.Add(_("Ohm/km")); + m_choiceReactance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceReactanceArr, 0); m_choiceReactance->SetSelection(0); - - boxSizerLvl5_2->Add(m_choiceReactance, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_2->Add(m_choiceReactance, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_3 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSusceptance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Capacitive susceptance (B)"), - wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_3->Add(m_staticTextSusceptance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextSusceptance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Capacitive susceptance (B)"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_3->Add(m_staticTextSusceptance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_3 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_3->Add(boxSizerLvl5_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlSusceptance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlSusceptance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSusceptance->SetHint(wxT("")); -#endif - - boxSizerLvl5_3->Add(m_textCtrlSusceptance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_3->Add(m_textCtrlSusceptance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceSusceptanceArr; - m_choiceSusceptanceArr.Add(wxT("p.u.")); - m_choiceSusceptanceArr.Add(wxT("S")); - m_choiceSusceptanceArr.Add(wxT("S/km")); - m_choiceSusceptance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceSusceptanceArr, 0); + m_choiceSusceptanceArr.Add(_("p.u.")); + m_choiceSusceptanceArr.Add(_("S")); + m_choiceSusceptanceArr.Add(_("S/km")); + m_choiceSusceptance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceSusceptanceArr, 0); m_choiceSusceptance->SetSelection(0); - - boxSizerLvl5_3->Add(m_choiceSusceptance, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_3->Add(m_choiceSusceptance, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_4 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextLineSize = new wxStaticText(m_panelGeneral, wxID_ANY, _("Line size"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_4->Add(m_staticTextLineSize, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextLineSize = new wxStaticText(m_panelGeneral, wxID_ANY, _("Line size"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_4->Add(m_staticTextLineSize, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_4 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_4->Add(boxSizerLvl5_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlLineSize = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlLineSize = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlLineSize->SetHint(wxT("")); -#endif - - boxSizerLvl5_4->Add(m_textCtrlLineSize, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextKM = new wxStaticText(m_panelGeneral, wxID_ANY, _("km"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - + #endif + + boxSizerLvl5_4->Add(m_textCtrlLineSize, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextKM = new wxStaticText(m_panelGeneral, wxID_ANY, _("km"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + boxSizerLvl5_4->Add(m_staticTextKM, 0, wxALL, WXC_FROM_DIP(5)); - - m_checkUseLinePower = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Use line rated power as base"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + m_checkUseLinePower = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Use line rated power as base"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkUseLinePower->SetValue(false); - + boxSizerLvl2_1->Add(m_checkUseLinePower, 0, wxALL, WXC_FROM_DIP(5)); - - m_panelFault = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelFault = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelFault, _("Fault"), false); - + wxBoxSizer* boxSizerLvl2_2 = new wxBoxSizer(wxVERTICAL); m_panelFault->SetSizer(boxSizerLvl2_2); - - wxStaticBoxSizer* staticBoxSizerZeroImpSeq = - new wxStaticBoxSizer(new wxStaticBox(m_panelFault, wxID_ANY, _("Zero-sequence impedances (p.u.)")), wxVERTICAL); - - boxSizerLvl2_2->Add(staticBoxSizerZeroImpSeq, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + wxStaticBoxSizer* staticBoxSizerZeroImpSeq = new wxStaticBoxSizer( new wxStaticBox(m_panelFault, wxID_ANY, _("Zero-sequence impedances (p.u.)")), wxVERTICAL); + + boxSizerLvl2_2->Add(staticBoxSizerZeroImpSeq, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_2 = new wxGridSizer(0, 2, 0, 0); - + staticBoxSizerZeroImpSeq->Add(gridSizerLvl3_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_5 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextZeroResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Resistance (R0)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_5->Add(m_staticTextZeroResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlZeroResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextZeroResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Resistance (R0)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_5->Add(m_staticTextZeroResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlZeroResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlZeroResistance->SetHint(wxT("")); -#endif - - boxSizerLvl4_5->Add(m_textCtrlZeroResistance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_5->Add(m_textCtrlZeroResistance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_6 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextZeroReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Indutive reactance (X0)"), - wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_6->Add(m_staticTextZeroReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlZeroReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextZeroReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Indutive reactance (X0)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_6->Add(m_staticTextZeroReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlZeroReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlZeroReactance->SetHint(wxT("")); -#endif - - boxSizerLvl4_6->Add(m_textCtrlZeroReactance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_6->Add(m_textCtrlZeroReactance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_7 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextZeroSusceptance = new wxStaticText(m_panelFault, wxID_ANY, _("Capacitive susceptance (B0)"), - wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_7->Add(m_staticTextZeroSusceptance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlZeroSusceptance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextZeroSusceptance = new wxStaticText(m_panelFault, wxID_ANY, _("Capacitive susceptance (B0)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_7->Add(m_staticTextZeroSusceptance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlZeroSusceptance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlZeroSusceptance->SetHint(wxT("")); -#endif - - boxSizerLvl4_7->Add(m_textCtrlZeroSusceptance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_7->Add(m_textCtrlZeroSusceptance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonStability = - new wxButton(this, wxID_ANY, _("Stability"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonStability, 0, wxALL | wxALIGN_LEFT, WXC_FROM_DIP(5)); - - boxSizerBottomButtons->Add(0, 0, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonStability = new wxButton(this, wxID_ANY, _("Stability"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonStability, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); + + boxSizerBottomButtons->Add(0, 0, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("LineFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonStability->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(LineFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LineFormBase::OnOKButtonClick), NULL, this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LineFormBase::OnCancelButtonClick), - NULL, this); + m_buttonStability->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LineFormBase::OnStabilityButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LineFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LineFormBase::OnCancelButtonClick, this); + } LineFormBase::~LineFormBase() { - m_buttonStability->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(LineFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LineFormBase::OnOKButtonClick), NULL, - this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LineFormBase::OnCancelButtonClick), - NULL, this); + m_buttonStability->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &LineFormBase::OnStabilityButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &LineFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &LineFormBase::OnCancelButtonClick, this); + } -TransformerFormBase::TransformerFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +TransformerFormBase::TransformerFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlName->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlName->SetMinSize(wxSize(300,-1)); + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNominalVoltage = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated voltage"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_1->Add(m_staticTextNominalVoltage, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextNominalVoltageValue = - new wxStaticText(m_panelGeneral, wxID_ANY, _("138 kV / 138 kV"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + m_staticTextNominalVoltage = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated voltage"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_1->Add(m_staticTextNominalVoltage, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextNominalVoltageValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("138 kV / 138 kV"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); wxFont m_staticTextNominalVoltageValueFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); m_staticTextNominalVoltageValueFont.SetWeight(wxFONTWEIGHT_BOLD); m_staticTextNominalVoltageValue->SetFont(m_staticTextNominalVoltageValueFont); - - boxSizerLvl4_1->Add(m_staticTextNominalVoltageValue, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + boxSizerLvl4_1->Add(m_staticTextNominalVoltageValue, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_5 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextBaseVoltage = new wxStaticText(m_panelGeneral, wxID_ANY, _("Base voltage"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_5->Add(m_staticTextBaseVoltage, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextBaseVoltage = new wxStaticText(m_panelGeneral, wxID_ANY, _("Base voltage"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_5->Add(m_staticTextBaseVoltage, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceBaseVoltageArr; - m_choiceBaseVoltageArr.Add(wxT("138 kV")); - m_choiceBaseVoltageArr.Add(wxT("138 kV")); - m_choiceBaseVoltage = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceBaseVoltageArr, 0); + m_choiceBaseVoltageArr.Add(_("138 kV")); + m_choiceBaseVoltageArr.Add(_("138 kV")); + m_choiceBaseVoltage = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceBaseVoltageArr, 0); m_choiceBaseVoltage->SetSelection(0); - - boxSizerLvl4_5->Add(m_choiceBaseVoltage, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl4_5->Add(m_choiceBaseVoltage, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNominalPower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_2->Add(m_staticTextNominalPower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextNominalPower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_2->Add(m_staticTextNominalPower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_2->Add(boxSizerLvl5_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlNominalPower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlNominalPower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlNominalPower->SetHint(wxT("")); -#endif - - boxSizerLvl5_1->Add(m_textCtrlNominalPower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_1->Add(m_textCtrlNominalPower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceNominalPowerArr; - m_choiceNominalPowerArr.Add(wxT("VA")); - m_choiceNominalPowerArr.Add(wxT("kVA")); - m_choiceNominalPowerArr.Add(wxT("MVA")); - m_choiceNominalPower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceNominalPowerArr, 0); + m_choiceNominalPowerArr.Add(_("VA")); + m_choiceNominalPowerArr.Add(_("kVA")); + m_choiceNominalPowerArr.Add(_("MVA")); + m_choiceNominalPower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceNominalPowerArr, 0); m_choiceNominalPower->SetSelection(2); - - boxSizerLvl5_1->Add(m_choiceNominalPower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_1->Add(m_choiceNominalPower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + gridSizerLvl3_1->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_3 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextResistance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Resistance (R)"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_3->Add(m_staticTextResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextResistance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Resistance (R)"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_3->Add(m_staticTextResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_3->Add(boxSizerLvl5_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlResistance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlResistance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlResistance->SetHint(wxT("")); -#endif - - boxSizerLvl5_2->Add(m_textCtrlResistance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_2->Add(m_textCtrlResistance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceResistanceArr; - m_choiceResistanceArr.Add(wxT("p.u.")); - m_choiceResistanceArr.Add(wxT("Ohm")); - m_choiceResistance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceResistanceArr, 0); + m_choiceResistanceArr.Add(_("p.u.")); + m_choiceResistanceArr.Add(_("Ohm")); + m_choiceResistance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceResistanceArr, 0); m_choiceResistance->SetSelection(0); - - boxSizerLvl5_2->Add(m_choiceResistance, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_2->Add(m_choiceResistance, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_4 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Indutive reactance (XL)"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_4->Add(m_staticTextReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextReactance = new wxStaticText(m_panelGeneral, wxID_ANY, _("Indutive reactance (XL)"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_4->Add(m_staticTextReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_3 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_4->Add(boxSizerLvl5_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactance = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_3->Add(m_textCtrlReactance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_3->Add(m_textCtrlReactance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceReactanceArr; - m_choiceReactanceArr.Add(wxT("p.u.")); - m_choiceReactanceArr.Add(wxT("Ohm")); - m_choiceReactance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceReactanceArr, 0); + m_choiceReactanceArr.Add(_("p.u.")); + m_choiceReactanceArr.Add(_("Ohm")); + m_choiceReactance = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceReactanceArr, 0); m_choiceReactance->SetSelection(0); - - boxSizerLvl5_3->Add(m_choiceReactance, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - - m_staticLine_1 = new wxStaticLine(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), wxLI_HORIZONTAL); - - boxSizerLvl2_1->Add(m_staticLine_1, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl5_3->Add(m_choiceReactance, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + + m_staticLine_1 = new wxStaticLine(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), wxLI_HORIZONTAL); + + boxSizerLvl2_1->Add(m_staticLine_1, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl3_1 = new wxBoxSizer(wxVERTICAL); - + boxSizerLvl2_1->Add(boxSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextConnection = new wxStaticText(m_panelGeneral, wxID_ANY, _("Connection"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl3_1->Add(m_staticTextConnection, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextConnection = new wxStaticText(m_panelGeneral, wxID_ANY, _("Connection"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl3_1->Add(m_staticTextConnection, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceConnectionArr; - m_choiceConnectionArr.Add(wxT("Grounded Wye - Grounded Wye")); - m_choiceConnectionArr.Add(wxT("Wye - Grounded Wye")); - m_choiceConnectionArr.Add(wxT("Grounded Wye - Wye")); - m_choiceConnectionArr.Add(wxT("Wye - Wye")); - m_choiceConnectionArr.Add(wxT("Delta - Grounded Wye")); - m_choiceConnectionArr.Add(wxT("Delta - Wye")); - m_choiceConnectionArr.Add(wxT("Grounded Wye - Delta")); - m_choiceConnectionArr.Add(wxT("Wye - Delta")); - m_choiceConnectionArr.Add(wxT("Delta - Delta")); - m_choiceConnection = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceConnectionArr, 0); + m_choiceConnectionArr.Add(_("Grounded Wye - Grounded Wye")); + m_choiceConnectionArr.Add(_("Wye - Grounded Wye")); + m_choiceConnectionArr.Add(_("Grounded Wye - Wye")); + m_choiceConnectionArr.Add(_("Wye - Wye")); + m_choiceConnectionArr.Add(_("Delta - Grounded Wye")); + m_choiceConnectionArr.Add(_("Delta - Wye")); + m_choiceConnectionArr.Add(_("Grounded Wye - Delta")); + m_choiceConnectionArr.Add(_("Wye - Delta")); + m_choiceConnectionArr.Add(_("Delta - Delta")); + m_choiceConnection = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceConnectionArr, 0); m_choiceConnection->SetSelection(0); - - boxSizerLvl3_1->Add(m_choiceConnection, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl3_1->Add(m_choiceConnection, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_2 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_6 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextTurnsRatio = new wxStaticText(m_panelGeneral, wxID_ANY, _("Turns ratio"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_6->Add(m_staticTextTurnsRatio, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlTurnRatio = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextTurnsRatio = new wxStaticText(m_panelGeneral, wxID_ANY, _("Turns ratio"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_6->Add(m_staticTextTurnsRatio, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlTurnRatio = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlTurnRatio->SetHint(wxT("")); -#endif - - boxSizerLvl4_6->Add(m_textCtrlTurnRatio, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_6->Add(m_textCtrlTurnRatio, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_7 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextPhaseShift = new wxStaticText(m_panelGeneral, wxID_ANY, _("Phase shift"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_7->Add(m_staticTextPhaseShift, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextPhaseShift = new wxStaticText(m_panelGeneral, wxID_ANY, _("Phase shift"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_7->Add(m_staticTextPhaseShift, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_4 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_7->Add(boxSizerLvl5_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlPhaseShift = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlPhaseShift = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlPhaseShift->SetHint(wxT("")); -#endif - - boxSizerLvl5_4->Add(m_textCtrlPhaseShift, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextDeg = new wxStaticText(m_panelGeneral, wxID_ANY, _("degrees"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - + #endif + + boxSizerLvl5_4->Add(m_textCtrlPhaseShift, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextDeg = new wxStaticText(m_panelGeneral, wxID_ANY, _("degrees"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + boxSizerLvl5_4->Add(m_staticTextDeg, 0, wxALL, WXC_FROM_DIP(5)); - - m_checkUseTransformerPower = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Use transformer rated power as base"), - wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + m_checkUseTransformerPower = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Use transformer rated power as base"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkUseTransformerPower->SetValue(false); - + boxSizerLvl2_1->Add(m_checkUseTransformerPower, 0, wxALL, WXC_FROM_DIP(5)); - - m_panelFault = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelFault = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelFault, _("Fault"), false); - + wxBoxSizer* boxSizerLvl2_2 = new wxBoxSizer(wxVERTICAL); m_panelFault->SetSizer(boxSizerLvl2_2); - - wxStaticBoxSizer* staticBoxSizerZeroImpSeq = - new wxStaticBoxSizer(new wxStaticBox(m_panelFault, wxID_ANY, _("Zero-sequence impedances (p.u.)")), wxVERTICAL); - - boxSizerLvl2_2->Add(staticBoxSizerZeroImpSeq, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + wxStaticBoxSizer* staticBoxSizerZeroImpSeq = new wxStaticBoxSizer( new wxStaticBox(m_panelFault, wxID_ANY, _("Zero-sequence impedances (p.u.)")), wxVERTICAL); + + boxSizerLvl2_2->Add(staticBoxSizerZeroImpSeq, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_3 = new wxGridSizer(0, 2, 0, 0); - + staticBoxSizerZeroImpSeq->Add(gridSizerLvl3_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_8 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_3->Add(boxSizerLvl4_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextZeroResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Resistance (R0)"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_8->Add(m_staticTextZeroResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlZeroResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 - m_textCtrlZeroResistance->SetHint(wxT("")); -#endif - - boxSizerLvl4_8->Add(m_textCtrlZeroResistance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextZeroResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Resistance (R0)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_8->Add(m_staticTextZeroResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlZeroResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 + m_textCtrlZeroResistance->SetHint(wxT("")); + #endif + + boxSizerLvl4_8->Add(m_textCtrlZeroResistance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_9 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_3->Add(boxSizerLvl4_9, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextZeroReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Indutive reactance (X0)"), - wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_9->Add(m_staticTextZeroReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlZeroReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextZeroReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Indutive reactance (X0)"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_9->Add(m_staticTextZeroReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlZeroReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlZeroReactance->SetHint(wxT("")); -#endif - - boxSizerLvl4_9->Add(m_textCtrlZeroReactance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - wxStaticBoxSizer* staticBoxSizerGroundImpedances = - new wxStaticBoxSizer(new wxStaticBox(m_panelFault, wxID_ANY, _("Ground impedances (p.u.)")), wxVERTICAL); - - boxSizerLvl2_2->Add(staticBoxSizerGroundImpedances, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_9->Add(m_textCtrlZeroReactance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + wxStaticBoxSizer* staticBoxSizerGroundImpedances = new wxStaticBoxSizer( new wxStaticBox(m_panelFault, wxID_ANY, _("Ground impedances (p.u.)")), wxVERTICAL); + + boxSizerLvl2_2->Add(staticBoxSizerGroundImpedances, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_4 = new wxGridSizer(0, 2, 0, 0); - + staticBoxSizerGroundImpedances->Add(gridSizerLvl3_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_10 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_4->Add(boxSizerLvl4_10, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextPrimResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Primary resistance"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_10->Add(m_staticTextPrimResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlPrimResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextPrimResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Primary resistance"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_10->Add(m_staticTextPrimResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlPrimResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlPrimResistance->SetHint(wxT("")); -#endif - - boxSizerLvl4_10->Add(m_textCtrlPrimResistance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_10->Add(m_textCtrlPrimResistance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_11 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_4->Add(boxSizerLvl4_11, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextPrimReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Primary reactance"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_11->Add(m_staticTextPrimReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlPrimReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextPrimReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Primary reactance"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_11->Add(m_staticTextPrimReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlPrimReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlPrimReactance->SetHint(wxT("")); -#endif - - boxSizerLvl4_11->Add(m_textCtrlPrimReactance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_11->Add(m_textCtrlPrimReactance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_12 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_4->Add(boxSizerLvl4_12, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSecResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Secondary resistance"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_12->Add(m_staticTextSecResistance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlSecResistance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextSecResistance = new wxStaticText(m_panelFault, wxID_ANY, _("Secondary resistance"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_12->Add(m_staticTextSecResistance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlSecResistance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSecResistance->SetHint(wxT("")); -#endif - - boxSizerLvl4_12->Add(m_textCtrlSecResistance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_12->Add(m_textCtrlSecResistance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_13 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_4->Add(boxSizerLvl4_13, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextSecReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Secondary reactance"), wxDefaultPosition, - wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); - - boxSizerLvl4_13->Add(m_staticTextSecReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlSecReactance = - new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextSecReactance = new wxStaticText(m_panelFault, wxID_ANY, _("Secondary reactance"), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + + boxSizerLvl4_13->Add(m_staticTextSecReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlSecReactance = new wxTextCtrl(m_panelFault, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelFault, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSecReactance->SetHint(wxT("")); -#endif - - boxSizerLvl4_13->Add(m_textCtrlSecReactance, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_13->Add(m_textCtrlSecReactance, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonStability = - new wxButton(this, wxID_ANY, _("Stability"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonStability, 0, wxALL | wxALIGN_LEFT, WXC_FROM_DIP(5)); - - boxSizerBottomButtons->Add(0, 0, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonStability = new wxButton(this, wxID_ANY, _("Stability"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonStability, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); + + boxSizerBottomButtons->Add(0, 0, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("TransformerFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonStability->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(TransformerFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TransformerFormBase::OnOKButtonClick), NULL, - this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(TransformerFormBase::OnCancelButtonClick), NULL, this); + m_buttonStability->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &TransformerFormBase::OnStabilityButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &TransformerFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &TransformerFormBase::OnCancelButtonClick, this); + } TransformerFormBase::~TransformerFormBase() { - m_buttonStability->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(TransformerFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TransformerFormBase::OnOKButtonClick), - NULL, this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(TransformerFormBase::OnCancelButtonClick), NULL, this); + m_buttonStability->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &TransformerFormBase::OnStabilityButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &TransformerFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &TransformerFormBase::OnCancelButtonClick, this); + } -LoadFormBase::LoadFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +LoadFormBase::LoadFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlName->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlName->SetMinSize(wxSize(300,-1)); + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextActivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Active power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_1->Add(m_staticTextActivePower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextActivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Active power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_1->Add(m_staticTextActivePower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_1->Add(boxSizerLvl5_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlActivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlActivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlActivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_1->Add(m_textCtrlActivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_1->Add(m_textCtrlActivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceActivePowerArr; - m_choiceActivePowerArr.Add(wxT("p.u.")); - m_choiceActivePowerArr.Add(wxT("W")); - m_choiceActivePowerArr.Add(wxT("kW")); - m_choiceActivePowerArr.Add(wxT("MW")); - m_choiceActivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceActivePowerArr, 0); + m_choiceActivePowerArr.Add(_("p.u.")); + m_choiceActivePowerArr.Add(_("W")); + m_choiceActivePowerArr.Add(_("kW")); + m_choiceActivePowerArr.Add(_("MW")); + m_choiceActivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceActivePowerArr, 0); m_choiceActivePower->SetSelection(3); - - boxSizerLvl5_1->Add(m_choiceActivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_1->Add(m_choiceActivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Reactive power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_2->Add(m_staticTextReactivePower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextReactivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Reactive power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_2->Add(m_staticTextReactivePower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_2->Add(boxSizerLvl5_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_2->Add(m_textCtrlReactivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_2->Add(m_textCtrlReactivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceReactivePowerArr; - m_choiceReactivePowerArr.Add(wxT("p.u.")); - m_choiceReactivePowerArr.Add(wxT("VAr")); - m_choiceReactivePowerArr.Add(wxT("kVAr")); - m_choiceReactivePowerArr.Add(wxT("MVAr")); - m_choiceReactivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceReactivePowerArr, 0); + m_choiceReactivePowerArr.Add(_("p.u.")); + m_choiceReactivePowerArr.Add(_("VAr")); + m_choiceReactivePowerArr.Add(_("kVAr")); + m_choiceReactivePowerArr.Add(_("MVAr")); + m_choiceReactivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceReactivePowerArr, 0); m_choiceReactivePower->SetSelection(3); - - boxSizerLvl5_2->Add(m_choiceReactivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - - m_staticTextType = new wxStaticText(m_panelGeneral, wxID_ANY, _("Load type (power flow)"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextType, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + boxSizerLvl5_2->Add(m_choiceReactivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + + m_staticTextType = new wxStaticText(m_panelGeneral, wxID_ANY, _("Load type (power flow)"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextType, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceTypeArr; - m_choiceTypeArr.Add(wxT("Constant power")); - m_choiceTypeArr.Add(wxT("Constant impedance")); - m_choiceType = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), - m_choiceTypeArr, 0); + m_choiceTypeArr.Add(_("Constant power")); + m_choiceTypeArr.Add(_("Constant impedance")); + m_choiceType = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceTypeArr, 0); m_choiceType->SetSelection(0); - - boxSizerLvl2_1->Add(m_choiceType, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - - m_panelStability = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + boxSizerLvl2_1->Add(m_choiceType, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + + m_panelStability = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelStability, _("Stability"), false); - + wxBoxSizer* boxSizerLvl2_2 = new wxBoxSizer(wxVERTICAL); m_panelStability->SetSizer(boxSizerLvl2_2); - - m_checkBoxPlotData = new wxCheckBox(m_panelStability, wxID_ANY, _("Plot load data"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); + + m_checkBoxPlotData = new wxCheckBox(m_panelStability, wxID_ANY, _("Plot load data"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); m_checkBoxPlotData->SetValue(false); - - boxSizerLvl2_2->Add(m_checkBoxPlotData, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_checkBoxUseCompLoad = new wxCheckBox(m_panelStability, wxID_ANY, _("Use ZIP load composition"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); + + boxSizerLvl2_2->Add(m_checkBoxPlotData, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_checkBoxUseCompLoad = new wxCheckBox(m_panelStability, wxID_ANY, _("Use ZIP load composition"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); m_checkBoxUseCompLoad->SetValue(false); - + boxSizerLvl2_2->Add(m_checkBoxUseCompLoad, 0, wxALL, WXC_FROM_DIP(5)); - + wxGridSizer* gridSizerLvl3_2 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_2->Add(gridSizerLvl3_2, 1, wxEXPAND, WXC_FROM_DIP(5)); - - wxStaticBoxSizer* staticBoxSizerLvl4_3 = - new wxStaticBoxSizer(new wxStaticBox(m_panelStability, wxID_ANY, _("Active power")), wxVERTICAL); - - gridSizerLvl3_2->Add(staticBoxSizerLvl4_3, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + wxStaticBoxSizer* staticBoxSizerLvl4_3 = new wxStaticBoxSizer( new wxStaticBox(m_panelStability, wxID_ANY, _("Active power")), wxVERTICAL); + + gridSizerLvl3_2->Add(staticBoxSizerLvl4_3, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_3 = new wxBoxSizer(wxVERTICAL); - + staticBoxSizerLvl4_3->Add(boxSizerLvl5_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextActivePowerImp = new wxStaticText(m_panelStability, wxID_ANY, _("Constant impedance"), - wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_3->Add(m_staticTextActivePowerImp, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextActivePowerImp = new wxStaticText(m_panelStability, wxID_ANY, _("Constant impedance"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_3->Add(m_staticTextActivePowerImp, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_3->Add(boxSizerLvl6_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlActivePowerImp = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("100"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlActivePowerImp = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("100"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlActivePowerImp->SetHint(wxT("")); -#endif - - boxSizerLvl6_1->Add(m_textCtrlActivePowerImp, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPerc_1 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl6_1->Add(m_staticTextPerc_1, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_1->Add(m_textCtrlActivePowerImp, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPerc_1 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl6_1->Add(m_staticTextPerc_1, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_4 = new wxBoxSizer(wxVERTICAL); - + staticBoxSizerLvl4_3->Add(boxSizerLvl5_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextActivePowerCur = new wxStaticText(m_panelStability, wxID_ANY, _("Constant current"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_4->Add(m_staticTextActivePowerCur, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextActivePowerCur = new wxStaticText(m_panelStability, wxID_ANY, _("Constant current"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_4->Add(m_staticTextActivePowerCur, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_4->Add(boxSizerLvl6_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlActivePowerCur = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("0"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlActivePowerCur = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("0"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlActivePowerCur->SetHint(wxT("")); -#endif - - boxSizerLvl6_2->Add(m_textCtrlActivePowerCur, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPerc_2 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl6_2->Add(m_staticTextPerc_2, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_2->Add(m_textCtrlActivePowerCur, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPerc_2 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl6_2->Add(m_staticTextPerc_2, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_5 = new wxBoxSizer(wxVERTICAL); - + staticBoxSizerLvl4_3->Add(boxSizerLvl5_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextActivePowerPow = new wxStaticText(m_panelStability, wxID_ANY, _("Constant power"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_5->Add(m_staticTextActivePowerPow, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextActivePowerPow = new wxStaticText(m_panelStability, wxID_ANY, _("Constant power"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_5->Add(m_staticTextActivePowerPow, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_3 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_5->Add(boxSizerLvl6_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlActivePowerPow = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("0"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlActivePowerPow = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("0"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlActivePowerPow->SetHint(wxT("")); -#endif - - boxSizerLvl6_3->Add(m_textCtrlActivePowerPow, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPerc_3 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl6_3->Add(m_staticTextPerc_3, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - wxStaticBoxSizer* staticBoxSizerLvl4_4 = - new wxStaticBoxSizer(new wxStaticBox(m_panelStability, wxID_ANY, _("Reactive power")), wxVERTICAL); - - gridSizerLvl3_2->Add(staticBoxSizerLvl4_4, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_3->Add(m_textCtrlActivePowerPow, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPerc_3 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl6_3->Add(m_staticTextPerc_3, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + wxStaticBoxSizer* staticBoxSizerLvl4_4 = new wxStaticBoxSizer( new wxStaticBox(m_panelStability, wxID_ANY, _("Reactive power")), wxVERTICAL); + + gridSizerLvl3_2->Add(staticBoxSizerLvl4_4, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_6 = new wxBoxSizer(wxVERTICAL); - + staticBoxSizerLvl4_4->Add(boxSizerLvl5_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactivePowerImp = new wxStaticText(m_panelStability, wxID_ANY, _("Constant impedance"), - wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_6->Add(m_staticTextReactivePowerImp, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextReactivePowerImp = new wxStaticText(m_panelStability, wxID_ANY, _("Constant impedance"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_6->Add(m_staticTextReactivePowerImp, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_4 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_6->Add(boxSizerLvl6_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactivePowerImp = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("100"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactivePowerImp = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("100"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactivePowerImp->SetHint(wxT("")); -#endif - - boxSizerLvl6_4->Add(m_textCtrlReactivePowerImp, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPerc_4 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl6_4->Add(m_staticTextPerc_4, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_4->Add(m_textCtrlReactivePowerImp, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPerc_4 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl6_4->Add(m_staticTextPerc_4, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_7 = new wxBoxSizer(wxVERTICAL); - + staticBoxSizerLvl4_4->Add(boxSizerLvl5_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactivePowerCur = new wxStaticText(m_panelStability, wxID_ANY, _("Constant current"), - wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_7->Add(m_staticTextReactivePowerCur, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextReactivePowerCur = new wxStaticText(m_panelStability, wxID_ANY, _("Constant current"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_7->Add(m_staticTextReactivePowerCur, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_5 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_7->Add(boxSizerLvl6_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactivePowerCur = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("0"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactivePowerCur = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("0"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactivePowerCur->SetHint(wxT("")); -#endif - - boxSizerLvl6_5->Add(m_textCtrlReactivePowerCur, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPerc_5 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl6_5->Add(m_staticTextPerc_5, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_5->Add(m_textCtrlReactivePowerCur, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPerc_5 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl6_5->Add(m_staticTextPerc_5, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_8 = new wxBoxSizer(wxVERTICAL); - + staticBoxSizerLvl4_4->Add(boxSizerLvl5_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactivePowerPow = new wxStaticText(m_panelStability, wxID_ANY, _("Constant power"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_8->Add(m_staticTextReactivePowerPow, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextReactivePowerPow = new wxStaticText(m_panelStability, wxID_ANY, _("Constant power"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_8->Add(m_staticTextReactivePowerPow, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl6_6 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl5_8->Add(boxSizerLvl6_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactivePowerPow = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("0"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactivePowerPow = new wxTextCtrl(m_panelStability, wxID_ANY, wxT("0"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactivePowerPow->SetHint(wxT("")); -#endif - - boxSizerLvl6_6->Add(m_textCtrlReactivePowerPow, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPerc_6 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl6_6->Add(m_staticTextPerc_6, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl6_6->Add(m_textCtrlReactivePowerPow, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPerc_6 = new wxStaticText(m_panelStability, wxID_ANY, _("%"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl6_6->Add(m_staticTextPerc_6, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonStabButton = - new wxButton(this, wxID_ANY, _("Switching"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonStabButton, 0, wxALL | wxALIGN_LEFT, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonStabButton = new wxButton(this, wxID_ANY, _("Switching"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonStabButton, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("LoadFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_checkBoxUseCompLoad->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(LoadFormBase::OnCheckBoxCompLoadClick), NULL, this); - m_buttonStabButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(LoadFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LoadFormBase::OnOnButtonClick), NULL, this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LoadFormBase::OnCancelButtonClick), - NULL, this); + m_checkBoxUseCompLoad->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &LoadFormBase::OnCheckBoxCompLoadClick, this); + m_buttonStabButton->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoadFormBase::OnStabilityButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoadFormBase::OnOnButtonClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LoadFormBase::OnCancelButtonClick, this); + } LoadFormBase::~LoadFormBase() { - m_checkBoxUseCompLoad->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(LoadFormBase::OnCheckBoxCompLoadClick), NULL, this); - m_buttonStabButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(LoadFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LoadFormBase::OnOnButtonClick), NULL, - this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LoadFormBase::OnCancelButtonClick), - NULL, this); + m_checkBoxUseCompLoad->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &LoadFormBase::OnCheckBoxCompLoadClick, this); + m_buttonStabButton->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &LoadFormBase::OnStabilityButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &LoadFormBase::OnOnButtonClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &LoadFormBase::OnCancelButtonClick, this); + } -ReactiveShuntElementFormBase::ReactiveShuntElementFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +ReactiveShuntElementFormBase::ReactiveShuntElementFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlName->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlName->SetMinSize(wxSize(300,-1)); + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Reactive power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_2->Add(m_staticTextReactivePower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextReactivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Reactive power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_2->Add(m_staticTextReactivePower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_2->Add(boxSizerLvl5_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_2->Add(m_textCtrlReactivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_2->Add(m_textCtrlReactivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceReactivePowerArr; - m_choiceReactivePowerArr.Add(wxT("p.u.")); - m_choiceReactivePowerArr.Add(wxT("VAr")); - m_choiceReactivePowerArr.Add(wxT("kVAr")); - m_choiceReactivePowerArr.Add(wxT("MVAr")); - m_choiceReactivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceReactivePowerArr, 0); + m_choiceReactivePowerArr.Add(_("p.u.")); + m_choiceReactivePowerArr.Add(_("VAr")); + m_choiceReactivePowerArr.Add(_("kVAr")); + m_choiceReactivePowerArr.Add(_("MVAr")); + m_choiceReactivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceReactivePowerArr, 0); m_choiceReactivePower->SetSelection(3); - - boxSizerLvl5_2->Add(m_choiceReactivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_2->Add(m_choiceReactivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonStabButton = - new wxButton(this, wxID_ANY, _("Stability"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonStabButton, 0, wxALL | wxALIGN_LEFT, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonStabButton = new wxButton(this, wxID_ANY, _("Stability"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonStabButton, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("ReactiveShuntElementFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonStabButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ReactiveShuntElementFormBase::OnStabilityButtonClick), NULL, - this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ReactiveShuntElementFormBase::OnOKButtonClick), NULL, this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ReactiveShuntElementFormBase::OnCancelButtonClick), NULL, this); + m_buttonStabButton->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ReactiveShuntElementFormBase::OnStabilityButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ReactiveShuntElementFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ReactiveShuntElementFormBase::OnCancelButtonClick, this); + } ReactiveShuntElementFormBase::~ReactiveShuntElementFormBase() { - m_buttonStabButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ReactiveShuntElementFormBase::OnStabilityButtonClick), NULL, - this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ReactiveShuntElementFormBase::OnOKButtonClick), NULL, this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ReactiveShuntElementFormBase::OnCancelButtonClick), NULL, this); + m_buttonStabButton->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &ReactiveShuntElementFormBase::OnStabilityButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &ReactiveShuntElementFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &ReactiveShuntElementFormBase::OnCancelButtonClick, this); + } -SwitchingFormBase::SwitchingFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +SwitchingFormBase::SwitchingFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl1_1->Add(boxSizerLvl2_1, 0, wxALL, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl3_1 = new wxBoxSizer(wxVERTICAL); - - boxSizerLvl2_1->Add(boxSizerLvl3_1, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl2_1->Add(boxSizerLvl3_1, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxArrayString m_pgMgrSwitchingsPropArr; wxUnusedVar(m_pgMgrSwitchingsPropArr); wxArrayInt m_pgMgrSwitchingsPropIntArr; wxUnusedVar(m_pgMgrSwitchingsPropIntArr); - m_pgMgrSwitchingsProp = - new wxPropertyGridManager(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), - wxPG_STATIC_LAYOUT | wxPG_SPLITTER_AUTO_CENTER | wxPG_BOLD_MODIFIED); - + m_pgMgrSwitchingsProp = new wxPropertyGridManager(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxPG_STATIC_LAYOUT|wxPG_SPLITTER_AUTO_CENTER|wxPG_BOLD_MODIFIED); + boxSizerLvl3_1->Add(m_pgMgrSwitchingsProp, 1, wxALL, WXC_FROM_DIP(5)); - - m_pgPropTitle = m_pgMgrSwitchingsProp->Append(new wxPropertyCategory(_("Switching properties"))); + + m_pgPropTitle = m_pgMgrSwitchingsProp->Append( new wxPropertyCategory( _("Switching properties") ) ); m_pgPropTitle->SetHelpString(wxT("")); - + m_pgMgrSwitchingsPropArr.Clear(); m_pgMgrSwitchingsPropIntArr.Clear(); m_pgMgrSwitchingsPropArr.Add(_("Insert")); m_pgMgrSwitchingsPropArr.Add(_("Remove")); - m_pgPropType = m_pgMgrSwitchingsProp->Append( - new wxEnumProperty(_("Type"), wxPG_LABEL, m_pgMgrSwitchingsPropArr, m_pgMgrSwitchingsPropIntArr, 0)); + m_pgPropType = m_pgMgrSwitchingsProp->Append( new wxEnumProperty( _("Type"), wxPG_LABEL, m_pgMgrSwitchingsPropArr, m_pgMgrSwitchingsPropIntArr, 0) ); m_pgPropType->SetHelpString(wxT("")); - - m_pgPropTime = m_pgMgrSwitchingsProp->Append(new wxFloatProperty(_("Time (s)"), wxPG_LABEL, 0)); + + m_pgPropTime = m_pgMgrSwitchingsProp->Append( new wxFloatProperty( _("Time (s)"), wxPG_LABEL, 0) ); m_pgPropTime->SetHelpString(wxT("")); - m_pgMgrSwitchingsProp->SetMinSize(wxSize(150, -1)); - + m_pgMgrSwitchingsProp->SetMinSize(wxSize(150,-1)); + wxBoxSizer* boxSizerLvl3_3 = new wxBoxSizer(wxVERTICAL); - - boxSizerLvl2_1->Add(boxSizerLvl3_3, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_buttonInsert = new wxButton(this, wxID_ANY, _("Add"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl3_3->Add(m_buttonInsert, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonRemove = new wxButton(this, wxID_ANY, _("Remove"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl3_3->Add(m_buttonRemove, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonUp = new wxButton(this, wxID_ANY, _("Up"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl3_3->Add(m_buttonUp, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonDown = new wxButton(this, wxID_ANY, _("Down"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl3_3->Add(m_buttonDown, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - + + boxSizerLvl2_1->Add(boxSizerLvl3_3, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_buttonInsert = new wxButton(this, wxID_ANY, _("Add"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl3_3->Add(m_buttonInsert, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonRemove = new wxButton(this, wxID_ANY, _("Remove"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl3_3->Add(m_buttonRemove, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonUp = new wxButton(this, wxID_ANY, _("Up"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl3_3->Add(m_buttonUp, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonDown = new wxButton(this, wxID_ANY, _("Down"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl3_3->Add(m_buttonDown, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl3_2 = new wxBoxSizer(wxVERTICAL); - + boxSizerLvl2_1->Add(boxSizerLvl3_2, 0, wxALL, WXC_FROM_DIP(5)); - - m_staticTextSwList = - new wxStaticText(this, wxID_ANY, _("Switching list"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl3_2->Add(m_staticTextSwList, 0, wxLEFT | wxRIGHT | wxTOP, WXC_FROM_DIP(5)); - - m_listCtrlSwitchings = - new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxLC_REPORT); - - boxSizerLvl3_2->Add(m_listCtrlSwitchings, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + m_staticTextSwList = new wxStaticText(this, wxID_ANY, _("Switching list"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl3_2->Add(m_staticTextSwList, 0, wxLEFT|wxRIGHT|wxTOP, WXC_FROM_DIP(5)); + + m_listCtrlSwitchings = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxLC_REPORT); + + boxSizerLvl3_2->Add(m_listCtrlSwitchings, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + SetName(wxT("SwitchingFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_pgMgrSwitchingsProp->Connect(wxEVT_PG_CHANGED, wxPropertyGridEventHandler(SwitchingFormBase::OnChangeProperties), - NULL, this); - m_buttonInsert->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnInsertButtonClick), - NULL, this); - m_buttonRemove->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnRemoveButtonClick), - NULL, this); - m_buttonUp->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnUpButtonClick), NULL, - this); - m_buttonDown->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnDownButtonClick), - NULL, this); - m_listCtrlSwitchings->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(SwitchingFormBase::OnSelectItem), - NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnOKButtonClick), NULL, - this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnCancelButtonClick), - NULL, this); + m_pgMgrSwitchingsProp->Bind(wxEVT_PG_CHANGED, &SwitchingFormBase::OnChangeProperties, this); + m_buttonInsert->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnInsertButtonClick, this); + m_buttonRemove->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnRemoveButtonClick, this); + m_buttonUp->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnUpButtonClick, this); + m_buttonDown->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnDownButtonClick, this); + m_listCtrlSwitchings->Bind(wxEVT_COMMAND_LIST_ITEM_SELECTED, &SwitchingFormBase::OnSelectItem, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnCancelButtonClick, this); + } SwitchingFormBase::~SwitchingFormBase() { - m_pgMgrSwitchingsProp->Disconnect(wxEVT_PG_CHANGED, - wxPropertyGridEventHandler(SwitchingFormBase::OnChangeProperties), NULL, this); - m_buttonInsert->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(SwitchingFormBase::OnInsertButtonClick), NULL, this); - m_buttonRemove->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(SwitchingFormBase::OnRemoveButtonClick), NULL, this); - m_buttonUp->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnUpButtonClick), - NULL, this); - m_buttonDown->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnDownButtonClick), - NULL, this); - m_listCtrlSwitchings->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, - wxListEventHandler(SwitchingFormBase::OnSelectItem), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SwitchingFormBase::OnOKButtonClick), - NULL, this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(SwitchingFormBase::OnCancelButtonClick), NULL, this); + m_pgMgrSwitchingsProp->Unbind(wxEVT_PG_CHANGED, &SwitchingFormBase::OnChangeProperties, this); + m_buttonInsert->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnInsertButtonClick, this); + m_buttonRemove->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnRemoveButtonClick, this); + m_buttonUp->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnUpButtonClick, this); + m_buttonDown->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnDownButtonClick, this); + m_listCtrlSwitchings->Unbind(wxEVT_COMMAND_LIST_ITEM_SELECTED, &SwitchingFormBase::OnSelectItem, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SwitchingFormBase::OnCancelButtonClick, this); + } -IndMotorFormBase::IndMotorFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +IndMotorFormBase::IndMotorFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlName = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlName->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlName->SetMinSize(wxSize(300,-1)); + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_15 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_15, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextNominalPower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_15->Add(m_staticTextNominalPower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextNominalPower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Rated power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_15->Add(m_staticTextNominalPower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_15 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_15->Add(boxSizerLvl5_15, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlnominalPower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlnominalPower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlnominalPower->SetHint(wxT("")); -#endif - - boxSizerLvl5_15->Add(m_textCtrlnominalPower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_15->Add(m_textCtrlnominalPower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceNominalPowerArr; - m_choiceNominalPowerArr.Add(wxT("VA")); - m_choiceNominalPowerArr.Add(wxT("kVA")); - m_choiceNominalPowerArr.Add(wxT("MVA")); - m_choiceNominalPower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceNominalPowerArr, 0); + m_choiceNominalPowerArr.Add(_("VA")); + m_choiceNominalPowerArr.Add(_("kVA")); + m_choiceNominalPowerArr.Add(_("MVA")); + m_choiceNominalPower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceNominalPowerArr, 0); m_choiceNominalPower->SetSelection(2); - - boxSizerLvl5_15->Add(m_choiceNominalPower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - - gridSizerLvl3_1->Add(0, 0, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl5_15->Add(m_choiceNominalPower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + + gridSizerLvl3_1->Add(0, 0, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextActivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Active power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_1->Add(m_staticTextActivePower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextActivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Active power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_1->Add(m_staticTextActivePower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_1->Add(boxSizerLvl5_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlActivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlActivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlActivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_1->Add(m_textCtrlActivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_1->Add(m_textCtrlActivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceActivePowerArr; - m_choiceActivePowerArr.Add(wxT("p.u.")); - m_choiceActivePowerArr.Add(wxT("W")); - m_choiceActivePowerArr.Add(wxT("kW")); - m_choiceActivePowerArr.Add(wxT("MW")); - m_choiceActivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceActivePowerArr, 0); + m_choiceActivePowerArr.Add(_("p.u.")); + m_choiceActivePowerArr.Add(_("W")); + m_choiceActivePowerArr.Add(_("kW")); + m_choiceActivePowerArr.Add(_("MW")); + m_choiceActivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceActivePowerArr, 0); m_choiceActivePower->SetSelection(3); - - boxSizerLvl5_1->Add(m_choiceActivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - + + boxSizerLvl5_1->Add(m_choiceActivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextReactivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Reactive power"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_2->Add(m_staticTextReactivePower, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextReactivePower = new wxStaticText(m_panelGeneral, wxID_ANY, _("Reactive power"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_2->Add(m_staticTextReactivePower, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_2 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_2->Add(boxSizerLvl5_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlReactivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlReactivePower = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlReactivePower->SetHint(wxT("")); -#endif - - boxSizerLvl5_2->Add(m_textCtrlReactivePower, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_2->Add(m_textCtrlReactivePower, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceReactivePowerArr; - m_choiceReactivePowerArr.Add(wxT("p.u.")); - m_choiceReactivePowerArr.Add(wxT("VAr")); - m_choiceReactivePowerArr.Add(wxT("kVAr")); - m_choiceReactivePowerArr.Add(wxT("MVAr")); - m_choiceReactivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceReactivePowerArr, 0); + m_choiceReactivePowerArr.Add(_("p.u.")); + m_choiceReactivePowerArr.Add(_("VAr")); + m_choiceReactivePowerArr.Add(_("kVAr")); + m_choiceReactivePowerArr.Add(_("MVAr")); + m_choiceReactivePower = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceReactivePowerArr, 0); m_choiceReactivePower->SetSelection(3); - - boxSizerLvl5_2->Add(m_choiceReactivePower, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - - m_checkBoxComputeQ = - new wxCheckBox(m_panelGeneral, wxID_ANY, _("Calculate reactive power in load flow (using stability data)"), - wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + boxSizerLvl5_2->Add(m_choiceReactivePower, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + + m_checkBoxComputeQ = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Calculate reactive power in load flow (using stability data)"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxComputeQ->SetValue(false); - - boxSizerLvl2_1->Add(m_checkBoxComputeQ, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_checkBoxUseMachinePower = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Use machine rated power as base"), - wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + boxSizerLvl2_1->Add(m_checkBoxComputeQ, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_checkBoxUseMachinePower = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Use machine rated power as base"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxUseMachinePower->SetValue(false); - - boxSizerLvl2_1->Add(m_checkBoxUseMachinePower, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_panelStability = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + boxSizerLvl2_1->Add(m_checkBoxUseMachinePower, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_panelStability = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelStability, _("Stability"), false); - + wxBoxSizer* boxSizerLvl2_2 = new wxBoxSizer(wxVERTICAL); m_panelStability->SetSizer(boxSizerLvl2_2); - - m_checkBoxPlotIndMachine = new wxCheckBox(m_panelStability, wxID_ANY, _("Plot induction machine data"), - wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); + + m_checkBoxPlotIndMachine = new wxCheckBox(m_panelStability, wxID_ANY, _("Plot induction machine data"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); m_checkBoxPlotIndMachine->SetValue(false); - - boxSizerLvl2_2->Add(m_checkBoxPlotIndMachine, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + boxSizerLvl2_2->Add(m_checkBoxPlotIndMachine, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl3_2 = new wxGridSizer(0, 2, 0, 0); - + boxSizerLvl2_2->Add(gridSizerLvl3_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_8 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextInertia = new wxStaticText(m_panelStability, wxID_ANY, _("Inertia"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_8->Add(m_staticTextInertia, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextInertia = new wxStaticText(m_panelStability, wxID_ANY, _("Inertia"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_8->Add(m_staticTextInertia, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_12 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_8->Add(boxSizerLvl5_12, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlInertia = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlInertia = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlInertia->SetHint(wxT("")); -#endif - - boxSizerLvl5_12->Add(m_textCtrlInertia, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_staticTextS_1 = new wxStaticText(m_panelStability, wxID_ANY, _("s"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_12->Add(m_staticTextS_1, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_12->Add(m_textCtrlInertia, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextS_1 = new wxStaticText(m_panelStability, wxID_ANY, _("s"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_12->Add(m_staticTextS_1, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + gridSizerLvl3_2->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_3 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextStatorResistence = new wxStaticText(m_panelStability, wxID_ANY, _("Stator resistence"), - wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_3->Add(m_staticTextStatorResistence, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextStatorResistence = new wxStaticText(m_panelStability, wxID_ANY, _("Stator resistence"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_3->Add(m_staticTextStatorResistence, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_3 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_3->Add(boxSizerLvl5_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlStatorResistence = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlStatorResistence = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlStatorResistence->SetHint(wxT("")); -#endif - - boxSizerLvl5_3->Add(m_textCtrlStatorResistence, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_1 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_3->Add(m_staticTextPU_1, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_3->Add(m_textCtrlStatorResistence, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_1 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_3->Add(m_staticTextPU_1, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_4 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextStatorReactance = new wxStaticText(m_panelStability, wxID_ANY, _("Stator reactance"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_4->Add(m_staticTextStatorReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextStatorReactance = new wxStaticText(m_panelStability, wxID_ANY, _("Stator reactance"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_4->Add(m_staticTextStatorReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_4 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_4->Add(boxSizerLvl5_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlStatorReactance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlStatorReactance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlStatorReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_4->Add(m_textCtrlStatorReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_2 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_4->Add(m_staticTextPU_2, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_4->Add(m_textCtrlStatorReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_2 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_4->Add(m_staticTextPU_2, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_5 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextRotorResistence = new wxStaticText(m_panelStability, wxID_ANY, _("Rotor resistence"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_5->Add(m_staticTextRotorResistence, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextRotorResistence = new wxStaticText(m_panelStability, wxID_ANY, _("Rotor resistence"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_5->Add(m_staticTextRotorResistence, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_6 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_5->Add(boxSizerLvl5_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlRotorResistence = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlRotorResistence = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlRotorResistence->SetHint(wxT("")); -#endif - - boxSizerLvl5_6->Add(m_textCtrlRotorResistence, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_3 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_6->Add(m_staticTextPU_3, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_6->Add(m_textCtrlRotorResistence, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_3 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_6->Add(m_staticTextPU_3, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_6 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextRotorReactance = new wxStaticText(m_panelStability, wxID_ANY, _("Rotor reactance"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_6->Add(m_staticTextRotorReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextRotorReactance = new wxStaticText(m_panelStability, wxID_ANY, _("Rotor reactance"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_6->Add(m_staticTextRotorReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_7 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_6->Add(boxSizerLvl5_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlRotorReactance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlRotorReactance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlRotorReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_7->Add(m_textCtrlRotorReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_4 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_7->Add(m_staticTextPU_4, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_7->Add(m_textCtrlRotorReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_4 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_7->Add(m_staticTextPU_4, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_7 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_7, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextMagnetizingReactance = - new wxStaticText(m_panelStability, wxID_ANY, _("Magnetizing reactance"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl4_7->Add(m_staticTextMagnetizingReactance, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextMagnetizingReactance = new wxStaticText(m_panelStability, wxID_ANY, _("Magnetizing reactance"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl4_7->Add(m_staticTextMagnetizingReactance, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_8 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl4_7->Add(boxSizerLvl5_8, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlMagnetizingReactance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlMagnetizingReactance = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlMagnetizingReactance->SetHint(wxT("")); -#endif - - boxSizerLvl5_8->Add(m_textCtrlMagnetizingReactance, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextPU_5 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_8->Add(m_staticTextPU_5, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_8->Add(m_textCtrlMagnetizingReactance, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextPU_5 = new wxStaticText(m_panelStability, wxID_ANY, _("p.u."), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_8->Add(m_staticTextPU_5, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_9 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_2->Add(boxSizerLvl4_9, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_checkBoxUseKf = new wxCheckBox(m_panelStability, wxID_ANY, _("Use cage factor"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); + + m_checkBoxUseKf = new wxCheckBox(m_panelStability, wxID_ANY, _("Use cage factor"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); m_checkBoxUseKf->SetValue(false); - - boxSizerLvl4_9->Add(m_checkBoxUseKf, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlKf = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + boxSizerLvl4_9->Add(m_checkBoxUseKf, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlKf = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlKf->SetHint(wxT("")); -#endif - - boxSizerLvl4_9->Add(m_textCtrlKf, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl4_9->Add(m_textCtrlKf, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl3_3 = new wxBoxSizer(wxVERTICAL); - + boxSizerLvl2_2->Add(boxSizerLvl3_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextLoadCharacteristic = - new wxStaticText(m_panelStability, wxID_ANY, _("Load characteristic"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl3_3->Add(m_staticTextLoadCharacteristic, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + + m_staticTextLoadCharacteristic = new wxStaticText(m_panelStability, wxID_ANY, _("Load characteristic"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl3_3->Add(m_staticTextLoadCharacteristic, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxGridSizer* gridSizerLvl4_8 = new wxGridSizer(0, 3, 0, 0); - + boxSizerLvl3_3->Add(gridSizerLvl4_8, 1, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl5_9 = new wxBoxSizer(wxHORIZONTAL); - + gridSizerLvl4_8->Add(boxSizerLvl5_9, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlA = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(50, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlA = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(50,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlA->SetHint(wxT("")); -#endif - - boxSizerLvl5_9->Add(m_textCtrlA, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - m_textCtrlA->SetMinSize(wxSize(50, -1)); - - m_staticTextPlus = new wxStaticText(m_panelStability, wxID_ANY, _("+"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_9->Add(m_staticTextPlus, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_9->Add(m_textCtrlA, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlA->SetMinSize(wxSize(50,-1)); + + m_staticTextPlus = new wxStaticText(m_panelStability, wxID_ANY, _("+"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_9->Add(m_staticTextPlus, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_10 = new wxBoxSizer(wxHORIZONTAL); - + gridSizerLvl4_8->Add(boxSizerLvl5_10, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlB = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(50, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlB = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(50,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlB->SetHint(wxT("")); -#endif - - boxSizerLvl5_10->Add(m_textCtrlB, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - m_textCtrlB->SetMinSize(wxSize(50, -1)); - - m_staticTextw = new wxStaticText(m_panelStability, wxID_ANY, _("w +"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_10->Add(m_staticTextw, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_10->Add(m_textCtrlB, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlB->SetMinSize(wxSize(50,-1)); + + m_staticTextw = new wxStaticText(m_panelStability, wxID_ANY, _("w +"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_10->Add(m_staticTextw, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl5_11 = new wxBoxSizer(wxHORIZONTAL); - + gridSizerLvl4_8->Add(boxSizerLvl5_11, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_textCtrlC = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(50, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_textCtrlC = new wxTextCtrl(m_panelStability, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(50,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlC->SetHint(wxT("")); -#endif - - boxSizerLvl5_11->Add(m_textCtrlC, 1, wxLEFT | wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - m_textCtrlC->SetMinSize(wxSize(50, -1)); - - m_staticTextw2 = new wxStaticText(m_panelStability, wxID_ANY, _("w2"), wxDefaultPosition, - wxDLG_UNIT(m_panelStability, wxSize(-1, -1)), 0); - - boxSizerLvl5_11->Add(m_staticTextw2, 0, wxRIGHT | wxBOTTOM | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl5_11->Add(m_textCtrlC, 1, wxLEFT|wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlC->SetMinSize(wxSize(50,-1)); + + m_staticTextw2 = new wxStaticText(m_panelStability, wxID_ANY, _("w2"), wxDefaultPosition, wxDLG_UNIT(m_panelStability, wxSize(-1,-1)), 0); + + boxSizerLvl5_11->Add(m_staticTextw2, 0, wxRIGHT|wxBOTTOM|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonSwitchingButton = - new wxButton(this, wxID_ANY, _("Switching"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonSwitchingButton, 0, wxALL | wxALIGN_LEFT, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonSwitchingButton = new wxButton(this, wxID_ANY, _("Switching"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonSwitchingButton, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("IndMotorFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_checkBoxComputeQ->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(IndMotorFormBase::OnCalcQInPFClick), NULL, this); - m_checkBoxUseKf->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(IndMotorFormBase::OnCheckboxUseCageFactorClick), NULL, this); - m_buttonSwitchingButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(IndMotorFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IndMotorFormBase::OnOKButtonClick), NULL, - this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IndMotorFormBase::OnCancelButtonClick), - NULL, this); + m_checkBoxComputeQ->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &IndMotorFormBase::OnCalcQInPFClick, this); + m_checkBoxUseKf->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &IndMotorFormBase::OnCheckboxUseCageFactorClick, this); + m_buttonSwitchingButton->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &IndMotorFormBase::OnStabilityButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &IndMotorFormBase::OnOKButtonClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &IndMotorFormBase::OnCancelButtonClick, this); + } IndMotorFormBase::~IndMotorFormBase() { - m_checkBoxComputeQ->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(IndMotorFormBase::OnCalcQInPFClick), NULL, this); - m_checkBoxUseKf->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(IndMotorFormBase::OnCheckboxUseCageFactorClick), NULL, this); - m_buttonSwitchingButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(IndMotorFormBase::OnStabilityButtonClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IndMotorFormBase::OnOKButtonClick), NULL, - this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(IndMotorFormBase::OnCancelButtonClick), NULL, this); + m_checkBoxComputeQ->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &IndMotorFormBase::OnCalcQInPFClick, this); + m_checkBoxUseKf->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &IndMotorFormBase::OnCheckboxUseCageFactorClick, this); + m_buttonSwitchingButton->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &IndMotorFormBase::OnStabilityButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &IndMotorFormBase::OnOKButtonClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &IndMotorFormBase::OnCancelButtonClick, this); + } -TextFormBase::TextFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +TextFormBase::TextFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - + wxGridSizer* gridSizerLvl3_1 = new wxGridSizer(0, 3, 0, 0); - + boxSizerLvl2_1->Add(gridSizerLvl3_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl4_1 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_1, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextElement = new wxStaticText(m_panelGeneral, wxID_ANY, _("Element"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_1->Add(m_staticTextElement, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextElement = new wxStaticText(m_panelGeneral, wxID_ANY, _("Element"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_1->Add(m_staticTextElement, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceElementArr; - m_choiceElementArr.Add(wxT("Bus")); - m_choiceElementArr.Add(wxT("Generator")); - m_choiceElementArr.Add(wxT("Line")); - m_choiceElementArr.Add(wxT("Transformer")); - m_choiceElementArr.Add(wxT("Load")); - m_choiceElementArr.Add(wxT("Capacitor")); - m_choiceElementArr.Add(wxT("Inductor")); - m_choiceElementArr.Add(wxT("Synchronous compensator")); - m_choiceElementArr.Add(wxT("Induction motor")); - m_choiceElement = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceElementArr, 0); - - boxSizerLvl4_1->Add(m_choiceElement, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + m_choiceElementArr.Add(_("Bus")); + m_choiceElementArr.Add(_("Generator")); + m_choiceElementArr.Add(_("Line")); + m_choiceElementArr.Add(_("Transformer")); + m_choiceElementArr.Add(_("Load")); + m_choiceElementArr.Add(_("Capacitor")); + m_choiceElementArr.Add(_("Inductor")); + m_choiceElementArr.Add(_("Synchronous compensator")); + m_choiceElementArr.Add(_("Induction motor")); + m_choiceElement = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceElementArr, 0); + + boxSizerLvl4_1->Add(m_choiceElement, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_2 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_2, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Element name"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_2->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextName = new wxStaticText(m_panelGeneral, wxID_ANY, _("Element name"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_2->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceNameArr; - m_choiceName = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), - m_choiceNameArr, 0); - - boxSizerLvl4_2->Add(m_choiceName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + m_choiceName = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceNameArr, 0); + + boxSizerLvl4_2->Add(m_choiceName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_3 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_3, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextType = new wxStaticText(m_panelGeneral, wxID_ANY, _("Text type"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_3->Add(m_staticTextType, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextType = new wxStaticText(m_panelGeneral, wxID_ANY, _("Text type"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_3->Add(m_staticTextType, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceTextTypeArr; - m_choiceTextType = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceTextTypeArr, 0); - - boxSizerLvl4_3->Add(m_choiceTextType, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + m_choiceTextType = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceTextTypeArr, 0); + + boxSizerLvl4_3->Add(m_choiceTextType, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_4 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_4, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextFromBus = new wxStaticText(m_panelGeneral, wxID_ANY, _("From bus"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_4->Add(m_staticTextFromBus, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextFromBus = new wxStaticText(m_panelGeneral, wxID_ANY, _("From bus"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_4->Add(m_staticTextFromBus, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceTextFromBusArr; - m_choiceTextFromBus = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceTextFromBusArr, 0); - - boxSizerLvl4_4->Add(m_choiceTextFromBus, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + m_choiceTextFromBus = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceTextFromBusArr, 0); + + boxSizerLvl4_4->Add(m_choiceTextFromBus, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_5 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_5, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextToBus = new wxStaticText(m_panelGeneral, wxID_ANY, _("To bus"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_5->Add(m_staticTextToBus, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextToBus = new wxStaticText(m_panelGeneral, wxID_ANY, _("To bus"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_5->Add(m_staticTextToBus, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceTextToBusArr; - m_choiceTextToBus = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceTextToBusArr, 0); - - boxSizerLvl4_5->Add(m_choiceTextToBus, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + m_choiceTextToBus = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceTextToBusArr, 0); + + boxSizerLvl4_5->Add(m_choiceTextToBus, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl4_6 = new wxBoxSizer(wxVERTICAL); - + gridSizerLvl3_1->Add(boxSizerLvl4_6, 0, wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextUnit = new wxStaticText(m_panelGeneral, wxID_ANY, _("Unit"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl4_6->Add(m_staticTextUnit, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + + m_staticTextUnit = new wxStaticText(m_panelGeneral, wxID_ANY, _("Unit"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl4_6->Add(m_staticTextUnit, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxArrayString m_choiceTextUnitArr; - m_choiceTextUnit = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceTextUnitArr, 0); - - boxSizerLvl4_6->Add(m_choiceTextUnit, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + m_choiceTextUnit = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceTextUnitArr, 0); + + boxSizerLvl4_6->Add(m_choiceTextUnit, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl3_2 = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl2_1->Add(boxSizerLvl3_2, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextDecimal = new wxStaticText(m_panelGeneral, wxID_ANY, _("Decimal places:"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl3_2->Add(m_staticTextDecimal, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlDecimal = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT("2"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), wxTE_PROCESS_ENTER); -#if wxVERSION_NUMBER >= 3000 + + boxSizerLvl2_1->Add(boxSizerLvl3_2, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_staticTextDecimal = new wxStaticText(m_panelGeneral, wxID_ANY, _("Decimal places:"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl3_2->Add(m_staticTextDecimal, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlDecimal = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT("2"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), wxTE_PROCESS_ENTER); + #if wxVERSION_NUMBER >= 3000 m_textCtrlDecimal->SetHint(wxT("")); -#endif - - boxSizerLvl3_2->Add(m_textCtrlDecimal, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl3_2->Add(m_textCtrlDecimal, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + boxSizerLvl3_2->Add(0, 0, 0, wxALL, WXC_FROM_DIP(5)); - - m_staticTextPreview = new wxStaticText(m_panelGeneral, wxID_ANY, _("Preview:"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl3_2->Add(m_staticTextPreview, 0, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlPreview = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), wxTE_CENTRE); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextPreview = new wxStaticText(m_panelGeneral, wxID_ANY, _("Preview:"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl3_2->Add(m_staticTextPreview, 0, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlPreview = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), wxTE_CENTRE); + #if wxVERSION_NUMBER >= 3000 m_textCtrlPreview->SetHint(wxT("")); -#endif - - boxSizerLvl3_2->Add(m_textCtrlPreview, 1, wxALL | wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - + #endif + + boxSizerLvl3_2->Add(m_textCtrlPreview, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("TextFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_choiceElement->Connect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(TextFormBase::OnElementChoiceSelected), NULL, this); - m_choiceName->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(TextFormBase::OnNameChoiceSelected), - NULL, this); - m_choiceTextType->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(TextFormBase::OnTypeChoiceSelected), - NULL, this); - m_choiceTextFromBus->Connect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(TextFormBase::OnFromBusChoiceSelected), NULL, this); - m_choiceTextToBus->Connect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(TextFormBase::OnToBusChoiceSelected), NULL, this); - m_choiceTextUnit->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(TextFormBase::OnUnitChoiceSelected), - NULL, this); - m_textCtrlDecimal->Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(TextFormBase::OnTextEnter), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TextFormBase::OnOKButtonClick), NULL, this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TextFormBase::OnCancelButtonClick), - NULL, this); + m_choiceElement->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnElementChoiceSelected, this); + m_choiceName->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnNameChoiceSelected, this); + m_choiceTextType->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnTypeChoiceSelected, this); + m_choiceTextFromBus->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnFromBusChoiceSelected, this); + m_choiceTextToBus->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnToBusChoiceSelected, this); + m_choiceTextUnit->Bind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnUnitChoiceSelected, this); + m_textCtrlDecimal->Bind(wxEVT_COMMAND_TEXT_ENTER, &TextFormBase::OnTextEnter, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &TextFormBase::OnOKButtonClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &TextFormBase::OnCancelButtonClick, this); + } TextFormBase::~TextFormBase() { - m_choiceElement->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(TextFormBase::OnElementChoiceSelected), NULL, this); - m_choiceName->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(TextFormBase::OnNameChoiceSelected), - NULL, this); - m_choiceTextType->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(TextFormBase::OnTypeChoiceSelected), NULL, this); - m_choiceTextFromBus->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(TextFormBase::OnFromBusChoiceSelected), NULL, this); - m_choiceTextToBus->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(TextFormBase::OnToBusChoiceSelected), NULL, this); - m_choiceTextUnit->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, - wxCommandEventHandler(TextFormBase::OnUnitChoiceSelected), NULL, this); - m_textCtrlDecimal->Disconnect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(TextFormBase::OnTextEnter), NULL, - this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TextFormBase::OnOKButtonClick), NULL, - this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TextFormBase::OnCancelButtonClick), - NULL, this); + m_choiceElement->Unbind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnElementChoiceSelected, this); + m_choiceName->Unbind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnNameChoiceSelected, this); + m_choiceTextType->Unbind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnTypeChoiceSelected, this); + m_choiceTextFromBus->Unbind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnFromBusChoiceSelected, this); + m_choiceTextToBus->Unbind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnToBusChoiceSelected, this); + m_choiceTextUnit->Unbind(wxEVT_COMMAND_CHOICE_SELECTED, &TextFormBase::OnUnitChoiceSelected, this); + m_textCtrlDecimal->Unbind(wxEVT_COMMAND_TEXT_ENTER, &TextFormBase::OnTextEnter, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &TextFormBase::OnOKButtonClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &TextFormBase::OnCancelButtonClick, this); + } -TransferFunctionFormBase::TransferFunctionFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +TransferFunctionFormBase::TransferFunctionFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextNumerator = new wxStaticText(m_panelGeneral, wxID_ANY, _("Numerator parameters"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextNumerator, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlNumerator = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextNumerator = new wxStaticText(m_panelGeneral, wxID_ANY, _("Numerator parameters"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextNumerator, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlNumerator = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlNumerator->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlNumerator, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlNumerator->SetMinSize(wxSize(300, -1)); - - m_staticTextDenominator = new wxStaticText(m_panelGeneral, wxID_ANY, _("Denominator parameters"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextDenominator, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_textCtrlDenominator = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + #endif + + boxSizerLvl2_1->Add(m_textCtrlNumerator, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlNumerator->SetMinSize(wxSize(300,-1)); + + m_staticTextDenominator = new wxStaticText(m_panelGeneral, wxID_ANY, _("Denominator parameters"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextDenominator, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlDenominator = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlDenominator->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlDenominator, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlDenominator->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlDenominator, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlDenominator->SetMinSize(wxSize(300,-1)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("TransferFunctionFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TransferFunctionFormBase::OnOKClick), NULL, - this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(TransferFunctionFormBase::OnCancelClick), NULL, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &TransferFunctionFormBase::OnOKClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &TransferFunctionFormBase::OnCancelClick, this); + } TransferFunctionFormBase::~TransferFunctionFormBase() { - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TransferFunctionFormBase::OnOKClick), - NULL, this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(TransferFunctionFormBase::OnCancelClick), NULL, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &TransferFunctionFormBase::OnOKClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &TransferFunctionFormBase::OnCancelClick, this); + } -SumFormBase::SumFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +SumFormBase::SumFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextSigns = new wxStaticText(m_panelGeneral, wxID_ANY, _("Signs"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextSigns, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlSigns = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextSigns = new wxStaticText(m_panelGeneral, wxID_ANY, _("Signs"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextSigns, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlSigns = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlSigns->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlSigns, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlSigns->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlSigns, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlSigns->SetMinSize(wxSize(300,-1)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("SumFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SumFormBase::OnOKClick), NULL, this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SumFormBase::OnCancelClick), NULL, - this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SumFormBase::OnOKClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &SumFormBase::OnCancelClick, this); + } SumFormBase::~SumFormBase() { - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SumFormBase::OnOKClick), NULL, this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(SumFormBase::OnCancelClick), NULL, - this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SumFormBase::OnOKClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &SumFormBase::OnCancelClick, this); + } -LimiterFormBase::LimiterFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +LimiterFormBase::LimiterFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextUpLimiter = new wxStaticText(m_panelGeneral, wxID_ANY, _("Upper limit"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextUpLimiter, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlUpLimit = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextUpLimiter = new wxStaticText(m_panelGeneral, wxID_ANY, _("Upper limit"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextUpLimiter, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlUpLimit = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlUpLimit->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlUpLimit, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlUpLimit->SetMinSize(wxSize(100, -1)); - - m_staticTextLowLimit = new wxStaticText(m_panelGeneral, wxID_ANY, _("Lower limit"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextLowLimit, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlLowLimit = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + #endif + + boxSizerLvl2_1->Add(m_textCtrlUpLimit, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlUpLimit->SetMinSize(wxSize(100,-1)); + + m_staticTextLowLimit = new wxStaticText(m_panelGeneral, wxID_ANY, _("Lower limit"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextLowLimit, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlLowLimit = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlLowLimit->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlLowLimit, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlLowLimit->SetMinSize(wxSize(100, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlLowLimit, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlLowLimit->SetMinSize(wxSize(100,-1)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("LimiterFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LimiterFormBase::OnOKButtonClick), NULL, - this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LimiterFormBase::OnCancelButtonClick), - NULL, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LimiterFormBase::OnOKButtonClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &LimiterFormBase::OnCancelButtonClick, this); + } LimiterFormBase::~LimiterFormBase() { - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(LimiterFormBase::OnOKButtonClick), NULL, - this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(LimiterFormBase::OnCancelButtonClick), NULL, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &LimiterFormBase::OnOKButtonClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &LimiterFormBase::OnCancelButtonClick, this); + } -RateLimiterFormBase::RateLimiterFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +RateLimiterFormBase::RateLimiterFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextUpLimiter = new wxStaticText(m_panelGeneral, wxID_ANY, _("Upper limit"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextUpLimiter, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlUpLimit = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextUpLimiter = new wxStaticText(m_panelGeneral, wxID_ANY, _("Upper limit"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextUpLimiter, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlUpLimit = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlUpLimit->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlUpLimit, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlUpLimit->SetMinSize(wxSize(100, -1)); - - m_staticTextLowLimit = new wxStaticText(m_panelGeneral, wxID_ANY, _("Lower limit"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextLowLimit, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlLowLimit = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + #endif + + boxSizerLvl2_1->Add(m_textCtrlUpLimit, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlUpLimit->SetMinSize(wxSize(100,-1)); + + m_staticTextLowLimit = new wxStaticText(m_panelGeneral, wxID_ANY, _("Lower limit"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextLowLimit, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlLowLimit = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlLowLimit->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlLowLimit, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlLowLimit->SetMinSize(wxSize(100, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlLowLimit, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlLowLimit->SetMinSize(wxSize(100,-1)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("RateLimiterFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RateLimiterFormBase::OnOKButtonClick), NULL, - this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(RateLimiterFormBase::OnCancelButtonClick), NULL, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &RateLimiterFormBase::OnOKButtonClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &RateLimiterFormBase::OnCancelButtonClick, this); + } RateLimiterFormBase::~RateLimiterFormBase() { - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(RateLimiterFormBase::OnOKButtonClick), - NULL, this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(RateLimiterFormBase::OnCancelButtonClick), NULL, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &RateLimiterFormBase::OnOKButtonClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &RateLimiterFormBase::OnCancelButtonClick, this); + } -ExponentialFormBase::ExponentialFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +ExponentialFormBase::ExponentialFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextExp = new wxStaticText(m_panelGeneral, wxID_ANY, _("y = A.eB.x"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), wxALIGN_CENTRE); - - boxSizerLvl2_1->Add(m_staticTextExp, 1, - wxLEFT | wxRIGHT | wxTOP | wxEXPAND | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - - m_staticTextAValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("A value"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextAValue, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlAValue = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextExp = new wxStaticText(m_panelGeneral, wxID_ANY, _("y = A.eB.x"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), wxALIGN_CENTRE); + + boxSizerLvl2_1->Add(m_staticTextExp, 1, wxLEFT|wxRIGHT|wxTOP|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_staticTextAValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("A value"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextAValue, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlAValue = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlAValue->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlAValue, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlAValue->SetMinSize(wxSize(100, -1)); - - m_staticTextBValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("B value"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextBValue, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlBValue = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + #endif + + boxSizerLvl2_1->Add(m_textCtrlAValue, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlAValue->SetMinSize(wxSize(100,-1)); + + m_staticTextBValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("B value"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextBValue, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlBValue = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlBValue->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlBValue, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlBValue->SetMinSize(wxSize(100, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlBValue, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlBValue->SetMinSize(wxSize(100,-1)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("ExponentialFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExponentialFormBase::OnOKButtonClick), NULL, - this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ExponentialFormBase::OnCancelButtonClick), NULL, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ExponentialFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ExponentialFormBase::OnCancelButtonClick, this); + } ExponentialFormBase::~ExponentialFormBase() { - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExponentialFormBase::OnOKButtonClick), - NULL, this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ExponentialFormBase::OnCancelButtonClick), NULL, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &ExponentialFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &ExponentialFormBase::OnCancelButtonClick, this); + } -ConstantFormBase::ConstantFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +ConstantFormBase::ConstantFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("Constant value"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextValue, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlValue = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("Constant value"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextValue, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlValue = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlValue->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlValue, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlValue->SetMinSize(wxSize(100, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlValue, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlValue->SetMinSize(wxSize(100,-1)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("ConstantFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ConstantFormBase::OnOKButtonClick), NULL, - this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ConstantFormBase::OnCancelButtonClick), - NULL, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ConstantFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &ConstantFormBase::OnCancelButtonClick, this); + } ConstantFormBase::~ConstantFormBase() { - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ConstantFormBase::OnOKButtonClick), NULL, - this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(ConstantFormBase::OnCancelButtonClick), NULL, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &ConstantFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &ConstantFormBase::OnCancelButtonClick, this); + } -GainFormBase::GainFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +GainFormBase::GainFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("Gain value"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextValue, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlValue = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextValue = new wxStaticText(m_panelGeneral, wxID_ANY, _("Gain value"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextValue, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlValue = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlValue->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlValue, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlValue->SetMinSize(wxSize(100, -1)); - + #endif + + boxSizerLvl2_1->Add(m_textCtrlValue, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlValue->SetMinSize(wxSize(100,-1)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("GainFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(GainFormBase::OnOKButtonClick), NULL, this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(GainFormBase::OnCancelButtonClick), - NULL, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GainFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &GainFormBase::OnCancelButtonClick, this); + } GainFormBase::~GainFormBase() { - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(GainFormBase::OnOKButtonClick), NULL, - this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(GainFormBase::OnCancelButtonClick), - NULL, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &GainFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &GainFormBase::OnCancelButtonClick, this); + } -IOControlFormBase::IOControlFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +IOControlFormBase::IOControlFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_checkBoxInput = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Input"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + + m_checkBoxInput = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Input"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxInput->SetValue(false); - - boxSizerLvl2_1->Add(m_checkBoxInput, 0, wxLEFT | wxRIGHT | wxTOP, WXC_FROM_DIP(5)); - + + boxSizerLvl2_1->Add(m_checkBoxInput, 0, wxLEFT|wxRIGHT|wxTOP, WXC_FROM_DIP(5)); + wxArrayString m_choiceInputArr; - m_choiceInput = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceInputArr, 0); - - boxSizerLvl2_1->Add(m_choiceInput, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - - m_checkBoxOutput = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Output"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); + m_choiceInput = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceInputArr, 0); + + boxSizerLvl2_1->Add(m_choiceInput, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + + m_checkBoxOutput = new wxCheckBox(m_panelGeneral, wxID_ANY, _("Output"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); m_checkBoxOutput->SetValue(false); - - boxSizerLvl2_1->Add(m_checkBoxOutput, 0, wxLEFT | wxRIGHT | wxTOP, WXC_FROM_DIP(5)); - + + boxSizerLvl2_1->Add(m_checkBoxOutput, 0, wxLEFT|wxRIGHT|wxTOP, WXC_FROM_DIP(5)); + wxArrayString m_choiceOutputArr; - m_choiceOutput = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), m_choiceOutputArr, 0); - - boxSizerLvl2_1->Add(m_choiceOutput, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, WXC_FROM_DIP(5)); - + m_choiceOutput = new wxChoice(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), m_choiceOutputArr, 0); + + boxSizerLvl2_1->Add(m_choiceOutput, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_ButtonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_ButtonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("IOControlFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_checkBoxInput->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(IOControlFormBase::OnInputChecked), - NULL, this); - m_checkBoxOutput->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(IOControlFormBase::OnOutputChecked), - NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IOControlFormBase::OnOKButtonClick), NULL, - this); - m_ButtonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IOControlFormBase::OnCancelButtonClick), - NULL, this); + m_checkBoxInput->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &IOControlFormBase::OnInputChecked, this); + m_checkBoxOutput->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, &IOControlFormBase::OnOutputChecked, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &IOControlFormBase::OnOKButtonClick, this); + m_ButtonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &IOControlFormBase::OnCancelButtonClick, this); + } IOControlFormBase::~IOControlFormBase() { - m_checkBoxInput->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(IOControlFormBase::OnInputChecked), NULL, this); - m_checkBoxOutput->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, - wxCommandEventHandler(IOControlFormBase::OnOutputChecked), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(IOControlFormBase::OnOKButtonClick), - NULL, this); - m_ButtonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(IOControlFormBase::OnCancelButtonClick), NULL, this); + m_checkBoxInput->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &IOControlFormBase::OnInputChecked, this); + m_checkBoxOutput->Unbind(wxEVT_COMMAND_CHECKBOX_CLICKED, &IOControlFormBase::OnOutputChecked, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &IOControlFormBase::OnOKButtonClick, this); + m_ButtonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &IOControlFormBase::OnCancelButtonClick, this); + } -MathExpressionFormBase::MathExpressionFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +MathExpressionFormBase::MathExpressionFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - - m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBK_DEFAULT); + + m_notebook = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxBK_DEFAULT); m_notebook->SetName(wxT("m_notebook")); - + boxSizerLvl1_1->Add(m_notebook, 1, wxEXPAND, WXC_FROM_DIP(5)); - - m_panelGeneral = - new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1, -1)), wxTAB_TRAVERSAL); + + m_panelGeneral = new wxPanel(m_notebook, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_notebook, wxSize(-1,-1)), wxTAB_TRAVERSAL); m_notebook->AddPage(m_panelGeneral, _("General"), false); - + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxVERTICAL); m_panelGeneral->SetSizer(boxSizerLvl2_1); - - m_staticTextVariables = new wxStaticText(m_panelGeneral, wxID_ANY, _("Input variables (space separated)"), - wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - - boxSizerLvl2_1->Add(m_staticTextVariables, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlVariables = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT("x y"), wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + m_staticTextVariables = new wxStaticText(m_panelGeneral, wxID_ANY, _("Input variables (space separated)"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + + boxSizerLvl2_1->Add(m_staticTextVariables, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlVariables = new wxTextCtrl(m_panelGeneral, wxID_ANY, wxT("x y"), wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlVariables->SetHint(wxT("")); -#endif - - boxSizerLvl2_1->Add(m_textCtrlVariables, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlVariables->SetMinSize(wxSize(100, -1)); - - m_stcMathExpr = new wxStyledTextCtrl(m_panelGeneral, wxID_ANY, wxDefaultPosition, - wxDLG_UNIT(m_panelGeneral, wxSize(-1, -1)), 0); - wxFont m_stcMathExprFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, - wxT("Courier New")); + #endif + + boxSizerLvl2_1->Add(m_textCtrlVariables, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlVariables->SetMinSize(wxSize(100,-1)); + + m_stcMathExpr = new wxStyledTextCtrl(m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_panelGeneral, wxSize(-1,-1)), 0); + wxFont m_stcMathExprFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Courier New")); m_stcMathExpr->SetFont(m_stcMathExprFont); // Configure the fold margin - m_stcMathExpr->SetMarginType(4, wxSTC_MARGIN_SYMBOL); - m_stcMathExpr->SetMarginMask(4, wxSTC_MASK_FOLDERS); + m_stcMathExpr->SetMarginType (4, wxSTC_MARGIN_SYMBOL); + m_stcMathExpr->SetMarginMask (4, wxSTC_MASK_FOLDERS); m_stcMathExpr->SetMarginSensitive(4, true); - m_stcMathExpr->SetMarginWidth(4, 16); - - m_stcMathExpr->SetProperty(wxT("fold"), wxT("1")); - m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN); - m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_ARROW); - m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_BACKGROUND); - m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_BACKGROUND); - m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_ARROW); + m_stcMathExpr->SetMarginWidth (4, 16); + + m_stcMathExpr->SetProperty(wxT("fold"),wxT("1")); + m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN); + m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_ARROW); + m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_BACKGROUND); + m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_BACKGROUND); + m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_ARROW); m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN); m_stcMathExpr->MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_BACKGROUND); // Configure the tracker margin m_stcMathExpr->SetMarginWidth(1, 0); - + // Configure the symbol margin - m_stcMathExpr->SetMarginType(2, wxSTC_MARGIN_SYMBOL); - m_stcMathExpr->SetMarginMask(2, ~(wxSTC_MASK_FOLDERS)); + m_stcMathExpr->SetMarginType (2, wxSTC_MARGIN_SYMBOL); + m_stcMathExpr->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); m_stcMathExpr->SetMarginWidth(2, 0); m_stcMathExpr->SetMarginSensitive(2, true); - + // Configure the line numbers margin m_stcMathExpr->SetMarginType(0, wxSTC_MARGIN_NUMBER); - m_stcMathExpr->SetMarginWidth(0, 0); - + m_stcMathExpr->SetMarginWidth(0,0); + // Configure the line symbol margin m_stcMathExpr->SetMarginType(3, wxSTC_MARGIN_FORE); m_stcMathExpr->SetMarginMask(3, 0); - m_stcMathExpr->SetMarginWidth(3, 0); + m_stcMathExpr->SetMarginWidth(3,0); // Select the lexer m_stcMathExpr->SetLexer(wxSTC_LEX_PASCAL); // Set default font / styles m_stcMathExpr->StyleClearAll(); - for(int i = 0; i < wxSTC_STYLE_MAX; ++i) { m_stcMathExpr->StyleSetFont(i, m_stcMathExprFont); } + for(int i=0; iStyleSetFont(i, m_stcMathExprFont); + } m_stcMathExpr->SetWrapMode(0); m_stcMathExpr->SetIndentationGuides(0); m_stcMathExpr->SetKeyWords(0, wxT("")); @@ -4737,237 +4098,207 @@ MathExpressionFormBase::MathExpressionFormBase(wxWindow* parent, m_stcMathExpr->SetKeyWords(2, wxT("")); m_stcMathExpr->SetKeyWords(3, wxT("")); m_stcMathExpr->SetKeyWords(4, wxT("")); - + boxSizerLvl2_1->Add(m_stcMathExpr, 0, wxALL, WXC_FROM_DIP(5)); - m_stcMathExpr->SetMinSize(wxSize(400, 200)); - - m_staticTextCheckStatus = new wxStaticText(this, wxID_ANY, _("No checks performed"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl1_1->Add(m_staticTextCheckStatus, 0, - wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - + m_stcMathExpr->SetMinSize(wxSize(400,200)); + + m_staticTextCheckStatus = new wxStaticText(this, wxID_ANY, _("No checks performed"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl1_1->Add(m_staticTextCheckStatus, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_buttonCheck = - new wxButton(this, wxID_ANY, _("Check expression"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCheck, 0, wxALL | wxALIGN_LEFT, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_buttonCheck = new wxButton(this, wxID_ANY, _("Check expression"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCheck, 0, wxALL|wxALIGN_LEFT, WXC_FROM_DIP(5)); + boxSizerBottomButtons->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - -#if wxVERSION_NUMBER >= 2900 - if(!wxPersistenceManager::Get().Find(m_notebook)) { + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + + #if wxVERSION_NUMBER >= 2900 + if(!wxPersistenceManager::Get().Find(m_notebook)){ wxPersistenceManager::Get().RegisterAndRestore(m_notebook); } else { wxPersistenceManager::Get().Restore(m_notebook); } -#endif - + #endif + SetName(wxT("MathExpressionFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_textCtrlVariables->Connect(wxEVT_COMMAND_TEXT_UPDATED, - wxCommandEventHandler(MathExpressionFormBase::OnTextUpdate), NULL, this); - m_textCtrlVariables->Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(MathExpressionFormBase::OnTextEnter), - NULL, this); - m_stcMathExpr->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MathExpressionFormBase::OnLeftClickDown), NULL, this); - m_buttonCheck->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(MathExpressionFormBase::OnCheckButtonClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MathExpressionFormBase::OnOKButtonClick), - NULL, this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(MathExpressionFormBase::OnCancelButtonClick), NULL, this); + m_textCtrlVariables->Bind(wxEVT_COMMAND_TEXT_UPDATED, &MathExpressionFormBase::OnTextUpdate, this); + m_textCtrlVariables->Bind(wxEVT_COMMAND_TEXT_ENTER, &MathExpressionFormBase::OnTextEnter, this); + m_stcMathExpr->Bind(wxEVT_LEFT_DOWN, &MathExpressionFormBase::OnLeftClickDown, this); + m_buttonCheck->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MathExpressionFormBase::OnCheckButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MathExpressionFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &MathExpressionFormBase::OnCancelButtonClick, this); + } MathExpressionFormBase::~MathExpressionFormBase() { - m_textCtrlVariables->Disconnect(wxEVT_COMMAND_TEXT_UPDATED, - wxCommandEventHandler(MathExpressionFormBase::OnTextUpdate), NULL, this); - m_textCtrlVariables->Disconnect(wxEVT_COMMAND_TEXT_ENTER, - wxCommandEventHandler(MathExpressionFormBase::OnTextEnter), NULL, this); - m_stcMathExpr->Disconnect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MathExpressionFormBase::OnLeftClickDown), NULL, - this); - m_buttonCheck->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(MathExpressionFormBase::OnCheckButtonClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MathExpressionFormBase::OnOKButtonClick), - NULL, this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(MathExpressionFormBase::OnCancelButtonClick), NULL, this); + m_textCtrlVariables->Unbind(wxEVT_COMMAND_TEXT_UPDATED, &MathExpressionFormBase::OnTextUpdate, this); + m_textCtrlVariables->Unbind(wxEVT_COMMAND_TEXT_ENTER, &MathExpressionFormBase::OnTextEnter, this); + m_stcMathExpr->Unbind(wxEVT_LEFT_DOWN, &MathExpressionFormBase::OnLeftClickDown, this); + m_buttonCheck->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &MathExpressionFormBase::OnCheckButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &MathExpressionFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &MathExpressionFormBase::OnCancelButtonClick, this); + } -HarmCurrentFormBase::HarmCurrentFormBase(wxWindow* parent, - wxWindowID id, - const wxString& title, - const wxPoint& pos, - const wxSize& size, - long style) +HarmCurrentFormBase::HarmCurrentFormBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxDialog(parent, id, title, pos, size, style) { - if(!bBitmapLoaded) { + if ( !bBitmapLoaded ) { // We need to initialise the default bitmap handler wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); wxC9EE9InitBitmapResources(); bBitmapLoaded = true; } - + wxBoxSizer* boxSizerLvl1_1 = new wxBoxSizer(wxVERTICAL); this->SetSizer(boxSizerLvl1_1); - + wxBoxSizer* boxSizerLvl2_2 = new wxBoxSizer(wxVERTICAL); - - boxSizerLvl1_1->Add(boxSizerLvl2_2, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - - m_staticTextName = - new wxStaticText(this, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl2_2->Add(m_staticTextName, 0, wxLEFT | wxRIGHT | wxTOP | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_textCtrlName = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); -#if wxVERSION_NUMBER >= 3000 + + boxSizerLvl1_1->Add(boxSizerLvl2_2, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + + m_staticTextName = new wxStaticText(this, wxID_ANY, _("Name"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl2_2->Add(m_staticTextName, 0, wxLEFT|wxRIGHT|wxTOP|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_textCtrlName = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + #if wxVERSION_NUMBER >= 3000 m_textCtrlName->SetHint(wxT("")); -#endif - - boxSizerLvl2_2->Add(m_textCtrlName, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND | wxALIGN_CENTER_VERTICAL, - WXC_FROM_DIP(5)); - m_textCtrlName->SetMinSize(wxSize(300, -1)); - + #endif + + boxSizerLvl2_2->Add(m_textCtrlName, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + m_textCtrlName->SetMinSize(wxSize(300,-1)); + wxBoxSizer* boxSizerLvl2_1 = new wxBoxSizer(wxHORIZONTAL); - + boxSizerLvl1_1->Add(boxSizerLvl2_1, 0, wxALL, WXC_FROM_DIP(5)); - + wxBoxSizer* boxSizerLvl3_1 = new wxBoxSizer(wxVERTICAL); - - boxSizerLvl2_1->Add(boxSizerLvl3_1, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5)); - + + boxSizerLvl2_1->Add(boxSizerLvl3_1, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); + wxArrayString m_pgMgrHarmCurrentPropArr; wxUnusedVar(m_pgMgrHarmCurrentPropArr); wxArrayInt m_pgMgrHarmCurrentPropIntArr; wxUnusedVar(m_pgMgrHarmCurrentPropIntArr); - m_pgMgrHarmCurrentProp = - new wxPropertyGridManager(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), - wxPG_STATIC_LAYOUT | wxPG_SPLITTER_AUTO_CENTER | wxPG_BOLD_MODIFIED); - + m_pgMgrHarmCurrentProp = new wxPropertyGridManager(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxPG_STATIC_LAYOUT|wxPG_SPLITTER_AUTO_CENTER|wxPG_BOLD_MODIFIED); + boxSizerLvl3_1->Add(m_pgMgrHarmCurrentProp, 1, wxALL, WXC_FROM_DIP(5)); - - m_pgPropTitle = m_pgMgrHarmCurrentProp->Append(new wxPropertyCategory(_("Harmonic Current properties"))); + + m_pgPropTitle = m_pgMgrHarmCurrentProp->Append( new wxPropertyCategory( _("Harmonic Current properties") ) ); m_pgPropTitle->SetHelpString(wxT("")); - - m_pgPropHarmOrder = m_pgMgrHarmCurrentProp->Append(new wxIntProperty(_("Order"), wxPG_LABEL, 3)); + + m_pgPropHarmOrder = m_pgMgrHarmCurrentProp->Append( new wxIntProperty( _("Order"), wxPG_LABEL, 3) ); m_pgPropHarmOrder->SetHelpString(wxT("")); - - m_pgPropHarmCurrent = m_pgMgrHarmCurrentProp->Append(new wxFloatProperty(_("Current"), wxPG_LABEL, 0)); + + m_pgPropHarmCurrent = m_pgMgrHarmCurrentProp->Append( new wxFloatProperty( _("Current"), wxPG_LABEL, 0) ); m_pgPropHarmCurrent->SetHelpString(wxT("")); - + m_pgMgrHarmCurrentPropArr.Clear(); m_pgMgrHarmCurrentPropIntArr.Clear(); m_pgMgrHarmCurrentPropArr.Add(_("A")); m_pgMgrHarmCurrentPropArr.Add(_("p.u.")); - m_pgPropUnit = m_pgMgrHarmCurrentProp->Append( - new wxEnumProperty(_("Unit"), wxPG_LABEL, m_pgMgrHarmCurrentPropArr, m_pgMgrHarmCurrentPropIntArr, 0)); + m_pgPropUnit = m_pgMgrHarmCurrentProp->Append( new wxEnumProperty( _("Unit"), wxPG_LABEL, m_pgMgrHarmCurrentPropArr, m_pgMgrHarmCurrentPropIntArr, 0) ); m_pgPropUnit->SetHelpString(wxT("")); - - m_pgPropHarmAngle = m_pgMgrHarmCurrentProp->Append(new wxFloatProperty(_("Angle (degrees)"), wxPG_LABEL, 0)); + + m_pgPropHarmAngle = m_pgMgrHarmCurrentProp->Append( new wxFloatProperty( _("Angle (degrees)"), wxPG_LABEL, 0) ); m_pgPropHarmAngle->SetHelpString(wxT("")); - m_pgMgrHarmCurrentProp->SetMinSize(wxSize(300, -1)); - + m_pgMgrHarmCurrentProp->SetMinSize(wxSize(300,-1)); + wxBoxSizer* boxSizerLvl3_3 = new wxBoxSizer(wxVERTICAL); - - boxSizerLvl2_1->Add(boxSizerLvl3_3, 0, wxALL | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); - - m_buttonInsert = new wxButton(this, wxID_ANY, _("Add"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl3_3->Add(m_buttonInsert, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonRemove = new wxButton(this, wxID_ANY, _("Remove"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl3_3->Add(m_buttonRemove, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - + + boxSizerLvl2_1->Add(boxSizerLvl3_3, 0, wxALL|wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5)); + + m_buttonInsert = new wxButton(this, wxID_ANY, _("Add"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl3_3->Add(m_buttonInsert, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonRemove = new wxButton(this, wxID_ANY, _("Remove"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl3_3->Add(m_buttonRemove, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + wxBoxSizer* boxSizerLvl3_2 = new wxBoxSizer(wxVERTICAL); - + boxSizerLvl2_1->Add(boxSizerLvl3_2, 0, wxALL, WXC_FROM_DIP(5)); - - m_staticTextHarmCurrentList = new wxStaticText(this, wxID_ANY, _("Injected harmonic currents"), wxDefaultPosition, - wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerLvl3_2->Add(m_staticTextHarmCurrentList, 0, wxLEFT | wxRIGHT | wxTOP, WXC_FROM_DIP(5)); - - m_listCtrlHarmCurrentList = - new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxLC_REPORT); - - boxSizerLvl3_2->Add(m_listCtrlHarmCurrentList, 0, wxLEFT | wxRIGHT | wxBOTTOM, WXC_FROM_DIP(5)); - m_listCtrlHarmCurrentList->SetMinSize(wxSize(400, -1)); - + + m_staticTextHarmCurrentList = new wxStaticText(this, wxID_ANY, _("Injected harmonic currents"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerLvl3_2->Add(m_staticTextHarmCurrentList, 0, wxLEFT|wxRIGHT|wxTOP, WXC_FROM_DIP(5)); + + m_listCtrlHarmCurrentList = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxLC_REPORT); + + boxSizerLvl3_2->Add(m_listCtrlHarmCurrentList, 0, wxLEFT|wxRIGHT|wxBOTTOM, WXC_FROM_DIP(5)); + m_listCtrlHarmCurrentList->SetMinSize(wxSize(400,-1)); + wxBoxSizer* boxSizerBottomButtons = new wxBoxSizer(wxHORIZONTAL); - - boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - - m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0); - - boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL | wxALIGN_RIGHT, WXC_FROM_DIP(5)); - + + boxSizerLvl1_1->Add(boxSizerBottomButtons, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonOK = new wxButton(this, wxID_ANY, _("OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonOK, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + + m_buttonCancel = new wxButton(this, wxID_ANY, _("Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), 0); + + boxSizerBottomButtons->Add(m_buttonCancel, 0, wxALL|wxALIGN_RIGHT, WXC_FROM_DIP(5)); + SetName(wxT("HarmCurrentFormBase")); - SetSize(wxDLG_UNIT(this, wxSize(-1, -1))); - if(GetSizer()) { GetSizer()->Fit(this); } + SetSize(wxDLG_UNIT(this, wxSize(-1,-1))); + if (GetSizer()) { + GetSizer()->Fit(this); + } if(GetParent()) { CentreOnParent(wxBOTH); } else { CentreOnScreen(wxBOTH); } -#if wxVERSION_NUMBER >= 2900 if(!wxPersistenceManager::Get().Find(this)) { wxPersistenceManager::Get().RegisterAndRestore(this); } else { wxPersistenceManager::Get().Restore(this); } -#endif // Connect events - m_buttonInsert->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(HarmCurrentFormBase::OnAddButtonClick), - NULL, this); - m_buttonRemove->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(HarmCurrentFormBase::OnRemoveButtonClick), NULL, this); - m_buttonOK->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(HarmCurrentFormBase::OnOKButtonClick), NULL, - this); - m_buttonCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(HarmCurrentFormBase::OnCancelButtonClick), NULL, this); + m_buttonInsert->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &HarmCurrentFormBase::OnAddButtonClick, this); + m_buttonRemove->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &HarmCurrentFormBase::OnRemoveButtonClick, this); + m_buttonOK->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &HarmCurrentFormBase::OnOKButtonClick, this); + m_buttonCancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, &HarmCurrentFormBase::OnCancelButtonClick, this); + } HarmCurrentFormBase::~HarmCurrentFormBase() { - m_buttonInsert->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(HarmCurrentFormBase::OnAddButtonClick), NULL, this); - m_buttonRemove->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(HarmCurrentFormBase::OnRemoveButtonClick), NULL, this); - m_buttonOK->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(HarmCurrentFormBase::OnOKButtonClick), - NULL, this); - m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, - wxCommandEventHandler(HarmCurrentFormBase::OnCancelButtonClick), NULL, this); + m_buttonInsert->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &HarmCurrentFormBase::OnAddButtonClick, this); + m_buttonRemove->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &HarmCurrentFormBase::OnRemoveButtonClick, this); + m_buttonOK->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &HarmCurrentFormBase::OnOKButtonClick, this); + m_buttonCancel->Unbind(wxEVT_COMMAND_BUTTON_CLICKED, &HarmCurrentFormBase::OnCancelButtonClick, this); + } diff --git a/Project/ElementFormBase.h b/Project/ElementFormBase.h index 9556f7d1..6e1ecc22 100644 --- a/Project/ElementFormBase.h +++ b/Project/ElementFormBase.h @@ -7,33 +7,34 @@ #ifndef _PSP_PROJECT_ELEMENTFORM_BASE_CLASSES_H #define _PSP_PROJECT_ELEMENTFORM_BASE_CLASSES_H -#include -#include -#include -#include -#include +// clang-format off +#include +#include +#include #include #include -#include -#include +#include +#include #include #include -//#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include +#include +#include +#include +#include #include -#include -#include -#include #if wxVERSION_NUMBER >= 2900 #include -#include #include +#include #include #endif @@ -46,9 +47,11 @@ #define WXC_FROM_DIP(x) x #endif +// clang-format on + class BusFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextName; @@ -92,7 +95,7 @@ class BusFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnNominalVoltageChoice(wxCommandEvent& event) { event.Skip(); } virtual void OnControlledVoltageClick(wxCommandEvent& event) { event.Skip(); } virtual void OnInsertFaultClick(wxCommandEvent& event) { event.Skip(); } @@ -101,7 +104,7 @@ class BusFormBase : public wxDialog virtual void OnButtonOKClick(wxCommandEvent& event) { event.Skip(); } virtual void OnButtonCancelClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextName() { return m_staticTextName; } wxTextCtrl* GetTextCtrlName() { return m_textCtrlName; } wxStaticText* GetStaticTextNomVoltage() { return m_staticTextNomVoltage; } @@ -144,18 +147,14 @@ class BusFormBase : public wxDialog wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - BusFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Bus"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + BusFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Bus"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~BusFormBase(); }; + class SyncMachineFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextName; @@ -198,14 +197,14 @@ class SyncMachineFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnCheckMaxReactive(wxCommandEvent& event) { event.Skip(); } virtual void OnCheckMinReactive(wxCommandEvent& event) { event.Skip(); } virtual void OnStabilityButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextName() { return m_staticTextName; } wxTextCtrl* GetTextCtrlName() { return m_textCtrlName; } wxStaticText* GetStaticTextNominalPower() { return m_staticTextNominalPower; } @@ -247,18 +246,14 @@ class SyncMachineFormBase : public wxDialog wxButton* GetButtonStab() { return m_buttonStab; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - SyncMachineFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Generator"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + SyncMachineFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Generator"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~SyncMachineFormBase(); }; + class GeneratorStabFormBase : public wxDialog { - protected: +protected: wxCheckBox* m_checkBoxPlotSyncMachine; wxStaticText* m_staticTextInertia; wxTextCtrl* m_textCtrlInertia; @@ -317,7 +312,7 @@ class GeneratorStabFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void UseAVRClick(wxCommandEvent& event) { event.Skip(); } virtual void OnEditAVRButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void UseSGClick(wxCommandEvent& event) { event.Skip(); } @@ -326,7 +321,7 @@ class GeneratorStabFormBase : public wxDialog virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxCheckBox* GetCheckBoxPlotSyncMachine() { return m_checkBoxPlotSyncMachine; } wxStaticText* GetStaticTextInertia() { return m_staticTextInertia; } wxTextCtrl* GetTextCtrlInertia() { return m_textCtrlInertia; } @@ -384,18 +379,14 @@ class GeneratorStabFormBase : public wxDialog wxButton* GetButtonSwitching() { return m_buttonSwitching; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - GeneratorStabFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Generator: stability"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + GeneratorStabFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Generator: Stability"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~GeneratorStabFormBase(); }; + class LineFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextName; @@ -429,12 +420,12 @@ class LineFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnStabilityButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextName() { return m_staticTextName; } wxTextCtrl* GetTextCtrlName() { return m_textCtrlName; } wxStaticText* GetStaticTextNominalVoltage() { return m_staticTextNominalVoltage; } @@ -467,18 +458,14 @@ class LineFormBase : public wxDialog wxButton* GetButtonStability() { return m_buttonStability; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - LineFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Line"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + LineFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Line"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~LineFormBase(); }; + class TransformerFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextName; @@ -522,12 +509,12 @@ class TransformerFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnStabilityButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextName() { return m_staticTextName; } wxTextCtrl* GetTextCtrlName() { return m_textCtrlName; } wxStaticText* GetStaticTextNominalVoltage() { return m_staticTextNominalVoltage; } @@ -570,18 +557,14 @@ class TransformerFormBase : public wxDialog wxButton* GetButtonStability() { return m_buttonStability; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - TransformerFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Transformer"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + TransformerFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Transformer"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~TransformerFormBase(); }; + class LoadFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextName; @@ -619,13 +602,13 @@ class LoadFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnCheckBoxCompLoadClick(wxCommandEvent& event) { event.Skip(); } virtual void OnStabilityButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnOnButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextName() { return m_staticTextName; } wxTextCtrl* GetTextCtrlName() { return m_textCtrlName; } wxStaticText* GetStaticTextActivePower() { return m_staticTextActivePower; } @@ -662,18 +645,14 @@ class LoadFormBase : public wxDialog wxButton* GetButtonStabButton() { return m_buttonStabButton; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - LoadFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Load"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + LoadFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Load"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~LoadFormBase(); }; + class ReactiveShuntElementFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextName; @@ -685,12 +664,12 @@ class ReactiveShuntElementFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnStabilityButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextName() { return m_staticTextName; } wxTextCtrl* GetTextCtrlName() { return m_textCtrlName; } wxStaticText* GetStaticTextReactivePower() { return m_staticTextReactivePower; } @@ -701,18 +680,14 @@ class ReactiveShuntElementFormBase : public wxDialog wxButton* GetButtonStabButton() { return m_buttonStabButton; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - ReactiveShuntElementFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Reactive shunt element"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + ReactiveShuntElementFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Reactive shunt element"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~ReactiveShuntElementFormBase(); }; + class SwitchingFormBase : public wxDialog { - protected: +protected: wxPropertyGridManager* m_pgMgrSwitchingsProp; wxPGProperty* m_pgPropTitle; wxPGProperty* m_pgPropType; @@ -726,7 +701,7 @@ class SwitchingFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnChangeProperties(wxPropertyGridEvent& event) { event.Skip(); } virtual void OnInsertButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnRemoveButtonClick(wxCommandEvent& event) { event.Skip(); } @@ -736,7 +711,7 @@ class SwitchingFormBase : public wxDialog virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxPropertyGridManager* GetPgMgrSwitchingsProp() { return m_pgMgrSwitchingsProp; } wxButton* GetButtonInsert() { return m_buttonInsert; } wxButton* GetButtonRemove() { return m_buttonRemove; } @@ -746,18 +721,14 @@ class SwitchingFormBase : public wxDialog wxListCtrl* GetListCtrlSwitchings() { return m_listCtrlSwitchings; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - SwitchingFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Switching"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + SwitchingFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Switching"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~SwitchingFormBase(); }; + class IndMotorFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextName; @@ -806,14 +777,14 @@ class IndMotorFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnCalcQInPFClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCheckboxUseCageFactorClick(wxCommandEvent& event) { event.Skip(); } virtual void OnStabilityButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextName() { return m_staticTextName; } wxTextCtrl* GetTextCtrlName() { return m_textCtrlName; } wxStaticText* GetStaticTextNominalPower() { return m_staticTextNominalPower; } @@ -861,18 +832,14 @@ class IndMotorFormBase : public wxDialog wxButton* GetButtonSwitchingButton() { return m_buttonSwitchingButton; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - IndMotorFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Motor"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + IndMotorFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Motor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~IndMotorFormBase(); }; + class TextFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextElement; @@ -894,7 +861,7 @@ class TextFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnElementChoiceSelected(wxCommandEvent& event) { event.Skip(); } virtual void OnNameChoiceSelected(wxCommandEvent& event) { event.Skip(); } virtual void OnTypeChoiceSelected(wxCommandEvent& event) { event.Skip(); } @@ -905,7 +872,7 @@ class TextFormBase : public wxDialog virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextElement() { return m_staticTextElement; } wxChoice* GetChoiceElement() { return m_choiceElement; } wxStaticText* GetStaticTextName() { return m_staticTextName; } @@ -926,18 +893,14 @@ class TextFormBase : public wxDialog wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - TextFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Text"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + TextFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~TextFormBase(); }; + class TransferFunctionFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextNumerator; @@ -947,11 +910,11 @@ class TransferFunctionFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnOKClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextNumerator() { return m_staticTextNumerator; } wxTextCtrl* GetTextCtrlNumerator() { return m_textCtrlNumerator; } wxStaticText* GetStaticTextDenominator() { return m_staticTextDenominator; } @@ -960,18 +923,14 @@ class TransferFunctionFormBase : public wxDialog wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - TransferFunctionFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Transfer function"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + TransferFunctionFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Transfer function"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~TransferFunctionFormBase(); }; + class SumFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextSigns; @@ -979,29 +938,25 @@ class SumFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnOKClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextSigns() { return m_staticTextSigns; } wxTextCtrl* GetTextCtrlSigns() { return m_textCtrlSigns; } wxPanel* GetPanelGeneral() { return m_panelGeneral; } wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - SumFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Sum"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + SumFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Sum"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~SumFormBase(); }; + class LimiterFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextUpLimiter; @@ -1011,11 +966,11 @@ class LimiterFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextUpLimiter() { return m_staticTextUpLimiter; } wxTextCtrl* GetTextCtrlUpLimit() { return m_textCtrlUpLimit; } wxStaticText* GetStaticTextLowLimit() { return m_staticTextLowLimit; } @@ -1024,18 +979,14 @@ class LimiterFormBase : public wxDialog wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - LimiterFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Limiter"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + LimiterFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Limiter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~LimiterFormBase(); }; + class RateLimiterFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextUpLimiter; @@ -1045,11 +996,11 @@ class RateLimiterFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextUpLimiter() { return m_staticTextUpLimiter; } wxTextCtrl* GetTextCtrlUpLimit() { return m_textCtrlUpLimit; } wxStaticText* GetStaticTextLowLimit() { return m_staticTextLowLimit; } @@ -1058,18 +1009,14 @@ class RateLimiterFormBase : public wxDialog wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - RateLimiterFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Rate limiter"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + RateLimiterFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Rate limiter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~RateLimiterFormBase(); }; + class ExponentialFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextExp; @@ -1080,11 +1027,11 @@ class ExponentialFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextExp() { return m_staticTextExp; } wxStaticText* GetStaticTextAValue() { return m_staticTextAValue; } wxTextCtrl* GetTextCtrlAValue() { return m_textCtrlAValue; } @@ -1094,18 +1041,14 @@ class ExponentialFormBase : public wxDialog wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - ExponentialFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Exponential"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + ExponentialFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Exponential"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~ExponentialFormBase(); }; + class ConstantFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextValue; @@ -1113,29 +1056,25 @@ class ConstantFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextValue() { return m_staticTextValue; } wxTextCtrl* GetTextCtrlValue() { return m_textCtrlValue; } wxPanel* GetPanelGeneral() { return m_panelGeneral; } wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - ConstantFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Constant"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + ConstantFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Constant"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~ConstantFormBase(); }; + class GainFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextValue; @@ -1143,29 +1082,25 @@ class GainFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextValue() { return m_staticTextValue; } wxTextCtrl* GetTextCtrlValue() { return m_textCtrlValue; } wxPanel* GetPanelGeneral() { return m_panelGeneral; } wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - GainFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Gain"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + GainFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Gain"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~GainFormBase(); }; + class IOControlFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxCheckBox* m_checkBoxInput; @@ -1175,13 +1110,13 @@ class IOControlFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_ButtonCancel; - protected: +protected: virtual void OnInputChecked(wxCommandEvent& event) { event.Skip(); } virtual void OnOutputChecked(wxCommandEvent& event) { event.Skip(); } virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxCheckBox* GetCheckBoxInput() { return m_checkBoxInput; } wxChoice* GetChoiceInput() { return m_choiceInput; } wxCheckBox* GetCheckBoxOutput() { return m_checkBoxOutput; } @@ -1190,18 +1125,14 @@ class IOControlFormBase : public wxDialog wxNotebook* GetNotebook() { return m_notebook; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_ButtonCancel; } - IOControlFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Input / Output"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + IOControlFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Input / Output"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~IOControlFormBase(); }; + class MathExpressionFormBase : public wxDialog { - protected: +protected: wxNotebook* m_notebook; wxPanel* m_panelGeneral; wxStaticText* m_staticTextVariables; @@ -1212,7 +1143,7 @@ class MathExpressionFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnTextUpdate(wxCommandEvent& event) { event.Skip(); } virtual void OnTextEnter(wxCommandEvent& event) { event.Skip(); } virtual void OnLeftClickDown(wxMouseEvent& event) { event.Skip(); } @@ -1220,7 +1151,7 @@ class MathExpressionFormBase : public wxDialog virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextVariables() { return m_staticTextVariables; } wxTextCtrl* GetTextCtrlVariables() { return m_textCtrlVariables; } wxStyledTextCtrl* GetStcMathExpr() { return m_stcMathExpr; } @@ -1230,18 +1161,14 @@ class MathExpressionFormBase : public wxDialog wxButton* GetButtonCheck() { return m_buttonCheck; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - MathExpressionFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Math expression"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + MathExpressionFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Math expression"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~MathExpressionFormBase(); }; + class HarmCurrentFormBase : public wxDialog { - protected: +protected: wxStaticText* m_staticTextName; wxTextCtrl* m_textCtrlName; wxPropertyGridManager* m_pgMgrHarmCurrentProp; @@ -1257,13 +1184,13 @@ class HarmCurrentFormBase : public wxDialog wxButton* m_buttonOK; wxButton* m_buttonCancel; - protected: +protected: virtual void OnAddButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnRemoveButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnOKButtonClick(wxCommandEvent& event) { event.Skip(); } virtual void OnCancelButtonClick(wxCommandEvent& event) { event.Skip(); } - public: +public: wxStaticText* GetStaticTextName() { return m_staticTextName; } wxTextCtrl* GetTextCtrlName() { return m_textCtrlName; } wxPropertyGridManager* GetPgMgrHarmCurrentProp() { return m_pgMgrHarmCurrentProp; } @@ -1273,12 +1200,7 @@ class HarmCurrentFormBase : public wxDialog wxListCtrl* GetListCtrlHarmCurrentList() { return m_listCtrlHarmCurrentList; } wxButton* GetButtonOK() { return m_buttonOK; } wxButton* GetButtonCancel() { return m_buttonCancel; } - HarmCurrentFormBase(wxWindow* parent, - wxWindowID id = wxID_ANY, - const wxString& title = _("Switching"), - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxSize(-1, -1), - long style = wxDEFAULT_DIALOG_STYLE); + HarmCurrentFormBase(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Switching"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(-1,-1), long style = wxDEFAULT_DIALOG_STYLE); virtual ~HarmCurrentFormBase(); }; diff --git a/Project/ElementFormBitmaps.cpp b/Project/ElementFormBitmaps.cpp index 1e26d30d..9396f40a 100644 --- a/Project/ElementFormBitmaps.cpp +++ b/Project/ElementFormBitmaps.cpp @@ -44,6 +44,6 @@ void wxC9EE9InitBitmapResources() else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase); } - XRC_ADD_FILE(wxT("XRC_resource/ElementFormBitmaps.cpp$C__Users_thale_Documents_GitHub_PSP_Project_ElementFormBitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml")); - wxXmlResource::Get()->Load(wxT("memory:XRC_resource/ElementFormBitmaps.cpp$C__Users_thale_Documents_GitHub_PSP_Project_ElementFormBitmaps.xrc")); + XRC_ADD_FILE(wxT("XRC_resource/ElementFormBitmaps.cpp$C__Users_Pichau_Documents_GitHub_PSP_Project_ElementFormBitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml")); + wxXmlResource::Get()->Load(wxT("memory:XRC_resource/ElementFormBitmaps.cpp$C__Users_Pichau_Documents_GitHub_PSP_Project_ElementFormBitmaps.xrc")); } diff --git a/Project/Line.cpp b/Project/Line.cpp index f66b9f40..a6156abc 100644 --- a/Project/Line.cpp +++ b/Project/Line.cpp @@ -19,91 +19,92 @@ Line::Line() : Branch() { - for(int i = 0; i < 2; i++) { - for(int j = 0; j < 3; j++) { m_electricalData.faultCurrent[i][j] = std::complex(0.0, 0.0); } - } + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 3; j++) { m_electricalData.faultCurrent[i][j] = std::complex(0.0, 0.0); } + } } Line::Line(wxString name) : Branch() { - for(int i = 0; i < 2; i++) { - for(int j = 0; j < 3; j++) { m_electricalData.faultCurrent[i][j] = std::complex(0.0, 0.0); } - } - m_electricalData.name = name; + for (int i = 0; i < 2; i++) { + for (int j = 0; j < 3; j++) { m_electricalData.faultCurrent[i][j] = std::complex(0.0, 0.0); } + } + m_electricalData.name = name; } Line::~Line() {} bool Line::Contains(wxPoint2DDouble position) const { - if(PointToLineDistance(position) < 5.0) { return true; } - return false; + if (PointToLineDistance(position) < 5.0) { return true; } + return false; } void Line::Draw(wxPoint2DDouble translation, double scale) const { - OpenGLColour elementColour; - if(m_online) { - if(m_dynEvent) - elementColour = m_dynamicEventColour; - else - elementColour = m_onlineElementColour; - - } else - elementColour = m_offlineElementColour; - - std::vector pointList = m_pointList; - if(!m_inserted && pointList.size() > 0) { - wxPoint2DDouble secondPoint = m_position; - if(pointList.size() > 2) { secondPoint = pointList[2]; } - pointList[1] = GetSwitchPoint(m_parentList[0], pointList[0], secondPoint); - pointList.push_back(m_position); - } - - // Line selected (Layer 1). - if(m_selected) { - glLineWidth(1.5 + m_borderSize * 2.0); - glColor4dv(m_selectionColour.GetRGBA()); - DrawLine(pointList); - - // Draw nodes selection. - if(pointList.size() > 0) { - DrawCircle(pointList[0], 5.0 + m_borderSize / scale, 10, GL_POLYGON); - if(m_inserted) { DrawCircle(pointList[pointList.size() - 1], 5.0 + m_borderSize / scale, 10, GL_POLYGON); } - } - } - - // Draw line (Layer 2) - glLineWidth(1.5); - glColor4dv(elementColour.GetRGBA()); - DrawLine(pointList); - - if(m_inserted) { - DrawSwitches(); - DrawPowerFlowPts(); - } - - // Draw nodes. - if(pointList.size() > 0) { - glColor4dv(elementColour.GetRGBA()); - DrawCircle(pointList[0], 5.0, 10, GL_POLYGON); - if(m_inserted) { DrawCircle(pointList[pointList.size() - 1], 5.0, 10, GL_POLYGON); } - } - - // Draw pickboxes (Layer 3). - if(m_showPickbox) { - glPushMatrix(); - glLoadIdentity(); - - for(int i = 2; i < (int)m_pointList.size() - 2; i++) { - DrawPickbox(WorldToScreen(m_pointList[i], translation, scale)); - } - - glPopMatrix(); - } + OpenGLColour elementColour; + if (m_online) { + if (m_dynEvent) + elementColour = m_dynamicEventColour; + else + elementColour = m_onlineElementColour; + + } + else + elementColour = m_offlineElementColour; + + std::vector pointList = m_pointList; + if (!m_inserted && pointList.size() > 0) { + wxPoint2DDouble secondPoint = m_position; + if (pointList.size() > 2) { secondPoint = pointList[2]; } + pointList[1] = GetSwitchPoint(m_parentList[0], pointList[0], secondPoint); + pointList.push_back(m_position); + } + + // Line selected (Layer 1). + if (m_selected) { + glLineWidth(1.5 + m_borderSize * 2.0); + glColor4dv(m_selectionColour.GetRGBA()); + DrawLine(pointList); + + // Draw nodes selection. + if (pointList.size() > 0) { + DrawCircle(pointList[0], 5.0 + m_borderSize / scale, 10, GL_POLYGON); + if (m_inserted) { DrawCircle(pointList[pointList.size() - 1], 5.0 + m_borderSize / scale, 10, GL_POLYGON); } + } + } + + // Draw line (Layer 2) + glLineWidth(1.5); + glColor4dv(elementColour.GetRGBA()); + DrawLine(pointList); + + if (m_inserted) { + DrawSwitches(); + DrawPowerFlowPts(); + } + + // Draw nodes. + if (pointList.size() > 0) { + glColor4dv(elementColour.GetRGBA()); + DrawCircle(pointList[0], 5.0, 10, GL_POLYGON); + if (m_inserted) { DrawCircle(pointList[pointList.size() - 1], 5.0, 10, GL_POLYGON); } + } + + // Draw pickboxes (Layer 3). + if (m_showPickbox) { + glPushMatrix(); + glLoadIdentity(); + + for (int i = 2; i < (int)m_pointList.size() - 2; i++) { + DrawPickbox(WorldToScreen(m_pointList[i], translation, scale)); + } + + glPopMatrix(); + } } void Line::DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* gc) const { - //gc->SetBrush(*wxTRANSPARENT_BRUSH); + //gc->SetBrush(*wxTRANSPARENT_BRUSH); wxGraphicsMatrix identityMatrix = gc->GetTransform(); identityMatrix.Set(); // Set to identity @@ -129,25 +130,25 @@ void Line::DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* // Line selected (Layer 1). if (m_selected) { - gc->SetPen(wxPen(wxColour(m_selectionColour.GetDcRGBA()), 2 + m_borderSize * 2.0)); - gc->SetBrush(*wxTRANSPARENT_BRUSH); + gc->SetPen(wxPen(wxColour(m_selectionColour.GetDcRGBA()), 2 + m_borderSize * 2.0)); + gc->SetBrush(*wxTRANSPARENT_BRUSH); if (pointList.size() > 0) gc->DrawLines(pointList.size(), &pointList[0]); - + // Draw nodes selection. - gc->SetPen(*wxTRANSPARENT_PEN); - gc->SetBrush(wxBrush(wxColour(m_selectionColour.GetDcRGBA()))); + gc->SetPen(*wxTRANSPARENT_PEN); + gc->SetBrush(wxBrush(wxColour(m_selectionColour.GetDcRGBA()))); if (pointList.size() > 0) { - DrawDCCircle(pointList[0], 5.0 + m_borderSize / scale, 10, gc); + DrawDCCircle(pointList[0], 5.0 + m_borderSize / scale, 10, gc); if (m_inserted) { DrawDCCircle(pointList[pointList.size() - 1], 5.0 + m_borderSize / scale, 10, gc); } } } // Draw line (Layer 2) - gc->SetPen(wxPen(wxColour(elementColour.GetDcRGBA()), 2)); - gc->SetBrush(*wxTRANSPARENT_BRUSH); - if(pointList.size() > 0) - gc->DrawLines(pointList.size(), &pointList[0]); + gc->SetPen(wxPen(wxColour(elementColour.GetDcRGBA()), 2)); + gc->SetBrush(*wxTRANSPARENT_BRUSH); + if (pointList.size() > 0) + gc->DrawLines(pointList.size(), &pointList[0]); if (m_inserted) { DrawDCSwitches(gc); @@ -177,637 +178,661 @@ void Line::DrawDC(wxPoint2DDouble translation, double scale, wxGraphicsContext* void Line::Move(wxPoint2DDouble position) { - if(!m_parentList[0]) { - m_pointList[0] = m_movePts[0] + position - m_moveStartPt; - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); - } - if(!m_parentList[1]) { - m_pointList[m_pointList.size() - 1] = m_movePts[m_pointList.size() - 1] + position - m_moveStartPt; - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); - } - - if(!m_parentList[0] && !m_parentList[1]) { - for(int i = 2; i < (int)m_pointList.size() - 2; i++) { - m_pointList[i] = m_movePts[i] + position - m_moveStartPt; - } - } + if (!m_parentList[0]) { + m_pointList[0] = m_movePts[0] + position - m_moveStartPt; + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); + } + if (!m_parentList[1]) { + m_pointList[m_pointList.size() - 1] = m_movePts[m_pointList.size() - 1] + position - m_moveStartPt; + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); + } + + if (!m_parentList[0] && !m_parentList[1]) { + for (int i = 2; i < (int)m_pointList.size() - 2; i++) { + m_pointList[i] = m_movePts[i] + position - m_moveStartPt; + } + } } bool Line::AddParent(Element* parent, wxPoint2DDouble position) { - if(parent) { - // First bus. - if(m_parentList.size() == 0) { - m_position = position; - m_parentList.push_back(parent); - parent->AddChild(this); - wxPoint2DDouble parentPt = - parent->RotateAtPosition(position, -parent->GetAngle()); // Rotate click to horizontal position. - parentPt.m_y = parent->GetPosition().m_y; // Centralize on bus. - parentPt = parent->RotateAtPosition(parentPt, parent->GetAngle()); // Rotate back. - m_pointList.push_back(parentPt); // First point - m_pointList.push_back(GetSwitchPoint(parent, parentPt, m_position)); - - wxRect2DDouble genRect(0, 0, 0, 0); - m_switchRect.push_back(genRect); - UpdateSwitches(); - - Bus* parentBus = static_cast(parent); - m_electricalData.nominalVoltage = parentBus->GetElectricalData().nominalVoltage; - m_electricalData.nominalVoltageUnit = parentBus->GetElectricalData().nominalVoltageUnit; - - return false; - } - // Second bus. - else if(parent != m_parentList[0]) { - Bus* parentBus = static_cast(parent); - if(m_electricalData.nominalVoltage != parentBus->GetElectricalData().nominalVoltage || - m_electricalData.nominalVoltageUnit != parentBus->GetElectricalData().nominalVoltageUnit) { - wxMessageDialog msgDialog(nullptr, - _("Unable to connect two buses with different nominal voltages.\n" - "Use a transformer or edit the bus properties."), - _("Error"), wxOK | wxCENTRE | wxICON_ERROR); - msgDialog.ShowModal(); - return false; - } - - m_parentList.push_back(parent); - parent->AddChild(this); - wxPoint2DDouble parentPt = - parent->RotateAtPosition(position, -parent->GetAngle()); // Rotate click to horizontal position. - parentPt.m_y = parent->GetPosition().m_y; // Centralize on bus. - parentPt = parent->RotateAtPosition(parentPt, parent->GetAngle()); // Rotate back. - - // Set first switch point. - wxPoint2DDouble secondPoint = parentPt; - if(m_pointList.size() > 2) { secondPoint = m_pointList[2]; } - m_pointList[1] = GetSwitchPoint(m_parentList[0], m_pointList[0], secondPoint); - - // Set the second switch point. - m_pointList.push_back(GetSwitchPoint(parent, parentPt, m_pointList[m_pointList.size() - 1])); - - m_pointList.push_back(parentPt); // Last point. - - wxRect2DDouble genRect(0, 0, 0, 0); - m_switchRect.push_back(genRect); - UpdateSwitches(); - - m_inserted = true; - UpdatePowerFlowArrowsPosition(); - return true; - } - } - return false; + if (parent) { + // First bus. + if (m_parentList.size() == 0) { + m_position = position; + m_parentList.push_back(parent); + parent->AddChild(this); + wxPoint2DDouble parentPt = + parent->RotateAtPosition(position, -parent->GetAngle()); // Rotate click to horizontal position. + parentPt.m_y = parent->GetPosition().m_y; // Centralize on bus. + parentPt = parent->RotateAtPosition(parentPt, parent->GetAngle()); // Rotate back. + m_pointList.push_back(parentPt); // First point + m_pointList.push_back(GetSwitchPoint(parent, parentPt, m_position)); + + wxRect2DDouble genRect(0, 0, 0, 0); + m_switchRect.push_back(genRect); + UpdateSwitches(); + + Bus* parentBus = static_cast(parent); + m_electricalData.nominalVoltage = parentBus->GetElectricalData().nominalVoltage; + m_electricalData.nominalVoltageUnit = parentBus->GetElectricalData().nominalVoltageUnit; + + return false; + } + // Second bus. + else if (parent != m_parentList[0]) { + Bus* parentBus = static_cast(parent); + if (m_electricalData.nominalVoltage != parentBus->GetElectricalData().nominalVoltage || + m_electricalData.nominalVoltageUnit != parentBus->GetElectricalData().nominalVoltageUnit) { + wxMessageDialog msgDialog(nullptr, + _("Unable to connect two buses with different nominal voltages.\n" + "Use a transformer or edit the bus properties."), + _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + msgDialog.ShowModal(); + return false; + } + + m_parentList.push_back(parent); + parent->AddChild(this); + wxPoint2DDouble parentPt = + parent->RotateAtPosition(position, -parent->GetAngle()); // Rotate click to horizontal position. + parentPt.m_y = parent->GetPosition().m_y; // Centralize on bus. + parentPt = parent->RotateAtPosition(parentPt, parent->GetAngle()); // Rotate back. + + // Set first switch point. + wxPoint2DDouble secondPoint = parentPt; + if (m_pointList.size() > 2) { secondPoint = m_pointList[2]; } + m_pointList[1] = GetSwitchPoint(m_parentList[0], m_pointList[0], secondPoint); + + // Set the second switch point. + m_pointList.push_back(GetSwitchPoint(parent, parentPt, m_pointList[m_pointList.size() - 1])); + + m_pointList.push_back(parentPt); // Last point. + + wxRect2DDouble genRect(0, 0, 0, 0); + m_switchRect.push_back(genRect); + UpdateSwitches(); + + m_inserted = true; + UpdatePowerFlowArrowsPosition(); + return true; + } + } + return false; } bool Line::Intersects(wxRect2DDouble rect) const { - for(auto it = m_pointList.begin(); it != m_pointList.end(); ++it) { - if(rect.Contains(*it)) return true; - } - return false; + for (auto it = m_pointList.begin(); it != m_pointList.end(); ++it) { + if (rect.Contains(*it)) return true; + } + return false; } void Line::MovePickbox(wxPoint2DDouble position) { - if(m_activePickboxID == ID_PB_NONE) return; - - for(int i = 2; i < (int)m_pointList.size() - 2; i++) { - if(m_activePickboxID == i) { - m_pointList[i] = m_movePts[i] + position - m_moveStartPt; - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); - } - } + if (m_activePickboxID == ID_PB_NONE) return; + + for (int i = 2; i < (int)m_pointList.size() - 2; i++) { + if (m_activePickboxID == i) { + m_pointList[i] = m_movePts[i] + position - m_moveStartPt; + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); + } + } } bool Line::PickboxContains(wxPoint2DDouble position) { - for(int i = 2; i < (int)m_pointList.size() - 2; i++) { - wxRect2DDouble rect(m_pointList[i].m_x - 5.0, m_pointList[i].m_y - 5.0, 10.0, 10.0); - if(rect.Contains(position)) { - m_activePickboxID = i; - return true; - } - } - return false; + for (int i = 2; i < (int)m_pointList.size() - 2; i++) { + wxRect2DDouble rect(m_pointList[i].m_x - 5.0, m_pointList[i].m_y - 5.0, 10.0, 10.0); + if (rect.Contains(position)) { + m_activePickboxID = i; + return true; + } + } + return false; } void Line::AddPoint(wxPoint2DDouble point) { - if(m_parentList.size() != 0) { m_pointList.push_back(point); } + if (m_parentList.size() != 0) { m_pointList.push_back(point); } } void Line::StartMove(wxPoint2DDouble position) { - m_moveStartPt = position; - m_movePts = m_pointList; + m_moveStartPt = position; + m_movePts = m_pointList; } void Line::MoveNode(Element* parent, wxPoint2DDouble position) { - if(parent) { - // First bus. - if(parent == m_parentList[0]) { - m_pointList[0] = m_movePts[0] + position - m_moveStartPt; - } - // Second bus. - else if(parent == m_parentList[1]) { - m_pointList[m_pointList.size() - 1] = m_movePts[m_pointList.size() - 1] + position - m_moveStartPt; - } - - // If the line is selected, move all the points, except the switches and buses points. - if(m_selected) { - for(int i = 2; i < (int)m_pointList.size() - 1; i++) { - m_pointList[i] = m_movePts[i] + position - m_moveStartPt; - } - } - } else { - // If parent is setted to nullptr for the firts time, remove the parent child - if(m_activeNodeID == 1) { - m_pointList[0] = m_movePts[0] + position - m_moveStartPt; - if(m_parentList[0]) { - m_parentList[0]->RemoveChild(this); - m_parentList[0] = nullptr; - m_online = false; - } - } else if(m_activeNodeID == 2) { - m_pointList[m_pointList.size() - 1] = m_movePts[m_pointList.size() - 1] + position - m_moveStartPt; - if(m_parentList[1]) { - m_parentList[1]->RemoveChild(this); - m_parentList[1] = nullptr; - m_online = false; - } - } - } - - // Recalculate switches positions - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); + if (parent) { + // First bus. + if (parent == m_parentList[0]) { + m_pointList[0] = m_movePts[0] + position - m_moveStartPt; + } + // Second bus. + else if (parent == m_parentList[1]) { + m_pointList[m_pointList.size() - 1] = m_movePts[m_pointList.size() - 1] + position - m_moveStartPt; + } + + // If the line is selected, move all the points, except the switches and buses points. + if (m_selected) { + for (int i = 2; i < (int)m_pointList.size() - 1; i++) { + m_pointList[i] = m_movePts[i] + position - m_moveStartPt; + } + } + } + else { + // If parent is setted to nullptr for the firts time, remove the parent child + if (m_activeNodeID == 1) { + m_pointList[0] = m_movePts[0] + position - m_moveStartPt; + if (m_parentList[0]) { + m_parentList[0]->RemoveChild(this); + m_parentList[0] = nullptr; + m_online = false; + } + } + else if (m_activeNodeID == 2) { + m_pointList[m_pointList.size() - 1] = m_movePts[m_pointList.size() - 1] + position - m_moveStartPt; + if (m_parentList[1]) { + m_parentList[1]->RemoveChild(this); + m_parentList[1] = nullptr; + m_online = false; + } + } + } + + // Recalculate switches positions + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); } bool Line::GetContextMenu(wxMenu& menu) { - wxFileName exeFileName(wxStandardPaths::Get().GetExecutablePath()); - wxString exePath = exeFileName.GetPath(); - - menu.Append(ID_EDIT_ELEMENT, _("Edit line")); - if(m_activePickboxID == ID_PB_NONE) { - wxMenuItem* addNodeItem = new wxMenuItem(&menu, ID_LINE_ADD_NODE, _("Insert node")); - addNodeItem->SetBitmap( - wxImage(exePath + wxFileName::DirName("\\..\\data\\images\\menu\\addNode16.png", wxPATH_WIN).GetPath())); - menu.Append(addNodeItem); - } else { - wxMenuItem* addNodeItem = new wxMenuItem(&menu, ID_LINE_REMOVE_NODE, _("Remove node")); - addNodeItem->SetBitmap( - wxImage(exePath + wxFileName::DirName("\\..\\data\\images\\menu\\removeNode16.png", wxPATH_WIN).GetPath())); - menu.Append(addNodeItem); - } - wxMenuItem* deleteItem = new wxMenuItem(&menu, ID_DELETE, _("Delete")); - deleteItem->SetBitmap( - wxImage(exePath + wxFileName::DirName("\\..\\data\\images\\menu\\delete16.png", wxPATH_WIN).GetPath())); - menu.Append(deleteItem); - return true; + wxFileName exeFileName(wxStandardPaths::Get().GetExecutablePath()); + wxString exePath = exeFileName.GetPath(); + + menu.Append(ID_EDIT_ELEMENT, _("Edit line")); + if (m_activePickboxID == ID_PB_NONE) { + wxMenuItem* addNodeItem = new wxMenuItem(&menu, ID_LINE_ADD_NODE, _("Insert node")); + addNodeItem->SetBitmap( + wxImage(exePath + wxFileName::DirName("\\..\\data\\images\\menu\\addNode16.png", wxPATH_WIN).GetPath())); + menu.Append(addNodeItem); + } + else { + wxMenuItem* addNodeItem = new wxMenuItem(&menu, ID_LINE_REMOVE_NODE, _("Remove node")); + addNodeItem->SetBitmap( + wxImage(exePath + wxFileName::DirName("\\..\\data\\images\\menu\\removeNode16.png", wxPATH_WIN).GetPath())); + menu.Append(addNodeItem); + } + wxMenuItem* deleteItem = new wxMenuItem(&menu, ID_DELETE, _("Delete")); + deleteItem->SetBitmap( + wxImage(exePath + wxFileName::DirName("\\..\\data\\images\\menu\\delete16.png", wxPATH_WIN).GetPath())); + menu.Append(deleteItem); + return true; } void Line::RemoveNode(wxPoint2DDouble point) { - if(PickboxContains(point)) { - for(int i = 2; i < (int)m_pointList.size() - 2; i++) { - if(m_activePickboxID == i) { - m_pointList.erase(m_pointList.begin() + i); - break; - } - } - } - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); + if (PickboxContains(point)) { + for (int i = 2; i < (int)m_pointList.size() - 2; i++) { + if (m_activePickboxID == i) { + m_pointList.erase(m_pointList.begin() + i); + break; + } + } + } + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); } void Line::AddNode(wxPoint2DDouble point) { - int segmentNumber = 0; - PointToLineDistance(point, &segmentNumber); - if(segmentNumber > 0 && segmentNumber < (int)m_pointList.size() - 2) { - m_pointList.insert(m_pointList.begin() + segmentNumber + 1, point); - } - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); + int segmentNumber = 0; + PointToLineDistance(point, &segmentNumber); + if (segmentNumber > 0 && segmentNumber < (int)m_pointList.size() - 2) { + m_pointList.insert(m_pointList.begin() + segmentNumber + 1, point); + } + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); } void Line::CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& rightBottom) const { - if(m_pointList.size() > 0) { - // Check points list boundaries. - leftUp = m_pointList[0]; - rightBottom = m_pointList[0]; - for(int i = 1; i < (int)m_pointList.size(); i++) { - if(m_pointList[i].m_x < leftUp.m_x) leftUp.m_x = m_pointList[i].m_x; - if(m_pointList[i].m_y < leftUp.m_y) leftUp.m_y = m_pointList[i].m_y; - if(m_pointList[i].m_x > rightBottom.m_x) rightBottom.m_x = m_pointList[i].m_x; - if(m_pointList[i].m_y > rightBottom.m_y) rightBottom.m_y = m_pointList[i].m_y; - } - } + if (m_pointList.size() > 0) { + // Check points list boundaries. + leftUp = m_pointList[0]; + rightBottom = m_pointList[0]; + for (int i = 1; i < (int)m_pointList.size(); i++) { + if (m_pointList[i].m_x < leftUp.m_x) leftUp.m_x = m_pointList[i].m_x; + if (m_pointList[i].m_y < leftUp.m_y) leftUp.m_y = m_pointList[i].m_y; + if (m_pointList[i].m_x > rightBottom.m_x) rightBottom.m_x = m_pointList[i].m_x; + if (m_pointList[i].m_y > rightBottom.m_y) rightBottom.m_y = m_pointList[i].m_y; + } + } } bool Line::ShowForm(wxWindow* parent, Element* element) { - LineForm* lineForm = new LineForm(parent, this); - if(lineForm->ShowModal() == wxID_OK) { - lineForm->Destroy(); - return true; - } - lineForm->Destroy(); - return false; + LineForm* lineForm = new LineForm(parent, this); + if (lineForm->ShowModal() == wxID_OK) { + lineForm->Destroy(); + return true; + } + lineForm->Destroy(); + return false; } void Line::SetNominalVoltage(std::vector nominalVoltage, std::vector nominalVoltageUnit) { - if(nominalVoltage.size() > 0) { - m_electricalData.nominalVoltage = nominalVoltage[0]; - m_electricalData.nominalVoltageUnit = nominalVoltageUnit[0]; - } + if (nominalVoltage.size() > 0) { + m_electricalData.nominalVoltage = nominalVoltage[0]; + m_electricalData.nominalVoltageUnit = nominalVoltageUnit[0]; + } } bool Line::SetNodeParent(Element* parent) { - if(m_activeNodeID == 1 && parent == m_parentList[0]) return false; - if(m_activeNodeID == 2 && parent == m_parentList[1]) return false; - - if(parent && m_activeNodeID != 0) { - wxRect2DDouble nodeRect(0, 0, 0, 0); - if(m_activeNodeID == 1) { - nodeRect = wxRect2DDouble(m_pointList[0].m_x - 5.0 - m_borderSize, m_pointList[0].m_y - 5.0 - m_borderSize, - 10 + 2.0 * m_borderSize, 10 + 2.0 * m_borderSize); - } - if(m_activeNodeID == 2) { - nodeRect = wxRect2DDouble(m_pointList[m_pointList.size() - 1].m_x - 5.0 - m_borderSize, - m_pointList[m_pointList.size() - 1].m_y - 5.0 - m_borderSize, - 10 + 2.0 * m_borderSize, 10 + 2.0 * m_borderSize); - } - - if(parent->Intersects(nodeRect)) { - // If the line has no parents set the new rated voltage, otherwise check if it's not connecting - // two different voltages buses - Bus* parentBus = static_cast(parent); - if(!m_parentList[0] && !m_parentList[1]) { - m_electricalData.nominalVoltage = parentBus->GetElectricalData().nominalVoltage; - m_electricalData.nominalVoltageUnit = parentBus->GetElectricalData().nominalVoltageUnit; - } else if(m_electricalData.nominalVoltage != parentBus->GetElectricalData().nominalVoltage || - m_electricalData.nominalVoltageUnit != parentBus->GetElectricalData().nominalVoltageUnit) { - wxMessageDialog msgDialog(nullptr, - _("Unable to connect two buses with different nominal voltages.\n" - "Use a transformer or edit the bus properties."), - _("Error"), wxOK | wxCENTRE | wxICON_ERROR); - msgDialog.ShowModal(); - m_activeNodeID = 0; - return false; - } - - if(m_activeNodeID == 1) { - // Check if the user is trying to connect the same bus. - if(m_parentList[1] == parent) { - m_activeNodeID = 0; - return false; - } - - m_parentList[0] = parent; - - // Centralize the node on bus. - wxPoint2DDouble parentPt = parent->RotateAtPosition( - m_pointList[0], -parent->GetAngle()); // Rotate click to horizontal position. - parentPt.m_y = parent->GetPosition().m_y; // Centralize on bus. - parentPt = parent->RotateAtPosition(parentPt, parent->GetAngle()); - m_pointList[0] = parentPt; - - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); - return true; - } - if(m_activeNodeID == 2) { - if(m_parentList[0] == parent) { - m_activeNodeID = 0; - return false; - } - - m_parentList[1] = parent; - - wxPoint2DDouble parentPt = - parent->RotateAtPosition(m_pointList[m_pointList.size() - 1], -parent->GetAngle()); - parentPt.m_y = parent->GetPosition().m_y; - parentPt = parent->RotateAtPosition(parentPt, parent->GetAngle()); - m_pointList[m_pointList.size() - 1] = parentPt; - - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); - return true; - } - } else { - if(m_activeNodeID == 1) m_parentList[0] = nullptr; - if(m_activeNodeID == 2) m_parentList[1] = nullptr; - } - } - return false; + if (m_activeNodeID == 1 && parent == m_parentList[0]) return false; + if (m_activeNodeID == 2 && parent == m_parentList[1]) return false; + + if (parent && m_activeNodeID != 0) { + wxRect2DDouble nodeRect(0, 0, 0, 0); + if (m_activeNodeID == 1) { + nodeRect = wxRect2DDouble(m_pointList[0].m_x - 5.0 - m_borderSize, m_pointList[0].m_y - 5.0 - m_borderSize, + 10 + 2.0 * m_borderSize, 10 + 2.0 * m_borderSize); + } + if (m_activeNodeID == 2) { + nodeRect = wxRect2DDouble(m_pointList[m_pointList.size() - 1].m_x - 5.0 - m_borderSize, + m_pointList[m_pointList.size() - 1].m_y - 5.0 - m_borderSize, + 10 + 2.0 * m_borderSize, 10 + 2.0 * m_borderSize); + } + + if (parent->Intersects(nodeRect)) { + // If the line has no parents set the new rated voltage, otherwise check if it's not connecting + // two different voltages buses + Bus* parentBus = static_cast(parent); + if (!m_parentList[0] && !m_parentList[1]) { + m_electricalData.nominalVoltage = parentBus->GetElectricalData().nominalVoltage; + m_electricalData.nominalVoltageUnit = parentBus->GetElectricalData().nominalVoltageUnit; + } + else if (m_electricalData.nominalVoltage != parentBus->GetElectricalData().nominalVoltage || + m_electricalData.nominalVoltageUnit != parentBus->GetElectricalData().nominalVoltageUnit) { + wxMessageDialog msgDialog(nullptr, + _("Unable to connect two buses with different nominal voltages.\n" + "Use a transformer or edit the bus properties."), + _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + msgDialog.ShowModal(); + m_activeNodeID = 0; + return false; + } + + if (m_activeNodeID == 1) { + // Check if the user is trying to connect the same bus. + if (m_parentList[1] == parent) { + m_activeNodeID = 0; + return false; + } + + m_parentList[0] = parent; + + // Centralize the node on bus. + wxPoint2DDouble parentPt = parent->RotateAtPosition( + m_pointList[0], -parent->GetAngle()); // Rotate click to horizontal position. + parentPt.m_y = parent->GetPosition().m_y; // Centralize on bus. + parentPt = parent->RotateAtPosition(parentPt, parent->GetAngle()); + m_pointList[0] = parentPt; + + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); + return true; + } + if (m_activeNodeID == 2) { + if (m_parentList[0] == parent) { + m_activeNodeID = 0; + return false; + } + + m_parentList[1] = parent; + + wxPoint2DDouble parentPt = + parent->RotateAtPosition(m_pointList[m_pointList.size() - 1], -parent->GetAngle()); + parentPt.m_y = parent->GetPosition().m_y; + parentPt = parent->RotateAtPosition(parentPt, parent->GetAngle()); + m_pointList[m_pointList.size() - 1] = parentPt; + + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); + return true; + } + } + else { + if (m_activeNodeID == 1) m_parentList[0] = nullptr; + if (m_activeNodeID == 2) m_parentList[1] = nullptr; + } + } + return false; } void Line::SetPowerFlowDirection(PowerFlowDirection pfDirection) { - m_pfDirection = pfDirection; - UpdatePowerFlowArrowsPosition(); + m_pfDirection = pfDirection; + UpdatePowerFlowArrowsPosition(); } void Line::UpdatePowerFlowArrowsPosition() { - std::vector edges; - switch(m_pfDirection) { - case PowerFlowDirection::PF_NONE: { - m_powerFlowArrow.clear(); - } break; - case PowerFlowDirection::PF_BUS1_TO_BUS2: { - for(int i = 1; i < (int)m_pointList.size() - 1; i++) { edges.push_back(m_pointList[i]); } - } break; - case PowerFlowDirection::PF_BUS2_TO_BUS1: { - for(int i = (int)m_pointList.size() - 2; i > 0; i--) { edges.push_back(m_pointList[i]); } - } break; - default: - break; - } - CalculatePowerFlowPts(edges); + std::vector edges; + switch (m_pfDirection) { + case PowerFlowDirection::PF_NONE: { + m_powerFlowArrow.clear(); + } break; + case PowerFlowDirection::PF_BUS1_TO_BUS2: { + for (int i = 1; i < (int)m_pointList.size() - 1; i++) { edges.push_back(m_pointList[i]); } + } break; + case PowerFlowDirection::PF_BUS2_TO_BUS1: { + for (int i = (int)m_pointList.size() - 2; i > 0; i--) { edges.push_back(m_pointList[i]); } + } break; + default: + break; + } + CalculatePowerFlowPts(edges); } void Line::RotateNode(Element* parent, bool clockwise) { - double rotAngle = m_rotationAngle; - if(!clockwise) rotAngle = -m_rotationAngle; - - if(parent == m_parentList[0]) { - m_pointList[0] = parent->RotateAtPosition(m_pointList[0], rotAngle); - } else if(parent == m_parentList[1]) { - m_pointList[m_pointList.size() - 1] = parent->RotateAtPosition(m_pointList[m_pointList.size() - 1], rotAngle); - } - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); + double rotAngle = m_rotationAngle; + if (!clockwise) rotAngle = -m_rotationAngle; + + if (parent == m_parentList[0]) { + m_pointList[0] = parent->RotateAtPosition(m_pointList[0], rotAngle); + } + else if (parent == m_parentList[1]) { + m_pointList[m_pointList.size() - 1] = parent->RotateAtPosition(m_pointList[m_pointList.size() - 1], rotAngle); + } + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); } void Line::SetPointList(std::vector pointList) { - m_pointList = pointList; - UpdateSwitchesPosition(); - UpdatePowerFlowArrowsPosition(); + m_pointList = pointList; + UpdateSwitchesPosition(); + UpdatePowerFlowArrowsPosition(); } Element* Line::GetCopy() { - Line* copy = new Line(); - *copy = *this; - return copy; + Line* copy = new Line(); + *copy = *this; + return copy; } wxString Line::GetTipText() const { - wxString tipText = m_electricalData.name; - - if(m_online) { - tipText += "\n"; - int busNumber[2]; - busNumber[0] = static_cast(m_parentList[0])->GetElectricalData().number + 1; - busNumber[1] = static_cast(m_parentList[1])->GetElectricalData().number + 1; - - tipText += _("\nP") + wxString::Format("(%d-%d) = ", busNumber[0], busNumber[1]) + - wxString::FromDouble(m_electricalData.powerFlow[0].real(), 5) + _(" p.u."); - tipText += _("\nQ") + wxString::Format("(%d-%d) = ", busNumber[0], busNumber[1]) + - wxString::FromDouble(m_electricalData.powerFlow[0].imag(), 5) + _(" p.u."); - tipText += _("\nP") + wxString::Format("(%d-%d) = ", busNumber[1], busNumber[0]) + - wxString::FromDouble(m_electricalData.powerFlow[1].real(), 5) + _(" p.u."); - tipText += _("\nQ") + wxString::Format("(%d-%d) = ", busNumber[1], busNumber[0]) + - wxString::FromDouble(m_electricalData.powerFlow[1].imag(), 5) + _(" p.u."); - } - - return tipText; + wxString tipText = m_electricalData.name; + + if (m_online) { + tipText += "\n"; + int busNumber[2]; + busNumber[0] = static_cast(m_parentList[0])->GetElectricalData().number + 1; + busNumber[1] = static_cast(m_parentList[1])->GetElectricalData().number + 1; + + tipText += _("\nP") + wxString::Format("(%d-%d) = ", busNumber[0], busNumber[1]) + + wxString::FromDouble(m_electricalData.powerFlow[0].real(), 5) + _(" p.u."); + tipText += _("\nQ") + wxString::Format("(%d-%d) = ", busNumber[0], busNumber[1]) + + wxString::FromDouble(m_electricalData.powerFlow[0].imag(), 5) + _(" p.u."); + tipText += _("\nP") + wxString::Format("(%d-%d) = ", busNumber[1], busNumber[0]) + + wxString::FromDouble(m_electricalData.powerFlow[1].real(), 5) + _(" p.u."); + tipText += _("\nQ") + wxString::Format("(%d-%d) = ", busNumber[1], busNumber[0]) + + wxString::FromDouble(m_electricalData.powerFlow[1].imag(), 5) + _(" p.u."); + + if (!m_electricalData.harmonicOrder.empty()) { + tipText += _("\n\nHarmonic currents:"); + int i = 0; + for (auto& hCurrent1 : m_electricalData.harmonicCurrent[0]) { + auto& hCurrent2 = m_electricalData.harmonicCurrent[1][i]; + wxString i1, i2; + i1.Printf(_("\nIh(%d)(%d-%d) = %.5e%s%.2f%s p.u."), m_electricalData.harmonicOrder[i], busNumber[0], busNumber[1], std::abs(hCurrent1), wxString(L'\u2220'), wxRadToDeg(std::arg(hCurrent1)), wxString(L'\u00B0')); + i2.Printf(_("\nIh(%d)(%d-%d) = %.5e%s%.2f%s p.u."), m_electricalData.harmonicOrder[i], busNumber[1], busNumber[0], std::abs(hCurrent2), wxString(L'\u2220'), wxRadToDeg(std::arg(hCurrent2)), wxString(L'\u00B0')); + + tipText += i1 + i2; + i++; + } + } + } + + return tipText; } LineElectricalData Line::GetPUElectricalData(double systemBasePower) { - LineElectricalData data = m_electricalData; - double lineBasePower = GetValueFromUnit(data.nominalPower, data.nominalPowerUnit); - double baseVoltage = GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); - double systemBaseImpedance = (baseVoltage * baseVoltage) / systemBasePower; - double lineBaseImpedance = (baseVoltage * baseVoltage) / lineBasePower; - - // Resistance - double r = data.resistance; - if(data.resistanceUnit == ElectricalUnit::UNIT_OHM_km) r *= data.lineSize; - if(data.resistanceUnit == ElectricalUnit::UNIT_PU) { - if(data.useLinePower) data.resistance = (r * lineBaseImpedance) / systemBaseImpedance; - } else { - data.resistance = r / systemBaseImpedance; - } - data.resistanceUnit = ElectricalUnit::UNIT_PU; - - // Inductive reactance - double x = data.indReactance; - if(data.indReactanceUnit == ElectricalUnit::UNIT_OHM_km) x *= data.lineSize; - if(data.indReactanceUnit == ElectricalUnit::UNIT_PU) { - if(data.useLinePower) data.indReactance = (x * lineBaseImpedance) / systemBaseImpedance; - } else { - data.indReactance = x / systemBaseImpedance; - } - data.indReactanceUnit = ElectricalUnit::UNIT_PU; - - // Capacitive susceptance - double b = data.capSusceptance; - if(data.capSusceptanceUnit == ElectricalUnit::UNIT_OHM_km) b *= data.lineSize; - if(data.capSusceptanceUnit == ElectricalUnit::UNIT_PU) { - if(data.useLinePower) data.capSusceptance = (b * lineBaseImpedance) / systemBaseImpedance; - } else { - data.capSusceptance = b / systemBaseImpedance; - } - data.capSusceptanceUnit = ElectricalUnit::UNIT_PU; - - // Fault - - // Zero seq. resistance - double r0 = data.zeroResistance; - if(data.useLinePower) data.zeroResistance = (r0 * lineBaseImpedance) / systemBaseImpedance; - - // Zero seq. ind. reactance - double x0 = data.zeroIndReactance; - if(data.useLinePower) data.zeroIndReactance = (x0 * lineBaseImpedance) / systemBaseImpedance; - - // Zero seq. cap. susceptance - double b0 = data.zeroCapSusceptance; - if(data.useLinePower) data.zeroCapSusceptance = (b0 * lineBaseImpedance) / systemBaseImpedance; - - if(!m_online) { - data.powerFlow[0] = std::complex(0, 0); - data.powerFlow[1] = std::complex(0, 0); - data.faultCurrent[0][0] = std::complex(0, 0); - data.faultCurrent[0][1] = std::complex(0, 0); - data.faultCurrent[0][2] = std::complex(0, 0); - data.faultCurrent[1][0] = std::complex(0, 0); - data.faultCurrent[1][1] = std::complex(0, 0); - data.faultCurrent[1][2] = std::complex(0, 0); - } - - return data; + LineElectricalData data = m_electricalData; + double lineBasePower = GetValueFromUnit(data.nominalPower, data.nominalPowerUnit); + double baseVoltage = GetValueFromUnit(data.nominalVoltage, data.nominalVoltageUnit); + double systemBaseImpedance = (baseVoltage * baseVoltage) / systemBasePower; + double lineBaseImpedance = (baseVoltage * baseVoltage) / lineBasePower; + + // Resistance + double r = data.resistance; + if (data.resistanceUnit == ElectricalUnit::UNIT_OHM_km) r *= data.lineSize; + if (data.resistanceUnit == ElectricalUnit::UNIT_PU) { + if (data.useLinePower) data.resistance = (r * lineBaseImpedance) / systemBaseImpedance; + } + else { + data.resistance = r / systemBaseImpedance; + } + data.resistanceUnit = ElectricalUnit::UNIT_PU; + + // Inductive reactance + double x = data.indReactance; + if (data.indReactanceUnit == ElectricalUnit::UNIT_OHM_km) x *= data.lineSize; + if (data.indReactanceUnit == ElectricalUnit::UNIT_PU) { + if (data.useLinePower) data.indReactance = (x * lineBaseImpedance) / systemBaseImpedance; + } + else { + data.indReactance = x / systemBaseImpedance; + } + data.indReactanceUnit = ElectricalUnit::UNIT_PU; + + // Capacitive susceptance + double b = data.capSusceptance; + if (data.capSusceptanceUnit == ElectricalUnit::UNIT_OHM_km) b *= data.lineSize; + if (data.capSusceptanceUnit == ElectricalUnit::UNIT_PU) { + if (data.useLinePower) data.capSusceptance = (b * lineBaseImpedance) / systemBaseImpedance; + } + else { + data.capSusceptance = b / systemBaseImpedance; + } + data.capSusceptanceUnit = ElectricalUnit::UNIT_PU; + + // Fault + + // Zero seq. resistance + double r0 = data.zeroResistance; + if (data.useLinePower) data.zeroResistance = (r0 * lineBaseImpedance) / systemBaseImpedance; + + // Zero seq. ind. reactance + double x0 = data.zeroIndReactance; + if (data.useLinePower) data.zeroIndReactance = (x0 * lineBaseImpedance) / systemBaseImpedance; + + // Zero seq. cap. susceptance + double b0 = data.zeroCapSusceptance; + if (data.useLinePower) data.zeroCapSusceptance = (b0 * lineBaseImpedance) / systemBaseImpedance; + + if (!m_online) { + data.powerFlow[0] = std::complex(0, 0); + data.powerFlow[1] = std::complex(0, 0); + data.faultCurrent[0][0] = std::complex(0, 0); + data.faultCurrent[0][1] = std::complex(0, 0); + data.faultCurrent[0][2] = std::complex(0, 0); + data.faultCurrent[1][0] = std::complex(0, 0); + data.faultCurrent[1][1] = std::complex(0, 0); + data.faultCurrent[1][2] = std::complex(0, 0); + } + + return data; } rapidxml::xml_node<>* Line::SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode) { - auto elementNode = XMLParser::AppendNode(doc, elementListNode, "Line"); - XMLParser::SetNodeAttribute(doc, elementNode, "ID", m_elementID); - auto cadProp = XMLParser::AppendNode(doc, elementNode, "CADProperties"); - auto nodeList = XMLParser::AppendNode(doc, cadProp, "NodeList"); - int nodeID = 0; - // Parse all the points. - for(unsigned int i = 0; i < m_pointList.size(); i++) { - // Don't save switch points, the method UpdateSwitchesPosition() calculate these points properly after open the - // element - if((i != 1) && (i != m_pointList.size() - 2)) { - auto nodePos = XMLParser::AppendNode(doc, nodeList, "Node"); - XMLParser::SetNodeAttribute(doc, nodePos, "ID", nodeID); - auto nodePosX = XMLParser::AppendNode(doc, nodePos, "X"); - XMLParser::SetNodeValue(doc, nodePosX, m_pointList[i].m_x); - auto nodePosY = XMLParser::AppendNode(doc, nodePos, "Y"); - XMLParser::SetNodeValue(doc, nodePosY, m_pointList[i].m_y); - nodeID++; - } - } - - auto parentIDList = XMLParser::AppendNode(doc, cadProp, "ParentIDList"); - for(unsigned int i = 0; i < m_parentList.size(); i++) { - if(m_parentList[i]) { - auto parentID = XMLParser::AppendNode(doc, parentIDList, "ParentID"); - XMLParser::SetNodeAttribute(doc, parentID, "ID", static_cast(i)); - XMLParser::SetNodeValue(doc, parentID, m_parentList[i]->GetID()); - } - } - - auto electricalProp = XMLParser::AppendNode(doc, elementNode, "ElectricalProperties"); - auto isOnline = XMLParser::AppendNode(doc, electricalProp, "IsOnline"); - XMLParser::SetNodeValue(doc, isOnline, m_online); - auto name = XMLParser::AppendNode(doc, electricalProp, "Name"); - XMLParser::SetNodeValue(doc, name, m_electricalData.name); - auto nominalVoltage = XMLParser::AppendNode(doc, electricalProp, "NominalVoltage"); - XMLParser::SetNodeValue(doc, nominalVoltage, m_electricalData.nominalVoltage); - XMLParser::SetNodeAttribute(doc, nominalVoltage, "UnitID", static_cast(m_electricalData.nominalVoltageUnit)); - auto nominalPower = XMLParser::AppendNode(doc, electricalProp, "NominalPower"); - XMLParser::SetNodeValue(doc, nominalPower, m_electricalData.nominalPower); - XMLParser::SetNodeAttribute(doc, nominalPower, "UnitID", static_cast(m_electricalData.nominalPowerUnit)); - auto resistance = XMLParser::AppendNode(doc, electricalProp, "Resistance"); - XMLParser::SetNodeValue(doc, resistance, m_electricalData.resistance); - XMLParser::SetNodeAttribute(doc, resistance, "UnitID", static_cast(m_electricalData.resistanceUnit)); - auto indReactance = XMLParser::AppendNode(doc, electricalProp, "IndReactance"); - XMLParser::SetNodeValue(doc, indReactance, m_electricalData.indReactance); - XMLParser::SetNodeAttribute(doc, indReactance, "UnitID", static_cast(m_electricalData.indReactanceUnit)); - auto capSusceptance = XMLParser::AppendNode(doc, electricalProp, "CapSusceptance"); - XMLParser::SetNodeValue(doc, capSusceptance, m_electricalData.capSusceptance); - XMLParser::SetNodeAttribute(doc, capSusceptance, "UnitID", static_cast(m_electricalData.capSusceptanceUnit)); - auto lineSize = XMLParser::AppendNode(doc, electricalProp, "LineSize"); - XMLParser::SetNodeValue(doc, lineSize, m_electricalData.lineSize); - auto useLinePower = XMLParser::AppendNode(doc, electricalProp, "UseLinePower"); - XMLParser::SetNodeValue(doc, useLinePower, m_electricalData.useLinePower); - - auto fault = XMLParser::AppendNode(doc, electricalProp, "Fault"); - auto zeroResistance = XMLParser::AppendNode(doc, fault, "ZeroResistance"); - XMLParser::SetNodeValue(doc, zeroResistance, m_electricalData.zeroResistance); - auto zeroIndReactance = XMLParser::AppendNode(doc, fault, "ZeroIndReactance"); - XMLParser::SetNodeValue(doc, zeroIndReactance, m_electricalData.zeroIndReactance); - auto zeroCapSusceptance = XMLParser::AppendNode(doc, fault, "ZeroCapSusceptance"); - XMLParser::SetNodeValue(doc, zeroCapSusceptance, m_electricalData.zeroCapSusceptance); - - SaveSwitchingData(doc, electricalProp); - - return elementNode; + auto elementNode = XMLParser::AppendNode(doc, elementListNode, "Line"); + XMLParser::SetNodeAttribute(doc, elementNode, "ID", m_elementID); + auto cadProp = XMLParser::AppendNode(doc, elementNode, "CADProperties"); + auto nodeList = XMLParser::AppendNode(doc, cadProp, "NodeList"); + int nodeID = 0; + // Parse all the points. + for (unsigned int i = 0; i < m_pointList.size(); i++) { + // Don't save switch points, the method UpdateSwitchesPosition() calculate these points properly after open the + // element + if ((i != 1) && (i != m_pointList.size() - 2)) { + auto nodePos = XMLParser::AppendNode(doc, nodeList, "Node"); + XMLParser::SetNodeAttribute(doc, nodePos, "ID", nodeID); + auto nodePosX = XMLParser::AppendNode(doc, nodePos, "X"); + XMLParser::SetNodeValue(doc, nodePosX, m_pointList[i].m_x); + auto nodePosY = XMLParser::AppendNode(doc, nodePos, "Y"); + XMLParser::SetNodeValue(doc, nodePosY, m_pointList[i].m_y); + nodeID++; + } + } + + auto parentIDList = XMLParser::AppendNode(doc, cadProp, "ParentIDList"); + for (unsigned int i = 0; i < m_parentList.size(); i++) { + if (m_parentList[i]) { + auto parentID = XMLParser::AppendNode(doc, parentIDList, "ParentID"); + XMLParser::SetNodeAttribute(doc, parentID, "ID", static_cast(i)); + XMLParser::SetNodeValue(doc, parentID, m_parentList[i]->GetID()); + } + } + + auto electricalProp = XMLParser::AppendNode(doc, elementNode, "ElectricalProperties"); + auto isOnline = XMLParser::AppendNode(doc, electricalProp, "IsOnline"); + XMLParser::SetNodeValue(doc, isOnline, m_online); + auto name = XMLParser::AppendNode(doc, electricalProp, "Name"); + XMLParser::SetNodeValue(doc, name, m_electricalData.name); + auto nominalVoltage = XMLParser::AppendNode(doc, electricalProp, "NominalVoltage"); + XMLParser::SetNodeValue(doc, nominalVoltage, m_electricalData.nominalVoltage); + XMLParser::SetNodeAttribute(doc, nominalVoltage, "UnitID", static_cast(m_electricalData.nominalVoltageUnit)); + auto nominalPower = XMLParser::AppendNode(doc, electricalProp, "NominalPower"); + XMLParser::SetNodeValue(doc, nominalPower, m_electricalData.nominalPower); + XMLParser::SetNodeAttribute(doc, nominalPower, "UnitID", static_cast(m_electricalData.nominalPowerUnit)); + auto resistance = XMLParser::AppendNode(doc, electricalProp, "Resistance"); + XMLParser::SetNodeValue(doc, resistance, m_electricalData.resistance); + XMLParser::SetNodeAttribute(doc, resistance, "UnitID", static_cast(m_electricalData.resistanceUnit)); + auto indReactance = XMLParser::AppendNode(doc, electricalProp, "IndReactance"); + XMLParser::SetNodeValue(doc, indReactance, m_electricalData.indReactance); + XMLParser::SetNodeAttribute(doc, indReactance, "UnitID", static_cast(m_electricalData.indReactanceUnit)); + auto capSusceptance = XMLParser::AppendNode(doc, electricalProp, "CapSusceptance"); + XMLParser::SetNodeValue(doc, capSusceptance, m_electricalData.capSusceptance); + XMLParser::SetNodeAttribute(doc, capSusceptance, "UnitID", static_cast(m_electricalData.capSusceptanceUnit)); + auto lineSize = XMLParser::AppendNode(doc, electricalProp, "LineSize"); + XMLParser::SetNodeValue(doc, lineSize, m_electricalData.lineSize); + auto useLinePower = XMLParser::AppendNode(doc, electricalProp, "UseLinePower"); + XMLParser::SetNodeValue(doc, useLinePower, m_electricalData.useLinePower); + + auto fault = XMLParser::AppendNode(doc, electricalProp, "Fault"); + auto zeroResistance = XMLParser::AppendNode(doc, fault, "ZeroResistance"); + XMLParser::SetNodeValue(doc, zeroResistance, m_electricalData.zeroResistance); + auto zeroIndReactance = XMLParser::AppendNode(doc, fault, "ZeroIndReactance"); + XMLParser::SetNodeValue(doc, zeroIndReactance, m_electricalData.zeroIndReactance); + auto zeroCapSusceptance = XMLParser::AppendNode(doc, fault, "ZeroCapSusceptance"); + XMLParser::SetNodeValue(doc, zeroCapSusceptance, m_electricalData.zeroCapSusceptance); + + SaveSwitchingData(doc, electricalProp); + + return elementNode; } bool Line::OpenElement(rapidxml::xml_node<>* elementNode, std::vector parentList) { - auto cadPropNode = elementNode->first_node("CADProperties"); - if(!cadPropNode) return false; - - // Get nodes points - std::vector ptsList; - auto nodePosList = cadPropNode->first_node("NodeList"); - if(!nodePosList) return false; - auto nodePos = nodePosList->first_node("Node"); - while(nodePos) { - double nodePosX = XMLParser::GetNodeValueDouble(nodePos, "X"); - double nodePosY = XMLParser::GetNodeValueDouble(nodePos, "Y"); - ptsList.push_back(wxPoint2DDouble(nodePosX, nodePosY)); - nodePos = nodePos->next_sibling("Node"); - } - - // Get parents IDs - auto parentIDList = cadPropNode->first_node("ParentIDList"); - if(!parentIDList) return false; - auto parentNode = parentIDList->first_node("ParentID"); - long parentID[2] = {-1, -1}; - while(parentNode) { - long index = 0; - wxString(parentNode->first_attribute("ID")->value()).ToCLong(&index); - wxString(parentNode->value()).ToCLong(&parentID[index]); - parentNode = parentNode->next_sibling("ParentID"); - } - - std::vector nodePtsList; // List of node points - nodePtsList.push_back(ptsList[0]); // First point on the list - nodePtsList.push_back(ptsList[ptsList.size() - 1]); // Last point on the list - - // List of dummy buses to set not connected nodes properly - std::vector dummyBusList; - for(unsigned int i = 0; i < nodePtsList.size(); ++i) { - if(parentID[i] == -1) // No parent connected - { - Bus* dummyBus = new Bus(nodePtsList[i]); - dummyBusList.push_back(dummyBus); - AddParent(dummyBus, nodePtsList[i]); - } else { // Parent connected (necessarily a bus, get from bus list) - AddParent(parentList[parentID[i]], nodePtsList[i]); - } - } - - // Add the others nodes (if exists) - std::vector midPts; - for(unsigned int i = 1; i < ptsList.size() - 1; i++) midPts.push_back(ptsList[i]); - m_pointList.insert(m_pointList.begin() + 2, midPts.begin(), midPts.end()); - SetPointList(m_pointList); - - // Remove dummy buses - for(auto it = dummyBusList.begin(), itEnd = dummyBusList.end(); it != itEnd; ++it) { - RemoveParent(*it); - delete *it; - } - dummyBusList.clear(); - - auto electricalProp = elementNode->first_node("ElectricalProperties"); - if(!electricalProp) return false; - - SetOnline(XMLParser::GetNodeValueInt(electricalProp, "IsOnline")); - m_electricalData.name = electricalProp->first_node("Name")->value(); - m_electricalData.nominalVoltage = XMLParser::GetNodeValueDouble(electricalProp, "NominalVoltage"); - m_electricalData.nominalVoltageUnit = - static_cast(XMLParser::GetAttributeValueInt(electricalProp, "NominalVoltage", "UnitID")); - m_electricalData.nominalPower = XMLParser::GetNodeValueDouble(electricalProp, "NominalPower"); - m_electricalData.nominalPowerUnit = - static_cast(XMLParser::GetAttributeValueInt(electricalProp, "NominalPower", "UnitID")); - m_electricalData.resistance = XMLParser::GetNodeValueDouble(electricalProp, "Resistance"); - m_electricalData.resistanceUnit = - static_cast(XMLParser::GetAttributeValueInt(electricalProp, "Resistance", "UnitID")); - m_electricalData.indReactance = XMLParser::GetNodeValueDouble(electricalProp, "IndReactance"); - m_electricalData.indReactanceUnit = - static_cast(XMLParser::GetAttributeValueInt(electricalProp, "IndReactance", "UnitID")); - m_electricalData.capSusceptance = XMLParser::GetNodeValueDouble(electricalProp, "CapSusceptance"); - m_electricalData.capSusceptanceUnit = - static_cast(XMLParser::GetAttributeValueInt(electricalProp, "CapSusceptance", "UnitID")); - m_electricalData.lineSize = XMLParser::GetNodeValueDouble(electricalProp, "LineSize"); - m_electricalData.useLinePower = XMLParser::GetNodeValueInt(electricalProp, "UseLinePower"); - - auto fault = electricalProp->first_node("Fault"); - m_electricalData.zeroResistance = XMLParser::GetNodeValueDouble(fault, "ZeroResistance"); - m_electricalData.zeroIndReactance = XMLParser::GetNodeValueDouble(fault, "ZeroIndReactance"); - m_electricalData.zeroCapSusceptance = XMLParser::GetNodeValueDouble(fault, "ZeroCapSusceptance"); - - if(!OpenSwitchingData(electricalProp)) return false; - if(m_swData.swTime.size() != 0) SetDynamicEvent(true); - return true; + auto cadPropNode = elementNode->first_node("CADProperties"); + if (!cadPropNode) return false; + + // Get nodes points + std::vector ptsList; + auto nodePosList = cadPropNode->first_node("NodeList"); + if (!nodePosList) return false; + auto nodePos = nodePosList->first_node("Node"); + while (nodePos) { + double nodePosX = XMLParser::GetNodeValueDouble(nodePos, "X"); + double nodePosY = XMLParser::GetNodeValueDouble(nodePos, "Y"); + ptsList.push_back(wxPoint2DDouble(nodePosX, nodePosY)); + nodePos = nodePos->next_sibling("Node"); + } + + // Get parents IDs + auto parentIDList = cadPropNode->first_node("ParentIDList"); + if (!parentIDList) return false; + auto parentNode = parentIDList->first_node("ParentID"); + long parentID[2] = { -1, -1 }; + while (parentNode) { + long index = 0; + wxString(parentNode->first_attribute("ID")->value()).ToCLong(&index); + wxString(parentNode->value()).ToCLong(&parentID[index]); + parentNode = parentNode->next_sibling("ParentID"); + } + + std::vector nodePtsList; // List of node points + nodePtsList.push_back(ptsList[0]); // First point on the list + nodePtsList.push_back(ptsList[ptsList.size() - 1]); // Last point on the list + + // List of dummy buses to set not connected nodes properly + std::vector dummyBusList; + for (unsigned int i = 0; i < nodePtsList.size(); ++i) { + if (parentID[i] == -1) // No parent connected + { + Bus* dummyBus = new Bus(nodePtsList[i]); + dummyBusList.push_back(dummyBus); + AddParent(dummyBus, nodePtsList[i]); + } + else { // Parent connected (necessarily a bus, get from bus list) + AddParent(parentList[parentID[i]], nodePtsList[i]); + } + } + + // Add the others nodes (if exists) + std::vector midPts; + for (unsigned int i = 1; i < ptsList.size() - 1; i++) midPts.push_back(ptsList[i]); + m_pointList.insert(m_pointList.begin() + 2, midPts.begin(), midPts.end()); + SetPointList(m_pointList); + + // Remove dummy buses + for (auto it = dummyBusList.begin(), itEnd = dummyBusList.end(); it != itEnd; ++it) { + RemoveParent(*it); + delete* it; + } + dummyBusList.clear(); + + auto electricalProp = elementNode->first_node("ElectricalProperties"); + if (!electricalProp) return false; + + SetOnline(XMLParser::GetNodeValueInt(electricalProp, "IsOnline")); + m_electricalData.name = electricalProp->first_node("Name")->value(); + m_electricalData.nominalVoltage = XMLParser::GetNodeValueDouble(electricalProp, "NominalVoltage"); + m_electricalData.nominalVoltageUnit = + static_cast(XMLParser::GetAttributeValueInt(electricalProp, "NominalVoltage", "UnitID")); + m_electricalData.nominalPower = XMLParser::GetNodeValueDouble(electricalProp, "NominalPower"); + m_electricalData.nominalPowerUnit = + static_cast(XMLParser::GetAttributeValueInt(electricalProp, "NominalPower", "UnitID")); + m_electricalData.resistance = XMLParser::GetNodeValueDouble(electricalProp, "Resistance"); + m_electricalData.resistanceUnit = + static_cast(XMLParser::GetAttributeValueInt(electricalProp, "Resistance", "UnitID")); + m_electricalData.indReactance = XMLParser::GetNodeValueDouble(electricalProp, "IndReactance"); + m_electricalData.indReactanceUnit = + static_cast(XMLParser::GetAttributeValueInt(electricalProp, "IndReactance", "UnitID")); + m_electricalData.capSusceptance = XMLParser::GetNodeValueDouble(electricalProp, "CapSusceptance"); + m_electricalData.capSusceptanceUnit = + static_cast(XMLParser::GetAttributeValueInt(electricalProp, "CapSusceptance", "UnitID")); + m_electricalData.lineSize = XMLParser::GetNodeValueDouble(electricalProp, "LineSize"); + m_electricalData.useLinePower = XMLParser::GetNodeValueInt(electricalProp, "UseLinePower"); + + auto fault = electricalProp->first_node("Fault"); + m_electricalData.zeroResistance = XMLParser::GetNodeValueDouble(fault, "ZeroResistance"); + m_electricalData.zeroIndReactance = XMLParser::GetNodeValueDouble(fault, "ZeroIndReactance"); + m_electricalData.zeroCapSusceptance = XMLParser::GetNodeValueDouble(fault, "ZeroCapSusceptance"); + + if (!OpenSwitchingData(electricalProp)) return false; + if (m_swData.swTime.size() != 0) SetDynamicEvent(true); + return true; } diff --git a/Project/Line.h b/Project/Line.h index 3597367c..a38ade42 100644 --- a/Project/Line.h +++ b/Project/Line.h @@ -47,6 +47,10 @@ struct LineElectricalData { double zeroCapSusceptance = 0.0; // p.u. fault data std::complex faultCurrent[2][3]; + + // Power Quality + std::vector harmonicOrder; + std::vector< std::complex > harmonicCurrent[2]; }; /** diff --git a/Project/PSP-UFU.vcxproj b/Project/PSP-UFU.vcxproj index c800bce2..8d286416 100644 --- a/Project/PSP-UFU.vcxproj +++ b/Project/PSP-UFU.vcxproj @@ -59,18 +59,20 @@ + - + + - + diff --git a/Project/PSP-UFU.vcxproj.user b/Project/PSP-UFU.vcxproj.user index 4b5cd9f9..fce73ddd 100644 --- a/Project/PSP-UFU.vcxproj.user +++ b/Project/PSP-UFU.vcxproj.user @@ -8,4 +8,9 @@ WindowsLocalDebugger + + WXSUPRESS_SIZER_FLAGS_CHECK +$(LocalDebuggerEnvironment) + WindowsLocalDebugger + \ No newline at end of file diff --git a/Project/PowerFlow.cpp b/Project/PowerFlow.cpp index 61bdc719..61ed35d5 100644 --- a/Project/PowerFlow.cpp +++ b/Project/PowerFlow.cpp @@ -593,7 +593,7 @@ void PowerFlow::NewtonRaphson(std::vector busType, double inertia) { // Jacobian matrix - std::vector > jacobMatrix = CalculateJacobianMatrix(voltage, busType, numPV, numPQ); + std::vector > jacobMatrix = CalculateJacobianMatrix(voltage, power, busType, numPV, numPQ); // Apply inertia for(unsigned int i = 0; i < dPdQ.size(); ++i) { dPdQ[i] = inertia * dPdQ[i]; } @@ -623,6 +623,7 @@ void PowerFlow::NewtonRaphson(std::vector busType, } std::vector > PowerFlow::CalculateJacobianMatrix(std::vector > voltage, + std::vector > power, std::vector busType, int numPV, int numPQ) @@ -651,12 +652,22 @@ std::vector > PowerFlow::CalculateJacobianMatrix(std::vector double tj = std::arg(voltage[j]); double yij = std::abs(m_yBus[i][j]); double tij = std::arg(m_yBus[i][j]); +#ifdef STD_NR j11[busNumI][busNumJ] = -vi * vj * yij * std::sin(tij + tj - ti); +#else + double gij = m_yBus[i][j].real(); + double bij = m_yBus[i][j].imag(); + j11[busNumI][busNumJ] = vi * vj * (gij * std::sin(tij) - bij * std::cos(tij)); +#endif } else { // busNumI == busNumJ std::complex sj = std::complex(0.0, 0.0); for(int k = 0; k < m_numberOfBuses; k++) sj += voltage[j] * std::conj(m_yBus[j][k]) * std::conj(voltage[k]); +#ifdef STD_NR j11[busNumI][busNumJ] = -sj.imag() - m_yBus[j][j].imag() * std::pow(std::abs(voltage[j]), 2.0); +#else + j11[busNumI][busNumJ] = - power[i].imag() - m_yBus[j][j].imag() * std::pow(std::abs(voltage[j]), 2.0); +#endif } busNumJ++; } @@ -685,13 +696,22 @@ std::vector > PowerFlow::CalculateJacobianMatrix(std::vector double tj = std::arg(voltage[j]); double yij = std::abs(m_yBus[i][j]); double tij = std::arg(m_yBus[i][j]); - +#ifdef STD_NR j12[busNumI][busNumJ] = vj * vi * yij * std::cos(tij + tj - ti); +#else + double gij = m_yBus[i][j].real(); + double bij = m_yBus[i][j].imag(); + j12[busNumI][busNumJ] = vi * (gij * std::cos(tij) - bij * std::sin(tij)); +#endif } else { // busNumI == busNumJ std::complex sj = std::complex(0.0, 0.0); for(int k = 0; k < m_numberOfBuses; k++) sj += voltage[j] * std::conj(m_yBus[j][k]) * std::conj(voltage[k]); +#ifdef STD_NR j12[busNumI][busNumJ] = sj.real() + m_yBus[j][j].real() * std::pow(std::abs(voltage[j]), 2.0); +#else + j12[busNumI][busNumJ] = (power[i].real() + m_yBus[j][j].real() * std::pow(std::abs(voltage[j]), 2.0)) / std::abs(voltage[j]); +#endif } busNumJ++; } @@ -720,13 +740,23 @@ std::vector > PowerFlow::CalculateJacobianMatrix(std::vector double tj = std::arg(voltage[j]); double yij = std::abs(m_yBus[i][j]); double tij = std::arg(m_yBus[i][j]); - + +#ifdef STD_NR j21[busNumI][busNumJ] = -vi * vj * yij * std::cos(tij + tj - ti); +#else + double gij = m_yBus[i][j].real(); + double bij = m_yBus[i][j].imag(); + j21[busNumI][busNumJ] = -vi * vj * (gij * std::cos(tij) + bij * std::sin(tij)); +#endif } else { // busNumI == busNumJ std::complex sj = std::complex(0.0, 0.0); for(int k = 0; k < m_numberOfBuses; k++) sj += voltage[j] * std::conj(m_yBus[j][k]) * std::conj(voltage[k]); +#ifdef STD_NR j21[busNumI][busNumJ] = sj.real() - m_yBus[j][j].real() * std::pow(std::abs(voltage[j]), 2.0); +#else + j21[busNumI][busNumJ] = power[i].real() - m_yBus[j][j].real() * std::pow(std::abs(voltage[j]), 2.0); +#endif } busNumJ++; } @@ -755,12 +785,22 @@ std::vector > PowerFlow::CalculateJacobianMatrix(std::vector double yij = std::abs(m_yBus[i][j]); double tij = std::arg(m_yBus[i][j]); +#ifdef STD_NR j22[busNumI][busNumJ] = -vj * vi * yij * std::sin(tij + tj - ti); +#else + double gij = m_yBus[i][j].real(); + double bij = m_yBus[i][j].imag(); + j22[busNumI][busNumJ] = vi * (gij * std::sin(tij) - bij * std::cos(tij)); +#endif } else { // busNumI == busNumJ std::complex sj = std::complex(0.0, 0.0); for(int k = 0; k < m_numberOfBuses; k++) sj += voltage[j] * std::conj(m_yBus[j][k]) * std::conj(voltage[k]); +#ifdef STD_NR j22[busNumI][busNumJ] = sj.imag() - m_yBus[j][j].imag() * std::pow(std::abs(voltage[j]), 2.0); +#else + j22[busNumI][busNumJ] = (power[i].imag() - m_yBus[j][j].imag() * std::pow(std::abs(voltage[j]), 2.0)) / std::abs(voltage[j]); +#endif } busNumJ++; } diff --git a/Project/PowerFlow.h b/Project/PowerFlow.h index e8945c8c..8fb2474d 100644 --- a/Project/PowerFlow.h +++ b/Project/PowerFlow.h @@ -18,6 +18,8 @@ #ifndef POWERFLOW_H #define POWERFLOW_H +#define STD_NR + #include "ElectricCalculation.h" #include //_() @@ -67,6 +69,7 @@ class PowerFlow : public ElectricCalculation protected: void GetNumPVPQ(std::vector busType, int &numPQ, int &numPV); std::vector > CalculateJacobianMatrix(std::vector > voltage, + std::vector > power, std::vector busType, int numPV, int numPQ); diff --git a/Project/PowerQuality.cpp b/Project/PowerQuality.cpp index 6478132a..a3e098a6 100644 --- a/Project/PowerQuality.cpp +++ b/Project/PowerQuality.cpp @@ -8,302 +8,423 @@ PowerQuality::PowerQuality(std::vector elementList) { GetElementsFromL void PowerQuality::CalculateHarmonicYbusList(double systemPowerBase) { - // Clear and fill with zeros all the harmonic Ybuses - for(auto it = m_harmYbusList.begin(), itEnd = m_harmYbusList.end(); it != itEnd; ++it) { - HarmonicYbus harmYBus = *it; - harmYBus.yBus.clear(); - for(unsigned int i = 0; i < m_busList.size(); i++) { - std::vector > line; - for(unsigned int j = 0; j < m_busList.size(); j++) { line.push_back(std::complex(0.0, 0.0)); } - harmYBus.yBus.push_back(line); - } - *it = harmYBus; - } - - // Fill all Ybuses - for(auto itYbus = m_harmYbusList.begin(), itYbusEnd = m_harmYbusList.end(); itYbus != itYbusEnd; ++itYbus) { - HarmonicYbus harmYBus = *itYbus; - CalculateHarmonicYbus(harmYBus.yBus, systemPowerBase, harmYBus.order); - *itYbus = harmYBus; - } + // Clear and fill with zeros all the harmonic Ybuses + for (auto it = m_harmYbusList.begin(), itEnd = m_harmYbusList.end(); it != itEnd; ++it) { + HarmonicYbus harmYBus = *it; + harmYBus.yBus.clear(); + for (unsigned int i = 0; i < m_busList.size(); i++) { + std::vector > line; + for (unsigned int j = 0; j < m_busList.size(); j++) { line.push_back(std::complex(0.0, 0.0)); } + harmYBus.yBus.push_back(line); + } + *it = harmYBus; + } + + // Fill all Ybuses + for (auto itYbus = m_harmYbusList.begin(), itYbusEnd = m_harmYbusList.end(); itYbus != itYbusEnd; ++itYbus) { + HarmonicYbus harmYBus = *itYbus; + CalculateHarmonicYbus(harmYBus.yBus, systemPowerBase, harmYBus.order); + *itYbus = harmYBus; + } } void PowerQuality::CalculateHarmonicYbus(std::vector > >& yBus, - double systemPowerBase, - double order) + double systemPowerBase, + double order, + bool ignoreTransformerConnection) { - // Load - for(auto it = m_loadList.begin(), itEnd = m_loadList.end(); it != itEnd; ++it) { - Load* load = *it; - if(load->IsOnline()) { - int n = static_cast(load->GetParentList()[0])->GetElectricalData().number; - LoadElectricalData data = load->GetPUElectricalData(systemPowerBase); - std::complex yLoad = std::complex(data.activePower, -data.reactivePower / order); - std::complex v = static_cast(load->GetParentList()[0])->GetElectricalData().voltage; - yLoad /= (std::abs(v) * std::abs(v)); - yBus[n][n] += yLoad; - } - } - - // Capacitor - for(auto it = m_capacitorList.begin(), itEnd = m_capacitorList.end(); it != itEnd; ++it) { - Capacitor* capacitor = *it; - if(capacitor->IsOnline()) { - int n = static_cast(capacitor->GetParentList()[0])->GetElectricalData().number; - CapacitorElectricalData data = capacitor->GetPUElectricalData(systemPowerBase); - yBus[n][n] += std::complex(0.0, data.reactivePower) * order; - } - } - - // Inductor - for(auto it = m_inductorList.begin(), itEnd = m_inductorList.end(); it != itEnd; ++it) { - Inductor* inductor = *it; - if(inductor->IsOnline()) { - int n = static_cast(inductor->GetParentList()[0])->GetElectricalData().number; - InductorElectricalData data = inductor->GetPUElectricalData(systemPowerBase); - yBus[n][n] += std::complex(0.0, -data.reactivePower) / order; - } - } - - // Power line - for(auto it = m_lineList.begin(), itEnd = m_lineList.end(); it != itEnd; ++it) { - Line* line = *it; - if(line->IsOnline()) { - LineElectricalData data = line->GetPUElectricalData(systemPowerBase); - - int n1 = static_cast(line->GetParentList()[0])->GetElectricalData().number; - int n2 = static_cast(line->GetParentList()[1])->GetElectricalData().number; - - yBus[n1][n2] -= 1.0 / std::complex(data.resistance, data.indReactance * order); - yBus[n2][n1] -= 1.0 / std::complex(data.resistance, data.indReactance * order); - - yBus[n1][n1] += 1.0 / std::complex(data.resistance, data.indReactance * order); - yBus[n2][n2] += 1.0 / std::complex(data.resistance, data.indReactance * order); - - yBus[n1][n1] += std::complex(0.0, (data.capSusceptance * order) / 2.0); - yBus[n2][n2] += std::complex(0.0, (data.capSusceptance * order) / 2.0); - } - } - - // Transformer - for(auto it = m_transformerList.begin(), itEnd = m_transformerList.end(); it != itEnd; ++it) { - Transformer* transformer = *it; - - if(transformer->IsOnline()) { - TransformerElectricalData data = transformer->GetPUElectricalData(systemPowerBase); - - int n1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().number; - int n2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().number; - - // If the transformer have nominal turns ratio (1.0) and no phase shifting, it will be modelled as - // series impedance. - if(data.turnsRatio == 1.0 && data.phaseShift == 0.0) { - yBus[n1][n2] += -1.0 / std::complex(data.resistance, data.indReactance * order); - yBus[n2][n1] += -1.0 / std::complex(data.resistance, data.indReactance * order); - - yBus[n1][n1] += 1.0 / std::complex(data.resistance, data.indReactance * order); - yBus[n2][n2] += 1.0 / std::complex(data.resistance, data.indReactance * order); - } - // If the transformer have no-nominal turn ratio and/or phase shifting, it will be modelled in a - // different way (see references). - //[Ref. 1: Elementos de analise de sistemas de potencia - Stevenson - pg. 232] - //[Ref. 2: - // http://www.ee.washington.edu/research/real/Library/Reports/Tap_Adjustments_in_AC_Load_Flows.pdf] - // [Ref. 3: http://www.columbia.edu/~dano/courses/power/notes/power/andersson1.pdf] - else { - // Complex turns ratio - double radPhaseShift = wxDegToRad(data.phaseShift); - std::complex a = std::complex(data.turnsRatio * std::cos(radPhaseShift), - -data.turnsRatio * std::sin(radPhaseShift)); - - // Transformer admitance - std::complex y = 1.0 / std::complex(data.resistance, data.indReactance * order); - - yBus[n1][n1] += y / (std::pow(std::abs(a), 2.0)); - yBus[n1][n2] += -(y / std::conj(a)); - yBus[n2][n1] += -(y / a); - yBus[n2][n2] += y; - } - } - } - - // Synchronous generator - for(auto it = m_syncGeneratorList.begin(), itEnd = m_syncGeneratorList.end(); it != itEnd; ++it) { - SyncGenerator* syncGenerator = *it; - if(syncGenerator->IsOnline()) { - int n = static_cast(syncGenerator->GetParentList()[0])->GetElectricalData().number; - SyncGeneratorElectricalData data = syncGenerator->GetPUElectricalData(systemPowerBase); - yBus[n][n] += 1.0 / std::complex(data.positiveResistance, data.positiveReactance * order); - } - } - // Synchronous motor - for(auto it = m_syncMotorList.begin(), itEnd = m_syncMotorList.end(); it != itEnd; ++it) { - SyncMotor* syncMotor = *it; - if(syncMotor->IsOnline()) { - int n = static_cast(syncMotor->GetParentList()[0])->GetElectricalData().number; - SyncMotorElectricalData data = syncMotor->GetPUElectricalData(systemPowerBase); - yBus[n][n] += 1.0 / std::complex(data.positiveResistance, data.positiveReactance * order); - } - } + // Load + for (auto it = m_loadList.begin(), itEnd = m_loadList.end(); it != itEnd; ++it) { + Load* load = *it; + if (load->IsOnline()) { + int n = static_cast(load->GetParentList()[0])->GetElectricalData().number; + LoadElectricalData data = load->GetPUElectricalData(systemPowerBase); + std::complex yLoad = std::complex(data.activePower, -data.reactivePower / order); + std::complex v = static_cast(load->GetParentList()[0])->GetElectricalData().voltage; + yLoad /= (std::abs(v) * std::abs(v)); + yBus[n][n] += yLoad; + } + } + + // Capacitor + for (auto it = m_capacitorList.begin(), itEnd = m_capacitorList.end(); it != itEnd; ++it) { + Capacitor* capacitor = *it; + if (capacitor->IsOnline()) { + int n = static_cast(capacitor->GetParentList()[0])->GetElectricalData().number; + CapacitorElectricalData data = capacitor->GetPUElectricalData(systemPowerBase); + yBus[n][n] += std::complex(0.0, data.reactivePower) * order; + } + } + + // Inductor + for (auto it = m_inductorList.begin(), itEnd = m_inductorList.end(); it != itEnd; ++it) { + Inductor* inductor = *it; + if (inductor->IsOnline()) { + int n = static_cast(inductor->GetParentList()[0])->GetElectricalData().number; + InductorElectricalData data = inductor->GetPUElectricalData(systemPowerBase); + yBus[n][n] += std::complex(0.0, -data.reactivePower) / order; + } + } + + // Power line + for (auto it = m_lineList.begin(), itEnd = m_lineList.end(); it != itEnd; ++it) { + Line* line = *it; + if (line->IsOnline()) { + LineElectricalData data = line->GetPUElectricalData(systemPowerBase); + + int n1 = static_cast(line->GetParentList()[0])->GetElectricalData().number; + int n2 = static_cast(line->GetParentList()[1])->GetElectricalData().number; + + yBus[n1][n2] -= 1.0 / std::complex(data.resistance, data.indReactance * order); + yBus[n2][n1] -= 1.0 / std::complex(data.resistance, data.indReactance * order); + + yBus[n1][n1] += 1.0 / std::complex(data.resistance, data.indReactance * order); + yBus[n2][n2] += 1.0 / std::complex(data.resistance, data.indReactance * order); + + yBus[n1][n1] += std::complex(0.0, (data.capSusceptance * order) / 2.0); + yBus[n2][n2] += std::complex(0.0, (data.capSusceptance * order) / 2.0); + } + } + + // Transformer + for (auto it = m_transformerList.begin(), itEnd = m_transformerList.end(); it != itEnd; ++it) { + Transformer* transformer = *it; + + if (transformer->IsOnline()) { + TransformerElectricalData data = transformer->GetPUElectricalData(systemPowerBase); + + int n1 = static_cast(transformer->GetParentList()[0])->GetElectricalData().number; + int n2 = static_cast(transformer->GetParentList()[1])->GetElectricalData().number; + + auto yMatrix = GetTransformerHarmAdmmitance(transformer, systemPowerBase, order, ignoreTransformerConnection); + + yBus[n1][n2] += yMatrix[0][1]; + yBus[n2][n1] += yMatrix[1][0]; + yBus[n1][n1] += yMatrix[0][0]; + yBus[n2][n2] += yMatrix[1][1]; + } + } + + // Synchronous generator + for (auto it = m_syncGeneratorList.begin(), itEnd = m_syncGeneratorList.end(); it != itEnd; ++it) { + SyncGenerator* syncGenerator = *it; + if (syncGenerator->IsOnline()) { + int n = static_cast(syncGenerator->GetParentList()[0])->GetElectricalData().number; + SyncGeneratorElectricalData data = syncGenerator->GetPUElectricalData(systemPowerBase); + yBus[n][n] += 1.0 / std::complex(data.positiveResistance, data.positiveReactance * order); + } + } + // Synchronous motor + for (auto it = m_syncMotorList.begin(), itEnd = m_syncMotorList.end(); it != itEnd; ++it) { + SyncMotor* syncMotor = *it; + if (syncMotor->IsOnline()) { + int n = static_cast(syncMotor->GetParentList()[0])->GetElectricalData().number; + SyncMotorElectricalData data = syncMotor->GetPUElectricalData(systemPowerBase); + yBus[n][n] += 1.0 / std::complex(data.positiveResistance, data.positiveReactance * order); + } + } } bool PowerQuality::CalculateDistortions(double systemPowerBase) { - // Get harmonic orders - m_harmYbusList.clear(); - std::vector harmOrders = GetHarmonicOrdersList(); - - // Fill the Ybuses - for(unsigned int i = 0; i < harmOrders.size(); ++i) { - HarmonicYbus newYbus; - newYbus.order = harmOrders[i]; - m_harmYbusList.push_back(newYbus); - } - CalculateHarmonicYbusList(systemPowerBase); - - // Initialize current arrays with zeros - std::vector > > iHarmInjList; - for(unsigned int i = 0; i < harmOrders.size(); i++) { - std::vector > line; - for(unsigned int j = 0; j < m_busList.size(); j++) { line.push_back(std::complex(0.0, 0.0)); } - iHarmInjList.push_back(line); - } - - // Fill the current array - for(unsigned int i = 0; i < harmOrders.size(); ++i) { - for(auto it = m_harmCurrentList.begin(), itEnd = m_harmCurrentList.end(); it != itEnd; ++it) { - HarmCurrent* harmCurrent = *it; - if(harmCurrent->IsOnline()) { - // Get only the current order in analysis - for(unsigned int k = 0; k < harmCurrent->GetElectricalData().harmonicOrder.size(); ++k) { - if(harmCurrent->GetElectricalData().harmonicOrder[k] == static_cast(harmOrders[i])) { - Bus* parentBus = static_cast(harmCurrent->GetParentList()[0]); - auto busData = parentBus->GetElectricalData(); - int j = busData.number; - - // Bus voltage - double voltage = busData.nominalVoltage; - if(busData.nominalVoltageUnit == ElectricalUnit::UNIT_kV) voltage *= 1e3; - - auto puData = harmCurrent->GetPUElectricalData(systemPowerBase, voltage); - - iHarmInjList[i][j] += std::complex( - puData.injHarmCurrent[k] * std::cos(wxDegToRad(puData.injHarmAngle[k])), - puData.injHarmCurrent[k] * std::sin(wxDegToRad(puData.injHarmAngle[k]))); - } - } - } - } - } - - // Calculate harmonic voltages - std::vector > > vHarmList; - for(unsigned int i = 0; i < m_harmYbusList.size(); ++i) { - vHarmList.push_back(GaussianElimination(m_harmYbusList[i].yBus, iHarmInjList[i])); - } - - for(auto it = m_busList.begin(), itEnd = m_busList.end(); it != itEnd; ++it) { - Bus* bus = *it; - auto data = bus->GetElectricalData(); - data.harmonicOrder.clear(); - data.harmonicVoltage.clear(); - double thd = 0.0; - for(unsigned int i = 0; i < vHarmList.size(); ++i) { - thd += std::abs(vHarmList[i][data.number]) * std::abs(vHarmList[i][data.number]); - data.harmonicVoltage.push_back(vHarmList[i][data.number]); - data.harmonicOrder.push_back(static_cast(harmOrders[i])); - } - // distortion = std::sqrt(distortion) / std::abs(data.voltage); - thd = std::sqrt(thd) * 100.0; - data.thd = thd; - bus->SetElectricalData(data); - } - - return true; + // Get harmonic orders + m_harmYbusList.clear(); + std::vector harmOrders = GetHarmonicOrdersList(); + + // Fill the Ybuses + for (unsigned int i = 0; i < harmOrders.size(); ++i) { + HarmonicYbus newYbus; + newYbus.order = harmOrders[i]; + m_harmYbusList.push_back(newYbus); + } + CalculateHarmonicYbusList(systemPowerBase); + + // Initialize current arrays with zeros + std::vector > > iHarmInjList; + for (unsigned int i = 0; i < harmOrders.size(); i++) { + std::vector > line; + for (unsigned int j = 0; j < m_busList.size(); j++) { line.push_back(std::complex(0.0, 0.0)); } + iHarmInjList.push_back(line); + } + + // Fill the current array + for (unsigned int i = 0; i < harmOrders.size(); ++i) { + for (auto it = m_harmCurrentList.begin(), itEnd = m_harmCurrentList.end(); it != itEnd; ++it) { + HarmCurrent* harmCurrent = *it; + if (harmCurrent->IsOnline()) { + // Get only the current order in analysis + for (unsigned int k = 0; k < harmCurrent->GetElectricalData().harmonicOrder.size(); ++k) { + if (harmCurrent->GetElectricalData().harmonicOrder[k] == static_cast(harmOrders[i])) { + Bus* parentBus = static_cast(harmCurrent->GetParentList()[0]); + auto busData = parentBus->GetElectricalData(); + int j = busData.number; + + // Bus voltage + double voltage = busData.nominalVoltage; + if (busData.nominalVoltageUnit == ElectricalUnit::UNIT_kV) voltage *= 1e3; + + auto puData = harmCurrent->GetPUElectricalData(systemPowerBase, voltage); + + iHarmInjList[i][j] += std::complex( + puData.injHarmCurrent[k] * std::cos(wxDegToRad(puData.injHarmAngle[k])), + puData.injHarmCurrent[k] * std::sin(wxDegToRad(puData.injHarmAngle[k]))); + } + } + } + } + } + + // Calculate harmonic voltages + std::vector > > vHarmList; + for (unsigned int i = 0; i < m_harmYbusList.size(); ++i) { + vHarmList.push_back(GaussianElimination(m_harmYbusList[i].yBus, iHarmInjList[i])); + } + + for (auto it = m_busList.begin(), itEnd = m_busList.end(); it != itEnd; ++it) { + Bus* bus = *it; + auto data = bus->GetElectricalData(); + data.harmonicOrder.clear(); + data.harmonicVoltage.clear(); + double thd = 0.0; + for (unsigned int i = 0; i < vHarmList.size(); ++i) { + thd += std::abs(vHarmList[i][data.number]) * std::abs(vHarmList[i][data.number]); + data.harmonicVoltage.push_back(vHarmList[i][data.number]); + data.harmonicOrder.push_back(static_cast(harmOrders[i])); + } + // distortion = std::sqrt(distortion) / std::abs(data.voltage); + thd = std::sqrt(thd) * 100.0; + data.thd = thd; + bus->SetElectricalData(data); + } + + // Calculate harmonic currents through branches: + // Lines + for (auto* line : m_lineList) { + if (line->IsOnline()) { + LineElectricalData data = line->GetPUElectricalData(systemPowerBase); + + auto busData1 = static_cast(line->GetParentList()[0])->GetElectricalData(); + auto busData2 = static_cast(line->GetParentList()[1])->GetElectricalData(); + + if (busData1.harmonicVoltage.size() != busData1.harmonicVoltage.size()) { + m_errorMsg = _("Error calculating the harmonic current in \"") + data.name + wxT("\"."); + return false; + } + + // Clear old currents + data.harmonicOrder.clear(); + data.harmonicCurrent[0].clear(); + data.harmonicCurrent[1].clear(); + + int i = 0; + for (auto& hVoltage : busData1.harmonicVoltage) { + int order = busData1.harmonicOrder[i]; + data.harmonicOrder.push_back(order); + + std::complex v1 = hVoltage; + std::complex v2 = busData2.harmonicVoltage[i]; + std::complex zs = std::complex(data.resistance, data.indReactance * order); + std::complex bsh = std::complex(0.0, (data.capSusceptance * order) / 2.0); + + data.harmonicCurrent[0].push_back((v1 - v2) / zs + v1 * bsh); + data.harmonicCurrent[1].push_back((v2 - v1) / zs + v2 * bsh); + i++; + } + + line->SetElectricalData(data); + } + } + // Transformers + for (auto* transformer : m_transformerList) { + if (transformer->IsOnline()) { + TransformerElectricalData data = transformer->GetPUElectricalData(systemPowerBase); + + auto busData1 = static_cast(transformer->GetParentList()[0])->GetElectricalData(); + auto busData2 = static_cast(transformer->GetParentList()[1])->GetElectricalData(); + + if (busData1.harmonicVoltage.size() != busData1.harmonicVoltage.size()) { + m_errorMsg = _("Error calculating the harmonic current in \"") + data.name + wxT("\"."); + return false; + } + + // Clear old currents + data.harmonicOrder.clear(); + data.harmonicCurrent[0].clear(); + data.harmonicCurrent[1].clear(); + + int i = 0; + for (auto& hVoltage : busData1.harmonicVoltage) { + int order = busData1.harmonicOrder[i]; + data.harmonicOrder.push_back(order); + + std::complex v1 = hVoltage; + std::complex v2 = busData2.harmonicVoltage[i]; + + auto yMatrix = GetTransformerHarmAdmmitance(transformer, systemPowerBase, order); + + data.harmonicCurrent[0].push_back(yMatrix[0][0] * v1 + yMatrix[0][1] * v2); + data.harmonicCurrent[1].push_back(yMatrix[1][0] * v1 + yMatrix[1][1] * v2); + + i++; + } + + transformer->SetElectricaData(data); + + } + } + + return true; } std::vector PowerQuality::GetHarmonicOrdersList() { - std::vector harmOrders; - auto harmCurrentList = GetHarmCurrentList(); - // Check all harmonic sources and get all harmonic orders in the system - for(auto it = harmCurrentList.begin(), itEnd = harmCurrentList.end(); it != itEnd; ++it) { - HarmCurrent* harmCurrent = *it; - if(harmCurrent->IsOnline()) { - auto data = harmCurrent->GetElectricalData(); - for(unsigned int i = 0; i < data.harmonicOrder.size(); ++i) { - int order = data.harmonicOrder[i]; - // Check if this harmonic order have been added already - bool newOrder = true; - for(unsigned int j = 0; j < harmOrders.size(); ++j) { - if(order == harmOrders[j]) { - newOrder = false; - break; - } - } - if(newOrder) harmOrders.push_back(order); - } - } - } - std::vector doubleHarmOrder; - for(unsigned int i = 0; i < harmOrders.size(); ++i) { - doubleHarmOrder.push_back(static_cast(harmOrders[i])); - } - return doubleHarmOrder; + std::vector harmOrders; + auto harmCurrentList = GetHarmCurrentList(); + // Check all harmonic sources and get all harmonic orders in the system + for (auto it = harmCurrentList.begin(), itEnd = harmCurrentList.end(); it != itEnd; ++it) { + HarmCurrent* harmCurrent = *it; + if (harmCurrent->IsOnline()) { + auto data = harmCurrent->GetElectricalData(); + for (unsigned int i = 0; i < data.harmonicOrder.size(); ++i) { + int order = data.harmonicOrder[i]; + // Check if this harmonic order have been added already + bool newOrder = true; + for (unsigned int j = 0; j < harmOrders.size(); ++j) { + if (order == harmOrders[j]) { + newOrder = false; + break; + } + } + if (newOrder) harmOrders.push_back(order); + } + } + } + std::vector doubleHarmOrder; + for (unsigned int i = 0; i < harmOrders.size(); ++i) { + doubleHarmOrder.push_back(static_cast(harmOrders[i])); + } + return doubleHarmOrder; +} + +std::vector > > PowerQuality::GetTransformerHarmAdmmitance(Transformer* transformer, double systemPowerBase, double hOrder, bool ignoreConnection) +{ + TransformerElectricalData data = transformer->GetPUElectricalData(systemPowerBase); + + std::complex ys = std::complex(1.0, 0.0) / std::complex(data.resistance, data.indReactance * hOrder); + std::complex zeroCpx(0.0, 0.0); + std::vector > > yMatrix{ {zeroCpx, zeroCpx}, {zeroCpx, zeroCpx} }; + + // If the transformer have nominal turns ratio (1.0) and no phase shifting, it will be modelled as series impedance. + if ((data.turnsRatio == 1.0 && data.phaseShift == 0.0) || ignoreConnection) { + yMatrix[0][0] = ys; + yMatrix[1][1] = ys; + yMatrix[0][1] = -ys; + yMatrix[1][0] = -ys; + } + else { + // 1. If the harmonic order is negative sequence (order % 3 == 2), change the phase shift signal; + // 2. If the harmonic order if zero sequence (order % 3 == 0). transformer connection must be considered. + double radPhaseShift = wxDegToRad(data.phaseShift); + + if (static_cast(hOrder) % 3 != 0) { // Positive and Negative sequences + if (static_cast(hOrder) % 3 == 2) { // Negative sequence + radPhaseShift *= -1.0; + } + std::complex a = std::complex(data.turnsRatio * std::cos(radPhaseShift), + -data.turnsRatio * std::sin(radPhaseShift)); + + yMatrix[0][0] = ys / (std::pow(std::abs(a), 2.0)); + yMatrix[0][1] = -(ys / std::conj(a)); + yMatrix[1][0] = -(ys / a); + yMatrix[1][1] = ys; + } + else { // Zero sequence + switch (data.connection) { + case GWYE_GWYE: { + ys = 1.0 / std::complex( + data.zeroResistance + 3.0 * (data.primaryGrndResistance + data.secondaryGrndResistance), + data.zeroIndReactance + + 3.0 * (data.primaryGrndReactance + data.secondaryGrndReactance)); + std::complex a = std::complex(data.turnsRatio, 0.0); + + yMatrix[0][0] = ys / (a * a); + yMatrix[0][1] = -(ys / a); + yMatrix[1][0] = -(ys / a); + yMatrix[1][1] = ys; + } break; + case DELTA_GWYE: { + ys = 1.0 / std::complex(data.zeroResistance + 3.0 * (data.secondaryGrndResistance), + data.zeroIndReactance + 3.0 * (data.secondaryGrndReactance)); + yMatrix[1][1] = ys; + break; + } + case GWYE_DELTA: { + ys = 1.0 / std::complex(data.zeroResistance + 3.0 * (data.primaryGrndResistance), + data.zeroIndReactance + 3.0 * (data.primaryGrndReactance)); + yMatrix[0][0] = ys; + break; + } + default: + break; + } + } + } + + return yMatrix; } bool PowerQuality::CalculateFrequencyResponse(double systemFreq, - double initFreq, - double endFreq, - double stepFreq, - int injBusNumber, - double systemPowerBase) + double initFreq, + double endFreq, + double stepFreq, + int injBusNumber, + double systemPowerBase) { - // Clear all previous data - for(unsigned int i = 0; i < m_busList.size(); i++) { - auto data = m_busList[i]->GetElectricalData(); - data.absImpedanceVector.clear(); - data.absImpedanceVector.shrink_to_fit(); - m_busList[i]->SetElectricalData(data); - } - - // Create and fill with zeros the YBus - std::vector > > yBus; - for(unsigned int i = 0; i < m_busList.size(); i++) { - std::vector > line; - for(unsigned int j = 0; j < m_busList.size(); j++) { line.push_back(std::complex(0.0, 0.0)); } - yBus.push_back(line); - } - // Create and fill with zeros the injected current vector - std::vector > iInj; - for(unsigned int i = 0; i < m_busList.size(); i++) { iInj.push_back(std::complex(0.0, 0.0)); } - iInj[injBusNumber] = std::complex(1.0, 0.0); - - if(initFreq < 1e-6) initFreq = stepFreq; - double currentFreq = initFreq; - while(currentFreq <= endFreq) { - m_frequencyList.push_back(currentFreq); - - double order = currentFreq / systemFreq; - - // Fill YBus with zeros - for(unsigned int i = 0; i < m_busList.size(); i++) { - for(unsigned int j = 0; j < m_busList.size(); j++) { yBus[i][j] = std::complex(0.0, 0.0); } - } - - CalculateHarmonicYbus(yBus, systemPowerBase, order); - - for(unsigned int i = 0; i < m_busList.size(); i++) { - auto data = m_busList[i]->GetElectricalData(); - if(data.plotPQData) { - auto zh = GaussianElimination(yBus, iInj); - - data.absImpedanceVector.push_back(std::abs(zh[data.number])); - m_busList[i]->SetElectricalData(data); - } - } - - currentFreq += stepFreq; - } - return false; + // Clear all previous data + for (unsigned int i = 0; i < m_busList.size(); i++) { + auto data = m_busList[i]->GetElectricalData(); + data.absImpedanceVector.clear(); + data.absImpedanceVector.shrink_to_fit(); + m_busList[i]->SetElectricalData(data); + } + + // Create and fill with zeros the YBus + std::vector > > yBus; + for (unsigned int i = 0; i < m_busList.size(); i++) { + std::vector > line; + for (unsigned int j = 0; j < m_busList.size(); j++) { line.push_back(std::complex(0.0, 0.0)); } + yBus.push_back(line); + } + // Create and fill with zeros the injected current vector + std::vector > iInj; + for (unsigned int i = 0; i < m_busList.size(); i++) { iInj.push_back(std::complex(0.0, 0.0)); } + iInj[injBusNumber] = std::complex(1.0, 0.0); + + if (initFreq < 1e-6) initFreq = stepFreq; + double currentFreq = initFreq; + while (currentFreq <= endFreq) { + m_frequencyList.push_back(currentFreq); + + double order = currentFreq / systemFreq; + + // Fill YBus with zeros + for (unsigned int i = 0; i < m_busList.size(); i++) { + for (unsigned int j = 0; j < m_busList.size(); j++) { yBus[i][j] = std::complex(0.0, 0.0); } + } + + CalculateHarmonicYbus(yBus, systemPowerBase, order, true); + + for (unsigned int i = 0; i < m_busList.size(); i++) { + auto data = m_busList[i]->GetElectricalData(); + if (data.plotPQData) { + auto zh = GaussianElimination(yBus, iInj); + + data.absImpedanceVector.push_back(std::abs(zh[data.number])); + m_busList[i]->SetElectricalData(data); + } + } + + currentFreq += stepFreq; + } + return false; } diff --git a/Project/PowerQuality.h b/Project/PowerQuality.h index 47d2260a..3295a3ce 100644 --- a/Project/PowerQuality.h +++ b/Project/PowerQuality.h @@ -15,34 +15,40 @@ */ class PowerQuality : public ElectricCalculation { - public: - struct HarmonicYbus { - double order; - std::vector > > yBus; - }; - - PowerQuality(); - PowerQuality(std::vector elementList); - ~PowerQuality(); - - virtual void CalculateHarmonicYbusList(double systemPowerBase = 100e6); - virtual void CalculateHarmonicYbus(std::vector > > &yBus, - double systemPowerBase, - double order); - - virtual bool CalculateDistortions(double systemPowerBase = 100e6); - virtual bool CalculateFrequencyResponse(double systemFreq = 60.0, - double initFreq = 0.0, - double endFreq = 1500.0, - double stepFreq = 1.0, - int injBusNumber = 0, - double systemPowerBase = 100e6); - virtual std::vector GetHarmonicOrdersList(); - virtual std::vector GetFrequencies() { return m_frequencyList; } - - protected: - std::vector m_harmYbusList; - std::vector m_frequencyList; +public: + struct HarmonicYbus { + double order; + std::vector > > yBus; + }; + + PowerQuality(); + PowerQuality(std::vector elementList); + ~PowerQuality(); + + virtual wxString GetErrorMessage() { return m_errorMsg; } + + virtual void CalculateHarmonicYbusList(double systemPowerBase = 100e6); + virtual void CalculateHarmonicYbus(std::vector > >& yBus, + double systemPowerBase, + double order, + bool ignoreTransformerConnection = false); + + virtual bool CalculateDistortions(double systemPowerBase = 100e6); + virtual bool CalculateFrequencyResponse(double systemFreq = 60.0, + double initFreq = 0.0, + double endFreq = 1500.0, + double stepFreq = 1.0, + int injBusNumber = 0, + double systemPowerBase = 100e6); + virtual std::vector GetHarmonicOrdersList(); + virtual std::vector GetFrequencies() { return m_frequencyList; } + +protected: + std::vector > > GetTransformerHarmAdmmitance(Transformer* transformer, double systemPowerBase, double hOrder, bool ignoreConnection = false); + + std::vector m_harmYbusList; + std::vector m_frequencyList; + wxString m_errorMsg = ""; }; #endif // POWERQUALITY_H diff --git a/Project/Transformer.cpp b/Project/Transformer.cpp index c5fd96b7..633e5ae6 100644 --- a/Project/Transformer.cpp +++ b/Project/Transformer.cpp @@ -527,6 +527,20 @@ wxString Transformer::GetTipText() const wxString::FromDouble(m_electricalData.powerFlow[1].real(), 5) + _(" p.u."); tipText += _("\nQ") + wxString::Format("(%d-%d) = ", busNumber[1], busNumber[0]) + wxString::FromDouble(m_electricalData.powerFlow[1].imag(), 5) + _(" p.u."); + + if (!m_electricalData.harmonicOrder.empty()) { + tipText += _("\n\nHarmonic currents:"); + int i = 0; + for (auto& hCurrent1 : m_electricalData.harmonicCurrent[0]) { + auto& hCurrent2 = m_electricalData.harmonicCurrent[1][i]; + wxString i1, i2; + i1.Printf(_("\nIh(%d)(%d-%d) = %.5e%s%.2f%s p.u."), m_electricalData.harmonicOrder[i], busNumber[0], busNumber[1], std::abs(hCurrent1), wxString(L'\u2220'), wxRadToDeg(std::arg(hCurrent1)), wxString(L'\u00B0')); + i2.Printf(_("\nIh(%d)(%d-%d) = %.5e%s%.2f%s p.u."), m_electricalData.harmonicOrder[i], busNumber[1], busNumber[0], std::abs(hCurrent2), wxString(L'\u2220'), wxRadToDeg(std::arg(hCurrent2)), wxString(L'\u00B0')); + + tipText += i1 + i2; + i++; + } + } } return tipText; diff --git a/Project/Transformer.h b/Project/Transformer.h index d1a6b05d..eaa9c0f8 100644 --- a/Project/Transformer.h +++ b/Project/Transformer.h @@ -64,8 +64,13 @@ struct TransformerElectricalData { double primaryGrndReactance = 0.0; double secondaryGrndResistance = 0.0; double secondaryGrndReactance = 0.0; + // p.u. fault data std::complex faultCurrent[2][3]; + + // Power Quality + std::vector harmonicOrder; + std::vector< std::complex > harmonicCurrent[2]; }; /** diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp index 585ec82e..59dd2f22 100644 --- a/Project/Workspace.cpp +++ b/Project/Workspace.cpp @@ -1766,11 +1766,18 @@ bool Workspace::RunHarmonicDistortion() else if (simProp.basePowerUnit == ElectricalUnit::UNIT_kVA) basePower *= 1e3; if (!RunPowerFlow()) return false; + PowerQuality pq(GetElementList()); bool result = pq.CalculateDistortions(basePower); - UpdateTextElements(); - Redraw(); + if (!result) { + wxMessageDialog msgDialog(this, pq.GetErrorMessage(), _("Error"), wxOK | wxCENTRE | wxICON_ERROR); + msgDialog.ShowModal(); + } + else { + UpdateTextElements(); + Redraw(); + } return result; }