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 #133

Merged
merged 9 commits into from
Mar 25, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
clock plus train controller UI added
  • Loading branch information
tav38 committed Mar 24, 2024
commit 7cb5a7c68b1c996399922827528aa0b73f3f7650
Binary file modified Train_Model/__pycache__/clock_test.cpython-312.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions Train_Model/app_trainmodel_ui.py
Original file line number Diff line number Diff line change
@@ -558,5 +558,10 @@ def display_announcement(self):
window.show()
window_tb.show()

# Define the path to the mainControl.py file
main_control_path = "Train Controller SW/mainControl.py"

# Run mainControl.py as a separate process
subprocess.Popen(["python", main_control_path])

sys.exit(app.exec_())
49 changes: 3 additions & 46 deletions Train_Model/clock_test.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import sys
from PyQt5 import QtCore


#Fixing file hierarchy issues
# Fixing file hierarchy issues
import os
import re

project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(project_root)

import CTC
from CTC.CTC_UI import *
from CTC.CTC_Testbench import *


class Clock(QtCore.QObject):
# Define a signal to emit the current time
@@ -34,44 +32,3 @@ def update_time(self):

# Start the main event loop
sys.exit(app.exec_())


def clock():
global time
time = time.addSecs(60)

current_time = time.toString("hh:mm")
CTCwindow.displayClock(current_time)

UI_window = QtWidgets.QApplication(sys.argv)

"""CTC"""
#CTC UI connection
global CTCwindow
CTCwindow = CTC_UI()
CTCwindow.show()
#CTC Testbench connection
global CTC_tb
CTC_tb = CTC_Testbench()
CTC_tb.show()

#CTC Input Signals
CTC_tb.sendOccupiedBlocks.connect(CTCwindow.updateOccupiedBlocks)
CTC_tb.sendTicketSales.connect(CTCwindow.updateTicketSales)
#CTC Output Signals
CTCwindow.sendDispatchInfo.connect(CTC_tb.showDispatchInfo)




"""Clock"""
#Initializing Qtimer for clock
timer0 = QtCore.QTimer()
time = QtCore.QTime(0, 0, 0) #Hours, Minutes, Second
timer0.setInterval(100) #Interval in ms
timer0.timeout.connect(clock)
timer0.start()



sys.exit(UI_window.exec_())