diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-06 11:37:00 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-06 11:37:00 -0300 |
commit | c5636d2031b20e673441e095d90ba94942698e7c (patch) | |
tree | 30b9f15cd5d91fe11a07960154d03afc2328bf8a /Project/Bus.h | |
parent | 0586ac0d34e4d8d5dd9845f2fdd212716b3004f9 (diff) | |
download | PSP.git-c5636d2031b20e673441e095d90ba94942698e7c.tar.gz PSP.git-c5636d2031b20e673441e095d90ba94942698e7c.tar.xz PSP.git-c5636d2031b20e673441e095d90ba94942698e7c.zip |
Some class enum implementation
Just for better code design: https://docs.microsoft.com/pt-br/dotnet/architecture/microservices/microservice-ddd-cqrs-patterns/enumeration-classes-over-enum-types
Diffstat (limited to 'Project/Bus.h')
-rw-r--r-- | Project/Bus.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Project/Bus.h b/Project/Bus.h index 0b4bb53..50ce004 100644 --- a/Project/Bus.h +++ b/Project/Bus.h @@ -25,10 +25,10 @@ struct BusElectricalData { int number = 0; wxString name = ""; double nominalVoltage = 138.0; - ElectricalUnit nominalVoltageUnit = UNIT_kV; + ElectricalUnit nominalVoltageUnit = ElectricalUnit::UNIT_kV; bool isVoltageControlled = false; double controlledVoltage = 1.0; - int controlledVoltageUnitChoice = 0; // 0 = p.u., 1 = same as nominalVoltageUnit (UNIT_V or UNIT_kV). + int controlledVoltageUnitChoice = 0; // 0 = p.u., 1 = same as nominalVoltageUnit (ElectricalUnit::UNIT_V or ElectricalUnit::UNIT_kV). bool slackBus = false; // Power flow (p.u.) @@ -38,8 +38,8 @@ struct BusElectricalData { // Fault bool hasFault = false; - FaultData faultType = FAULT_THREEPHASE; - FaultData faultLocation = FAULT_LINE_A; + FaultData faultType = FaultData::FAULT_THREEPHASE; + FaultData faultLocation = FaultData::FAULT_LINE_A; // p.u. fault data double faultResistance = 0.0; double faultReactance = 0.0; @@ -96,7 +96,7 @@ class Bus : public PowerElement virtual BusElectricalData GetElectricalData() const { return m_electricalData; } virtual void SetElectricalData(const BusElectricalData& electricalData) { m_electricalData = electricalData; } virtual bool ShowForm(wxWindow* parent, Element* element); - virtual bool GetPlotData(ElementPlotData& plotData, PlotStudy study = STABILITY); + virtual bool GetPlotData(ElementPlotData& plotData, PlotStudy study = PlotStudy::STABILITY); virtual rapidxml::xml_node<>* SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode); virtual bool OpenElement(rapidxml::xml_node<>* elementNode); |