Skip to content

Commit 504e084

Browse files
authored
Merge pull request #997 from jbellister-slac/labels
FIX: Don't send the local value of the table's column headers back to the data plugin
2 parents 1a0a0c9 + adbc437 commit 504e084

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pydm/widgets/nt_table.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def value_changed(self, data=None):
250250
labels = list(labels)
251251

252252
try:
253-
values = list(zip(*[v for k, v in data.items()]))
253+
values = list(zip(*[v for k, v in data.items() if k != 'labels']))
254254
except TypeError:
255255
logger.exception("NTTable value items must be iterables.")
256256

@@ -296,9 +296,11 @@ def send_table(self, row, column, value):
296296
else:
297297
self.value[self._table_labels[column]][row] = value
298298

299+
value_to_send = {k: v for k, v in self.value.items() if k != 'labels'}
300+
299301
# dictionary needs to be wrapped in another dictionary with a key 'value'
300302
# to be passed back to the p4p plugin.
301-
emit_dict = {'value': self.value}
303+
emit_dict = {'value': value_to_send}
302304

303305
self.send_value_signal[dict].emit(emit_dict)
304-
return True
306+
return True

0 commit comments

Comments
 (0)