graphics/DebugDataConsumer.py
changeset 1365 debc97102b23
parent 1363 e87e0166d0a7
child 1571 486f94a8032c
equal deleted inserted replaced
1364:e9e17d3b2849 1365:debc97102b23
   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 NewValues(self, ticks, values, forced=False, raw="BOOL"):
   200     def NewValues(self, tick, values, 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]
   208         value, forced = values
   209         
   209         
   210         # Translate value to IEC literal
   210         # Translate value to IEC literal
   211         if self.DataType != raw:
   211         if self.DataType != raw:
   212             value = TYPE_TRANSLATOR.get(self.DataType, str)(value)
   212             value = TYPE_TRANSLATOR.get(self.DataType, str)(value)
   213         
   213