forked from zietzm/Helmholtz_Test_Bench
29 lines
827 B
Python
29 lines
827 B
Python
import User_Interface as ui
|
|
import cage_func as func
|
|
import traceback
|
|
import settings as g
|
|
|
|
try: # start normal operations
|
|
# Connect to Arduino:
|
|
g.ARDUINO = func.ArduinoCtrl(g.RELAY_PINS)
|
|
|
|
print("Connecting to PSUs...")
|
|
func.setup_axes() # initiate communication, set handles
|
|
|
|
print("\nOpening User Interface...")
|
|
'''g.TestValuesX = ui.TestValues()
|
|
g.TestValuesY = ui.TestValues()
|
|
#g.TestValuesZ = ui.TestValues()
|
|
g.TestValues = [g.TestValuesX, g.TestValuesY]#, g.TestValuesZ]'''
|
|
|
|
application = ui.HelmholtzGUI()
|
|
application.mainloop()
|
|
|
|
except BaseException as e: # if there is an error, print what happened
|
|
print("\nAn error occurred, Shutting down.")
|
|
print(e)
|
|
print(traceback.print_exc())
|
|
|
|
finally: # safely shut everything down at the end
|
|
func.shut_down_all()
|