I am trying to create a scene where I have a lamp driven by several signals.
I have created my 6 variables and have created 6 different instruments, each displaying the same lamp image. The goal is that when ANY of the signals is set to a particular value (0 or 2) the lamp will show and when ALL of the signals are set to a different value (1 or 3) the lamp should not be shown.
Showing the lamp works okay as the 6 images seem to stack perfectly. However, I cannot seem to be able to find a way to extinguish a lamp for one signal without removing it for all. E.g. if 3 signals have the fault set to 0x2 and I change one of them to 0x1, then the lamp will turn off, despite 2 signals still having value 0x2.
I originally tried an instrument with just two pictures - hoping that when the values were not in the ranges specified then the images would not show. Unfortunately this was not the case and the images were not removed when the values were out of range.
I have now tried to use an alpha channel but it seems the alpha channel is applied on top of the whole stack of all images and not just the one I am trying to hide - meaning if several fault signals are set then all lamps are removed.
Is the issue due to using the same image name with the images? Is there a cleaner way of coding up a lamp that looks at multiple signal values?
the alpha image is used to calculate the combined picture and fixed background in advance, so it is not possible to have several pictures at the same position (per default no calculation at runtime)
It think it would be necessary to calculate to final lamp status first and then display the result. Doing this calculation is not supported by the device.
For a test you could try
for eacht instrument.
It is an undocumented function that should take the currently existing background instead of the precalculated picture, but this function is not really tested.
You would need an alpha-image, set to either 0 (use current background) or 255 (use picture) for each pixel.