Skip to content

Commit

Permalink
Merge pull request #108 from asmithie13/setup_green_line_#55
Browse files Browse the repository at this point in the history
Setup green line #55
  • Loading branch information
asmithie13 authored Mar 18, 2024
2 parents 19caab2 + ad5966a commit b04a781
Show file tree
Hide file tree
Showing 10 changed files with 338 additions and 115 deletions.
5 changes: 4 additions & 1 deletion PLC_Files/PLC1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ SwitchOcc
LeftLIGHT

not SwitchOcc and SwitchRightOcc
RightLIGHT
RightLIGHT

CrossingBlockOccupied
crossingState
21 changes: 14 additions & 7 deletions PLC_Files/PLC_Definitions.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
OCCUPIED A #Perform actions if any block of A is OCCUPIED
SWITCH A5 B6 #SWITCH position of A5 to B6
LIGHT !C11 #Light of C11 is red
#CROSSING goes here, if blank, we just skip
OCCUPIED !A #Perform if every block of A is not OCCUPIED
SWITCH A5 C11
LIGHT C11 #Light of C11 is green
SwitchOcc or not SwitchRightOcc #boolean condition for if a switch block is occupied or its block to the right is not occupied
SWITCH #boolean value for the switch: true is left, false is right

SwitchOcc or SwitchRightOcc #boolean condition for if a switch block is occupied or its block to the right is occupied
CurrentLIGHT #boolean value for the current light: true is green, false is red

SwitchOcc #boolean condition for if a switch block is occupied
LeftLIGHT #boolean value for the left light: true is green, false is red

not SwitchOcc and SwitchRightOcc #boolean condition for if a switch block is not occupied and its block to the right is occupied
RightLIGHT #boolean value for the left light: true is green, false is red

CrossingBlockOccupied
crossingState
5 changes: 5 additions & 0 deletions PLC_Files/Parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def parsePLC(self):
for i in range(0, len(self.CrossingTriplesIDS) * 3, 3)
]

for block in self.outPuttedBlocks:
if block.CROSSING:
setattr(block, str(lines[13]), not block.occupied)


for data in CrossingTripleBlocks:
SwitchOcc = data[0].occupied
SwitchRightOcc = data[2].occupied
Expand Down
Binary file modified PLC_Files/__pycache__/Parser.cpython-311.pyc
Binary file not shown.
5 changes: 3 additions & 2 deletions Track_Resources/Block.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Define the Block class
class Block:
def __init__(self, lineColor, blockSection, blockNum, hasLight, hasCrossing, hasSwitch, lightState, crossingState, switchState,id,speedLimit):
def __init__(self, lineColor, blockSection, blockNum, hasLight, hasCrossing, hasSwitch, lightState, crossingState, switchState,id):
self.lineColor = lineColor
self.blockSection = blockSection
self.blockNum = blockNum
Expand All @@ -12,6 +12,7 @@ def __init__(self, lineColor, blockSection, blockNum, hasLight, hasCrossing, has
self.switchState = switchState
self.occupied = False
self.ID = id
self.speedLimit = speedLimit
self.speedLimit = None
self.authority = None
self.blockLength = None

Binary file modified Track_Resources/__pycache__/Block.cpython-311.pyc
Binary file not shown.
151 changes: 151 additions & 0 deletions Wayside SW/Green_Line.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
Line,Section,Block Number,Block Length (m),Block Grade (%),Speed Limit (Km/Hr),Infrastructure,Station Side,ELEVATION (M),CUMALTIVE ELEVATION (M)
Green,A,1,100,0.5,45,,,0.5,0.5
Green,A,2,100,1,45,STATION; PIONEER,Left,1,1.5
Green,A,3,100,1.5,45,,,1.5,3
Green,B,4,100,2,45,,,2,5
Green,B,5,100,3,45,,,3,8
Green,B,6,100,4,45,,,4,12
Green,C,7,100,5,45,,,5,17
Green,C,8,100,0,45,,,0,17
Green,C,9,100,-5,45,STATION; EDGEBROOK,Left,-5,12
Green,C,10,100,-4.5,45,,,-4.5,7.5
Green,C,11,100,-4,45,,,-4,3.5
Green,C,12,100,-3,45,SWITCH (12-13; 12-1),,-3,0.5
Green,D,13,150,0,70,,,0,0.5
Green,D,14,150,0,70,,,0,0.5
Green,D,15,150,0,70,,,0,0.5
Green,D,16,150,0,70,STATION,Left/Right,0,0.5
Green,E,17,150,0,60,,,0,0.5
Green,E,18,150,0,60,,,0,0.5
Green,E,19,150,0,60,RAILWAY CROSSING,,0,0.5
Green,E,20,150,0,60,,,0,0.5
Green,F,21,300,0,70,,,0,0.5
Green,F,22,300,0,70,STATION; WHITED,Left/Right,0,0.5
Green,F,23,300,0,70,,,0,0.5
Green,F,24,300,0,70,,,0,0.5
Green,F,25,200,0,70,,,0,0.5
Green,F,26,100,0,70,,,0,0.5
Green,F,27,50,0,30,,,0,0.5
Green,F,28,50,0,30,SWITCH (28-29; 28-150),,0,0.5
Green,G,29,50,0,30,,,0,0.5
Green,G,30,50,0,30,,,0,0.5
Green,G,31,50,0,30,STATION; SOUTH BANK,Left,0,0.5
Green,G,32,50,0,30,,,0,0.5
Green,H,33,50,0,30,,,0,0.5
Green,H,34,50,0,30,,,0,0.5
Green,H,35,50,0,30,,,0,0.5
Green,I,36,50,0,30,UNDERGROUND,,0,0.5
Green,I,37,50,0,30,UNDERGROUND,,0,0.5
Green,I,38,50,0,30,UNDERGROUND,,0,0.5
Green,I,39,50,0,30,STATION; CENTRAL; UNDERDROUND,Right,0,0.5
Green,I,40,50,0,30,UNDERGROUND,,0,0.5
Green,I,41,50,0,30,UNDERGROUND,,0,0.5
Green,I,42,50,0,30,UNDERGROUND,,0,0.5
Green,I,43,50,0,30,UNDERGROUND,,0,0.5
Green,I,44,50,0,30,UNDERGROUND,,0,0.5
Green,I,45,50,0,30,UNDERGROUND,,0,0.5
Green,I,46,50,0,30,UNDERGROUND,,0,0.5
Green,I,47,50,0,30,UNDERGROUND,,0,0.5
Green,I,48,50,0,30,STATION; INGLEWOOD; UNDERGROUND,Right,0,0.5
Green,I,49,50,0,30,UNDERGROUND,,0,0.5
Green,I,50,50,0,30,UNDERGROUND,,0,0.5
Green,I,51,50,0,30,UNDERGROUND,,0,0.5
Green,I,52,50,0,30,UNDERGROUND,,0,0.5
Green,I,53,50,0,30,UNDERGROUND,,0,0.5
Green,I,54,50,0,30,UNDERGROUND,,0,0.5
Green,I,55,50,0,30,UNDERGROUND,,0,0.5
Green,I,56,50,0,30,UNDERGROUND,,0,0.5
Green,I,57,50,0,30,STATION; OVERBROOK; UNDERGROUND,Right,0,0.5
Green,J,58,50,0,30,SWITCH TO YARD (57-yard),,0,0.5
Green,J,59,50,0,30,,,0,0.5
Green,J,60,50,0,30,,,0,0.5
Green,J,61,50,0,30,,,0,0.5
Green,J,62,50,0,30,SWITCH FROM YARD (Yard-63),,0,0.5
Green,K,63,100,0,70,,,0,0.5
Green,K,64,100,0,70,,,0,0.5
Green,K,65,200,0,70,STATION; GLENBURY,Right,0,0.5
Green,K,66,200,0,70,,,0,0.5
Green,K,67,100,0,40,,,0,0.5
Green,K,68,100,0,40,,,0,0.5
Green,L,69,100,0,40,,,0,0.5
Green,L,70,100,0,40,,,0,0.5
Green,L,71,100,0,40,,,0,0.5
Green,L,72,100,0,40,,,0,0.5
Green,L,73,100,0,40,STATION; DORMONT,Right,0,0.5
Green,M,74,100,0,40,,,0,0.5
Green,M,75,100,0,40,,,0,0.5
Green,M,76,100,0,40,SWITCH (76-77;76-101),,0,0.5
Green,N,77,300,0,70,STATION; MT LEBANON,Left/Right,0,0.5
Green,N,78,300,0,70,,,0,0.5
Green,N,79,300,0,70,,,0,0.5
Green,N,80,300,0,70,,,0,0.5
Green,N,81,300,0,70,,,0,0.5
Green,N,82,300,0,70,,,0,0.5
Green,N,83,300,0,70,,,0,0.5
Green,N,84,300,0,70,,,0,0.5
Green,N,85,300,0,70,SWITCH (85-86; 85-100),,0,0.5
Green,O,86,100,0,25,,,0,0.5
Green,O,87,86.6,0,25,,,0,0.5
Green,O,88,100,0,25,STATION; POPLAR,Left,0,0.5
Green,P,89,75,-0.5,25,,,-0.375,0.125
Green,P,90,75,-1,25,,,-0.75,-0.625
Green,P,91,75,-2,25,,,-1.5,-2.125
Green,P,92,75,0,25,,,0,-2.125
Green,P,93,75,2,25,,,1.5,-0.625
Green,P,94,75,1,25,,,0.75,0.125
Green,P,95,75,0.5,25,,,0.375,0.5
Green,P,96,75,0,25,STATION; CASTLE SHANNON,Left,0,0.5
Green,P,97,75,0,25,,,0,0.5
Green,Q,98,75,0,25,,,0,0.5
Green,Q,99,75,0,25,,,0,0.5
Green,Q,100,75,0,25,,,0,0.5
Green,R,101,35,0,26,,,0,0.5
Green,S,102,100,0,28,,,0,0.5
Green,S,103,100,0,28,,,0,0.5
Green,S,104,80,0,28,,,0,0.5
Green,T,105,100,0,28,STATION; DORMONT,Right,0,0.5
Green,T,106,100,0,28,,,0,0.5
Green,T,107,90,0,28,,,0,0.5
Green,T,108,100,0,28,RAILWAY CROSSING,,0,0.5
Green,T,109,100,0,28,,,0,0.5
Green,U,110,100,0,30,,,0,0.5
Green,U,111,100,0,30,,,0,0.5
Green,U,112,100,0,30,,,0,0.5
Green,U,113,100,0,30,,,0,0.5
Green,U,114,162,0,30,STATION; GLENBURY,Right,0,0.5
Green,U,115,100,0,30,,,0,0.5
Green,U,116,100,0,30,,,0,0.5
Green,V,117,50,0,15,,,0,0.5
Green,V,118,50,0,15,,,0,0.5
Green,V,119,40,0,15,,,0,0.5
Green,V,120,50,0,15,,,0,0.5
Green,V,121,50,0,15,,,0,0.5
Green,W,122,50,0,20,UNDERGROUND,,0,0.5
Green,W,123,50,0,20,STATION; OVERBROOK; UNDERGROUND,Right,0,0.5
Green,W,124,50,0,20,UNDERGROUND,,0,0.5
Green,W,125,50,0,20,UNDERGROUND,,0,0.5
Green,W,126,50,0,20,UNDERGROUND,,0,0.5
Green,W,127,50,0,20,UNDERGROUND,,0,0.5
Green,W,128,50,0,20,UNDERGROUND,,0,0.5
Green,W,129,50,0,20,UNDERGROUND,,0,0.5
Green,W,130,50,0,20,UNDERGROUND,,0,0.5
Green,W,131,50,0,20,UNDERGROUND,,0,0.5
Green,W,132,50,0,20,STATION; INGLEWOOD; UNDERGROUND,Left,0,0.5
Green,W,133,50,0,20,UNDERGROUND,,0,0.5
Green,W,134,50,0,20,UNDERGROUND,,0,0.5
Green,W,135,50,0,20,UNDERGROUND,,0,0.5
Green,W,136,50,0,20,UNDERGROUND,,0,0.5
Green,W,137,50,0,20,UNDERGROUND,,0,0.5
Green,W,138,50,0,20,UNDERGROUND,,0,0.5
Green,W,139,50,0,20,UNDERGROUND,,0,0.5
Green,W,140,50,0,20,UNDERGROUND,,0,0.5
Green,W,141,50,0,20,STATION; CENTRAL; UNDERDROUND,Right,0,0.5
Green,W,142,50,0,20,UNDERGROUND,,0,0.5
Green,W,143,50,0,20,UNDERGROUND,,0,0.5
Green,X,144,50,0,20,,,0,0.5
Green,X,145,50,0,20,,,0,0.5
Green,X,146,50,0,20,,,0,0.5
Green,Y,147,50,0,20,,,0,0.5
Green,Y,148,184,0,20,,,0,0.5
Green,Y,149,40,0,20,,,0,0.5
Green,Z,150,35,0,20,,,0,0.5
40 changes: 16 additions & 24 deletions Wayside SW/Wayside_UI_Rough.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>743</width>
<width>748</width>
<height>478</height>
</rect>
</property>
Expand Down Expand Up @@ -154,15 +154,28 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="selectLine">
<widget class="QCheckBox" name="selectGreenLine">
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>Blue</string>
<string>Green</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="selectRedLine">
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>18</pointsize>
</font>
</property>
<property name="text">
<string>Red</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -282,34 +295,13 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_15">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_14">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget">
Expand Down
Loading

0 comments on commit b04a781

Please sign in to comment.