Revision 041c3638

View differences:

client/python/hlrc_client/MiddlewareRSB.py
98 98
        rsb_em.emotion = self.convert_emotiontype_to_rsbval(emotion.value)
99 99
        rsb_em.duration = int(emotion.time_ms)
100 100

  
101
        with rsb.createRemoteServer(self.base_scope + '/HeadAnimationset') as server:
102
            self.logger.debug("calling the emotion rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
103

  
104
            if (blocking):
105
                #blocking rpc call:
106
                #if (em_type == EmotionExpression.TYPE_DEFAULT):
107
                #    result = server.defaultEmotion(rsb_em)
108
                #else:
109
                result = server.emotion(rsb_em)
110
                self.logger.debug("server reply: '%s'" % result)
111
            else:
112
                #if (em_type == EmotionExpression.TYPE_DEFAULT):
113
                #    future = server.defaultEmotion.async(rsb_em)
114
                #else:
115
                future = server.emotion.async(rsb_em)
116
                self.logger.debug("server reply: '%s'" % future)
117
                #we could block here for a incoming result with a timeout in s
118
                #print '> server reply: "%s"' % future.get(timeout = 10);
119
            self.logger.debug("emotion rpc done")
101
        # with rsb.createRemoteServer(self.base_scope + '/HeadAnimationset') as server:
102
        self.logger.debug("calling the emotion rpc (%s)..." % ("BLOCKING" if blocking else "NON-BLOCKING"))
103

  
104
        if (blocking):
105
            #blocking rpc call:
106
            #if (em_type == EmotionExpression.TYPE_DEFAULT):
107
            #    result = server.defaultEmotion(rsb_em)
108
            #else:
109
            result = self.server.emotion(rsb_em)
110
            self.logger.debug("server reply: '%s'" % result)
111
        else:
112
            #if (em_type == EmotionExpression.TYPE_DEFAULT):
113
            #    future = server.defaultEmotion.async(rsb_em)
114
            #else:
115
            future = self.server.emotion.async(rsb_em)
116
            self.logger.debug("server reply: '%s'" % future)
117
            #we could block here for a incoming result with a timeout in s
118
            #print '> server reply: "%s"' % future.get(timeout = 10);
119
        self.logger.debug("emotion rpc done")
120 120

  
121 121
    def publish_head_animation(self, animation, blocking):
122 122
        """publish an head HeadAnimation via mw

Also available in: Unified diff