Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tanvi's branch #130

Merged
merged 3 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified CTC/__pycache__/CTC_Maintenance.cpython-312.pyc
Binary file not shown.
Binary file modified CTC/__pycache__/CTC_Testbench.cpython-312.pyc
Binary file not shown.
Binary file modified CTC/__pycache__/CTC_UI.cpython-312.pyc
Binary file not shown.
Binary file modified CTC/__pycache__/OccupiedBlocks.cpython-312.pyc
Binary file not shown.
Binary file modified CTC/__pycache__/Schedule.cpython-312.pyc
Binary file not shown.
Binary file modified CTC/__pycache__/TempData.cpython-312.pyc
Binary file not shown.
Binary file modified CTC/__pycache__/Throughput.cpython-312.pyc
Binary file not shown.
Binary file modified PLC_Files/__pycache__/Parser.cpython-312.pyc
Binary file not shown.
Binary file modified PLC_Files/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified Track_Model/__pycache__/TrackModel.cpython-312.pyc
Binary file not shown.
Binary file modified Track_Resources/__pycache__/Block.cpython-312.pyc
Binary file not shown.
Binary file modified Track_Resources/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
30 changes: 18 additions & 12 deletions Train_Model/TrainModel_UI.ui
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,15 @@ font: 75 12pt &quot;Times New Roman&quot;;</string>
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
<pointsize>12</pointsize>
<weight>9</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(192, 192, 192);</string>
<string notr="true">background-color: rgb(192, 192, 192);
font: 75 12pt &quot;Times New Roman&quot;;</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
Expand Down Expand Up @@ -659,13 +661,15 @@ font: 75 12pt &quot;Times New Roman&quot;;</string>
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
<pointsize>10</pointsize>
<weight>9</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(192, 192, 192);</string>
<string notr="true">background-color: rgb(192, 192, 192);
font: 75 10pt &quot;Times New Roman&quot;;</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
Expand All @@ -680,13 +684,15 @@ font: 75 12pt &quot;Times New Roman&quot;;</string>
<property name="font">
<font>
<family>Times New Roman</family>
<pointsize>9</pointsize>
<weight>75</weight>
<bold>true</bold>
<pointsize>10</pointsize>
<weight>9</weight>
<italic>false</italic>
<bold>false</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(192, 192, 192);</string>
<string notr="true">background-color: rgb(192, 192, 192);
font: 75 10pt &quot;Times New Roman&quot;;</string>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
Expand Down
109 changes: 16 additions & 93 deletions Train_Model/TrainModel_testbench.ui
Original file line number Diff line number Diff line change
Expand Up @@ -761,30 +761,15 @@
<property name="title">
<string/>
</property>
<widget class="QWidget" name="horizontalLayoutWidget">
<widget class="QLineEdit" name="int_lights_input_tb">
<property name="geometry">
<rect>
<x>0</x>
<y>-5</y>
<width>281</width>
<height>21</height>
<y>0</y>
<width>362</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="int_lights_input_tb">
<property name="text">
<string>OFF</string>
</property>
<property name="autoRepeat">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
Expand All @@ -808,41 +793,6 @@
</property>
</widget>
</item>
<item row="18" column="1">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string/>
</property>
<widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry">
<rect>
<x>0</x>
<y>-5</y>
<width>281</width>
<height>21</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="ext_lights_input_tb">
<property name="text">
<string>OFF</string>
</property>
<property name="autoRepeat">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
<property name="tristate">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item row="19" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
Expand Down Expand Up @@ -1085,30 +1035,15 @@
<property name="title">
<string/>
</property>
<widget class="QWidget" name="horizontalLayoutWidget_3">
<widget class="QLineEdit" name="right_doors_input_tb">
<property name="geometry">
<rect>
<x>0</x>
<y>-5</y>
<width>281</width>
<height>20</height>
<y>0</y>
<width>362</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="right_doors_input_tb">
<property name="text">
<string>OPEN</string>
</property>
<property name="autoRepeat">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
Expand All @@ -1117,30 +1052,15 @@
<property name="title">
<string/>
</property>
<widget class="QWidget" name="horizontalLayoutWidget_4">
<widget class="QLineEdit" name="left_doors_input_tb">
<property name="geometry">
<rect>
<x>-1</x>
<y>-5</y>
<width>281</width>
<height>21</height>
<x>0</x>
<y>0</y>
<width>362</width>
<height>19</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="left_doors_input_tb">
<property name="text">
<string>OPEN</string>
</property>
<property name="autoRepeat">
<bool>false</bool>
</property>
<property name="autoExclusive">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
Expand All @@ -1167,6 +1087,9 @@
<item row="4" column="1">
<widget class="QLineEdit" name="commanded_speed_input_tb"/>
</item>
<item row="18" column="1">
<widget class="QLineEdit" name="ext_lights_input_tb"/>
</item>
</layout>
</widget>
<widget class="QLabel" name="label">
Expand Down
88 changes: 64 additions & 24 deletions Train_Model/app_trainmodel_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MyMainWindow(QMainWindow):

def __init__(self):
super().__init__()
uic.loadUi("Train Model/TrainModel_UI.ui", self)
uic.loadUi("Train_Model/TrainModel_UI.ui", self)
self.Calculate_acceleration()
self.calculate_force()
self.get_acceleration()
Expand Down Expand Up @@ -232,20 +232,53 @@ def engine_fail_tb(self,state):
self.en_fail_enable.setStyleSheet('')
self.en_fail_disable.setStyleSheet('background-color: rgb(38, 207, 4);')

def int_lights_tb(self,state):
message=state
if state:
#SETTING INTERIOR LIGHTS TO ON/DIM/OFF STATUS
def interior_lights(self,state):
if state==0:
self.int_lights_value.setFixedSize(109, 98)
# self.int_lights_value.setFont("Times New Roman",9)
self.int_lights_value.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
self.int_lights_value.setText(state)
self.int_lights_value.setText('OFF')

else :
elif state==1:
self.int_lights_value.setFixedSize(109, 98)
self.int_lights_value.setText(state)
self.int_lights_value.setText('ON')
elif state==2:
self.int_lights_value.setFixedSize(109, 98)
self.int_lights_value.setText('DIM')

#SETTING EXTERIOR LIGHTS TO ON/DIM/OFF STATUS
def exterior_lights(self,state):
if state==0:
self.ext_lights_value.setFixedSize(109, 97)
self.ext_lights_value.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
self.ext_lights_value.setText('OFF')

elif state==1:
self.ext_lights_value.setFixedSize(109, 97)
self.ext_lights_value.setText('ON')

#SETTING RIGHT DOORS
def right_doors(self,state):
if state==0:
self.right_doors_value.setFixedSize(109, 98)
self.right_doors_value.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
self.right_doors_value.setText('CLOSED')

elif state==1:
self.right_doors_value.setFixedSize(109, 98)
self.right_doors_value.setText('OPEN')

#SETTING LEFT DOORS
def left_doors(self,state):
if state==0:
self.left_doors_value.setFixedSize(109, 97)
self.left_doors_value.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
self.left_doors_value.setText('CLOSED')

elif state==1:
self.left_doors_value.setFixedSize(109, 97)
self.left_doors_value.setText('OPEN')




Expand All @@ -270,14 +303,14 @@ class trainmodel_testbench(QMainWindow):
engine_fail_input_signal=qtc.pyqtSignal(int)
right_doors_input_signal=qtc.pyqtSignal(int)
left_doors_input_signal=qtc.pyqtSignal(int)
int_lights_input_signal=qtc.pyqtSignal(str)
int_lights_input_signal=qtc.pyqtSignal(int)
ext_lights_input_signal=qtc.pyqtSignal(int)
cabin_temp_input_signal=qtc.pyqtSignal(str)


def __init__(self):
super().__init__()
uic.loadUi("Train Model/TrainModel_testbench.ui", self)
uic.loadUi("Train_Model/TrainModel_testbench.ui", self)
self.train_sel_combo_tb.activated[str].connect(self.get_train_selection)

self.power_input_tb.returnPressed.connect(self.receive_power)
Expand Down Expand Up @@ -318,31 +351,32 @@ def __init__(self):
self.cabin_temp_input_tb.returnPressed.connect(self.get_cabin_temp)
self.cabin_temp_input_tb.returnPressed.connect(self.display_cabin_temp)

self.int_lights_input_tb.stateChanged.connect(self.interior_lights)
self.int_lights_input_tb.returnPressed.connect(self.interior_lights_tb)

self.ext_lights_input_tb.stateChanged.connect(self.exterior_lights)
self.ext_lights_input_tb.returnPressed.connect(self.exterior_lights_tb)

self.right_doors_input_tb.stateChanged.connect(self.right_doors)
self.right_doors_input_tb.returnPressed.connect(self.right_doors_tb)

self.left_doors_input_tb.stateChanged.connect(self.left_doors)
self.left_doors_input_tb.returnPressed.connect(self.left_doors_tb)



def interior_lights(self,state):
if state:
self.int_lights_input_signal.emit("OFF")
else:
self.int_lights_input_signal.emit("ON")
def interior_lights_tb(self):
state=int(self.int_lights_input_tb.text())
self.int_lights_input_signal.emit(state)


def exterior_lights(self,state):
def exterior_lights_tb(self):
state=int(self.ext_lights_input_tb.text())
self.ext_lights_input_signal.emit(state)


def right_doors(self,state):
def right_doors_tb(self):
state=int(self.right_doors_input_tb.text())
self.right_doors_input_signal.emit(state)

def left_doors(self,state):
def left_doors_tb(self):
state=int(self.left_doors_input_tb.text())
self.left_doors_input_signal.emit(state)


Expand Down Expand Up @@ -500,8 +534,14 @@ def display_announcement(self):
window_tb.engine_fail_input_signal.connect(window.engine_fail_tb)
#cabin_temp
window_tb.cabin_temp_input_signal.connect(window.set_cabin_temp)
#interior_light
window_tb.int_lights_input_signal.connect(window.int_lights_tb)
#interior_lights
window_tb.int_lights_input_signal.connect(window.interior_lights)
#exterior_lights
window_tb.ext_lights_input_signal.connect(window.exterior_lights)
#right_doors
window_tb.right_doors_input_signal.connect(window.right_doors)
#left_doors
window_tb.left_doors_input_signal.connect(window.left_doors)

window.show()
window_tb.show()
Expand Down
Binary file modified Wayside_SW/__pycache__/WaysideSWandTB.cpython-312.pyc
Binary file not shown.
Binary file modified __pycache__/Main_UI.cpython-312.pyc
Binary file not shown.