@@ -62,11 +62,9 @@ def __call__(self, *args, **kwargs):
62
62
else :
63
63
commandArgument = args [0 ]
64
64
try :
65
- # logging.getLogger("HWR").info("Tine command %s sent" % self.commandName)
66
65
ret = tine .set (
67
66
self .tineName , self .commandName , commandArgument , self .timeout
68
67
)
69
- # logging.getLogger("HWR").info("Tine command %s reply arrived" % self.commandName)
70
68
self .emit ("commandReplyArrived" , (ret , str (self .name ())))
71
69
except IOError as strerror :
72
70
logging .getLogger ("user_level_log" ).exception ("TINE: %s" % strerror )
@@ -122,9 +120,6 @@ class TineChannel(ChannelObject):
122
120
attach = {"timer" : tine .attach , "event" : tine .notify , "datachange" : tine .update }
123
121
124
122
updates = queue .Queue ()
125
- # updates_emitter = QtCore.QTimer()
126
- # QtCore.QObject.connect(updates_emitter, QtCore.SIGNAL('timeout()'), emitTineChannelUpdates)
127
- # updates_emitter.start(20)
128
123
updates_emitter = gevent .spawn (do_tine_channel_update , 0.1 )
129
124
130
125
def __init__ (
@@ -167,10 +162,6 @@ def __init__(
167
162
self .linkid = TineChannel .attach [kwargs .get ("attach" , "timer" )](
168
163
self .tineName , self .attributeName , self .tineEventCallback , self .timeout
169
164
)
170
- # except IOError as strerror:
171
- # logging.getLogger("HWR").error("%s" %strerror)
172
- # except ValueError:
173
- # logging.getLogger("HWR").error("TINE attach object is not callable")
174
165
175
166
if self .linkid > 0 and kwargs .get ("attach" , "timer" ) == "datachange" :
176
167
tolerance = kwargs .get ("tolerance" , 0.0 )
@@ -180,9 +171,6 @@ def __init__(
180
171
if tolerance != 0.0 :
181
172
tine .tolerance (self .linkid , float (tolerance ), 0.0 )
182
173
183
- # TODO Remove this sleep. Tine lib bug when after attach directly get is called
184
- # time.sleep(0.025)
185
-
186
174
atexit .register (self .__del__ )
187
175
188
176
def __del__ (self ):
@@ -232,9 +220,6 @@ def tineEventCallback(self, id, cc, data_list):
232
220
"""
233
221
234
222
def update (self , value = None ):
235
- # if self.tineName.split("/")[2] == 'ics':
236
- # print '>>>>>>>>>>>>>>>>>>', self.attributeName, value, self.value, self.oldvalue
237
-
238
223
if value is None :
239
224
logging .getLogger ("HWR" ).warning (
240
225
"Update with value None on: %s %s" % (self .tineName , self .attributeName )
@@ -245,14 +230,8 @@ def update(self, value=None):
245
230
if value != self .oldvalue :
246
231
TineChannel .updates .put ((weakref .ref (self ), value ))
247
232
self .oldvalue = value
248
- # if self.tineName == "/P14/BCUIntensity/Device0":
249
- # logging.getLogger("HWR").debug('----------------- %s %s' %(self.attributeName,self.value))
250
233
251
234
def get_value (self , force = False ):
252
- # logging.getLogger("HWR").debug('TINE channel %s, %s get at val=%s'%(self.tineName,self.attributeName,self.value))
253
- # if self.tineName == "/P14/BCUIntensity/Device0":
254
- # print self.attributeName, self.value
255
-
256
235
# GB: if forced while having a value already, i.e. well after connecting a channel, do a real synchronous get and return
257
236
if force :
258
237
if self .value is not None :
@@ -279,7 +258,6 @@ def get_value(self, force=False):
279
258
# but now tine lib should be standing the get, so we try....
280
259
281
260
self .value = self ._synchronous_get ()
282
- # time.sleep(0.02)
283
261
_counter += 1
284
262
if self .value is None :
285
263
logging .getLogger ("HWR" ).warning (
0 commit comments