def main(): if not HandleCommandlineArguments(): return if not Configuration.get().ReadConfigFile(): return PrintVersion() downstreamConnInfo = Configuration.get().GetDownstreamConnection() upstreamConnInfo = Configuration.get().GetUpstreamConnection() downstreamServer = ServerUDP.ServerUDP(downstreamConnInfo,ConnectionType.DownstreamServer) upstreamServer = ServerUDP.ServerUDP(upstreamConnInfo,ConnectionType.UpstreamServer) # if None == Configuration.get().GetAutorunFilename() or 1==1: if upstreamServer.Start(): if None == downstreamConnInfo: return if None == upstreamConnInfo: return ThreadManager.GetThreadManager().CreateThread("StartupStuff",StartupWorkerProc,(downstreamServer,upstreamServer)) if not Configuration.get().GetUseGUI(): GuiMgr.Initialize(GuiMgr.UI.NONE,downstreamServer,upstreamServer) else: try: GuiMgr.Initialize(GuiMgr.UI.TKINTR,downstreamServer,upstreamServer) except Exception as Ex: print(str(Ex)) GuiMgr.Initialize(GuiMgr.UI.NONE,downstreamServer,upstreamServer) ThreadManager.GetThreadManager().StartThread("StartupStuff") GuiMgr.Start() ThreadManager.GetThreadManager().StopAllThreads()
def performBatchConvert(filematch): import os import fnmatch GuiMgr.Initialize(GuiMgr.UI.NONE,None,None) #dir_path = os.path.dirname(os.path.realpath(filematch)) convertCount = 0 rel_path,filename = os.path.split(filematch) if len(rel_path) < 1: rel_path='.' for file in os.listdir(rel_path): if fnmatch.fnmatch(file, filename): inputFilename = os.path.join(rel_path,file) if Playback.get().ReadFromFile(inputFilename): baseName,ext = os.path.splitext(inputFilename) csvFilename = baseName+".csv" Playback.get().WriteCSVFile(csvFilename,1) print("{0} --> {1}".format(inputFilename,csvFilename)) convertCount += 1 Playback.get().Clear() print("Converted {0} files".format(convertCount)) GuiMgr.Quit()
def main(): if not HandleCommandlineArguments(): return if not Configuration.get().ReadConfigFile(): return PrintVersion() downstreamConnInfo = Configuration.get().GetDownstreamConnection() upstreamConnInfo = Configuration.get().GetUpstreamConnection() downstreamServer = Server.ServerUDP(downstreamConnInfo, ConnectionType.DownstreamServer) upstreamServer = Server.ServerUDP(upstreamConnInfo, ConnectionType.UpstreamServer) proxyServer = None proxyClient = None goodToGo = True if upstreamServer.Start(): if None == downstreamConnInfo: return if None == upstreamConnInfo: return ThreadManager.GetThreadManager().CreateThread( "StartupStuff", StartupWorkerProc, (downstreamServer, upstreamServer)) if not Configuration.get().GetUseGUI(): GuiMgr.Initialize(GuiMgr.UI.NONE, downstreamServer, upstreamServer) else: try: GuiMgr.Initialize(GuiMgr.UI.TKINTR, downstreamServer, upstreamServer) except Exception as Ex: print(str(Ex)) GuiMgr.Initialize(GuiMgr.UI.NONE, downstreamServer, upstreamServer) if None != Configuration.get().GetProxyConnection(): proxyConnInfo_server = Configuration.get().GetProxyConnection() proxyServer = Server.ServerTCP( proxyConnInfo_server, ConnectionType.ProxyConnection_Server, downstreamServer, upstreamServer) if False == proxyServer.Start(): goodToGo = False elif None != Configuration.get().GetProxyServerConnection(): proxyConnInfo_Client = Configuration.get( ).GetProxyServerConnection() proxyClient = Server.ClientTCP( proxyConnInfo_Client, ConnectionType.ProxyConnection_Client, downstreamServer, upstreamServer) if False == proxyClient.Start(): goodToGo = False if True == goodToGo: ThreadManager.GetThreadManager().StartThread("StartupStuff") GuiMgr.Start() ThreadManager.GetThreadManager().StopAllThreads()