summaryrefslogtreecommitdiffstats
path: root/Project/SyncGenerator.h
blob: 1ada9eb678225a0cc87d00bf228bf64af2a12571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef SYNCGENERATOR_H
#define SYNCGENERATOR_H

#include "GeneratorForm.h"
#include "Machines.h"

struct SyncGeneratorElectricalData
{
    // General
    wxString name = "";
    double nominalPower = 100.0;
    ElectricalUnit nominalPowerUnit = UNIT_MVA;
    double activePower = 100.0;
    ElectricalUnit activePowerUnit = UNIT_MVA;
    double reactivePower = 0.0;
    ElectricalUnit reactivePowerUnit = UNIT_MVA;
    bool haveMaxReactive = false;
    double maxReactive = 9999.0;
    ElectricalUnit maxReactiveUnit = UNIT_MVA;
    bool haveMinReactive = false;
    double minReactive = -9999.0;
    ElectricalUnit minReactiveUnit = UNIT_MVA;
    bool useMachineBase = false;

    // Fault
    double positiveResistance = 0.0;
    double positiveReactance = 1.0;
    double negativeResistance = 0.0;
    double negativeReactance = 1.0;
    double zeroResistance = 0.0;
    double zeroReactance = 1.0;
    double groundResistance = 0.0;
    double groundReactance = 0.0;
    bool groundNeutral = true;

    // Stability
    bool plotSyncMachine = false;
    double inertia = 0.0;
    double damping = 0.0;
    bool useAVR = false;
    bool useSpeedGovernor = false;

    double armResistance = 0.0;
    double potierReactance = 0.0;
    double satFactor = 0.0;

    double syncXd = 0.0;
    double syncXq = 0.0;
    double transXd = 1.0;
    double transXq = 0.0;
    double transTd0 = 0.0;
    double transTq0 = 0.0;
    double subXd = 0.0;
    double subXq = 0.0;
    double subTd0 = 0.0;
    double subTq0 = 0.0;
};

class SyncGenerator : public Machines
{
   public:
    SyncGenerator();
	SyncGenerator(wxString name);
    ~SyncGenerator();
	
	virtual void Init();
    virtual void DrawSymbol() const;
    virtual bool GetContextMenu(wxMenu& menu);
    virtual bool ShowForm(wxWindow* parent, Element* element);
    virtual SyncGeneratorElectricalData GetElectricalData() { return m_electricalData; }
    virtual void SetElectricalData(SyncGeneratorElectricalData electricalData) { m_electricalData = electricalData; }
   protected:
    std::vector<wxPoint2DDouble> m_sinePts;

    SyncGeneratorElectricalData m_electricalData;
};

#endif  // SYNCGENERATOR_H