Skip to content

Commit

Permalink
Set voltage limits for transmission tower
Browse files Browse the repository at this point in the history
  • Loading branch information
Baughn committed Feb 17, 2017
1 parent 5f11fc7 commit 480cb89
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/main/java/mods/eln/Eln.java
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ private void registerGridDevices(int id) {
"textures/wire.png",
highVoltageCableDescriptor,
false,
24);
24,
12800);
GhostGroup g = new GhostGroup();
g.addElement(0, 1, 0);
g.addElement(0, 2, 0);
Expand All @@ -696,7 +697,8 @@ private void registerGridDevices(int id) {
"textures/wire.png",
highVoltageCableDescriptor,
true,
24);
24,
12800);
GhostGroup g = new GhostGroup();
g.addElement(0, 1, 0);
g.addElement(0, 2, 0);
Expand All @@ -713,7 +715,8 @@ private void registerGridDevices(int id) {
"textures/wire.png",
highVoltageCableDescriptor,
false,
96);
96,
51200);
GhostGroup g = new GhostGroup();
g.addRectangle(-1, 1, 0, 0, -1, 1);
g.addRectangle(0, 0, 1, 8, 0, 0);
Expand Down
1 change: 0 additions & 1 deletion src/main/java/mods/eln/gridnode/GridDescriptor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import org.lwjgl.opengl.GL11.*
open class GridDescriptor(name: String, private val obj: Obj3D, ElementClass: Class<*>, RenderClass: Class<*>, val cableTexture: String, val cableDescriptor: ElectricalCableDescriptor, val connectRange: Int) : TransparentNodeDescriptor(name, ElementClass, RenderClass) {
val plus = ArrayList<Obj3D.Obj3DPart>()
val gnd = ArrayList<Obj3D.Obj3DPart>()
// private final Obj3D.Obj3DPart main;

protected var static_parts = ArrayList<Obj3D.Obj3DPart>()
protected var rotating_parts = ArrayList<Obj3D.Obj3DPart>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ElectricalPoleDescriptor(name: String,
obj: Obj3D, cableTexture: String,
cableDescriptor: ElectricalCableDescriptor,
val includeTransformer: Boolean,
connectRange: Int)
connectRange: Int, val voltageLimit: Double)
: GridDescriptor(name, obj, ElectricalPoleElement::class.java, ElectricalPoleRender::class.java, cableTexture, cableDescriptor, connectRange) {
val minimalLoadToHum = 0.2f

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ElectricalPoleElement(node: TransparentNode, descriptor: TransparentNodeDe
}
voltageWatchdog
.set(electricalLoad)
.setUMaxMin(desc.cableDescriptor.electricalNominalVoltage * 16)
.setUMaxMin(desc.voltageLimit)
.set(exp)

if (desc.includeTransformer) {
Expand Down Expand Up @@ -151,7 +151,7 @@ class ElectricalPoleElement(node: TransparentNode, descriptor: TransparentNodeDe

override fun initialize() {
trafo?.apply {
voltageSecondaryWatchdog.setUNominal(3200.0)
voltageSecondaryWatchdog.setUNominal(Eln.instance.veryHighVoltageCableDescriptor.electricalNominalVoltage)
secondaryMaxCurrent = desc.cableDescriptor.electricalMaximalCurrent.toFloat()
interSystemProcess.setRatio(0.25)
}
Expand Down

0 comments on commit 480cb89

Please sign in to comment.