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

Trck model train model integration #155

Merged
merged 3 commits into from
Mar 27, 2024
Merged
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
17 changes: 13 additions & 4 deletions MainSimulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def clock():
for train in MainWindow.currentTrains:
train.update_time(time)

def updateClockSpeed():
#MainWindow.horizontalSlider.
print("temp")
#timer0.setInterval(1000)

#Starting PyQt application
UI_window = QtWidgets.QApplication(sys.argv)

Expand Down Expand Up @@ -86,12 +91,16 @@ def clock():

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

QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling)

#Initializing Time Slider
MainWindow.horizontalSlider.SliderRealeased(updateClockSpeed)


sys.exit(UI_window.exec_())