MFD Innitializing Boot Up Screen, How?

#1
Hey guys,

I am building a set of Garmin 900x's, PFD and MFD. I wish to make a bootup screen (System Innitializing) that shows up when you power up the Garmins. I was wondering if you might know what the code would be? Is there such a code as for booting up a gauge?


Many thanks,

Bill
LHC
 

n4gix

Resource contributor
#2
Bill, developing any code requires you to first, break down the task into logical steps. In the "dark ages," this was known as "flow charting" the logic, something few remember... ;)

This is for my SA4550 EADI in FS9 syntax. You can easily translate it to FSX syntax if needed:

Code:
// Reset variables when power is OFF
// Run for ~120 seconds (360ticks/18Hz = 120 seconds)
<Element>
	<Select>
		<Value>
			(A:Electrical master battery,bool) 0 == if{
			 0 (>L:BootScreen,enum) 
			 0 (>L:BootTime,enum) }
		</Value>
	</Select>
</Element>

// Start BootTime timer when power is ON
<Element>
	<Select>
		<Value>
			(A:Electrical master battery,bool) 1 == 
			(L:BootTime,enum) 361 &lt;
			and
				if{
				(L:BootTime,enum) ++ (>L:BootTime,enum) }
		</Value>
	</Select>
</Element>

// After a 10 second pause, set BootScreen,enum to 1 to display
// boot screen for 20 seconds
<Element>
	<Select>
		<Value>
			(L:BootTime,enum) 120 > if{
				1 (>L:BootScreen,enum) }
		</Value>
	</Select>
</Element>

// Set BootScreen to 2 to enable normal operations
<Element>
	<Select>
		<Value>
			(L:BootTime,enum) 360 > if{
				2 (>L:BootScreen,enum) }
		</Value>
	</Select>
</Element>

// When BootScreen = 1, display the bootscreen bitmap, overlaid
// with a "twirling set of blue dots"
<Element>
	<Visible>(L:BootScreen,enum) 1 == </Visible>
	<Element>
    		<Position X="0" Y="0"/>
	      <Image Name="SA4550_BootScreen.bmp" ImageSizes="367,370" Bright="Yes">
	      </Image>
	</Element>
	<Element>
    		<Position X="0" Y="0"/>
    		<MaskImage Name="SA4550_HorizonMask.bmp" ImageSizes="367,370">
     			<Axis X="189" Y="190"/>
    		</MaskImage>
    		<Image Name="SA4550_BootTwirlly.bmp" ImageSizes="44,44" Bright="Yes">
    			<Axis X="22" Y="22"/>
    		</Image>
    		<Rotate>
      		<Value>
				(L:BootTime,enum) 30 /
			</Value>
    		</Rotate>
	</Element>
</Element>

// Normal screen display after boot sequence completed
<Element>
    	<Visible>(L:BootScreen,enum) 2 == (A:Avionics Master Switch, bool) 0 == and</Visible>

        // the normal screens go in this <Element> section

</Element
 
Last edited:
#3
Thanks Fr. Bill,

Man, that is some sophisticated code for that. I beleive I will only need the screen background.

Your EHSI is brilliant. I was very impressed with how you made the animation function on its bootup.


Here is the G900x Bootup Screen on the Epic aircraft line. Shows their planes on one side, technical data on the other.

A thousand thanks for your help and input.


Bill
LHC
 
Last edited:
#4
Well.. I must confess that I have given this 2 1/2 days now trying to get the Innitialization screen to turn on for 20 seconds, and nothing seems to be working. I did give it a good go.

My last several efforts were to simply have a screen 'element' that shows up when power to the panel/gauges is on, (that would be the main background screen), then the 'off' screen is seen with off mode on, and then finally the bootup screen is last at the bottom of the Elements stack. I have written the timers in all ways I could figure, but must be missing the one single way of writing it. arrghh...


Bill
 

taguilo

Resource contributor
#5
Bill,

I believe this code should work. I went straight to solve the problem, so it's been optimized to be short and effective.

In pseudocode, (AMaster..) is Master avionics status, valid script is inside <Value>, rest is pseudocode.


Code:
<Element>
  <Select>
    <Value>
      (AMasterAvionics,bool) s0 
      (L:MFDInitTimer,number) 360 == s1 and 3 *
      l0 l1 ! and 2 * l0 ! 1 * + + (>LBackgroundView,enum)
      (L:MFDInitTimer,number) l0 * ++ 360 min (>L:MFDInitTimer,number)
    </Value>
  </Select>
</Element>


<Element Background off>
<Visible>(LBackgroundView,enum) 1 ==</Visible>
<Image BackgroundOff/>
</Element>

<Element background Init>
<Visible>(LBackgroundView,enum) 2 == </Visible>
<Image BackgroundInit/>
</Element>

<Element background Normal>
<Visible>(LBackgroundView,enum) 3 == </Visible>
   <Image BackgroundOn/>
   <Element..(Gauge+needle)..Element.(other gauge, etc)
</Element>
Hope this helps :)

Tom
 

n4gix

Resource contributor
#7
Thanks Fr. Bill,

Man, that is some sophisticated code for that. I beleive I will only need the screen background.
No, Tom's script is "sophisticated." ;)

Mine is quite deliberately kept "simple" and "linear" so my nearly sixty year old, fossilized brain can follow the logic tree more easily! :D

In any event, all that you really need is to display an "overlay boot screen" on top of your existing gauge's screen for 20 seconds...

Remember, XML "screens" are layered from top to bottom, so whatever is LAST in the sequence will also be the LAST image drawn! :D

For example, here is the rather simple boot screen* I added to my existing SN3308 EHSI gauge:

Code:
<!-- BOOT SCREEN -->
     <!-- Initialize all variables when power is OFF -->
		<Element>
			<Select>
				<Value>
					(A:Avionics Master Switch,bool) 0 == if{
					0 (>L:3308BootScreen,enum) 
					0 (>L:3308BootTime,enum) }
				</Value>
			</Select>
		</Element>

     <!-- Start timer and increment when both battery and avionics are ON -->
		<Element>
			<Select>
				<Value>
					(A:Avionics Master Switch,bool) 1 == 
					(A:Electrical Master Battery,bool) 1 ==
					and
					if{
						(L:3308BootTime,enum) ++ (>L:3308BootTime,enum) 1 (>L:3308BootScreen,enum) }
				</Value>
			</Select>
		</Element>

     <!-- Stop timer after 20 seconds -->
		<Element>
			<Select>
				<Value>
					(L:3308BootTime,enum) 360 > 
					(A:Electrical Master Battery,bool) 1 ==
					and			
					if{
						0 (>L:3308BootScreen,enum) }
				</Value>
			</Select>
		</Element>

     <!-- While the "bootscreen" variable is ON and battery is ON, display the bootscreen bitmap -->
		<Element>
			<Visible>(L:3308BootScreen,enum) 1 == (A:Electrical Master Battery,bool) 1 == and</Visible>
 			<Position X="0" Y="0"/>
			<Image Name="3308_BootScreen.bmp" ImageSizes="280,290" Bright="Yes">
			</Image>
		</Element>
*NOTE: to keep this simple and uncluttered, I've removed the SN3308's "twirly bitmap" from the above script... :)
 
Last edited:

taguilo

Resource contributor
#8
No, Tom's script is "sophisticated." ;)

Mine is quite deliberately kept "simple" and "linear" so my nearly sixty year old, fossilized brain can follow the logic tree more easily! :D

In any event, all that you really need is to display an "overlay boot screen" on top of your existing gauge's screen for 20 seconds...

Remember, XML "screens" are layered from top to bottom, so whatever is LAST in the sequence will also be the LAST image drawn! :D
I admit my code could be rather complex but as I stated before, the idea was to save another 2 1/2 days of trying to make the whole thing work ;)
Besides, a bit of "sophistication" could help to "defossilize" some of those ol'brains that wander around these forums :D:D:D:D:D

Now seriously, drawing sequence from top to bottom is true in XML, however the <Visible> condition us used precisely to get rid of this limitation, and also prevents a call to drawing routines (internal) that are not going to be displayed.

Tom
 
#9
Many thanks Gentlemen. You cannot know how much I appreciate it.

Fr. Bill, yours worked brilliant. My apologies Tom, but I couldnt get yours to function. I am only 3 weeks into learning code, so as you can see, I am only a Kindergarten student presently, trying to graduate with Seniors is a daunting task.

My main problem is that in making my MFD (and PFD) I was assuming that each component and 'section' had to be incased in Element sections, so I had compartenmentized the original Fr. Bill sections into one Element. I think that is where everything went wrong as I had the timer section incased in its own Element with the windows to show up.

The way I worked the other screens were that the 'AVIONICS_ON' screen is the base gauge texture, and I have another that is based on AVIONICS_OFF which causes the 'off screen' bitmap to appear. Now I have all three. (wooooooooo hooooooo!!!!! jumps up on the desk and dances a jig!!! ).

Many thanks for your patience and thanks for the enlightenment on the two different directions that can be taken.



My next question will be how to make a 'inner gauge element' to appear via a 'AREA' click zone. My thoughts are that I can easily make the Engine readout gauges appear via a single Element case of the many engine readout gauges, and have them to popup via a click. I'll save that for another thread though. This one has been a 4 day long test of eyebrow graying endurance.... :)




Bill
LHC
 
#10
I have to add that my MFD is from the stock FS9 GPS 500 series. Its elaborate sophsitication which uses perhaps a dozen pop-up windows and perhaps a hundred Macros had me in a delimma on having 'seperate' pop-up window conditions. How on a GPS/MFD could that be done with so many pop-ups going on. With a smaller gauge, I think it might have worked on the first try as I think about it in hind sight..


Bill
 

taguilo

Resource contributor
#11
My apologies Tom, but I couldnt get yours to function. I am only 3 weeks into learning code, so as you can see, I am only a Kindergarten student presently, trying to graduate with Seniors is a daunting task.


My next question will be how to make a 'inner gauge element' to appear via a 'AREA' click zone. My thoughts are that I can easily make the Engine readout gauges appear via a single Element case of the many engine readout gauges, and have them to popup via a click.
Bill, it wouldn't work as is (except the script) because I posted a pseudocode, not the sytactically correct one as I presumed you will understand the difference, sorry about that :(
Good that you finally made it work anyway.

Now regarding your 'inner gauge element', I guess you can use a single element with a <Visible> condition that is toggled in the Area section, to display/hide engine data over your MFD main bitmap. Just a thought as I don't have any code posted by you as a reference.

Tom
 
Top