Hi Tony,
Yes I hadn’t decided which event I wanted to use yet so I put both in the with the intent of cleaning up the code and adding comments when I got it working the way I want.
Controlling Panel Visibility with Device Switch
-
- Posts: 60
- Joined: Tue Nov 20, 2018 9:34 pm
Re: Controlling Panel Visibility with Device Switch
A bit more verbose code but probably easier to understand.
No need for two ifs.
No need for the avionics subscribe either, as Tony said since you don’t use it.
Jacques
No need for two ifs.
No need for the avionics subscribe either, as Tony said since you don’t use it.
Code: Select all
img_mask = img_add_fullscreen("mask.png")
function new_data_fsx (Battery,Avionics)
if Battery == true then
visible(img_mask, false)
else
visible(img_mask, true)
end
end — missing end to close the function added
fsx_variable_subscribe("ELECTRICAL MASTER BATTERY", "Bool",
"CIRCUIT AVIONICS ON", "Bool",
new_data_fsx)
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
-
- Posts: 60
- Joined: Tue Nov 20, 2018 9:34 pm
Re: Controlling Panel Visibility with Device Switch
Here is my result:
As a thank you, I've uploaded the instrument to the store, as "Generic Panel Dimmer." My first instrument!
I also took what I learned and customized my Digital OAT instrument to turn the LED panel on/off with the battery.
Thanks every for the help!
Dave
Does exactly what I wanted to do!img_mask = img_add_fullscreen("mask.png")
function new_data_fsx (Battery)
visible(img_mask, not Battery)
end
fsx_variable_subscribe("ELECTRICAL MASTER BATTERY", "Bool", new_data_fsx)
As a thank you, I've uploaded the instrument to the store, as "Generic Panel Dimmer." My first instrument!
I also took what I learned and customized my Digital OAT instrument to turn the LED panel on/off with the battery.
Thanks every for the help!
Dave
Re: Controlling Panel Visibility with Device Switch
Glad you got what you wanted. Be best to post the .siff file here if you want to share as this is not really an instrument and it’s specific to your application. Not really for the store.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Controlling Panel Visibility with Device Switch
Glad to know that you achieved what you wanted.
I understand that the panel with holes and recess is a Cessna original one?
Nice result!
Jacques
I understand that the panel with holes and recess is a Cessna original one?
Nice result!
Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
Re: Controlling Panel Visibility with Device Switch
Agreed, Looks superb. The actual facia does appear to be original with 3D printed bezels. Amazing result.
It would make a REALLY nice project for a CNC router with 12mm MDF and 'crinkle' finish paint also. Really gives me some ideas.
Beautiful work.
Joe
Joe. CISSP, MSc.
-
- Posts: 60
- Joined: Tue Nov 20, 2018 9:34 pm
Re: Controlling Panel Visibility with Device Switch
Crinkle finish! Stop giving me ideas! I have to stop building and start learning more than the basics.
Yes, its a real Cesssna 182RG panel, as is the sweet trim below the switch panel with the breakers. That was a great EBay find. I embraced the worn look of the real panels, it gave me permission to make mistakes and changes, without worrying about wrecking something pristine.
Thanks for all the feedback and kind words!
Yes, its a real Cesssna 182RG panel, as is the sweet trim below the switch panel with the breakers. That was a great EBay find. I embraced the worn look of the real panels, it gave me permission to make mistakes and changes, without worrying about wrecking something pristine.
Thanks for all the feedback and kind words!