summaryrefslogtreecommitdiffstats
path: root/Project
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-10-05 20:02:59 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-10-05 20:02:59 -0300
commitbc5a3e8923cb8efedbbd5b88e212eb0e9009cf87 (patch)
treea86d950b5ed31b6a7722ba3ef073d54ffc323a6e /Project
parentc7c1963fae6f88a55b3f7e4a3f9ea17e964d23d2 (diff)
downloadPSP.git-bc5a3e8923cb8efedbbd5b88e212eb0e9009cf87.tar.gz
PSP.git-bc5a3e8923cb8efedbbd5b88e212eb0e9009cf87.tar.xz
PSP.git-bc5a3e8923cb8efedbbd5b88e212eb0e9009cf87.zip
Add copyright on files and documentation update
Diffstat (limited to 'Project')
-rw-r--r--Project/AboutForm.cpp17
-rw-r--r--Project/AboutForm.h24
-rw-r--r--Project/Branch.cpp57
-rw-r--r--Project/Branch.h39
-rw-r--r--Project/Bus.cpp17
-rw-r--r--Project/Bus.h19
-rw-r--r--Project/BusForm.cpp19
-rw-r--r--Project/BusForm.h45
-rw-r--r--Project/Camera.cpp21
-rw-r--r--Project/Camera.h31
-rw-r--r--Project/Capacitor.cpp17
-rw-r--r--Project/Capacitor.h23
-rw-r--r--Project/ChartView.cpp17
-rw-r--r--Project/ChartView.h24
-rw-r--r--Project/ConnectionLine.cpp27
-rw-r--r--Project/ConnectionLine.h29
-rw-r--r--Project/Constant.cpp17
-rw-r--r--Project/Constant.h27
-rw-r--r--Project/ConstantForm.cpp19
-rw-r--r--Project/ConstantForm.h26
-rw-r--r--Project/ControlEditor.cpp17
-rw-r--r--Project/ControlEditor.h24
-rw-r--r--Project/ControlElement.cpp17
-rw-r--r--Project/ControlElement.h31
-rw-r--r--Project/ControlElementContainer.cpp17
-rw-r--r--Project/ControlElementContainer.h25
-rw-r--r--Project/ControlElementSolver.cpp17
-rw-r--r--Project/ControlElementSolver.h25
-rw-r--r--Project/ControlSystemTest.cpp19
-rw-r--r--Project/ControlSystemTest.h39
-rw-r--r--Project/DataReport.cpp17
-rw-r--r--Project/DataReport.h24
-rw-r--r--Project/ElectricCalculation.cpp17
-rw-r--r--Project/ElectricCalculation.h17
-rw-r--r--Project/Electromechanical.cpp23
-rw-r--r--Project/Electromechanical.h17
-rw-r--r--Project/Element.cpp111
-rw-r--r--Project/Element.h101
-rw-r--r--Project/ElementDataObject.cpp23
-rw-r--r--Project/ElementDataObject.h24
-rw-r--r--Project/ElementPlotData.cpp17
-rw-r--r--Project/ElementPlotData.h19
-rw-r--r--Project/Exponential.cpp17
-rw-r--r--Project/Exponential.h44
-rw-r--r--Project/ExponentialForm.cpp17
-rw-r--r--Project/ExponentialForm.h24
-rw-r--r--Project/Fault.cpp17
-rw-r--r--Project/Fault.h26
-rw-r--r--Project/FileHanding.cpp17
-rw-r--r--Project/FileHanding.h24
-rw-r--r--Project/Gain.cpp17
-rw-r--r--Project/Gain.h33
-rw-r--r--Project/GainForm.cpp19
-rw-r--r--Project/GainForm.h26
-rw-r--r--Project/GeneralPropertiesForm.cpp17
-rw-r--r--Project/GeneralPropertiesForm.h34
-rw-r--r--Project/GeneratorStabForm.cpp17
-rw-r--r--Project/GeneratorStabForm.h24
-rw-r--r--Project/GraphicalElement.cpp17
-rw-r--r--Project/GraphicalElement.h22
-rw-r--r--Project/IOControl.cpp19
-rw-r--r--Project/IOControl.h26
-rw-r--r--Project/IOControlForm.cpp19
-rw-r--r--Project/IOControlForm.h30
-rw-r--r--Project/IndMotor.cpp28
-rw-r--r--Project/IndMotor.h24
-rw-r--r--Project/IndMotorForm.cpp19
-rw-r--r--Project/IndMotorForm.h24
-rw-r--r--Project/Inductor.cpp17
-rw-r--r--Project/Inductor.h21
-rw-r--r--Project/Limiter.cpp25
-rw-r--r--Project/Limiter.h38
-rw-r--r--Project/LimiterForm.cpp19
-rw-r--r--Project/LimiterForm.h24
-rw-r--r--Project/Line.cpp17
-rw-r--r--Project/Line.h17
-rw-r--r--Project/LineForm.cpp17
-rw-r--r--Project/LineForm.h42
-rw-r--r--Project/Load.cpp17
-rw-r--r--Project/Load.h31
-rw-r--r--Project/LoadForm.cpp17
-rw-r--r--Project/LoadForm.h24
-rw-r--r--Project/Machines.cpp17
-rw-r--r--Project/Machines.h17
-rw-r--r--Project/MainFrame.cpp17
-rw-r--r--Project/MainFrame.h19
-rw-r--r--Project/Multiplier.cpp17
-rw-r--r--Project/Multiplier.h28
-rw-r--r--Project/PowerElement.cpp17
-rw-r--r--Project/PowerElement.h17
-rw-r--r--Project/PowerFlow.cpp65
-rw-r--r--Project/PowerFlow.h34
-rw-r--r--Project/Project.mk2
-rw-r--r--Project/PropertiesData.cpp27
-rw-r--r--Project/PropertiesData.h17
-rw-r--r--Project/RateLimiter.cpp17
-rw-r--r--Project/RateLimiter.h44
-rw-r--r--Project/RateLimiterForm.cpp21
-rw-r--r--Project/RateLimiterForm.h28
-rw-r--r--Project/ReactiveShuntElementForm.cpp17
-rw-r--r--Project/ReactiveShuntElementForm.h24
-rw-r--r--Project/Shunt.cpp17
-rw-r--r--Project/Shunt.h30
-rw-r--r--Project/SimulationsSettingsForm.cpp17
-rw-r--r--Project/SimulationsSettingsForm.h33
-rw-r--r--Project/Sum.cpp17
-rw-r--r--Project/Sum.h30
-rw-r--r--Project/SumForm.cpp31
-rw-r--r--Project/SumForm.h34
-rw-r--r--Project/SwitchingForm.cpp17
-rw-r--r--Project/SwitchingForm.h35
-rw-r--r--Project/SyncGenerator.cpp17
-rw-r--r--Project/SyncGenerator.h19
-rw-r--r--Project/SyncMachineForm.cpp17
-rw-r--r--Project/SyncMachineForm.h24
-rw-r--r--Project/SyncMotor.cpp17
-rw-r--r--Project/SyncMotor.h17
-rw-r--r--Project/Text.cpp17
-rw-r--r--Project/Text.h24
-rw-r--r--Project/TextForm.cpp17
-rw-r--r--Project/TextForm.h30
-rw-r--r--Project/TransferFunction.cpp17
-rw-r--r--Project/TransferFunction.h19
-rw-r--r--Project/TransferFunctionForm.cpp19
-rw-r--r--Project/TransferFunctionForm.h32
-rw-r--r--Project/Transformer.cpp37
-rw-r--r--Project/Transformer.h27
-rw-r--r--Project/TransformerForm.cpp23
-rw-r--r--Project/TransformerForm.h24
-rw-r--r--Project/Workspace.cpp17
-rw-r--r--Project/Workspace.h21
131 files changed, 2820 insertions, 404 deletions
diff --git a/Project/AboutForm.cpp b/Project/AboutForm.cpp
index b9d4f88..5de1d2d 100644
--- a/Project/AboutForm.cpp
+++ b/Project/AboutForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "AboutForm.h"
AboutForm::AboutForm(wxWindow* parent) : AboutFormBase(parent) { Init(); }
diff --git a/Project/AboutForm.h b/Project/AboutForm.h
index abba7f4..90a43b1 100644
--- a/Project/AboutForm.h
+++ b/Project/AboutForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef ABOUTFORM_H
#define ABOUTFORM_H
#include "PropertiesForm.h"
@@ -5,6 +22,13 @@
#include <wx/textfile.h>
#include <wx/stdpaths.h>
+/**
+ * @class AboutForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to show some informations.
+ * @file AboutForm.h
+ */
class AboutForm : public AboutFormBase
{
public:
diff --git a/Project/Branch.cpp b/Project/Branch.cpp
index 326b7e0..8bcbb5e 100644
--- a/Project/Branch.cpp
+++ b/Project/Branch.cpp
@@ -1,16 +1,31 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Branch.h"
-Branch::Branch()
- : PowerElement()
-{
-}
+Branch::Branch() : PowerElement() {}
Branch::~Branch() {}
bool Branch::NodeContains(wxPoint2DDouble position)
{
wxRect2DDouble nodeRect1(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);
+ 10 + 2.0 * m_borderSize, 10 + 2.0 * m_borderSize);
wxRect2DDouble nodeRect2(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);
+ m_pointList[m_pointList.size() - 1].m_y - 5.0 - m_borderSize, 10 + 2.0 * m_borderSize,
+ 10 + 2.0 * m_borderSize);
if(nodeRect1.Contains(position)) {
m_activeNodeID = 1;
@@ -34,12 +49,12 @@ bool Branch::SetNodeParent(Element* parent)
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);
+ 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);
+ 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)) {
@@ -54,8 +69,8 @@ bool Branch::SetNodeParent(Element* 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.
+ 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;
@@ -102,7 +117,7 @@ void Branch::UpdateNodes()
{
if(m_parentList[0]) {
wxRect2DDouble nodeRect(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);
+ 10 + 2.0 * m_borderSize, 10 + 2.0 * m_borderSize);
if(!m_parentList[0]->Intersects(nodeRect)) {
m_parentList[0]->RemoveChild(this);
@@ -113,8 +128,8 @@ void Branch::UpdateNodes()
}
if(m_parentList[1]) {
wxRect2DDouble 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);
+ m_pointList[m_pointList.size() - 1].m_y - 5.0 - m_borderSize,
+ 10 + 2.0 * m_borderSize, 10 + 2.0 * m_borderSize);
if(!m_parentList[1]->Intersects(nodeRect)) {
m_parentList[1]->RemoveChild(this);
@@ -156,16 +171,16 @@ void Branch::UpdateSwitchesPosition()
void Branch::UpdateSwitches()
{
- wxPoint2DDouble swCenter = wxPoint2DDouble(
- (m_pointList[0].m_x + m_pointList[1].m_x) / 2.0, (m_pointList[0].m_y + m_pointList[1].m_y) / 2.0);
- m_switchRect[0] = wxRect2DDouble(
- swCenter.m_x - m_switchSize / 2.0, swCenter.m_y - m_switchSize / 2.0, m_switchSize, m_switchSize);
+ wxPoint2DDouble swCenter = wxPoint2DDouble((m_pointList[0].m_x + m_pointList[1].m_x) / 2.0,
+ (m_pointList[0].m_y + m_pointList[1].m_y) / 2.0);
+ m_switchRect[0] = wxRect2DDouble(swCenter.m_x - m_switchSize / 2.0, swCenter.m_y - m_switchSize / 2.0, m_switchSize,
+ m_switchSize);
if(m_switchRect.size() > 1) {
swCenter =
wxPoint2DDouble((m_pointList[m_pointList.size() - 1].m_x + m_pointList[m_pointList.size() - 2].m_x) / 2.0,
- (m_pointList[m_pointList.size() - 1].m_y + m_pointList[m_pointList.size() - 2].m_y) / 2.0);
- m_switchRect[1] = wxRect2DDouble(
- swCenter.m_x - m_switchSize / 2.0, swCenter.m_y - m_switchSize / 2.0, m_switchSize, m_switchSize);
+ (m_pointList[m_pointList.size() - 1].m_y + m_pointList[m_pointList.size() - 2].m_y) / 2.0);
+ m_switchRect[1] = wxRect2DDouble(swCenter.m_x - m_switchSize / 2.0, swCenter.m_y - m_switchSize / 2.0,
+ m_switchSize, m_switchSize);
}
}
diff --git a/Project/Branch.h b/Project/Branch.h
index a782a1e..10c45d2 100644
--- a/Project/Branch.h
+++ b/Project/Branch.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef BRANCH_H
#define BRANCH_H
@@ -6,31 +23,31 @@
class Branch : public PowerElement
{
-public:
- Branch();
- ~Branch();
-
- virtual bool Contains(wxPoint2DDouble position) const { return false; }
+ public:
+ Branch();
+ ~Branch();
+
+ virtual bool Contains(wxPoint2DDouble position) const { return false; }
virtual void Draw(wxPoint2DDouble translation, double scale) const {}
virtual void Move(wxPoint2DDouble position) {}
virtual void StartMove(wxPoint2DDouble position) {}
virtual void MoveNode(Element* parent, wxPoint2DDouble position) {}
virtual bool NodeContains(wxPoint2DDouble position);
virtual bool SetNodeParent(Element* parent);
- virtual void RemoveParent(Element* parent);
+ virtual void RemoveParent(Element* parent);
virtual void UpdateNodes();
virtual wxCursor GetBestPickboxCursor() const { return wxCURSOR_ARROW; }
virtual bool Intersects(wxRect2DDouble rect) const { return false; }
virtual void MovePickbox(wxPoint2DDouble position) {}
virtual bool PickboxContains(wxPoint2DDouble position) { return false; }
virtual void RotateNode(Element* parent, bool clockwise = true);
- virtual void AddPoint(wxPoint2DDouble point) {};
+ virtual void AddPoint(wxPoint2DDouble point){};
virtual bool GetContextMenu(wxMenu& menu) { return false; }
- virtual void UpdateSwitchesPosition();
- virtual void UpdateSwitches();
+ virtual void UpdateSwitchesPosition();
+ virtual void UpdateSwitches();
protected:
- bool m_inserted = false;
+ bool m_inserted = false;
};
-#endif // BRANCH_H
+#endif // BRANCH_H
diff --git a/Project/Bus.cpp b/Project/Bus.cpp
index c366d76..ee84ec2 100644
--- a/Project/Bus.cpp
+++ b/Project/Bus.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Bus.h"
#ifdef USING_WX_3_0_X
#include "DegreesAndRadians.h"
diff --git a/Project/Bus.h b/Project/Bus.h
index 17d341b..f974a86 100644
--- a/Project/Bus.h
+++ b/Project/Bus.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef BUS_H
#define BUS_H
@@ -17,7 +34,7 @@ struct BusElectricalData {
// Power flow (p.u.)
std::complex<double> voltage = std::complex<double>(1.0, 0.0);
std::complex<double> power = std::complex<double>(0.0, 0.0);
- int busType = 2; // PQ
+ int busType = 2; // PQ
// Fault
bool hasFault = false;
diff --git a/Project/BusForm.cpp b/Project/BusForm.cpp
index 436357e..ca083e7 100644
--- a/Project/BusForm.cpp
+++ b/Project/BusForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "BusForm.h"
#include "Bus.h"
@@ -7,7 +24,7 @@ BusForm::BusForm(wxWindow* parent, Bus* bus) : BusFormBase(parent)
m_choiceFaultType->SetString(1, _("Line-to-line"));
m_choiceFaultType->SetString(2, _("Double line-to-ground"));
m_choiceFaultType->SetString(3, _("Line-to-ground"));
-
+
SetSize(GetBestSize());
m_parent = parent;
diff --git a/Project/BusForm.h b/Project/BusForm.h
index 38cb9d7..cbbe430 100644
--- a/Project/BusForm.h
+++ b/Project/BusForm.h
@@ -1,15 +1,40 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef BUSFORM_H
#define BUSFORM_H
#include "ElementForm.h"
class Bus;
+/**
+ * @class BusForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the bus power data.
+ * @file BusForm.h
+ */
class BusForm : public BusFormBase
{
-public:
+ public:
BusForm(wxWindow* parent, Bus* bus);
virtual ~BusForm();
-protected:
+
+ protected:
virtual void OnFaultTypeChoice(wxCommandEvent& event);
virtual void OnControlledVoltageClick(wxCommandEvent& event);
virtual void OnInsertFaultClick(wxCommandEvent& event);
@@ -17,12 +42,12 @@ protected:
virtual void OnNominalVoltageChoice(wxCommandEvent& event);
virtual void OnButtonCancelClick(wxCommandEvent& event);
virtual void OnButtonOKClick(wxCommandEvent& event);
- virtual void EnableCtrlVoltageFields(bool enable = true);
- virtual void EnableFaultFields(bool enable = true);
- virtual void EnableStabFaultFields(bool enable = true);
- virtual void UpdateChoiceBoxes();
-
- Bus* m_bus = NULL;
- wxWindow* m_parent = NULL;
+ virtual void EnableCtrlVoltageFields(bool enable = true);
+ virtual void EnableFaultFields(bool enable = true);
+ virtual void EnableStabFaultFields(bool enable = true);
+ virtual void UpdateChoiceBoxes();
+
+ Bus* m_bus = NULL;
+ wxWindow* m_parent = NULL;
};
-#endif // BUSFORM_H
+#endif // BUSFORM_H
diff --git a/Project/Camera.cpp b/Project/Camera.cpp
index 248a835..58c916c 100644
--- a/Project/Camera.cpp
+++ b/Project/Camera.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Camera.h"
Camera::Camera()
@@ -9,8 +26,8 @@ Camera::Camera()
Camera::~Camera() {}
wxPoint2DDouble Camera::ScreenToWorld(wxPoint2DDouble screenCoords) const
{
- return wxPoint2DDouble(
- screenCoords.m_x / m_scale - m_translation.m_x, screenCoords.m_y / m_scale - m_translation.m_y);
+ return wxPoint2DDouble(screenCoords.m_x / m_scale - m_translation.m_x,
+ screenCoords.m_y / m_scale - m_translation.m_y);
}
void Camera::SetTranslation(wxPoint2DDouble screenPoint)
diff --git a/Project/Camera.h b/Project/Camera.h
index 141047f..8c0427f 100644
--- a/Project/Camera.h
+++ b/Project/Camera.h
@@ -1,11 +1,35 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CAMERA_H
#define CAMERA_H
#include <wx/geometry.h>
+/**
+ * @class Camera
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Class responsible for the correct visualization of the elements on screen.
+ * @file Camera.h
+ */
class Camera
{
-public:
+ public:
Camera();
~Camera();
@@ -20,8 +44,7 @@ public:
wxPoint2DDouble ScreenToWorld(wxPoint2DDouble screenCoords) const;
double GetZoomMin() const { return m_zoomMin; }
double GetZoomMax() const { return m_zoomMax; }
-
-protected:
+ protected:
wxPoint2DDouble m_translation;
wxPoint2DDouble m_translationStartPt;
double m_scale;
@@ -32,4 +55,4 @@ protected:
double m_zoomMax = 3.0;
};
-#endif // CAMERA_H
+#endif // CAMERA_H
diff --git a/Project/Capacitor.cpp b/Project/Capacitor.cpp
index 75b74f4..4f7491f 100644
--- a/Project/Capacitor.cpp
+++ b/Project/Capacitor.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ReactiveShuntElementForm.h"
#include "Capacitor.h"
diff --git a/Project/Capacitor.h b/Project/Capacitor.h
index c124396..3dc126f 100644
--- a/Project/Capacitor.h
+++ b/Project/Capacitor.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CAPACITOR_H
#define CAPACITOR_H
@@ -13,7 +30,7 @@ struct CapacitorElectricalData {
class Capacitor : public Shunt
{
-public:
+ public:
Capacitor();
Capacitor(wxString name);
~Capacitor();
@@ -30,8 +47,8 @@ public:
virtual CapacitorElectricalData GetElectricalData() { return m_electricalData; }
virtual CapacitorElectricalData GetPUElectricalData(double systemPowerBase);
virtual void SetElectricalData(CapacitorElectricalData electricalData) { m_electricalData = electricalData; }
-protected:
+ protected:
CapacitorElectricalData m_electricalData;
};
-#endif // CAPACITOR_H
+#endif // CAPACITOR_H
diff --git a/Project/ChartView.cpp b/Project/ChartView.cpp
index acfc939..0a5d73c 100644
--- a/Project/ChartView.cpp
+++ b/Project/ChartView.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ChartView.h"
#include "ElementPlotData.h"
diff --git a/Project/ChartView.h b/Project/ChartView.h
index 8f5c3d9..82bb621 100644
--- a/Project/ChartView.h
+++ b/Project/ChartView.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CHARTVIEW_H
#define CHARTVIEW_H
#include "ChartViewBase.h"
@@ -13,6 +30,13 @@
class PlotData;
class ElementPlotData;
+/**
+ * @class ChartView
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief This class is responsible to manage the charts generated in the transient electromechanical studies.
+ * @file ChartView.h
+ */
class ChartView : public ChartViewBase
{
public:
diff --git a/Project/ConnectionLine.cpp b/Project/ConnectionLine.cpp
index 0258f2e..672c6e8 100644
--- a/Project/ConnectionLine.cpp
+++ b/Project/ConnectionLine.cpp
@@ -1,11 +1,24 @@
-#include "ConnectionLine.h"
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
-ConnectionLine::ConnectionLine() : ControlElement(-1)
-{
-}
+#include "ConnectionLine.h"
-ConnectionLine::ConnectionLine(Node* firstNode, int id)
- : ControlElement(id)
+ConnectionLine::ConnectionLine() : ControlElement(-1) {}
+ConnectionLine::ConnectionLine(Node* firstNode, int id) : ControlElement(id)
{
wxPoint2DDouble pt = firstNode->GetPosition();
m_tmpSndPt = pt;
@@ -17,7 +30,6 @@ ConnectionLine::ConnectionLine(Node* firstNode, int id)
}
ConnectionLine::~ConnectionLine() {}
-
void ConnectionLine::Draw(wxPoint2DDouble translation, double scale) const
{
// Line selected (Layer 1).
@@ -156,7 +168,6 @@ void ConnectionLine::StartMove(wxPoint2DDouble position)
}
wxPoint2DDouble ConnectionLine::GetMidPoint() const { return ((m_pointList[2] + m_pointList[3]) / 2.0); }
-
bool ConnectionLine::SetParentLine(ConnectionLine* parent)
{
if(m_nodeList[0]->GetNodeType() != Node::NODE_IN) return false;
diff --git a/Project/ConnectionLine.h b/Project/ConnectionLine.h
index c0355cd..768ef9f 100644
--- a/Project/ConnectionLine.h
+++ b/Project/ConnectionLine.h
@@ -1,8 +1,32 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CONNECTIONLINE_H
#define CONNECTIONLINE_H
#include "ControlElement.h"
+/**
+ * @class ConnectionLine
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Connection between two control elements or other connection line and an element.
+ * @file ConnectionLine.h
+ */
class ConnectionLine : public ControlElement
{
public:
@@ -29,10 +53,9 @@ class ConnectionLine : public ControlElement
virtual bool SetParentLine(ConnectionLine* parent);
virtual std::vector<ConnectionLine*> GetLineChildList() const;
-
+
virtual double GetValue() const { return m_value; }
virtual void SetValue(double value) { m_value = value; }
-
Element* GetCopy();
protected:
@@ -43,7 +66,7 @@ class ConnectionLine : public ControlElement
ConnectionLineType m_type = ELEMENT_ELEMENT;
ConnectionLine* m_parentLine = NULL;
-
+
double m_value;
};
diff --git a/Project/Constant.cpp b/Project/Constant.cpp
index f0c90fc..1c375f1 100644
--- a/Project/Constant.cpp
+++ b/Project/Constant.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Constant.h"
#include "ConstantForm.h"
diff --git a/Project/Constant.h b/Project/Constant.h
index 3f84b91..367916d 100644
--- a/Project/Constant.h
+++ b/Project/Constant.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CONSTANT_H
#define CONSTANT_H
@@ -8,6 +25,13 @@
class ConstantForm;
+/**
+ * @class Constant
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief A control element that provides a constant value.
+ * @file Constant.h
+ */
class Constant : public ControlElement
{
public:
@@ -20,11 +44,10 @@ class Constant : public ControlElement
virtual bool ShowForm(wxWindow* parent, Element* element);
virtual void Rotate(bool clockwise = true);
virtual void UpdateText() { SetValue(m_value); }
-
virtual void SetValue(double value);
virtual double GetValue() const { return m_value; }
virtual void UpdatePoints();
-
+
virtual Element* GetCopy();
protected:
diff --git a/Project/ConstantForm.cpp b/Project/ConstantForm.cpp
index f7d29d1..7db739b 100644
--- a/Project/ConstantForm.cpp
+++ b/Project/ConstantForm.cpp
@@ -1,10 +1,27 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ConstantForm.h"
#include "Constant.h"
ConstantForm::ConstantForm(wxWindow* parent, Constant* constant) : ConstantFormBase(parent)
{
SetSize(GetBestSize());
-
+
m_parent = parent;
m_constant = constant;
diff --git a/Project/ConstantForm.h b/Project/ConstantForm.h
index ca7a44a..ab91a55 100644
--- a/Project/ConstantForm.h
+++ b/Project/ConstantForm.h
@@ -1,9 +1,33 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CONSTANTFORM_H
#define CONSTANTFORM_H
#include "ElementForm.h"
class Constant;
+/**
+ * @class ConstantForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the constant control data.
+ * @file ConstantForm.h
+ */
class ConstantForm : public ConstantFormBase
{
public:
@@ -14,7 +38,7 @@ class ConstantForm : public ConstantFormBase
protected:
virtual void OnCancelButtonClick(wxCommandEvent& event) { EndModal(wxID_CANCEL); }
virtual void OnOKButtonClick(wxCommandEvent& event);
-
+
wxWindow* m_parent = NULL;
Constant* m_constant = NULL;
};
diff --git a/Project/ControlEditor.cpp b/Project/ControlEditor.cpp
index b72f6dd..75fe6c3 100644
--- a/Project/ControlEditor.cpp
+++ b/Project/ControlEditor.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ControlEditor.h"
#ifdef USING_WX_3_0_X
diff --git a/Project/ControlEditor.h b/Project/ControlEditor.h
index 674ed5d..dfa76ab 100644
--- a/Project/ControlEditor.h
+++ b/Project/ControlEditor.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CONTROLEDITOR_H
#define CONTROLEDITOR_H
@@ -36,6 +53,13 @@ class ElementDataObject;
enum ControlElementButtonID { ID_IO = 0, ID_TF, ID_SUM, ID_CONST, ID_LIMITER, ID_GAIN, ID_MULT, ID_EXP, ID_RATELIM };
+/**
+ * @class ControlElementButton
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief This class is responsible to handle the user interaction with control elements.
+ * @file ControlEditor.h
+ */
class ControlElementButton : public wxWindow
{
public:
diff --git a/Project/ControlElement.cpp b/Project/ControlElement.cpp
index 29a1fec..0a37803 100644
--- a/Project/ControlElement.cpp
+++ b/Project/ControlElement.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ControlElement.h"
#ifdef USING_WX_3_0_X
#include "DegreesAndRadians.h"
diff --git a/Project/ControlElement.h b/Project/ControlElement.h
index 7d0e620..1a6b8ac 100644
--- a/Project/ControlElement.h
+++ b/Project/ControlElement.h
@@ -1,8 +1,32 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CONTROLELEMENT_H
#define CONTROLELEMENT_H
#include "Element.h"
+/**
+ * @class Node
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Node of a control element. This class manages the user interaction with the connection and control elements.
+ * @file ControlElement.h
+ */
class Node
{
public:
@@ -50,6 +74,13 @@ class Node
double m_angle = 0.0;
};
+/**
+ * @class ControlElement
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @file ControlElement.h
+ * @brief Base class of a control element. Provide general methods to other control classes.
+ */
class ControlElement : public Element
{
public:
diff --git a/Project/ControlElementContainer.cpp b/Project/ControlElementContainer.cpp
index edfe684..3c420e7 100644
--- a/Project/ControlElementContainer.cpp
+++ b/Project/ControlElementContainer.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ControlElementContainer.h"
#include "ControlEditor.h"
#include "ControlElement.h"
diff --git a/Project/ControlElementContainer.h b/Project/ControlElementContainer.h
index 62b63e3..b9b9118 100644
--- a/Project/ControlElementContainer.h
+++ b/Project/ControlElementContainer.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CONTROLELEMENTCONTAINER_H
#define CONTROLELEMENTCONTAINER_H
@@ -17,6 +34,14 @@ class ControlElement;
#include "Sum.h"
#include "TransferFunction.h"
+/**
+ * @class ControlElementContainer
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Class that can contain all control elements.
+ * Can identify (using RTTI) the elements from a generic list and store them separately.
+ * @file ControlElementContainer.h
+ */
class ControlElementContainer
{
public:
diff --git a/Project/ControlElementSolver.cpp b/Project/ControlElementSolver.cpp
index 7c58512..175a329 100644
--- a/Project/ControlElementSolver.cpp
+++ b/Project/ControlElementSolver.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ControlElementSolver.h"
#include "ControlElementContainer.h"
diff --git a/Project/ControlElementSolver.h b/Project/ControlElementSolver.h
index 26b8ec5..44925f5 100644
--- a/Project/ControlElementSolver.h
+++ b/Project/ControlElementSolver.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CONTROLELEMENTSOLVER_H
#define CONTROLELEMENTSOLVER_H
@@ -17,6 +34,14 @@ class RateLimiter;
class Sum;
class TransferFunction;
+/**
+ * @class ControlElementSolver
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Solves in the time the control system.
+ * Can solve the control system directly from a ControlEditor or from a ControlEditorElement.
+ * @file ControlElementSolver.h
+ */
class ControlElementSolver
{
public:
diff --git a/Project/ControlSystemTest.cpp b/Project/ControlSystemTest.cpp
index ed1ea39..604adcb 100644
--- a/Project/ControlSystemTest.cpp
+++ b/Project/ControlSystemTest.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ControlSystemTest.h"
#include "ControlEditor.h"
@@ -10,7 +27,7 @@ ControlSystemTest::ControlSystemTest(ControlEditor* parent,
: ControlSystemTestBase(parent)
{
SetSize(GetBestSize());
-
+
m_inputType = inputType;
m_startTime = startTime;
m_slope = slope;
diff --git a/Project/ControlSystemTest.h b/Project/ControlSystemTest.h
index 0a66ae3..e82caac 100644
--- a/Project/ControlSystemTest.h
+++ b/Project/ControlSystemTest.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef CONTROLSYSTEMTEST_H
#define CONTROLSYSTEMTEST_H
@@ -5,13 +22,25 @@
class ControlEditor;
+/**
+ * @class ControlSystemTest
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit properties to test the control system created.
+ * @file ControlSystemTest.h
+ */
class ControlSystemTest : public ControlSystemTestBase
{
-public:
- ControlSystemTest(ControlEditor* parent, int* inputType, double* startTime, double* slope, double* timeStep, double* simTime);
+ public:
+ ControlSystemTest(ControlEditor* parent,
+ int* inputType,
+ double* startTime,
+ double* slope,
+ double* timeStep,
+ double* simTime);
virtual ~ControlSystemTest();
-
-protected:
+
+ protected:
virtual void OnCancelButtonClick(wxCommandEvent& event) { EndModal(wxID_CANCEL); }
virtual void OnRunButtonClick(wxCommandEvent& event);
int* m_inputType = NULL;
@@ -20,4 +49,4 @@ protected:
double* m_timeStep = NULL;
double* m_simTime = NULL;
};
-#endif // CONTROLSYSTEMTEST_H
+#endif // CONTROLSYSTEMTEST_H
diff --git a/Project/DataReport.cpp b/Project/DataReport.cpp
index 01a1e1d..1db2e2a 100644
--- a/Project/DataReport.cpp
+++ b/Project/DataReport.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "DataReport.h"
#include "Workspace.h"
#include "ElectricCalculation.h"
diff --git a/Project/DataReport.h b/Project/DataReport.h
index f262cb9..6babdf2 100644
--- a/Project/DataReport.h
+++ b/Project/DataReport.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef DATAREPORT_H
#define DATAREPORT_H
@@ -6,6 +23,13 @@
class Workspace;
class ElectricCalculation;
+/**
+ * @class DataReport
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form that shows the results of power flow and fault calculations.
+ * @file DataReport.h
+ */
class DataReport : public DataReportBase
{
public:
diff --git a/Project/ElectricCalculation.cpp b/Project/ElectricCalculation.cpp
index 485325f..36e7a9a 100644
--- a/Project/ElectricCalculation.cpp
+++ b/Project/ElectricCalculation.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ElectricCalculation.h"
#ifdef USING_WX_3_0_X
#include "DegreesAndRadians.h"
diff --git a/Project/ElectricCalculation.h b/Project/ElectricCalculation.h
index 93c422b..f3ad824 100644
--- a/Project/ElectricCalculation.h
+++ b/Project/ElectricCalculation.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef ELECTRICCALCULATION_H
#define ELECTRICCALCULATION_H
diff --git a/Project/Electromechanical.cpp b/Project/Electromechanical.cpp
index 4b40c53..4b8a711 100644
--- a/Project/Electromechanical.cpp
+++ b/Project/Electromechanical.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Electromechanical.h"
#include "ControlElementSolver.h"
@@ -502,7 +519,7 @@ bool Electromechanical::InitializeDynamicElements()
eq0 = data.terminalVoltage + std::complex<double>(ra, xqs) * ia;
delta = std::arg(eq0);*/
}
-
+
double ef0 = vq0 + ra * iq0 - xds * id0;
data.initialFieldVoltage = ef0 * sd;
@@ -523,7 +540,7 @@ bool Electromechanical::InitializeDynamicElements()
data.oldPe = data.pe;
data.oldSd = sd;
data.oldSq = sq;
-
+
m_sdC = sd;
m_sqC = sq;
@@ -818,7 +835,7 @@ bool Electromechanical::SolveSynchronousMachines()
pe = 2.0 * pe - data.oldPe;
sd = 2.0 * sd - data.oldSd;
sq = 2.0 * sq - data.oldSq;
-
+
m_sdC = sd;
m_sqC = sq;
diff --git a/Project/Electromechanical.h b/Project/Electromechanical.h
index cbbb600..1514a53 100644
--- a/Project/Electromechanical.h
+++ b/Project/Electromechanical.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef ELECTROMECHANICAL_H
#define ELECTROMECHANICAL_H
diff --git a/Project/Element.cpp b/Project/Element.cpp
index 0b6202e..27bcfb5 100644
--- a/Project/Element.cpp
+++ b/Project/Element.cpp
@@ -1,17 +1,33 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Element.h"
#ifdef USING_WX_3_0_X
#include "DegreesAndRadians.h"
#endif
Element::Element() { m_selectionColour.SetRGBA(0.0, 0.5, 1.0, 0.5); }
-
Element::~Element() {}
-
void Element::SetPosition(const wxPoint2DDouble position)
{
m_position = position;
- m_rect = wxRect2DDouble(m_position.m_x - m_width / 2.0 - m_borderSize,
- m_position.m_y - m_height / 2.0 - m_borderSize, m_width + 2.0 * m_borderSize, m_height + 2.0 * m_borderSize);
+ m_rect =
+ wxRect2DDouble(m_position.m_x - m_width / 2.0 - m_borderSize, m_position.m_y - m_height / 2.0 - m_borderSize,
+ m_width + 2.0 * m_borderSize, m_height + 2.0 * m_borderSize);
}
void Element::DrawCircle(wxPoint2DDouble position, double radius, int numSegments, GLenum mode) const
@@ -25,11 +41,11 @@ void Element::DrawCircle(wxPoint2DDouble position, double radius, int numSegment
}
void Element::DrawArc(wxPoint2DDouble position,
- double radius,
- double initAngle,
- double finalAngle,
- int numSegments,
- GLenum mode) const
+ double radius,
+ double initAngle,
+ double finalAngle,
+ int numSegments,
+ GLenum mode) const
{
double initAngRad = wxDegToRad(initAngle);
double finalAngRad = wxDegToRad(finalAngle);
@@ -52,7 +68,7 @@ void Element::DrawTriangle(std::vector<wxPoint2DDouble> points, GLenum mode) con
void Element::DrawRectangle(wxPoint2DDouble position, double width, double height, GLenum mode) const
{
- glBegin(mode); // TODO: GL_QUADS é obsoleto (OpenGL 3.0+), encontrar outra solução.
+ glBegin(mode); // TODO: GL_QUADS é obsoleto (OpenGL 3.0+), encontrar outra solução.
glVertex2d(position.m_x - width / 2.0, position.m_y - height / 2.0);
glVertex2d(position.m_x - width / 2.0, position.m_y + height / 2.0);
glVertex2d(position.m_x + width / 2.0, position.m_y + height / 2.0);
@@ -62,7 +78,7 @@ void Element::DrawRectangle(wxPoint2DDouble position, double width, double heigh
void Element::DrawRectangle(wxPoint2DDouble* points, GLenum mode) const
{
- glBegin(mode); // TODO: GL_QUADS é obsoleto (OpenGL 3.0+), encontrar outra solução.
+ glBegin(mode); // TODO: GL_QUADS é obsoleto (OpenGL 3.0+), encontrar outra solução.
glVertex2d(points[0].m_x, points[0].m_y);
glVertex2d(points[1].m_x, points[1].m_y);
glVertex2d(points[2].m_x, points[2].m_y);
@@ -93,9 +109,9 @@ wxPoint2DDouble Element::RotateAtPosition(wxPoint2DDouble pointToRotate, double
double radAngle = angle;
if(degrees) radAngle = wxDegToRad(angle);
return wxPoint2DDouble(std::cos(radAngle) * (pointToRotate.m_x - m_position.m_x) -
- std::sin(radAngle) * (pointToRotate.m_y - m_position.m_y) + m_position.m_x,
- std::sin(radAngle) * (pointToRotate.m_x - m_position.m_x) +
- std::cos(radAngle) * (pointToRotate.m_y - m_position.m_y) + m_position.m_y);
+ std::sin(radAngle) * (pointToRotate.m_y - m_position.m_y) + m_position.m_x,
+ std::sin(radAngle) * (pointToRotate.m_x - m_position.m_x) +
+ std::cos(radAngle) * (pointToRotate.m_y - m_position.m_y) + m_position.m_y);
}
void Element::StartMove(wxPoint2DDouble position)
@@ -105,18 +121,17 @@ void Element::StartMove(wxPoint2DDouble position)
}
void Element::Move(wxPoint2DDouble position) { SetPosition(m_movePos + position - m_moveStartPt); }
-
wxPoint2DDouble Element::WorldToScreen(wxPoint2DDouble translation, double scale, double offsetX, double offsetY) const
{
return wxPoint2DDouble(m_position.m_x + offsetX + translation.m_x, m_position.m_y + offsetY + translation.m_y) *
- scale;
+ scale;
}
wxPoint2DDouble Element::WorldToScreen(wxPoint2DDouble position,
- wxPoint2DDouble translation,
- double scale,
- double offsetX,
- double offsetY) const
+ wxPoint2DDouble translation,
+ double scale,
+ double offsetX,
+ double offsetY) const
{
return wxPoint2DDouble(position.m_x + offsetX + translation.m_x, position.m_y + offsetY + translation.m_y) * scale;
}
@@ -130,14 +145,14 @@ void Element::DrawPoint(wxPoint2DDouble position, double size) const
}
bool Element::RotatedRectanglesIntersects(wxRect2DDouble rect1,
- wxRect2DDouble rect2,
- double angle1,
- double angle2) const
+ wxRect2DDouble rect2,
+ double angle1,
+ double angle2) const
{
- wxPoint2DDouble rect1Corners[4] = { rect1.GetLeftTop(), rect1.GetLeftBottom(), rect1.GetRightBottom(),
- rect1.GetRightTop() };
- wxPoint2DDouble rect2Corners[4] = { rect2.GetLeftTop(), rect2.GetLeftBottom(), rect2.GetRightBottom(),
- rect2.GetRightTop() };
+ wxPoint2DDouble rect1Corners[4] = {rect1.GetLeftTop(), rect1.GetLeftBottom(), rect1.GetRightBottom(),
+ rect1.GetRightTop()};
+ wxPoint2DDouble rect2Corners[4] = {rect2.GetLeftTop(), rect2.GetLeftBottom(), rect2.GetRightBottom(),
+ rect2.GetRightTop()};
wxPoint2DDouble rect1Center(rect1.m_x + rect1.m_width / 2.0, rect1.m_y + rect1.m_height / 2.0);
wxPoint2DDouble rect2Center(rect2.m_x + rect2.m_width / 2.0, rect2.m_y + rect2.m_height / 2.0);
@@ -146,26 +161,28 @@ bool Element::RotatedRectanglesIntersects(wxRect2DDouble rect1,
double radAngle2 = wxDegToRad(angle2);
for(int i = 0; i < 4; i++) {
- rect1Corners[i] = wxPoint2DDouble(std::cos(radAngle1) * (rect1Corners[i].m_x - rect1Center.m_x) -
- std::sin(radAngle1) * (rect1Corners[i].m_y - rect1Center.m_y) + rect1Center.m_x,
- std::sin(radAngle1) * (rect1Corners[i].m_x - rect1Center.m_x) +
- std::cos(radAngle1) * (rect1Corners[i].m_y - rect1Center.m_y) + rect1Center.m_y);
-
- rect2Corners[i] = wxPoint2DDouble(std::cos(radAngle2) * (rect2Corners[i].m_x - rect2Center.m_x) -
- std::sin(radAngle2) * (rect2Corners[i].m_y - rect2Center.m_y) + rect2Center.m_x,
- std::sin(radAngle2) * (rect2Corners[i].m_x - rect2Center.m_x) +
- std::cos(radAngle2) * (rect2Corners[i].m_y - rect2Center.m_y) + rect2Center.m_y);
+ rect1Corners[i] =
+ wxPoint2DDouble(std::cos(radAngle1) * (rect1Corners[i].m_x - rect1Center.m_x) -
+ std::sin(radAngle1) * (rect1Corners[i].m_y - rect1Center.m_y) + rect1Center.m_x,
+ std::sin(radAngle1) * (rect1Corners[i].m_x - rect1Center.m_x) +
+ std::cos(radAngle1) * (rect1Corners[i].m_y - rect1Center.m_y) + rect1Center.m_y);
+
+ rect2Corners[i] =
+ wxPoint2DDouble(std::cos(radAngle2) * (rect2Corners[i].m_x - rect2Center.m_x) -
+ std::sin(radAngle2) * (rect2Corners[i].m_y - rect2Center.m_y) + rect2Center.m_x,
+ std::sin(radAngle2) * (rect2Corners[i].m_x - rect2Center.m_x) +
+ std::cos(radAngle2) * (rect2Corners[i].m_y - rect2Center.m_y) + rect2Center.m_y);
}
//[Ref] http://www.gamedev.net/page/resources/_/technical/game-programming/2d-rotated-rectangle-collision-r2604
// Find the rectangles axis to project
- wxPoint2DDouble axis[4] = { rect1Corners[3] - rect1Corners[0], rect1Corners[3] - rect1Corners[2],
- rect2Corners[3] - rect2Corners[0], rect2Corners[3] - rect2Corners[2] };
+ wxPoint2DDouble axis[4] = {rect1Corners[3] - rect1Corners[0], rect1Corners[3] - rect1Corners[2],
+ rect2Corners[3] - rect2Corners[0], rect2Corners[3] - rect2Corners[2]};
// Calculate the projected points to each axis
- wxPoint2DDouble rect1ProjPts[4][4]; // [axis][corner]
- wxPoint2DDouble rect2ProjPts[4][4]; // [axis][corner]
+ wxPoint2DDouble rect1ProjPts[4][4]; // [axis][corner]
+ wxPoint2DDouble rect2ProjPts[4][4]; // [axis][corner]
for(int i = 0; i < 4; i++) {
double den = axis[i].m_x * axis[i].m_x + axis[i].m_y * axis[i].m_y;
for(int j = 0; j < 4; j++) {
@@ -178,8 +195,8 @@ bool Element::RotatedRectanglesIntersects(wxRect2DDouble rect1,
}
// Calculate the scalar value to identify the max and min values on projections
- double rect1Scalar[4][4]; //[axis][corner]
- double rect2Scalar[4][4]; //[axis][corner]
+ double rect1Scalar[4][4]; //[axis][corner]
+ double rect2Scalar[4][4]; //[axis][corner]
for(int i = 0; i < 4; i++) {
for(int j = 0; j < 4; j++) {
rect1Scalar[i][j] = rect1ProjPts[i][j].m_x * axis[i].m_x + rect1ProjPts[i][j].m_y * axis[i].m_y;
@@ -229,7 +246,7 @@ void Element::GeneralMenuItens(wxMenu& menu)
{
wxFileName exeFileName(wxStandardPaths::Get().GetExecutablePath());
wxString exePath = exeFileName.GetPath();
-
+
wxMenuItem* clockItem = new wxMenuItem(&menu, ID_ROTATE_CLOCK, _("Rotate clockwise"));
clockItem->SetBitmap(wxImage(exePath + "\\..\\data\\images\\menu\\rotateClock16.png"));
menu.Append(clockItem);
@@ -248,8 +265,8 @@ void Element::CalculateBoundaries(wxPoint2DDouble& leftUp, wxPoint2DDouble& righ
// Check rect corners boundaries.
// Get rectangle corners
- wxPoint2DDouble rectCorner[4] = { m_rect.GetLeftTop(), m_rect.GetLeftBottom(), m_rect.GetRightBottom(),
- m_rect.GetRightTop() };
+ wxPoint2DDouble rectCorner[4] = {m_rect.GetLeftTop(), m_rect.GetLeftBottom(), m_rect.GetRightBottom(),
+ m_rect.GetRightTop()};
// Rotate corners.
for(int i = 0; i < 4; ++i) {
rectCorner[i] = RotateAtPosition(rectCorner[i], m_angle);
@@ -334,7 +351,6 @@ void Element::ReplaceParent(Element* oldParent, Element* newParent)
}
void Element::AddChild(Element* child) { m_childList.push_back(child); }
-
void Element::RemoveChild(Element* child)
{
for(auto it = m_childList.begin(); it != m_childList.end(); ++it) {
@@ -359,7 +375,6 @@ void OpenGLColour::SetRGBA(GLdouble red, GLdouble green, GLdouble blue, GLdouble
}
OpenGLColour::OpenGLColour() { SetRGBA(1.0, 1.0, 1.0, 1.0); }
-
OpenGLColour::OpenGLColour(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
{
SetRGBA(red, green, blue, alpha);
@@ -368,7 +383,7 @@ OpenGLColour::OpenGLColour(GLdouble red, GLdouble green, GLdouble blue, GLdouble
double Element::PointToLineDistance(wxPoint2DDouble point, int* segmentNumber) const
{
//[Ref] http://geomalgorithms.com/a02-_lines.html
- double distance = 100.0; // Big initial distance.
+ double distance = 100.0; // Big initial distance.
wxPoint2DDouble p0 = point;
for(int i = 1; i < (int)m_pointList.size() - 2; i++) {
diff --git a/Project/Element.h b/Project/Element.h
index 2cd7392..3f15416 100644
--- a/Project/Element.h
+++ b/Project/Element.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef ELEMENT_H
#define ELEMENT_H
@@ -49,7 +66,7 @@ enum ContextMenuID {
*/
class OpenGLColour
{
-public:
+ public:
/**
* @brief Default construnctor. Use SetRGBA(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha).
*/
@@ -68,7 +85,6 @@ public:
* @brief Destructor.
*/
virtual ~OpenGLColour() {}
-
/**
* @brief Set the colour in RGBA. The colour values must be between 0.0 and 1.0.
* @param red Red colour value.
@@ -83,7 +99,7 @@ public:
* @return RGBA colour.
*/
const GLdouble* GetRGBA() const { return rgba; }
-protected:
+ protected:
GLdouble rgba[4];
};
@@ -96,7 +112,7 @@ protected:
*/
class Element
{
-public:
+ public:
/**
* @brief Constructor.
*/
@@ -112,13 +128,11 @@ public:
* @param dragging True if is dragging, false otherwise.
*/
void SetDragging(bool dragging = true) { m_dragging = dragging; }
-
/**
* @brief Set element height.
* @param height Height value.
*/
void SetHeight(double height) { m_height = height; }
-
/**
* @brief Set the element position and update the rectangle.
* @param position Position value.
@@ -130,31 +144,26 @@ public:
* @param selected True if selected, false otherwise.
*/
void SetSelected(bool selected = true) { m_selected = selected; }
-
/**
* @brief Set element width.
* @param width Width value.
*/
void SetWidth(double width) { m_width = width; }
-
/**
* @brief Set element angle
* @param angle Angle value in degrees.
*/
void SetAngle(double angle) { m_angle = angle; }
-
/**
* @brief Set if the pickbox is shown.
* @param showPickbox True if show, false otherwise.
*/
void ShowPickbox(bool showPickbox = true) { m_showPickbox = showPickbox; }
-
/**
* @brief Set the size of the border (shown in selected elements).
* @param borderSize Border size.
*/
void SetBorderSize(double borderSize) { m_borderSize = borderSize; }
-
/**
* @brief Set if the element is online or offline.
* @param online True if online, false if offline.
@@ -166,73 +175,61 @@ public:
* @param pointList List of points.
*/
virtual void SetPointList(std::vector<wxPoint2DDouble> pointList) { m_pointList = pointList; }
-
/**
* @brief Get the element rectangle.
* @return Element rectangle.
*/
wxRect2DDouble GetRect() const { return m_rect; }
-
/**
* @brief Get the element position.
* @return Element position.
*/
wxPoint2DDouble GetPosition() const { return m_position; }
-
/**
* @brief Checks if the element is being dragged.
* @return True if is being dragged, false otherwise.
*/
bool IsDragging() const { return m_dragging; }
-
/**
* @brief Get the element height.
* @return Element height.
*/
double GetHeight() const { return m_height; }
-
/**
* @brief Checks if the element is selected.
* @return True if selected, false otherwise.
*/
bool IsSelected() const { return m_selected; }
-
/**
* @brief Get the element width.
* @return Element width.
*/
double GetWidth() const { return m_width; }
-
/**
* @brief Get the element angle.
* @return Angle value.
*/
double GetAngle() const { return m_angle; }
-
/**
* @brief Get the angle of rotation.
* @return Rotation angle.
*/
double GetRotationAngle() const { return m_rotationAngle; }
-
/**
* @brief Checks if the pickbox is shown.
* @return True if the pickbox is show, false otherwise.
*/
bool IsPickboxShown() const { return m_showPickbox; }
-
/**
* @brief Checks if the element is online or offline.
* @return True if online, false if offline.
*/
bool IsOnline() const { return m_online; }
-
/**
* @brief Get the list of points that connect the element to bus.
* @return List of points.
*/
virtual std::vector<wxPoint2DDouble> GetPointList() const { return m_pointList; }
-
/**
* @brief Add a parent to the element. This method must be used on power elements that connect to a bus, so the
* parent must be a bus.
@@ -241,13 +238,11 @@ public:
* @param position Node position in the parent.
*/
virtual bool AddParent(Element* parent, wxPoint2DDouble position) { return false; }
-
/**
* @brief Add a parent to the element.
* @param parent Element parent.
*/
virtual void AddParent(Element* parent) { m_parentList.push_back(parent); }
-
/**
* @brief Checks if the element contains a position.
* @param position Position to be checked.
@@ -265,19 +260,16 @@ public:
* @return Copy of the element.
*/
virtual Element* GetCopy() { return NULL; }
-
/**
* @brief Set the element ID.
* @param id Element ID.
*/
virtual void SetID(int id) { m_elementID = id; }
-
/**
* @brief Get the element ID.
* @return Element ID.
*/
virtual int GetID() const { return m_elementID; }
-
/**
* @brief Add a child to the child list.
* @param child New child.
@@ -302,33 +294,28 @@ public:
* @return Tip text.
*/
virtual wxString GetTipText() const { return wxEmptyString; }
-
/**
* @brief Draw the element.
* @param translation Translation of the system.
* @param scale Scale of the system.
*/
virtual void Draw(wxPoint2DDouble translation, double scale) const {}
-
/**
* @brief Rotate the element.
* @param clockwise True to rotate clockwise, false to rotate counter-clockwise.
*/
virtual void Rotate(bool clockwise = true) {}
-
/**
* @brief Get the element contex menu.
* @param menu menu that will be inserted the element itens.
* @return True if was possible to build the menu, false otherwise.
*/
virtual bool GetContextMenu(wxMenu& menu) { return false; }
-
/**
* @brief Add point to the list of points that connect the element to the bus.
* @param point Point to be added.
*/
virtual void AddPoint(wxPoint2DDouble point) {}
-
/**
* @brief Update the element attributes related to the movement.
* @param position Start move position.
@@ -348,19 +335,16 @@ public:
* @param position New node position.
*/
virtual void MoveNode(Element* parent, wxPoint2DDouble position) {}
-
/**
* @brief Check if a node contains a point. If contains, set the attributes related to node movement.
* @param position Position tested.
* @return True if at least one node contains the position, false otherwise.
*/
virtual bool NodeContains(wxPoint2DDouble position) { return false; }
-
/**
* @brief Update the nodes according to the parents. If a parent is removed, use this method.
*/
virtual void UpdateNodes() {}
-
/**
* @brief Set a perent to the node. If all conditions are met, a new parent are added to the element and the points
* related to the nodes will be calculated.
@@ -368,13 +352,11 @@ public:
* @return True if was possible to set the parent.
*/
virtual bool SetNodeParent(Element* parent) { return false; }
-
/**
* @brief Remove a parent.
* @param parent Parent to be removed.
*/
virtual void RemoveParent(Element* parent) {}
-
/**
* @brief Replace a parent.
* @param oldParent Parent to be replaced.
@@ -388,7 +370,6 @@ public:
* @param clockwise True to rotate clockwise, false to rotate counter-clockwise.
*/
virtual void RotateNode(Element* parent, bool clockwise = true) {}
-
/**
* @brief Check if a pickbox contains a point. If contains the attributes related to pickbox movement will be
* calculated.
@@ -396,29 +377,24 @@ public:
* @return True if the element constains the pickbox, false otherwise.
*/
virtual bool PickboxContains(wxPoint2DDouble position) { return false; }
-
/**
* @brief Move the pickbox.
* @param position position that the pickbox will be moved.
*/
virtual void MovePickbox(wxPoint2DDouble position) {}
-
/**
* @brief Get the best cursor to shown to the user when the mouse is above a pickbox.
* @return Cursor.
*/
virtual wxCursor GetBestPickboxCursor() const { return wxCURSOR_ARROW; }
-
/**
* @brief Remove the pickboxes.
*/
virtual void ResetPickboxes() { m_activePickboxID = ID_PB_NONE; }
-
/**
* @brief Remove the active nodes.
*/
virtual void ResetNodes() { m_activeNodeID = 0; }
-
/**
* @brief Convert the element position to screen position.
* @param translation System translation.
@@ -426,8 +402,10 @@ public:
* @param offsetX Offset in X axis.
* @param offsetY Offset if Y axis.
*/
- virtual wxPoint2DDouble
- WorldToScreen(wxPoint2DDouble translation, double scale, double offsetX = 0.0, double offsetY = 0.0) const;
+ virtual wxPoint2DDouble WorldToScreen(wxPoint2DDouble translation,
+ double scale,
+ double offsetX = 0.0,
+ double offsetY = 0.0) const;
/**
* @brief Convert a generic position to screen position.
@@ -438,10 +416,10 @@ public:
* @param offsetY Offset in Y axis.
*/
virtual wxPoint2DDouble WorldToScreen(wxPoint2DDouble position,
- wxPoint2DDouble translation,
- double scale,
- double offsetX = 0.0,
- double offsetY = 0.0) const;
+ wxPoint2DDouble translation,
+ double scale,
+ double offsetX = 0.0,
+ double offsetY = 0.0) const;
/**
* @brief Check if two roteted rectangles intersect.
@@ -450,8 +428,10 @@ public:
* @param angle1 Rotation algle of first rectangle.
* @param angle2 Rotation angle of second rectangle.
*/
- virtual bool
- RotatedRectanglesIntersects(wxRect2DDouble rect1, wxRect2DDouble rect2, double angle1, double angle2) const;
+ virtual bool RotatedRectanglesIntersects(wxRect2DDouble rect1,
+ wxRect2DDouble rect2,
+ double angle1,
+ double angle2) const;
/**
* @brief Draw a circle.
@@ -462,11 +442,11 @@ public:
*/
virtual void DrawCircle(wxPoint2DDouble position, double radius, int numSegments, GLenum mode = GL_LINE_LOOP) const;
virtual void DrawArc(wxPoint2DDouble position,
- double radius,
- double initAngle,
- double finalAngle,
- int numSegments,
- GLenum mode = GL_LINE_LOOP) const;
+ double radius,
+ double initAngle,
+ double finalAngle,
+ int numSegments,
+ GLenum mode = GL_LINE_LOOP) const;
/**
* @brief Draw rectangle.
@@ -524,13 +504,11 @@ public:
* @return Parent list.
*/
virtual std::vector<Element*> GetParentList() const { return m_parentList; }
-
/**
* @brief Get the Child list.
* @return Child List.
*/
virtual std::vector<Element*> GetChildList() const { return m_childList; }
-
// virtual wxPoint2DDouble GetMoveStartPosition() const { return m_moveStartPt; }
// virtual wxPoint2DDouble GetMovePosition() const { return m_movePos; }
@@ -554,7 +532,6 @@ public:
* @return True if the form is shown, false otherwise.
*/
virtual bool ShowForm(wxWindow* parent, Element* element) { return false; }
-
/**
* @brief Get a double value from a string. Show a error message if the conversion fail.
* @param parent Message box parent.
@@ -588,7 +565,7 @@ public:
*/
virtual double PointToLineDistance(wxPoint2DDouble point, int* segmentNumber = NULL) const;
-protected:
+ protected:
int m_elementID = 0;
std::vector<Element*> m_parentList;
std::vector<Element*> m_childList;
@@ -622,4 +599,4 @@ protected:
OpenGLColour m_selectionColour;
};
-#endif // ELEMENT_H
+#endif // ELEMENT_H
diff --git a/Project/ElementDataObject.cpp b/Project/ElementDataObject.cpp
index 0ea01cb..6f27b22 100644
--- a/Project/ElementDataObject.cpp
+++ b/Project/ElementDataObject.cpp
@@ -1,13 +1,28 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ElementDataObject.h"
-ElementDataObject::ElementDataObject()
- : wxDataObjectSimple(wxDataFormat("PSPCopy"))
+ElementDataObject::ElementDataObject() : wxDataObjectSimple(wxDataFormat("PSPCopy"))
{
m_elementsLists = new ElementsLists();
}
-ElementDataObject::ElementDataObject(std::vector<Element*> elementList)
- : wxDataObjectSimple(wxDataFormat("PSPCopy"))
+ElementDataObject::ElementDataObject(std::vector<Element*> elementList) : wxDataObjectSimple(wxDataFormat("PSPCopy"))
{
m_elementsLists = new ElementsLists();
if(elementList.size() > 0) {
diff --git a/Project/ElementDataObject.h b/Project/ElementDataObject.h
index 3baf792..0318ded 100644
--- a/Project/ElementDataObject.h
+++ b/Project/ElementDataObject.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef ELEMENTDATAOBJECT_H
#define ELEMENTDATAOBJECT_H
@@ -11,7 +28,7 @@ struct ElementsLists {
class ElementDataObject : public wxDataObjectSimple
{
-public:
+ public:
ElementDataObject();
ElementDataObject(std::vector<Element*> elementList);
~ElementDataObject();
@@ -21,9 +38,8 @@ public:
bool SetData(size_t len, const void* buf) override;
ElementsLists* GetElementsLists() { return m_elementsLists; }
-
-protected:
+ protected:
ElementsLists* m_elementsLists = NULL;
};
-#endif // ELEMENTDATAOBJECT_H
+#endif // ELEMENTDATAOBJECT_H
diff --git a/Project/ElementPlotData.cpp b/Project/ElementPlotData.cpp
index ca1fd84..d08108b 100644
--- a/Project/ElementPlotData.cpp
+++ b/Project/ElementPlotData.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ElementPlotData.h"
ElementPlotData::ElementPlotData(wxString name, CurveType curveType)
diff --git a/Project/ElementPlotData.h b/Project/ElementPlotData.h
index 5c67575..1f0acf7 100644
--- a/Project/ElementPlotData.h
+++ b/Project/ElementPlotData.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef ELEMENTPLOTDATA_H
#define ELEMENTPLOTDATA_H
@@ -53,7 +70,7 @@ class ElementPlotData
NUM_ELEMENTS,
CT_TIME
};
- ElementPlotData() {};
+ ElementPlotData(){};
ElementPlotData(wxString name, CurveType curveType);
~ElementPlotData();
diff --git a/Project/Exponential.cpp b/Project/Exponential.cpp
index 3ff1842..64af421 100644
--- a/Project/Exponential.cpp
+++ b/Project/Exponential.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Exponential.h"
#include "ExponentialForm.h"
diff --git a/Project/Exponential.h b/Project/Exponential.h
index 7510266..e9fd019 100644
--- a/Project/Exponential.h
+++ b/Project/Exponential.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef EXPONENTIAL_H
#define EXPONENTIAL_H
@@ -5,12 +22,20 @@
class ExponentialForm;
+/**
+ * @class Exponential
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Generates an output following an exponential function.
+ * \f$ output = A\cdot e^{B\cdot input} \f$
+ * @file Exponential.h
+ */
class Exponential : public ControlElement
{
-public:
+ public:
Exponential(int id);
~Exponential();
-
+
virtual void Draw(wxPoint2DDouble translation, double scale) const;
virtual bool Contains(wxPoint2DDouble position) const { return m_rect.Contains(position); }
virtual bool Intersects(wxRect2DDouble rect) const { return m_rect.Intersects(rect); }
@@ -18,18 +43,17 @@ public:
virtual void Rotate(bool clockwise = true);
virtual void UpdatePoints();
-
- virtual void GetValues(double& aValue, double &bValue);
+
+ virtual void GetValues(double& aValue, double& bValue);
virtual void SetValues(double aValue, double bValue);
-
+
virtual bool Solve(double input, double timeStep);
-
+
virtual Element* GetCopy();
-
-protected:
+
+ protected:
double m_aValue = 0.001;
double m_bValue = 5.0;
-
};
-#endif // EXPONENTIAL_H
+#endif // EXPONENTIAL_H
diff --git a/Project/ExponentialForm.cpp b/Project/ExponentialForm.cpp
index 4ab040b..752c032 100644
--- a/Project/ExponentialForm.cpp
+++ b/Project/ExponentialForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ExponentialForm.h"
#include "Exponential.h"
diff --git a/Project/ExponentialForm.h b/Project/ExponentialForm.h
index c53ef9f..7459be7 100644
--- a/Project/ExponentialForm.h
+++ b/Project/ExponentialForm.h
@@ -1,9 +1,33 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef EXPONENTIALFORM_H
#define EXPONENTIALFORM_H
#include "ElementForm.h"
class Exponential;
+/**
+ * @class ExponentialForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the exponential control data.
+ * @file ExponentialForm.h
+ */
class ExponentialForm : public ExponentialFormBase
{
public:
diff --git a/Project/Fault.cpp b/Project/Fault.cpp
index 40b03d7..3d335fd 100644
--- a/Project/Fault.cpp
+++ b/Project/Fault.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Fault.h"
#ifdef USING_WX_3_0_X
#include "DegreesAndRadians.h"
diff --git a/Project/Fault.h b/Project/Fault.h
index ea68997..0ed82d6 100644
--- a/Project/Fault.h
+++ b/Project/Fault.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef FAULT_H
#define FAULT_H
@@ -12,7 +29,7 @@
class Fault : public ElectricCalculation
{
-public:
+ public:
/**
* @brief Contructor.
* @param elementList List of elements in workspace
@@ -52,10 +69,9 @@ public:
* @return Error message.
*/
virtual wxString GetErrorMessage() { return m_errorMsg; }
-
-protected:
+ protected:
wxString m_errorMsg = "";
-
+
double m_systemPowerBase;
std::vector<std::vector<std::complex<double> > > m_zBusPos;
@@ -75,4 +91,4 @@ protected:
std::vector<std::complex<double> > m_posFaultVoltageC;
};
-#endif // FAULT_H
+#endif // FAULT_H
diff --git a/Project/FileHanding.cpp b/Project/FileHanding.cpp
index f5b881d..e1a8e4b 100644
--- a/Project/FileHanding.cpp
+++ b/Project/FileHanding.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "FileHanding.h"
FileHanding::~FileHanding() {}
diff --git a/Project/FileHanding.h b/Project/FileHanding.h
index c952824..83c7587 100644
--- a/Project/FileHanding.h
+++ b/Project/FileHanding.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef FILEHANDING_H
#define FILEHANDING_H
@@ -16,6 +33,13 @@
#include "rapidXML/rapidxml_print.hpp"
#include "rapidXML/rapidxml_utils.hpp"
+/**
+ * @class FileHanding
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Save and opens the projects created on disk.
+ * @file FileHanding.h
+ */
class FileHanding
{
public:
diff --git a/Project/Gain.cpp b/Project/Gain.cpp
index d6dc7a2..98dfa8c 100644
--- a/Project/Gain.cpp
+++ b/Project/Gain.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Gain.h"
#include "GainForm.h"
diff --git a/Project/Gain.h b/Project/Gain.h
index 82b2793..6b378d2 100644
--- a/Project/Gain.h
+++ b/Project/Gain.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef GAIN_H
#define GAIN_H
@@ -8,6 +25,14 @@
class GainForm;
+/**
+ * @class Gain
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Provide an output multiplying the input by a constant.
+ * \f$ output = K \cdot input \f$
+ * @file Gain.h
+ */
class Gain : public ControlElement
{
public:
@@ -24,17 +49,17 @@ class Gain : public ControlElement
virtual void SetValue(double value);
virtual double GetValue() const { return m_value; }
virtual void UpdatePoints();
-
+
virtual bool Solve(double input, double timeStep);
-
+
virtual Element* GetCopy();
protected:
double m_value = 1.0;
-
+
wxGLString* m_glStringValue = NULL;
int m_fontSize = 10;
-
+
std::vector<wxPoint2DDouble> m_triPts;
};
diff --git a/Project/GainForm.cpp b/Project/GainForm.cpp
index 03a70ef..a844b9b 100644
--- a/Project/GainForm.cpp
+++ b/Project/GainForm.cpp
@@ -1,10 +1,27 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "GainForm.h"
#include "Gain.h"
GainForm::GainForm(wxWindow* parent, Gain* gain) : GainFormBase(parent)
{
SetSize(GetBestSize());
-
+
m_parent = parent;
m_gain = gain;
diff --git a/Project/GainForm.h b/Project/GainForm.h
index 45d6c40..32bc629 100644
--- a/Project/GainForm.h
+++ b/Project/GainForm.h
@@ -1,15 +1,39 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef GAINFORM_H
#define GAINFORM_H
#include "ElementForm.h"
class Gain;
+/**
+ * @class GainForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the gain control data.
+ * @file GainForm.h
+ */
class GainForm : public GainFormBase
{
public:
GainForm(wxWindow* parent, Gain* gain);
virtual ~GainForm();
-
+
virtual bool ValidateData();
protected:
diff --git a/Project/GeneralPropertiesForm.cpp b/Project/GeneralPropertiesForm.cpp
index 90ecf29..2761d16 100644
--- a/Project/GeneralPropertiesForm.cpp
+++ b/Project/GeneralPropertiesForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "GeneralPropertiesForm.h"
#include "PropertiesData.h"
diff --git a/Project/GeneralPropertiesForm.h b/Project/GeneralPropertiesForm.h
index 77bf4d2..f1d4382 100644
--- a/Project/GeneralPropertiesForm.h
+++ b/Project/GeneralPropertiesForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef GENERALPROPERTIESFORM_H
#define GENERALPROPERTIESFORM_H
@@ -8,17 +25,24 @@
class PropertiesData;
+/**
+ * @class GeneralPropertiesForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the software's general data.
+ * @file GeneralPropertiesForm.h
+ */
class GeneralPropertiesForm : public GeneralPropertiesFormBase
{
-public:
+ public:
GeneralPropertiesForm(wxWindow* parent, PropertiesData* properties);
virtual ~GeneralPropertiesForm();
-
-protected:
+
+ protected:
virtual void OnButtonCancelClick(wxCommandEvent& event) { EndModal(wxID_CANCEL); }
virtual void OnButtonOKClick(wxCommandEvent& event);
virtual bool ValidateData();
-
+
PropertiesData* m_properties = NULL;
};
-#endif // GENERALPROPERTIESFORM_H
+#endif // GENERALPROPERTIESFORM_H
diff --git a/Project/GeneratorStabForm.cpp b/Project/GeneratorStabForm.cpp
index 2280906..7a68391 100644
--- a/Project/GeneratorStabForm.cpp
+++ b/Project/GeneratorStabForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "GeneratorStabForm.h"
#include "SwitchingForm.h"
#include "SyncGenerator.h"
diff --git a/Project/GeneratorStabForm.h b/Project/GeneratorStabForm.h
index 4ff2127..86aab5b 100644
--- a/Project/GeneratorStabForm.h
+++ b/Project/GeneratorStabForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef GENERATORSTABFORM_H
#define GENERATORSTABFORM_H
@@ -8,6 +25,13 @@ class SyncGenerator;
class ControlEditor;
class ControlElementContainer;
+/**
+ * @class GeneratorStabForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the synchronous generator data for electromechanical studies.
+ * @file GeneratorStabForm.h
+ */
class GeneratorStabForm : public GeneratorStabFormBase
{
public:
diff --git a/Project/GraphicalElement.cpp b/Project/GraphicalElement.cpp
index 87a5302..d9fa9e5 100644
--- a/Project/GraphicalElement.cpp
+++ b/Project/GraphicalElement.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "GraphicalElement.h"
GraphicalElement::GraphicalElement() : Element()
diff --git a/Project/GraphicalElement.h b/Project/GraphicalElement.h
index 86ca30d..e536dbd 100644
--- a/Project/GraphicalElement.h
+++ b/Project/GraphicalElement.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef GRAPHICALELEMENT_H
#define GRAPHICALELEMENT_H
@@ -5,10 +22,9 @@
class GraphicalElement : public Element
{
-public:
+ public:
GraphicalElement();
~GraphicalElement();
-
};
-#endif // GRAPHICALELEMENT_H
+#endif // GRAPHICALELEMENT_H
diff --git a/Project/IOControl.cpp b/Project/IOControl.cpp
index 2eab8de..bf40200 100644
--- a/Project/IOControl.cpp
+++ b/Project/IOControl.cpp
@@ -1,10 +1,27 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "IOControl.h"
#include "IOControlForm.h"
IOControl::IOControl(int ioFlags, int id) : ControlElement(id)
{
m_ioFlags = ioFlags;
-
+
Node* node = new Node(m_position, Node::NODE_IN, m_borderSize);
m_nodeList.push_back(node);
diff --git a/Project/IOControl.h b/Project/IOControl.h
index 513b008..307cc1a 100644
--- a/Project/IOControl.h
+++ b/Project/IOControl.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef IOCONTROL_H
#define IOCONTROL_H
@@ -8,6 +25,13 @@
class IOControlForm;
+/**
+ * @class IOControl
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Provides the communication with the power element.
+ * @file IOControl.h
+ */
class IOControl : public ControlElement
{
public:
@@ -36,8 +60,8 @@ class IOControl : public ControlElement
virtual void SetValue(IOFlags value);
virtual int GetIOFlags() const { return m_ioFlags; }
virtual Node::NodeType GetType() { return m_ioNodeType; }
-
virtual Element* GetCopy();
+
protected:
IOFlags m_value;
int m_ioFlags;
diff --git a/Project/IOControlForm.cpp b/Project/IOControlForm.cpp
index c4527d6..583e534 100644
--- a/Project/IOControlForm.cpp
+++ b/Project/IOControlForm.cpp
@@ -1,9 +1,26 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "IOControlForm.h"
IOControlForm::IOControlForm(wxWindow* parent, IOControl* ioControl) : IOControlFormBase(parent)
{
SetSize(GetBestSize());
-
+
m_parent = parent;
m_ioControl = ioControl;
diff --git a/Project/IOControlForm.h b/Project/IOControlForm.h
index 8b3f2d9..a1c3d36 100644
--- a/Project/IOControlForm.h
+++ b/Project/IOControlForm.h
@@ -1,15 +1,39 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef IOCONTROLFORM_H
#define IOCONTROLFORM_H
#include "ElementForm.h"
#include "IOControl.h"
+/**
+ * @class IOControlForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the input/output control data.
+ * @file IOControlForm.h
+ */
class IOControlForm : public IOControlFormBase
{
public:
IOControlForm(wxWindow* parent, IOControl* ioControl);
virtual ~IOControlForm();
-
+
virtual bool ValidateData();
protected:
@@ -20,8 +44,8 @@ class IOControlForm : public IOControlFormBase
wxWindow* m_parent;
IOControl* m_ioControl;
-
+
std::vector<IOControl::IOFlags> m_inputFlags;
- std::vector<IOControl::IOFlags> m_outputFlags;
+ std::vector<IOControl::IOFlags> m_outputFlags;
};
#endif // IOCONTROLFORM_H
diff --git a/Project/IndMotor.cpp b/Project/IndMotor.cpp
index 8fab5c4..64d40c4 100644
--- a/Project/IndMotor.cpp
+++ b/Project/IndMotor.cpp
@@ -1,15 +1,25 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "IndMotorForm.h"
#include "IndMotor.h"
-IndMotor::IndMotor()
- : Machines()
-{
-}
-IndMotor::IndMotor(wxString name)
- : Machines()
-{
- m_electricalData.name = name;
-}
+IndMotor::IndMotor() : Machines() {}
+IndMotor::IndMotor(wxString name) : Machines() { m_electricalData.name = name; }
IndMotor::~IndMotor() {}
void IndMotor::DrawSymbol() const
{
diff --git a/Project/IndMotor.h b/Project/IndMotor.h
index 1a40511..0c16b9d 100644
--- a/Project/IndMotor.h
+++ b/Project/IndMotor.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef INDMOTOR_H
#define INDMOTOR_H
@@ -5,8 +22,7 @@
class IndMotorForm;
-struct IndMotorElectricalData
-{
+struct IndMotorElectricalData {
wxString name;
double activePower = 100.0;
ElectricalUnit activePowerUnit = UNIT_MW;
@@ -20,8 +36,8 @@ class IndMotor : public Machines
IndMotor();
IndMotor(wxString name);
~IndMotor();
-
- virtual Element* GetCopy();
+
+ virtual Element* GetCopy();
virtual void DrawSymbol() const;
virtual bool GetContextMenu(wxMenu& menu);
virtual wxString GetTipText() const;
diff --git a/Project/IndMotorForm.cpp b/Project/IndMotorForm.cpp
index 6af2433..d758c18 100644
--- a/Project/IndMotorForm.cpp
+++ b/Project/IndMotorForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "IndMotorForm.h"
#include "IndMotor.h"
@@ -62,7 +79,7 @@ void IndMotorForm::OnStabilityButtonClick(wxCommandEvent& event)
bool IndMotorForm::ValidateData()
{
IndMotorElectricalData data;
-
+
data.name = m_textCtrlName->GetValue();
if(!m_indMotor->DoubleFromString(m_parent, m_textCtrlActivePower->GetValue(), data.activePower,
diff --git a/Project/IndMotorForm.h b/Project/IndMotorForm.h
index 561bb25..ffdd742 100644
--- a/Project/IndMotorForm.h
+++ b/Project/IndMotorForm.h
@@ -1,9 +1,33 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef INDMOTORFORM_H
#define INDMOTORFORM_H
#include "ElementForm.h"
class IndMotor;
+/**
+ * @class IndMotorForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the induction motor power data.
+ * @file IndMotorForm.h
+ */
class IndMotorForm : public IndMotorFormBase
{
public:
diff --git a/Project/Inductor.cpp b/Project/Inductor.cpp
index ca0dcd8..c3fe3cd 100644
--- a/Project/Inductor.cpp
+++ b/Project/Inductor.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ReactiveShuntElementForm.h"
#include "Inductor.h"
diff --git a/Project/Inductor.h b/Project/Inductor.h
index 64e6889..a78c79b 100644
--- a/Project/Inductor.h
+++ b/Project/Inductor.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef INDUCTOR_H
#define INDUCTOR_H
@@ -17,8 +34,8 @@ class Inductor : public Shunt
Inductor();
Inductor(wxString name);
~Inductor();
-
- virtual Element* GetCopy();
+
+ virtual Element* GetCopy();
virtual bool AddParent(Element* parent, wxPoint2DDouble position);
virtual void Draw(wxPoint2DDouble translation, double scale) const;
virtual bool Contains(wxPoint2DDouble position) const;
diff --git a/Project/Limiter.cpp b/Project/Limiter.cpp
index 8519482..830ef6a 100644
--- a/Project/Limiter.cpp
+++ b/Project/Limiter.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Limiter.h"
#include "LimiterForm.h"
@@ -91,9 +108,11 @@ void Limiter::UpdatePoints()
bool Limiter::Solve(double input, double timeStep)
{
m_output = input;
- if(m_output > m_upLimit) m_output = m_upLimit;
- else if(m_output < m_lowLimit) m_output = m_lowLimit;
-
+ if(m_output > m_upLimit)
+ m_output = m_upLimit;
+ else if(m_output < m_lowLimit)
+ m_output = m_lowLimit;
+
return true;
}
diff --git a/Project/Limiter.h b/Project/Limiter.h
index 82617a7..396ae16 100644
--- a/Project/Limiter.h
+++ b/Project/Limiter.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef LIMITER_H
#define LIMITER_H
@@ -5,12 +22,19 @@
class LimiterForm;
+/**
+ * @class Limiter
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Limits the input value by superior and inferior values.
+ * @file Limiter.h
+ */
class Limiter : public ControlElement
{
-public:
+ public:
Limiter(int id);
~Limiter();
-
+
virtual void Draw(wxPoint2DDouble translation, double scale) const;
virtual bool Contains(wxPoint2DDouble position) const { return m_rect.Contains(position); }
virtual bool Intersects(wxRect2DDouble rect) const { return m_rect.Intersects(rect); }
@@ -19,18 +43,16 @@ public:
virtual bool Solve(double input, double timeStep);
virtual void UpdatePoints();
-
+
double GetUpLimit() const { return m_upLimit; }
double GetLowLimit() const { return m_lowLimit; }
-
void SetUpLimit(double upLimit) { m_upLimit = upLimit; }
void SetLowLimit(double lowLimit) { m_lowLimit = lowLimit; }
-
virtual Element* GetCopy();
-
-protected:
+
+ protected:
double m_upLimit = 5.0;
double m_lowLimit = -5.0;
};
-#endif // LIMITER_H
+#endif // LIMITER_H
diff --git a/Project/LimiterForm.cpp b/Project/LimiterForm.cpp
index a43d6d2..8874d2d 100644
--- a/Project/LimiterForm.cpp
+++ b/Project/LimiterForm.cpp
@@ -1,10 +1,27 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "LimiterForm.h"
#include "Limiter.h"
LimiterForm::LimiterForm(wxWindow* parent, Limiter* limiter) : LimiterFormBase(parent)
{
SetSize(GetBestSize());
-
+
m_limiter = limiter;
m_parent = parent;
diff --git a/Project/LimiterForm.h b/Project/LimiterForm.h
index f26ee9d..96deb61 100644
--- a/Project/LimiterForm.h
+++ b/Project/LimiterForm.h
@@ -1,9 +1,33 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef LIMITERFORM_H
#define LIMITERFORM_H
#include "ElementForm.h"
class Limiter;
+/**
+ * @class LimiterForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the limit control data.
+ * @file LimiterForm.h
+ */
class LimiterForm : public LimiterFormBase
{
public:
diff --git a/Project/Line.cpp b/Project/Line.cpp
index 540d844..215c6b5 100644
--- a/Project/Line.cpp
+++ b/Project/Line.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Line.h"
Line::Line() : Branch()
diff --git a/Project/Line.h b/Project/Line.h
index 513dc11..598e671 100644
--- a/Project/Line.h
+++ b/Project/Line.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef LINE_H
#define LINE_H
diff --git a/Project/LineForm.cpp b/Project/LineForm.cpp
index beab909..f0df0c7 100644
--- a/Project/LineForm.cpp
+++ b/Project/LineForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "LineForm.h"
#include "SwitchingForm.h"
#include "Line.h"
diff --git a/Project/LineForm.h b/Project/LineForm.h
index 523e8bb..f80eafa 100644
--- a/Project/LineForm.h
+++ b/Project/LineForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef LINEFORM_H
#define LINEFORM_H
#include "ElementForm.h"
@@ -5,20 +22,27 @@
class Line;
class SwitchingForm;
+/**
+ * @class LineForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the line power data.
+ * @file LineForm.h
+ */
class LineForm : public LineFormBase
{
-public:
+ public:
LineForm(wxWindow* parent, Line* line);
virtual ~LineForm();
-protected:
+
+ protected:
virtual void OnCancelButtonClick(wxCommandEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
virtual void OnStabilityButtonClick(wxCommandEvent& event);
- virtual void ReplaceStaticTextLabelChar(wxStaticText* staticText, wchar_t newChar);
- virtual bool ValidateData();
-
- wxWindow* m_parent = NULL;
- Line* m_line = NULL;
-
+ virtual void ReplaceStaticTextLabelChar(wxStaticText* staticText, wchar_t newChar);
+ virtual bool ValidateData();
+
+ wxWindow* m_parent = NULL;
+ Line* m_line = NULL;
};
-#endif // LINEFORM_H
+#endif // LINEFORM_H
diff --git a/Project/Load.cpp b/Project/Load.cpp
index c490d24..64cca31 100644
--- a/Project/Load.cpp
+++ b/Project/Load.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Load.h"
Load::Load() : Shunt() {}
diff --git a/Project/Load.h b/Project/Load.h
index ce71e5f..9e0f363 100644
--- a/Project/Load.h
+++ b/Project/Load.h
@@ -1,17 +1,29 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef LOAD_H
#define LOAD_H
#include "LoadForm.h"
#include "Shunt.h"
-enum LoadType
-{
- CONST_POWER = 0,
- CONST_IMPEDANCE
-};
+enum LoadType { CONST_POWER = 0, CONST_IMPEDANCE };
-struct LoadElectricalData
-{
+struct LoadElectricalData {
wxString name;
double activePower = 100.0;
ElectricalUnit activePowerUnit = UNIT_MW;
@@ -26,8 +38,8 @@ class Load : public Shunt
Load();
Load(wxString name);
~Load();
-
- virtual Element* GetCopy();
+
+ virtual Element* GetCopy();
virtual bool AddParent(Element* parent, wxPoint2DDouble position);
virtual void Draw(wxPoint2DDouble translation, double scale) const;
virtual void Rotate(bool clockwise = true);
@@ -37,7 +49,6 @@ class Load : public Shunt
LoadElectricalData GetElectricalData() { return m_electricalData; }
LoadElectricalData GetPUElectricalData(double systemPowerBase);
void SetElectricalData(LoadElectricalData electricalData) { m_electricalData = electricalData; }
-
protected:
std::vector<wxPoint2DDouble> m_triangPts;
LoadElectricalData m_electricalData;
diff --git a/Project/LoadForm.cpp b/Project/LoadForm.cpp
index 270723a..67fd356 100644
--- a/Project/LoadForm.cpp
+++ b/Project/LoadForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "LoadForm.h"
#include "SwitchingForm.h"
#include "Load.h"
diff --git a/Project/LoadForm.h b/Project/LoadForm.h
index 27f03c5..eff53c8 100644
--- a/Project/LoadForm.h
+++ b/Project/LoadForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef LOADFORM_H
#define LOADFORM_H
#include "ElementForm.h"
@@ -5,6 +22,13 @@
class Load;
class SwitchingForm;
+/**
+ * @class LoadForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the load power data.
+ * @file LoadForm.h
+ */
class LoadForm : public LoadFormBase
{
public:
diff --git a/Project/Machines.cpp b/Project/Machines.cpp
index c793469..8ee940f 100644
--- a/Project/Machines.cpp
+++ b/Project/Machines.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Machines.h"
#include "ControlElementContainer.h"
diff --git a/Project/Machines.h b/Project/Machines.h
index c1814d5..4c8e48e 100644
--- a/Project/Machines.h
+++ b/Project/Machines.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef MACHINES_H
#define MACHINES_H
diff --git a/Project/MainFrame.cpp b/Project/MainFrame.cpp
index 436f1fd..429eabf 100644
--- a/Project/MainFrame.cpp
+++ b/Project/MainFrame.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "MainFrame.h"
#include "ArtMetro.h"
#include "Workspace.h"
diff --git a/Project/MainFrame.h b/Project/MainFrame.h
index 2b91b20..e4f19b2 100644
--- a/Project/MainFrame.h
+++ b/Project/MainFrame.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef MAINFRAME_H
#define MAINFRAME_H
@@ -34,8 +51,8 @@ enum {
* @class MainFrame
* @author Thales Lima Oliveira <thales@ufu.br>
* @date 19/09/2017
- * @file MainFrame.h
* @brief Main frame of the program. This class manage the ribbon menu and the notebook behavior.
+ * @file MainFrame.h
*/
class MainFrame : public MainFrameBase
{
diff --git a/Project/Multiplier.cpp b/Project/Multiplier.cpp
index a44f254..2b5d702 100644
--- a/Project/Multiplier.cpp
+++ b/Project/Multiplier.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Multiplier.h"
#include "ConnectionLine.h"
diff --git a/Project/Multiplier.h b/Project/Multiplier.h
index 76a8679..f675b34 100644
--- a/Project/Multiplier.h
+++ b/Project/Multiplier.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef MULTIPLIER_H
#define MULTIPLIER_H
@@ -5,6 +22,13 @@
class ConnectionLine;
+/**
+ * @class Multiplier
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Multiplies two inputs.
+ * @file Multiplier.h
+ */
class Multiplier : public ControlElement
{
public:
@@ -18,9 +42,9 @@ class Multiplier : public ControlElement
virtual void Rotate(bool clockwise = true);
virtual void UpdatePoints();
-
+
virtual bool Solve(double input, double timeStep);
-
+
virtual Element* GetCopy();
};
diff --git a/Project/PowerElement.cpp b/Project/PowerElement.cpp
index 379d341..4c4e072 100644
--- a/Project/PowerElement.cpp
+++ b/Project/PowerElement.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "PowerElement.h"
#ifdef USING_WX_3_0_X
#include "DegreesAndRadians.h"
diff --git a/Project/PowerElement.h b/Project/PowerElement.h
index 9bf125d..2c39d27 100644
--- a/Project/PowerElement.h
+++ b/Project/PowerElement.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef POWERELEMENT_H
#define POWERELEMENT_H
diff --git a/Project/PowerFlow.cpp b/Project/PowerFlow.cpp
index fe59067..4a2b7c9 100644
--- a/Project/PowerFlow.cpp
+++ b/Project/PowerFlow.cpp
@@ -1,23 +1,30 @@
-#include "PowerFlow.h"
-
-PowerFlow::PowerFlow()
- : ElectricCalculation()
-{
-}
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
-PowerFlow::PowerFlow(std::vector<Element*> elementList)
- : ElectricCalculation()
-{
- GetElementsFromList(elementList);
-}
+#include "PowerFlow.h"
+PowerFlow::PowerFlow() : ElectricCalculation() {}
+PowerFlow::PowerFlow(std::vector<Element*> elementList) : ElectricCalculation() { GetElementsFromList(elementList); }
PowerFlow::~PowerFlow() {}
-
bool PowerFlow::RunGaussSeidel(double systemPowerBase,
- int maxIteration,
- double error,
- double initAngle,
- double accFactor)
+ int maxIteration,
+ double error,
+ double initAngle,
+ double accFactor)
{
// Calculate the Ybus.
if(!GetYBus(m_yBus, systemPowerBase)) {
@@ -28,11 +35,11 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase,
// Number of buses on the system.
int numberOfBuses = static_cast<int>(m_busList.size());
- std::vector<BusType> busType; // Bus type
- std::vector<std::complex<double> > voltage; // Voltage of buses
- std::vector<std::complex<double> > power; // Injected power
- std::vector<std::complex<double> > loadPower; // Only the load power
- std::vector<ReactiveLimits> reactiveLimit; // Limit of reactive power on PV buses
+ std::vector<BusType> busType; // Bus type
+ std::vector<std::complex<double> > voltage; // Voltage of buses
+ std::vector<std::complex<double> > power; // Injected power
+ std::vector<std::complex<double> > loadPower; // Only the load power
+ std::vector<ReactiveLimits> reactiveLimit; // Limit of reactive power on PV buses
reactiveLimit.resize(numberOfBuses);
@@ -72,7 +79,7 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase,
}
// Fill the power array
- power.push_back(std::complex<double>(0.0, 0.0)); // Initial value
+ power.push_back(std::complex<double>(0.0, 0.0)); // Initial value
loadPower.push_back(std::complex<double>(0.0, 0.0));
// Synchronous generator
@@ -179,12 +186,12 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase,
}
// Gauss-Seidel method
- std::vector<std::complex<double> > oldVoltage; // Old voltage array.
+ std::vector<std::complex<double> > oldVoltage; // Old voltage array.
oldVoltage.resize(voltage.size());
auto oldBusType = busType;
- int iteration = 0; // Current itaration number.
+ int iteration = 0; // Current itaration number.
while(true) {
// Reach the max number of iterations.
@@ -214,7 +221,7 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase,
// Apply the acceleration factor.
newVolt = std::complex<double>(accFactor * (newVolt.real() - voltage[i].real()) + voltage[i].real(),
- accFactor * (newVolt.imag() - voltage[i].imag()) + voltage[i].imag());
+ accFactor * (newVolt.imag() - voltage[i].imag()) + voltage[i].imag());
voltage[i] = newVolt;
}
@@ -238,15 +245,15 @@ bool PowerFlow::RunGaussSeidel(double systemPowerBase,
// Apply the acceleration factor.
newVolt = std::complex<double>(accFactor * (newVolt.real() - voltage[i].real()) + voltage[i].real(),
- accFactor * (newVolt.imag() - voltage[i].imag()) + voltage[i].imag());
+ accFactor * (newVolt.imag() - voltage[i].imag()) + voltage[i].imag());
// Keep the same voltage magnitude.
voltage[i] = std::complex<double>(std::abs(voltage[i]) * std::cos(std::arg(newVolt)),
- std::abs(voltage[i]) * std::sin(std::arg(newVolt)));
+ std::abs(voltage[i]) * std::sin(std::arg(newVolt)));
}
- double busError = std::max(
- std::abs(voltage[i].real() - oldVoltage[i].real()), std::abs(voltage[i].imag() - oldVoltage[i].imag()));
+ double busError = std::max(std::abs(voltage[i].real() - oldVoltage[i].real()),
+ std::abs(voltage[i].imag() - oldVoltage[i].imag()));
if(busError > iterationError) iterationError = busError;
}
diff --git a/Project/PowerFlow.h b/Project/PowerFlow.h
index 29e205a..75cd3a5 100644
--- a/Project/PowerFlow.h
+++ b/Project/PowerFlow.h
@@ -1,28 +1,44 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef POWERFLOW_H
#define POWERFLOW_H
#include "ElectricCalculation.h"
#include <wx/string.h>
-#include <wx/intl.h> //_()
+#include <wx/intl.h> //_()
class PowerFlow : public ElectricCalculation
{
-public:
+ public:
PowerFlow();
PowerFlow(std::vector<Element*> elementList);
~PowerFlow();
virtual bool RunGaussSeidel(double systemPowerBase = 100e6,
- int maxIteration = 5000,
- double error = 1e-6,
- double initAngle = 0.0,
- double accFactor = 1.0);
+ int maxIteration = 5000,
+ double error = 1e-6,
+ double initAngle = 0.0,
+ double accFactor = 1.0);
virtual wxString GetErrorMessage() { return m_errorMsg; }
-
-protected:
+ protected:
std::vector<std::vector<std::complex<double> > > m_yBus;
wxString m_errorMsg = "";
};
-#endif // POWERFLOW_H
+#endif // POWERFLOW_H
diff --git a/Project/Project.mk b/Project/Project.mk
index 71c206d..d74ffe2 100644
--- a/Project/Project.mk
+++ b/Project/Project.mk
@@ -13,7 +13,7 @@ CurrentFileName :=
CurrentFilePath :=
CurrentFileFullPath :=
User :=NDSE-69
-Date :=04/10/2017
+Date :=05/10/2017
CodeLitePath :="C:/Program Files/CodeLite"
LinkerName :=C:/TDM-GCC-64/bin/g++.exe
SharedObjectLinkerName :=C:/TDM-GCC-64/bin/g++.exe -shared -fPIC
diff --git a/Project/PropertiesData.cpp b/Project/PropertiesData.cpp
index a9a57c4..dc12c82 100644
--- a/Project/PropertiesData.cpp
+++ b/Project/PropertiesData.cpp
@@ -1,10 +1,21 @@
-#include "PropertiesData.h"
-
-PropertiesData::PropertiesData()
-{
-}
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
-PropertiesData::~PropertiesData()
-{
-}
+#include "PropertiesData.h"
+PropertiesData::PropertiesData() {}
+PropertiesData::~PropertiesData() {}
diff --git a/Project/PropertiesData.h b/Project/PropertiesData.h
index 634e60e..d63a906 100644
--- a/Project/PropertiesData.h
+++ b/Project/PropertiesData.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef PROPERTIESDATA_H
#define PROPERTIESDATA_H
diff --git a/Project/RateLimiter.cpp b/Project/RateLimiter.cpp
index ea0db25..afba0ee 100644
--- a/Project/RateLimiter.cpp
+++ b/Project/RateLimiter.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "RateLimiter.h"
#include "RateLimiterForm.h"
diff --git a/Project/RateLimiter.h b/Project/RateLimiter.h
index 49596db..bab52db 100644
--- a/Project/RateLimiter.h
+++ b/Project/RateLimiter.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef RATELIMITER_H
#define RATELIMITER_H
@@ -5,6 +22,13 @@
class RateLimiterForm;
+/**
+ * @class RateLimiter
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Limits the rising and/or falling rate.<br>
+ * @file RateLimiter.h
+ */
class RateLimiter : public ControlElement
{
public:
@@ -23,11 +47,25 @@ class RateLimiter : public ControlElement
double GetLowLimit() const { return m_lowLimit; }
void SetUpLimit(double upLimit) { m_upLimit = upLimit; }
void SetLowLimit(double lowLimit) { m_lowLimit = lowLimit; }
-
+ /**
+ * @brief Calculate the rate and limits it if exceeds.<br>
+ * The rate is calculated by:<br><br>
+ * \f$ rate = \frac{x(i) - y(i-1)}{\Delta t} \f$<br><br>
+ * \f$ x(i) \f$ is the current input and \f$ y(i-1) \f$ is the previous output.<br>
+ * If the \f$rate\f$ is greater than rising rate (\f$ R \f$), the output will be:<br><br>
+ * \f$ output = \Delta t \cdot R + y(i-1)\f$<br><br>
+ * If the \f$rate\f$ is lower than falling rate (\f$ F \f$), the output will be:<br><br>
+ * \f$ output = \Delta t \cdot L + y(i-1) \f$<br><br>
+ * Otherwise:<br><br>
+ * \f$ output = input \f$.
+ * @param input input value.
+ * @param timeStep Time step.
+ * @return Always true.
+ */
virtual bool Solve(double input, double timeStep);
-
+
virtual Element* GetCopy();
-
+
protected:
double m_upLimit = 5.0;
double m_lowLimit = -5.0;
diff --git a/Project/RateLimiterForm.cpp b/Project/RateLimiterForm.cpp
index c9b8a24..fa962d6 100644
--- a/Project/RateLimiterForm.cpp
+++ b/Project/RateLimiterForm.cpp
@@ -1,10 +1,27 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "RateLimiterForm.h"
#include "RateLimiter.h"
RateLimiterForm::RateLimiterForm(wxWindow* parent, RateLimiter* rateLimiter) : RateLimiterFormBase(parent)
{
SetSize(GetBestSize());
-
+
m_rateLimiter = rateLimiter;
m_parent = parent;
@@ -27,7 +44,7 @@ bool RateLimiterForm::ValidateData()
m_rateLimiter->SetUpLimit(upLimit);
m_rateLimiter->SetLowLimit(lowLimit);
-
+
return true;
}
diff --git a/Project/RateLimiterForm.h b/Project/RateLimiterForm.h
index 539504e..6958169 100644
--- a/Project/RateLimiterForm.h
+++ b/Project/RateLimiterForm.h
@@ -1,9 +1,33 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef RATELIMITERFORM_H
#define RATELIMITERFORM_H
#include "ElementForm.h"
class RateLimiter;
+/**
+ * @class RateLimiterForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the rate limit control data.
+ * @file RateLimiterForm.h
+ */
class RateLimiterForm : public RateLimiterFormBase
{
public:
@@ -12,9 +36,9 @@ class RateLimiterForm : public RateLimiterFormBase
bool ValidateData();
protected:
- virtual void OnCancelButtonClick(wxCommandEvent& event) {EndModal(wxID_OK);}
+ virtual void OnCancelButtonClick(wxCommandEvent& event) { EndModal(wxID_OK); }
virtual void OnOKButtonClick(wxCommandEvent& event);
-
+
wxWindow* m_parent = NULL;
RateLimiter* m_rateLimiter = NULL;
};
diff --git a/Project/ReactiveShuntElementForm.cpp b/Project/ReactiveShuntElementForm.cpp
index ededa6b..985127d 100644
--- a/Project/ReactiveShuntElementForm.cpp
+++ b/Project/ReactiveShuntElementForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "ReactiveShuntElementForm.h"
#include "SwitchingForm.h"
#include "Capacitor.h"
diff --git a/Project/ReactiveShuntElementForm.h b/Project/ReactiveShuntElementForm.h
index c5562c2..241e092 100644
--- a/Project/ReactiveShuntElementForm.h
+++ b/Project/ReactiveShuntElementForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef REACTIVESHUNTELEMENTFORM_H
#define REACTIVESHUNTELEMENTFORM_H
#include "ElementForm.h"
@@ -7,6 +24,13 @@ class Capacitor;
class Inductor;
class SwitchingForm;
+/**
+ * @class ReactiveShuntElementForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the reactive shunt element power data.
+ * @file ReactiveShuntElementForm.h
+ */
class ReactiveShuntElementForm : public ReactiveShuntElementFormBase
{
public:
diff --git a/Project/Shunt.cpp b/Project/Shunt.cpp
index a0caab7..63def85 100644
--- a/Project/Shunt.cpp
+++ b/Project/Shunt.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Shunt.h"
Shunt::Shunt() : PowerElement() {}
diff --git a/Project/Shunt.h b/Project/Shunt.h
index 15b8efb..eb0384a 100644
--- a/Project/Shunt.h
+++ b/Project/Shunt.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef SHUNT_H
#define SHUNT_H
@@ -6,10 +23,10 @@
class Shunt : public PowerElement
{
-public:
- Shunt();
- ~Shunt();
-
+ public:
+ Shunt();
+ ~Shunt();
+
virtual bool Contains(wxPoint2DDouble position) const { return m_rect.Contains(position); }
virtual bool Intersects(wxRect2DDouble rect) const { return m_rect.Intersects(rect); }
virtual void Move(wxPoint2DDouble position);
@@ -24,9 +41,8 @@ public:
protected:
void UpdateSwitchesPosition();
void UpdatePowerFlowArrowsPosition();
- void DrawGround(wxPoint2DDouble position) const;
+ void DrawGround(wxPoint2DDouble position) const;
bool m_inserted = false;
-
};
-#endif // SHUNT_H
+#endif // SHUNT_H
diff --git a/Project/SimulationsSettingsForm.cpp b/Project/SimulationsSettingsForm.cpp
index 714e49b..a203662 100644
--- a/Project/SimulationsSettingsForm.cpp
+++ b/Project/SimulationsSettingsForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "SimulationsSettingsForm.h"
#include "PropertiesData.h"
diff --git a/Project/SimulationsSettingsForm.h b/Project/SimulationsSettingsForm.h
index d6b0a08..045a0c6 100644
--- a/Project/SimulationsSettingsForm.h
+++ b/Project/SimulationsSettingsForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef SIMULATIONSSETTINGSFORM_H
#define SIMULATIONSSETTINGSFORM_H
@@ -5,17 +22,25 @@
class PropertiesData;
+/**
+ * @class SimulationsSettingsForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the simulation data.
+ * @file SimulationsSettingsForm.h
+ */
class SimulationsSettingsForm : public SimulationsSettingsFormBase
{
-public:
+ public:
SimulationsSettingsForm(wxWindow* parent, PropertiesData* properties);
virtual ~SimulationsSettingsForm();
-protected:
+
+ protected:
virtual void OnPFMethodChoiceSelected(wxCommandEvent& event);
virtual void OnButtonCancelClick(wxCommandEvent& event) { EndModal(wxID_CANCEL); }
virtual void OnButtonOKClick(wxCommandEvent& event);
virtual bool ValidateData();
-
+
PropertiesData* m_properties;
};
-#endif // SIMULATIONSSETTINGSFORM_H
+#endif // SIMULATIONSSETTINGSFORM_H
diff --git a/Project/Sum.cpp b/Project/Sum.cpp
index 45dc80d..37d10f9 100644
--- a/Project/Sum.cpp
+++ b/Project/Sum.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Sum.h"
#include "SumForm.h"
#include "ConnectionLine.h"
diff --git a/Project/Sum.h b/Project/Sum.h
index 72a71a5..3a5e289 100644
--- a/Project/Sum.h
+++ b/Project/Sum.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef SUM_H
#define SUM_H
@@ -8,7 +25,7 @@ class ConnectionLine;
class Sum : public ControlElement
{
-public:
+ public:
enum Signal { SIGNAL_POSITIVE = 0, SIGNAL_NEGATIVE };
Sum(int id);
~Sum();
@@ -18,20 +35,19 @@ public:
virtual bool Intersects(wxRect2DDouble rect) const { return m_rect.Intersects(rect); }
virtual bool ShowForm(wxWindow* parent, Element* element);
virtual void Rotate(bool clockwise = true);
-
+
virtual std::vector<Signal> GetSignalList() const { return m_signalList; }
virtual void SetSignalList(std::vector<Signal> signalList) { m_signalList = signalList; }
-
virtual bool Solve(double input, double timeStep);
-
+
virtual void UpdatePoints();
void AddInNode();
void RemoveInNode();
-
+
virtual Element* GetCopy();
-protected:
+ protected:
std::vector<Signal> m_signalList;
};
-#endif // SUM_H
+#endif // SUM_H
diff --git a/Project/SumForm.cpp b/Project/SumForm.cpp
index fb0fa58..028b004 100644
--- a/Project/SumForm.cpp
+++ b/Project/SumForm.cpp
@@ -1,11 +1,27 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "SumForm.h"
#include "Sum.h"
-SumForm::SumForm(wxWindow* parent, Sum* sum)
- : SumFormBase(parent)
+SumForm::SumForm(wxWindow* parent, Sum* sum) : SumFormBase(parent)
{
SetSize(GetBestSize());
-
+
m_parent = parent;
m_sum = sum;
@@ -27,7 +43,6 @@ SumForm::SumForm(wxWindow* parent, Sum* sum)
}
SumForm::~SumForm() {}
-
void SumForm::OnOKClick(wxCommandEvent& event)
{
if(ValidateData()) EndModal(wxID_OK);
@@ -39,8 +54,9 @@ bool SumForm::ValidateData()
for(int i = 0; i < (int)m_textCtrlSigns->GetValue().length(); ++i) {
if(m_textCtrlSigns->GetValue()[i] != ' ') signalStr += m_textCtrlSigns->GetValue()[i];
}
- if(signalStr.size() < 2){
- wxMessageDialog msg(this, _("You must assign at least two signals."), _("Error"), wxOK | wxCENTRE | wxICON_ERROR);
+ if(signalStr.size() < 2) {
+ wxMessageDialog msg(this, _("You must assign at least two signals."), _("Error"),
+ wxOK | wxCENTRE | wxICON_ERROR);
msg.ShowModal();
return false;
}
@@ -55,7 +71,8 @@ bool SumForm::ValidateData()
signalList.push_back(Sum::SIGNAL_NEGATIVE);
} break;
default: {
- wxMessageDialog msg(this, _("Value entered incorrectly in the field \"Signs\"."), _("Error"), wxOK | wxCENTRE | wxICON_ERROR);
+ wxMessageDialog msg(this, _("Value entered incorrectly in the field \"Signs\"."), _("Error"),
+ wxOK | wxCENTRE | wxICON_ERROR);
msg.ShowModal();
return false;
}
diff --git a/Project/SumForm.h b/Project/SumForm.h
index cf29421..9610202 100644
--- a/Project/SumForm.h
+++ b/Project/SumForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef SUMFORM_H
#define SUMFORM_H
@@ -5,18 +22,25 @@
class Sum;
+/**
+ * @class SumForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the sum control data.
+ * @file SumForm.h
+ */
class SumForm : public SumFormBase
{
-public:
+ public:
SumForm(wxWindow* parent, Sum* sum);
virtual ~SumForm();
-
+
bool ValidateData();
-
-protected:
+
+ protected:
virtual void OnCancelClick(wxCommandEvent& event) { EndModal(wxID_CANCEL); }
virtual void OnOKClick(wxCommandEvent& event);
wxWindow* m_parent = NULL;
Sum* m_sum = NULL;
};
-#endif // SUMFORM_H
+#endif // SUMFORM_H
diff --git a/Project/SwitchingForm.cpp b/Project/SwitchingForm.cpp
index 29da9c2..8a52553 100644
--- a/Project/SwitchingForm.cpp
+++ b/Project/SwitchingForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "SwitchingForm.h"
#include "PowerElement.h"
diff --git a/Project/SwitchingForm.h b/Project/SwitchingForm.h
index cf39701..973648e 100644
--- a/Project/SwitchingForm.h
+++ b/Project/SwitchingForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef SWITCHINGFORM_H
#define SWITCHINGFORM_H
@@ -5,13 +22,21 @@
class PowerElement;
+/**
+ * @class SwitchingForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the switching data of power elements for electromechanical transient studies.
+ * @file SwitchingForm.h
+ */
class SwitchingForm : public SwitchingFormBase
{
-public:
+ public:
SwitchingForm(wxWindow* parent);
SwitchingForm(wxWindow* parent, PowerElement* element);
virtual ~SwitchingForm();
-protected:
+
+ protected:
virtual void OnDownButtonClick(wxCommandEvent& event);
virtual void OnUpButtonClick(wxCommandEvent& event);
virtual void OnChangeProperties(wxPropertyGridEvent& event);
@@ -20,9 +45,9 @@ protected:
virtual void OnInsertButtonClick(wxCommandEvent& event);
virtual void OnOKButtonClick(wxCommandEvent& event);
virtual void OnRemoveButtonClick(wxCommandEvent& event);
-
+
int m_maxID = 0;
-
+
PowerElement* m_element = NULL;
};
-#endif // SWITCHINGFORM_H
+#endif // SWITCHINGFORM_H
diff --git a/Project/SyncGenerator.cpp b/Project/SyncGenerator.cpp
index 709e456..74806b6 100644
--- a/Project/SyncGenerator.cpp
+++ b/Project/SyncGenerator.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "SyncMachineForm.h"
#include "SyncGenerator.h"
#include "ControlElementContainer.h"
diff --git a/Project/SyncGenerator.h b/Project/SyncGenerator.h
index b035eed..c2fa80b 100644
--- a/Project/SyncGenerator.h
+++ b/Project/SyncGenerator.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef SYNCGENERATOR_H
#define SYNCGENERATOR_H
@@ -86,7 +103,7 @@ struct SyncGeneratorElectricalData {
double iq;
double sd;
double sq;
-
+
// Variables to extrapolate
double oldId;
double oldIq;
diff --git a/Project/SyncMachineForm.cpp b/Project/SyncMachineForm.cpp
index 6ca490a..486a043 100644
--- a/Project/SyncMachineForm.cpp
+++ b/Project/SyncMachineForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "GeneratorStabForm.h"
#include "SyncMachineForm.h"
#include "SyncGenerator.h"
diff --git a/Project/SyncMachineForm.h b/Project/SyncMachineForm.h
index 518d16c..0a611ad 100644
--- a/Project/SyncMachineForm.h
+++ b/Project/SyncMachineForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef SYNCMACHINEFORM_H
#define SYNCMACHINEFORM_H
@@ -7,6 +24,13 @@ class GeneratorStabForm;
class SyncGenerator;
class SyncMotor;
+/**
+ * @class SyncMachineForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the synchronous machine power data.
+ * @file SyncMachineForm.h
+ */
class SyncMachineForm : public SyncMachineFormBase
{
public:
diff --git a/Project/SyncMotor.cpp b/Project/SyncMotor.cpp
index fb24bac..1a5b20d 100644
--- a/Project/SyncMotor.cpp
+++ b/Project/SyncMotor.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "SyncMachineForm.h"
#include "SyncMotor.h"
diff --git a/Project/SyncMotor.h b/Project/SyncMotor.h
index f6f21c4..90b7186 100644
--- a/Project/SyncMotor.h
+++ b/Project/SyncMotor.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef SYNCMOTOR_H
#define SYNCMOTOR_H
diff --git a/Project/Text.cpp b/Project/Text.cpp
index aa36aef..52ec26f 100644
--- a/Project/Text.cpp
+++ b/Project/Text.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "TextForm.h"
#include "Text.h"
diff --git a/Project/Text.h b/Project/Text.h
index 062032c..03acd48 100644
--- a/Project/Text.h
+++ b/Project/Text.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef TEXT_H
#define TEXT_H
@@ -47,7 +64,7 @@ enum DataType {
class Text : public GraphicalElement
{
-public:
+ public:
Text();
Text(wxPoint2DDouble position);
~Text();
@@ -79,8 +96,7 @@ public:
int GetFontSize() const { return m_fontSize; }
const ElectricalUnit GetUnit() const { return m_unit; }
int GetDecimalPlaces() const { return m_decimalPlaces; }
-
-protected:
+ protected:
wxGLString* m_glString = NULL;
wxGLStringArray* m_glStringArray = NULL;
@@ -98,4 +114,4 @@ protected:
int m_decimalPlaces = 2;
};
-#endif // TEXT_H
+#endif // TEXT_H
diff --git a/Project/TextForm.cpp b/Project/TextForm.cpp
index b2624ba..993593c 100644
--- a/Project/TextForm.cpp
+++ b/Project/TextForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "TextForm.h"
TextForm::TextForm(wxWindow* parent, Text* text, std::vector<Element*> elementList, double systemPowerBase)
diff --git a/Project/TextForm.h b/Project/TextForm.h
index 069c0e4..e6d08e8 100644
--- a/Project/TextForm.h
+++ b/Project/TextForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef TEXTFORM_H
#define TEXTFORM_H
#include "ElementForm.h"
@@ -5,9 +22,16 @@
#include "Text.h"
#include "ElectricCalculation.h"
+/**
+ * @class TextForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the text graphical data.
+ * @file TextForm.h
+ */
class TextForm : public TextFormBase
{
-public:
+ public:
TextForm(wxWindow* parent, Text* text, std::vector<Element*> elementList, double systemPowerBase = 100e6);
virtual ~TextForm();
@@ -21,7 +45,7 @@ public:
virtual void Preview();
virtual bool ValidateData();
-protected:
+ protected:
virtual void OnUnitChoiceSelected(wxCommandEvent& event);
virtual void OnCancelButtonClick(wxCommandEvent& event) { EndModal(wxID_CANCEL); }
virtual void OnOKButtonClick(wxCommandEvent& event);
@@ -38,4 +62,4 @@ protected:
ElectricCalculation m_allElements;
double m_systemPowerBase;
};
-#endif // TEXTFORM_H
+#endif // TEXTFORM_H
diff --git a/Project/TransferFunction.cpp b/Project/TransferFunction.cpp
index b91627a..39e9b4f 100644
--- a/Project/TransferFunction.cpp
+++ b/Project/TransferFunction.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "TransferFunction.h"
#include "TransferFunctionForm.h"
diff --git a/Project/TransferFunction.h b/Project/TransferFunction.h
index aab4bd2..fd83ba4 100644
--- a/Project/TransferFunction.h
+++ b/Project/TransferFunction.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef TRANSFERFUNCTION_H
#define TRANSFERFUNCTION_H
@@ -36,7 +53,7 @@ class TransferFunction : public ControlElement
virtual SpaceState GetSpaceState() { return m_ss; }
virtual void CalculateSpaceState(int maxIteration = 100, double error = 1e-3);
virtual bool Solve(double input, double timeStep);
-
+
virtual Element* GetCopy();
protected:
diff --git a/Project/TransferFunctionForm.cpp b/Project/TransferFunctionForm.cpp
index 0317da6..0d8450e 100644
--- a/Project/TransferFunctionForm.cpp
+++ b/Project/TransferFunctionForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "TransferFunctionForm.h"
#include "TransferFunction.h"
@@ -5,7 +22,7 @@ TransferFunctionForm::TransferFunctionForm(wxWindow* parent, TransferFunction* t
: TransferFunctionFormBase(parent)
{
SetSize(GetBestSize());
-
+
m_parent = parent;
m_tf = transferFunction;
LoadTFData();
diff --git a/Project/TransferFunctionForm.h b/Project/TransferFunctionForm.h
index 269eda6..ebc3b26 100644
--- a/Project/TransferFunctionForm.h
+++ b/Project/TransferFunctionForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef TRANSFERFUNCTIONFORM_H
#define TRANSFERFUNCTIONFORM_H
@@ -5,19 +22,26 @@
class TransferFunction;
+/**
+ * @class TransferFunctionForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the transfer function control data.
+ * @file TransferFunctionForm.h
+ */
class TransferFunctionForm : public TransferFunctionFormBase
{
-public:
+ public:
TransferFunctionForm(wxWindow* parent, TransferFunction* transferFunction);
virtual ~TransferFunctionForm();
bool ValidateData();
-protected:
+ protected:
virtual void OnCancelClick(wxCommandEvent& event);
virtual void OnOKClick(wxCommandEvent& event);
void LoadTFData();
-
+
wxWindow* m_parent = NULL;
TransferFunction* m_tf = NULL;
};
-#endif // TRANSFERFUNCTIONFORM_H
+#endif // TRANSFERFUNCTIONFORM_H
diff --git a/Project/Transformer.cpp b/Project/Transformer.cpp
index 8f8ecb5..75816ce 100644
--- a/Project/Transformer.cpp
+++ b/Project/Transformer.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "TransformerForm.h"
#include "Transformer.h"
@@ -460,7 +477,7 @@ TransformerElectricalData Transformer::GetPUElectricalData(double systemBasePowe
// Resistance
double r = data.resistance;
- if(data.resistanceUnit == UNIT_PU) {
+ if(data.resistanceUnit == UNIT_PU) {
if(data.useTransformerPower) data.resistance = (r * transformerBaseImpedance) / systemBaseImpedance;
} else {
data.resistance = r / systemBaseImpedance;
@@ -501,16 +518,16 @@ TransformerElectricalData Transformer::GetPUElectricalData(double systemBasePowe
// Secondary ground ind reactance
double xgs = data.secondaryGrndReactance;
if(data.useTransformerPower) data.secondaryGrndReactance = (xgs * transformerBaseImpedance) / systemBaseImpedance;
-
+
if(!m_online) {
- data.powerFlow[0] = std::complex<double>(0,0);
- data.powerFlow[1] = std::complex<double>(0,0);
- data.faultCurrent[0][0] = std::complex<double>(0,0);
- data.faultCurrent[0][1] = std::complex<double>(0,0);
- data.faultCurrent[0][2] = std::complex<double>(0,0);
- data.faultCurrent[1][0] = std::complex<double>(0,0);
- data.faultCurrent[1][1] = std::complex<double>(0,0);
- data.faultCurrent[1][2] = std::complex<double>(0,0);
+ data.powerFlow[0] = std::complex<double>(0, 0);
+ data.powerFlow[1] = std::complex<double>(0, 0);
+ data.faultCurrent[0][0] = std::complex<double>(0, 0);
+ data.faultCurrent[0][1] = std::complex<double>(0, 0);
+ data.faultCurrent[0][2] = std::complex<double>(0, 0);
+ data.faultCurrent[1][0] = std::complex<double>(0, 0);
+ data.faultCurrent[1][1] = std::complex<double>(0, 0);
+ data.faultCurrent[1][2] = std::complex<double>(0, 0);
}
return data;
diff --git a/Project/Transformer.h b/Project/Transformer.h
index 689b8f6..6c5efea 100644
--- a/Project/Transformer.h
+++ b/Project/Transformer.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef TRANSFORMER_H
#define TRANSFORMER_H
@@ -37,8 +54,8 @@ struct TransformerElectricalData {
bool useTransformerPower = false;
// Power flow (p.u.)
- std::complex<double> current[2] = { std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0) };
- std::complex<double> powerFlow[2] = { std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0) };
+ std::complex<double> current[2] = {std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0)};
+ std::complex<double> powerFlow[2] = {std::complex<double>(0.0, 0.0), std::complex<double>(0.0, 0.0)};
// Fault
double zeroResistance = 0.0;
@@ -53,7 +70,7 @@ struct TransformerElectricalData {
class Transformer : public Branch
{
-public:
+ public:
Transformer();
Transformer(wxString name);
virtual ~Transformer();
@@ -78,9 +95,9 @@ public:
virtual void SetElectricaData(TransformerElectricalData electricalData) { m_electricalData = electricalData; }
virtual void SetNominalVoltage(std::vector<double> nominalVoltage, std::vector<ElectricalUnit> nominalVoltageUnit);
-protected:
+ protected:
void UpdatePowerFlowArrowsPosition();
TransformerElectricalData m_electricalData;
};
-#endif // TRANSFORMER_H
+#endif // TRANSFORMER_H
diff --git a/Project/TransformerForm.cpp b/Project/TransformerForm.cpp
index 920b0a0..7c921c4 100644
--- a/Project/TransformerForm.cpp
+++ b/Project/TransformerForm.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "TransformerForm.h"
#include "SwitchingForm.h"
#include "Transformer.h"
@@ -6,8 +23,8 @@ TransformerForm::TransformerForm(wxWindow* parent, Transformer* transformer) : T
{
m_choiceResistance->SetString(1, L'\u03A9');
m_choiceReactance->SetString(1, L'\u03A9');
-
- //Reset connections choice labels (to be translated)
+
+ // Reset connections choice labels (to be translated)
m_choiceConnection->SetString(0, _("Grounded Wye - Grounded Wye"));
m_choiceConnection->SetString(1, _("Wye - Grounded Wye"));
m_choiceConnection->SetString(2, _("Grounded Wye - Wye"));
@@ -99,7 +116,7 @@ TransformerForm::TransformerForm(wxWindow* parent, Transformer* transformer) : T
m_textCtrlTurnRatio->SetValue(Transformer::StringFromDouble(data.turnsRatio));
m_textCtrlPhaseShift->SetValue(Transformer::StringFromDouble(data.phaseShift));
-
+
m_checkUseTransformerPower->SetValue(data.useTransformerPower);
m_textCtrlZeroResistance->SetValue(Transformer::StringFromDouble(data.zeroResistance));
diff --git a/Project/TransformerForm.h b/Project/TransformerForm.h
index fb76809..82daadc 100644
--- a/Project/TransformerForm.h
+++ b/Project/TransformerForm.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef TRANSFORMERFORM_H
#define TRANSFORMERFORM_H
@@ -6,6 +23,13 @@
class SwitchingForm;
class Transformer;
+/**
+ * @class TransformerForm
+ * @author Thales Lima Oliveira <thales@ufu.br>
+ * @date 05/10/2017
+ * @brief Form to edit the transformer power data.
+ * @file TransformerForm.h
+ */
class TransformerForm : public TransformerFormBase
{
public:
diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp
index 6f753ce..bd385b5 100644
--- a/Project/Workspace.cpp
+++ b/Project/Workspace.cpp
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#include "Workspace.h"
#include "Camera.h"
#include "Element.h"
diff --git a/Project/Workspace.h b/Project/Workspace.h
index 09b94e5..7cc8b33 100644
--- a/Project/Workspace.h
+++ b/Project/Workspace.h
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2017 Thales Lima Oliveira <thales@ufu.br>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
#ifndef WORKSPACE_H
#define WORKSPACE_H
@@ -57,9 +74,9 @@ enum ElementID {
* @class Workspace
* @author Thales Lima Oliveira <thales@ufu.br>
* @date 19/09/2017
+ * @brief This class manages the graphical and power elements.
+ * It is responsible for handling the user's interaction with the elements.
* @file Workspace.h
- * @brief This class manages the graphical and power elements. It is responsible for handling the user's interaction
- * with the elements.
*/
class Workspace : public WorkspaceBase
{