I have a table that lists out a sequence of steps the PLC is going through. I want to highlight the current step that is being run and to grey out the previous steps and right now I have a custom property on my table that is bound to the PLC tag that says what step it is on like this
and in my configureCell I have the following script -
try:
curStep = self.currentSequenceStep - 1
if rowIndex < curStep:
return {'background':'grey'}
elif rowIndex == curStep:
return {'background':'green'}
else:
return {'background':'white'}
except TypeError:
# Occurs sometimes on initial loading before tag is found so this is just to
# keep the console from getting flooded with useless errors
pass
It would be nice IMO if the extension function documentation
Provides a chance to configure the contents of each cell. Return a
dictionary of name-value pairs with the desired attributes. Available
attributes include: 'background', 'border', 'font', 'foreground',
'horizontalAlignment', 'iconPath', 'text', 'toolTipText',
'verticalAlignment'
said what it was that made it trigger and run this. I know a data property change seems to consistently trigger it but not sure what else.
The behavior I am experiencing now is that the step will increment, but the table does not seem to reflect the changes until the user clicks on the table and then it is up to date (and even then sometimes it requires multiple clicks for some reason).
I am wondering if there is a different way to set this up, of if there’s a way I can leverage a prop change on my custom property that would be like
if event.propertyName == 'currentSequenceStep':
# Tell table to configureCells again
I am using 8.1.3 if that matters.