-
Notifications
You must be signed in to change notification settings - Fork 5
/
TransformerResult.java
88 lines (79 loc) · 2.5 KB
/
TransformerResult.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
/*
* © 2021. TU Dortmund University,
* Institute of Energy Systems, Energy Efficiency and Energy Economics,
* Research group Distribution grid planning and operation
*/
package edu.ie3.datamodel.models.result.connector;
import java.time.ZonedDateTime;
import java.util.Objects;
import java.util.UUID;
import javax.measure.quantity.Angle;
import javax.measure.quantity.ElectricCurrent;
import tech.units.indriya.ComparableQuantity;
/**
* Abstract class that adds a tap changer position attribute to the {@link ConnectorResult} which
* actually creates a transformer representation.
*/
public abstract class TransformerResult extends ConnectorResult {
/** Current tapping position if a transformer has a tap changer */
private int tapPos;
/**
* Standard constructor with automatic uuid generation.
*
* @param time date and time when the result is produced
* @param inputModel uuid of the input model that produces the result
* @param iAMag electric current magnitude @ port A, normally provided in Ampere
* @param iAAng electric current angle @ Port A in degree
* @param iBMag electric current magnitude @ port B, normally provided in Ampere
* @param iBAng electric current angle @ Port B in degree
* @param tapPos the current position of the transformers tap changer
*/
protected TransformerResult(
ZonedDateTime time,
UUID inputModel,
ComparableQuantity<ElectricCurrent> iAMag,
ComparableQuantity<Angle> iAAng,
ComparableQuantity<ElectricCurrent> iBMag,
ComparableQuantity<Angle> iBAng,
int tapPos) {
super(time, inputModel, iAMag, iAAng, iBMag, iBAng);
this.tapPos = tapPos;
}
public int getTapPos() {
return tapPos;
}
public void setTapPos(int tapPos) {
this.tapPos = tapPos;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
TransformerResult that = (TransformerResult) o;
return tapPos == that.tapPos;
}
@Override
public int hashCode() {
return Objects.hash(super.hashCode(), tapPos);
}
@Override
public String toString() {
return "TransformerResult{"
+ "time="
+ getTime()
+ ", inputModel="
+ getInputModel()
+ ", iAMag="
+ getiAMag()
+ ", iAAng="
+ getiAAng()
+ ", iBMag="
+ getiBMag()
+ ", iBAng="
+ getiBAng()
+ ", tapPos="
+ tapPos
+ '}';
}
}