Skip to content

Commit

Permalink
Add temperature in characteristic points label
Browse files Browse the repository at this point in the history
ESS-1095
  • Loading branch information
riccardomarotti committed Jun 1, 2016
1 parent e5fcd7e commit d432aae
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions misura/client/plugin/ShapesPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ def __init__(self, sample=None, temp=True, time=True, text='$shape$'):
"""Make list of fields."""
#\\\\%(xlabel)s=%(x)i
self.fields = [
FieldMisuraNavigator(
"sample", descr="Target sample:", depth='sample', default=sample),
FieldMisuraNavigator("sample",
descr="Target sample:",
depth='sample',
default=sample),
plugins.FieldText('text', 'Label text', default=text),
plugins.FieldCombo('characteristic_shape_standard',
descr='Standard',
Expand Down Expand Up @@ -101,10 +103,11 @@ def apply(self, cmd, fields):
required_sample_shapes = filter(lambda item: required_shapes_filter(item[0]), sample_shapes)

for shape, opt in required_sample_shapes:
txt = str(fields['text']).replace('$shape$', remove_prefix(shape))
pt = opt['current']
t = pt['time']
T = pt['temp']
shape_name = str(fields['text']).replace('$shape$', remove_prefix(shape))
txt = u'%s - %s °C' % (shape_name, pt['temp'])
if t in [0, None, 'None'] or T in [0, None, 'None']:
logging.debug('%s %s', 'Shape not found:', shape)
continue
Expand Down

0 comments on commit d432aae

Please sign in to comment.