forked from powerdata/com.powerdata.openpa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gen.java
160 lines (135 loc) · 3.38 KB
/
Gen.java
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
package com.powerdata.openpa;
public class Gen extends OneTermDev
{
GenList _list;
public enum Mode
{
/** Off */ OFF,
/** On in unknown mode */ ON,
/** On with manual active power setpoint */ MAN,
/** Load Frequency Control */ LFC,
/** Automatic Generation Control */ AGC,
/** Economic Dispatch */ EDC,
/** Pumping */ PMP,
/** Condense */ CON,
/** Isochronous Restore Mode */ RES;
}
public enum Type {Unknown, Thermal, Hydro};
public Gen(GenList list, int ndx)
{
super(list, ndx);
_list = list;
}
public Type getType() throws PAModelException
{
return _list.getType(_ndx);
}
public void setType(Type t) throws PAModelException
{
_list.setType(_ndx, t);
}
public Mode getMode() throws PAModelException
{
return _list.getMode(_ndx);
}
public void setMode(Mode m) throws PAModelException
{
_list.setMode(_ndx, m);
}
public float getOpMinP() throws PAModelException
{
return _list.getOpMinP(_ndx);
}
public void setOpMinP(float mw) throws PAModelException
{
_list.setOpMinP(_ndx, mw);
}
/** max active power in MW */
public float getOpMaxP() throws PAModelException
{
return _list.getOpMaxP(_ndx);
}
/** max active power in MW */
public void setOpMaxP(float mw) throws PAModelException
{
_list.setOpMaxP(_ndx, mw);
}
/** Minimum generator reactive power output (MVAr) */
public float getMinQ() throws PAModelException
{
return _list.getMinQ(_ndx);
}
/** Minimum generator reactive power output (MVAr) */
public void setMinQ(float mvar) throws PAModelException
{
_list.setMinQ(_ndx, mvar);
}
/** Maximum generator reactive power output (MVAr) */
public float getMaxQ() throws PAModelException
{
return _list.getMaxQ(_ndx);
}
/** Maximum generator reactive power output (MVAr) */
public void setMaxQ(float mvar) throws PAModelException
{
_list.setMaxQ(_ndx, mvar);
}
/** get the active power setpoint in MW */
public float getPS() throws PAModelException
{
return _list.getPS(_ndx);
}
/** get the active power setpoint in MW */
public void setPS(float mw) throws PAModelException
{
_list.setPS(_ndx, mw);
}
/** get the reactive power setpoint when not regulating voltage (MVAr)*/
public float getQS() throws PAModelException
{
return _list.getQS(_ndx);
}
/** get the reactive power setpoint when not regulating voltage (MVAr)*/
public void setQS(float mvar) throws PAModelException
{
_list.setQS(_ndx, mvar);
}
/** is unit regulating voltage */
public boolean isRegKV() throws PAModelException
{
return _list.isRegKV(_ndx);
}
/** is unit regulating voltage */
public void setRegKV(boolean reg) throws PAModelException
{
_list.setRegKV(_ndx, reg);
}
/** voltage setpoint in KV, used if regulating voltage */
public float getVS() throws PAModelException
{
return _list.getVS(_ndx);
}
/** voltage setpoint in KV, used if regulating voltage */
public void setVS(float kv) throws PAModelException
{
_list.setVS(_ndx, kv);
}
/** Bus where voltage is regulated */
public Bus getRegBus() throws PAModelException
{
return _list.getRegBus(_ndx);
}
public void setRegBus(Bus b) throws PAModelException
{
_list.setRegBus(_ndx, b);
}
public boolean unitInAVR() throws PAModelException
{
return isGenerating() && isRegKV();
}
public boolean isGenerating() throws PAModelException
{
Mode m = getMode();
return !isOutOfSvc() && m != Mode.PMP && m != Mode.OFF;
}
}