def COMPortChoosen(self, event): for item in self.COMmenu.GetMenuItems(): if item.IsChecked(): #print str(item.GetId()); FullPortName = self.ports[item.GetId()]; print FullPortName; PondPort = FullPortName[FullPortName.index('M')+1:len(FullPortName)-1]; print PondPort; a_pond.start(int(PondPort));
def Pond_ManualStart_Button_Click(self,event): global GetTempThreadPause, GetTempThreadStop, ThreadCompletyStop, GetInfoThread_Done; #have to define GetTempThreadPause to be a global variable so it can be passed to GetTempThread func GetTempThreadPause = False; GetTempThreadStop = False; ThreadCompletyStop = False; GetInfoThread_Done = False; retries = 3; self.Log += "Connecting, please be patience.... \n"; self.Log_Text.SetValue(self.Log); a_pond.pondPort = int(self.InputCOMPort_Text.GetValue()); for retry in range(retries): temp = a_pond.start(); print temp if (temp==1): print temp; self.Pond_Start_Button.Disable(); #Disable auto start self.Pond_GoToTemp_Button.Enable(); self.Pond_StartCycle_Button.Enable(); self.Pond_SaveSetting_Button.Enable(); self.ManualStart_Button_Status = "Disconnect COM"; self.ManualStart_Button_StatusCheck(); GetInfoThreadStart(self); GetTempThreadStart(self); return; else: print "Can not connect" + str(temp); Status = "Can not connect"; self.Log += Status; self.Log_Text.SetValue(self.Log); self.ManualStart_Button_Status = "Connect to COM"; self.ManualStart_Button_StatusCheck();