#!/usr/bin/python ################################################################# # # Handles the communication between the driver _VMEmodule.so, # the user interface (PythonShell.py) and TCP/IP (CommSocket.py) # # Michael Rissi 06/2009 # ################################################################# import _VME import threading #import CommSocket import PythonShell import CommSocket #mport CommServer import GlobalVariables import CommunicateWithVME import ReadTemperatures import time #connecting to the crates: print "\n\n\n" print " ####################################" print " # #" print " # Trigger Control Program #" print " # M. Rissi 2009 #" print " # #" print " ####################################" print "\n\n\n" print "connecting to the crates..." _VME.VME_Open() _VME.V560_Open() #_VME.V560_Print_Info() _VME.V812_Open() # clear the v560 scales: _VME.V560_Clear_Scales(1) GlobalVariables.UserInput = '' #print "start the shell... " inputShell= PythonShell.InputShell() #inputShell.daemon=True inputShell.start() # start the server: #print "start the server... " commServer = CommSocket.CommServer(3492,5) commServer.start() #print "start the parser..." parseUserInput= CommunicateWithVME.ParseUserInput() parseUserInput.start() #print "listening to Arduino..." readTemperatures = ReadTemperatures.ReadTemperatures() readTemperatures.start() while(GlobalVariables.UserInput[1:]!="exit" and GlobalVariables.UserInput[1:] != "EXIT"): time.sleep(0.1) #do something # dummy=1 _VME.V812_Close() _VME.V560_Close() _VME.VME_Close()