Display image based on multiple variables
Posted: Tue 21. Mar 2023, 18:15
Hello,
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.
[instrument1]
pictures=2
no_restore=0
transparency=0
name="S1"
offset=0,0
var_name="Status_1"
0="warn_lamp_on.bmp","",110,83,0,0
1="warn_lamp_on.bmp","",110,83,2,2
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.
[instrument1]
pictures=4
no_restore=0
transparency=1
name="S1"
offset=0,0
var_name="Status_1"
0="warn_lamp_on.bmp","",110,83,0,0
1="warn_lamp_on.bmp","alpha.bmp",110,83,1,1
2="warn_lamp_on.bmp","",110,83,2,2
3="warn_lamp_on.bmp","alpha.bmp",110,83,3,3
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?
Thanks
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.
[instrument1]
pictures=2
no_restore=0
transparency=0
name="S1"
offset=0,0
var_name="Status_1"
0="warn_lamp_on.bmp","",110,83,0,0
1="warn_lamp_on.bmp","",110,83,2,2
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.
[instrument1]
pictures=4
no_restore=0
transparency=1
name="S1"
offset=0,0
var_name="Status_1"
0="warn_lamp_on.bmp","",110,83,0,0
1="warn_lamp_on.bmp","alpha.bmp",110,83,1,1
2="warn_lamp_on.bmp","",110,83,2,2
3="warn_lamp_on.bmp","alpha.bmp",110,83,3,3
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?
Thanks