Exemplo n.º 1
0
    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')
Exemplo n.º 2
0
    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')
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
    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')
Exemplo n.º 5
0
 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\"')
Exemplo n.º 6
0
 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\"')
Exemplo n.º 7
0
 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\"')
Exemplo n.º 8
0
 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\"')
Exemplo n.º 9
0
 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]))
Exemplo n.º 10
0
 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]))
Exemplo n.º 11
0
    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)
Exemplo n.º 12
0
    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)
Exemplo n.º 13
0
 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\"')
Exemplo n.º 14
0
 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\"')
Exemplo n.º 15
0
 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\"')
Exemplo n.º 16
0
 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\"')
Exemplo n.º 17
0
 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\"')
Exemplo n.º 18
0
 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\"')
Exemplo n.º 19
0
 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\"')
Exemplo n.º 20
0
 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\"')
Exemplo n.º 21
0
    # 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:
Exemplo n.º 22
0
 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\"')
Exemplo n.º 23
0
    # 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:
Exemplo n.º 24
0
 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')
Exemplo n.º 25
0
 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\"')