コード例 #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')
コード例 #2
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
    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')
コード例 #3
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
    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')
コード例 #4
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
    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')
コード例 #5
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
 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\"')
コード例 #6
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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\"')
コード例 #7
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
 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\"')
コード例 #8
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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\"')
コード例 #9
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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]))
コード例 #10
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
 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]))
コード例 #11
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
    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)
コード例 #12
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
    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)
コード例 #13
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
 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\"')
コード例 #14
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
 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\"')
コード例 #15
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
 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\"')
コード例 #16
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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\"')
コード例 #17
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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\"')
コード例 #18
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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\"')
コード例 #19
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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\"')
コード例 #20
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
 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\"')
コード例 #21
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
    # 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:
コード例 #22
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
 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\"')
コード例 #23
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/snowball
    # 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:
コード例 #24
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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')
コード例 #25
0
ファイル: cxCybosBase.py プロジェクト: ClarkOh/MyWork
 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\"')