graphics/DebugDataConsumer.py
changeset 1363 e87e0166d0a7
parent 1220 16c283246241
child 1365 debc97102b23
equal deleted inserted replaced
1362:077bcba2d485 1363:e87e0166d0a7
   195         Set value IEC data type
   195         Set value IEC data type
   196         @param data_type: Value IEC data type
   196         @param data_type: Value IEC data type
   197         """
   197         """
   198         self.DataType = data_type
   198         self.DataType = data_type
   199     
   199     
   200     def NewValue(self, tick, value, forced=False, raw="BOOL"):
   200     def NewValues(self, ticks, values, forced=False, raw="BOOL"):
   201         """
   201         """
   202         Function called by debug thread when a new debug value is available
   202         Function called by debug thread when a new debug value is available
   203         @param tick: PLC tick when value was captured
   203         @param tick: PLC tick when value was captured
   204         @param value: Value captured
   204         @param value: Value captured
   205         @param forced: Forced flag, True if value is forced (default: False)
   205         @param forced: Forced flag, True if value is forced (default: False)
   206         @param raw: Data type of values not translated (default: 'BOOL')
   206         @param raw: Data type of values not translated (default: 'BOOL')
   207         """
   207         """
       
   208         tick, value = ticks[-1], values[-1]
       
   209         
   208         # Translate value to IEC literal
   210         # Translate value to IEC literal
   209         if self.DataType != raw:
   211         if self.DataType != raw:
   210             value = TYPE_TRANSLATOR.get(self.DataType, str)(value)
   212             value = TYPE_TRANSLATOR.get(self.DataType, str)(value)
   211         
   213         
   212         # Store value and forced flag when value update is inhibited
   214         # Store value and forced flag when value update is inhibited