def open(self): try: self.__ch = stackless.channel() except : raise cxError(1,'cxChannel',u'stackless.channel() is failed',\ 'check whether stackless is imported or not') try: stackless.tasklet(self.__on_received)() except : raise cxError(2,'cxChannel',u'stackless.tasklet() is failed',\ 'check whether cxChannel::__on_received function is existed or not')
def __init__(self,com_cp_str): try : self.__received_evt_ch = cxChannel() except cxError as e : raise e except : raise cxError(0xFFFFFFFF,'general','unknown error','') try : self.com_cp = DispatchWithEvents( com_cp_str,\ cxCybosBaseWithEvent.cxEvent ) except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check whether cybos plus running or not')
def __init__(self,com_cp_str): self.com_cp = None try: self.com_cp = Dispatch(com_cp_str) except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check whether cybos plus running or not')
def Unsubscribe(self): self.__b_received = False if self.com_cp != None: try: self.com_cp.Unsubscribe() except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check the connection and support of this method \"Unsubscribe\"')
def Request(self): self.__b_received = False if self.com_cp != None: try: return self.com_cp.Request() except pythoncom.com_error, (hr, msg, exc, arg) : print common.UNI(msg) raise cxError(hr,'COM',msg,'check the connection and support of this method \"Request\"')
def Request(self): self.__b_received = False if self.com_cp != None: try: return self.com_cp.Request() except pythoncom.com_error, (hr, msg, exc, arg) : print msg raise cxError(hr,'COM',msg,'check the connection and support of this method \"Request\"')
def BlockRequest(self): if self.com_cp != None: try: return self.com_cp.BlockRequest() except pythoncom.com_error, (hr, msg, exc, arg) : #print 'exc', exc #print 'exc[2]', exc[2] #print 'arg', arg raise cxError(hr,'COM',msg,'\"BlockRequest\":%s'%(exc[2]))
def open(self, handler): if self.__received_evt_ch != None: try: self.__received_evt_ch.open() except cxError as e : raise e except : raise cxError(0xFFFFFFFF,'general','unknown error','') self.__received_evt_ch.set_event_handler(handler) self.com_cp.set_event_channel(self.__received_evt_ch)
def Subscribe(self): if self.com_cp != None: try: self.com_cp.Subscribe() except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check the connection and support of this method \"Subscribe\"')
def Data(self): if self.com_cp != None: try: return self.com_cp.Data except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check the connection and suppor tof this property \"Data\"')
def GetDataValue(self,Type,index): if self.com_cp != None: try: return self.com_cp.GetDataValue(Type,index) except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check the connection and support of this method \"GetDataValue\"')
def GetDibMsg1(self): if self.com_cp != None: try: return self.com_cp.GetDibMsg1() except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check the connection and support of this method \"GetDibMsg1\"')
def BlockRequest2(self,option): if self.com_cp != None: try: return self.com_cp.BlockRequest2(option) except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check the connection and support of this method \"BlockRequest2\"')
# Parameter Input Methods... def SetInputValue(self,Type,value): if self.com_cp != None: self.com_cp.SetInputValue(Type,value) # Data Requesting Methods... def Subscribe(self): if self.com_cp != None: try: self.com_cp.Subscribe() except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check the connection and support of this method \"Subscribe\"') else : raise cxError(10,'cxCybosBaseWithEvent','com_cp is None','') def Unsubscribe(self): self.__b_received = False if self.com_cp != None: try: self.com_cp.Unsubscribe() except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check the connection and support of this method \"Unsubscribe\"') else : raise cxError(10,'cxCybosBaseWithEvent','com_cp is None','') def Request(self): self.__b_received = False if self.com_cp != None: try:
def __init__(self,com_cp_str): try: self.com_cp = Dispatch(com_cp_str) except pythoncom.com_error, (hr, msg, exc, arg) : raise cxError(hr,'COM',msg,'check whether cybos plus running or not')