Jump to content
Sign in to follow this  
bliksimpie

Panel popups and view changes

Recommended Posts

This looks like something I can do, but I have never made a gauge before. Can I simply put this code you wrote INTO the panel.cfg file in those 2 places? I have edited a lot of panel.cfg files, but never seen such code before, so I want to make sure I know what to do. You said substitute the ident=, but I don't see "ident=" in your code, so where would I put the substituted number from the panel.cfg's ident= statement in the gauge window? Do I just add that into your code?
What I posted is XML gauge script. This .xml file along with the bitmap should be in a subfolder of the ..\panel folder. Give the new subfolder some unique name, such as "MyGauges" for example...\panel\MyGauges...........\AutoOpen.xml...........\Transparent.bmpThe panel.cfg entry would be:gaugenn=Mygauges!AutoOpen, 0,0,1,1Whatever ident= number you use in the panel.cfg for the new popup window you want "auto opened" is placed in the .xml script as the number immediately before the (>K:PANEL_ID_TOGGLE)command:10040 (>K:PANEL_ID_TOGGLE)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
What I posted is XML gauge script. This .xml file along with the bitmap should be in a subfolder of the ..\panel folder. Give the new subfolder some unique name, such as "MyGauges" for example...\panel\MyGauges...........\AutoOpen.xml...........\Transparent.bmpThe panel.cfg entry would be:gaugenn=Mygauges!AutoOpen, 0,0,1,1Whatever ident= number you use in the panel.cfg for the new popup window you want "auto opened" is placed in the .xml script as the number immediately before the (>K:PANEL_ID_TOGGLE)command:10040 (>K:PANEL_ID_TOGGLE)
It works!! :( Thank you so much!!One more question. Is it possible to concurrently open more than one window with this script, perhaps by adding another line such as :10020 (>K:PANEL_ID_TOGGLE)Below the one above, or would I need to do something else? Just curious. I really appreciate this! There is so much one can do to customize FSX it staggers the mind. But without good folks like yourself to guide the way, those of us wanting to modify it would not have nearly as much success. THANKS!!Zoandar

Share this post


Link to post
Share on other sites

Hi,You can have as many as you want!Jan

Share this post


Link to post
Share on other sites

I did try several variations just for fun. But I cannot make more than one window auto-open. I can get one, or the other (a second window) but never both together. So can you show me how it is done?

Share this post


Link to post
Share on other sites
I did try several variations just for fun. But I cannot make more than one window auto-open. I can get one, or the other (a second window) but never both together. So can you show me how it is done?
Is there no "edit" button for these posts?? ( I finally see one in THIS post ONLY, but not in any of my posts above??)I have tried many variations on trying to include reference to 2 different windows within the same XML code. I have tried using 2 different XML code files in the same panel subfolder. I have tried using separate panel subfolders for opening the two different windows. I have tried placing the "gaugenn=...." lines in 2 of the several different [Vcockpitxx] windows within the panel.cfg file for the aircraft I am using during testing. It always comes out the same way. Either it doesn't work at all, or else when it does work I get ONE window to auto-open. Usually the first one, numbered 10040. If I remark out the "gauge=nn......" listing for the first window, being ident=10040, then the second window, being ident=90 WILL open! So I can open "either", but never "both". I don't know what to do so I will stop the attempt to do multiple windows until someone can show me exactly how to do it. Clearly there is some piece of information I need that I don't have. BTW, in all the testing I did it doesn't seem to matter one way or the other whether I put the gaugenn=..... listing in [Window00] or not. But it does need to be in [Vcockpit01].

Share this post


Link to post
Share on other sites
One more question. Is it possible to concurrently open more than one window with this script, perhaps by adding another line such as :10020 (>K:PANEL_ID_TOGGLE)
<Gauge Name="AutoOpen" Version="1.0">   <Image Name="Transparent.bmp" />   <Update Hidden="Yes">     (L:Init,bool) 0 ==     if{       10020 (>K:PANEL_ID_TOGGLE)       10030 (>K:PANEL_ID_TOGGLE)      10040 (>K:PANEL_ID_TOGGLE)      1 (>L:Init,bool)     }   </Update> </Gauge>

Make sure that you edit each of the subpanels to appear in a different place on the screen, otherwise they will simply stack up on top of each other!


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
<Gauge Name="AutoOpen" Version="1.0">   <Image Name="Transparent.bmp" />   <Update Hidden="Yes">     (L:Init,bool) 0 ==     if{       10020 (>K:PANEL_ID_TOGGLE)       10030 (>K:PANEL_ID_TOGGLE)      10040 (>K:PANEL_ID_TOGGLE)      1 (>L:Init,bool)     }   </Update> </Gauge>

Make sure that you edit each of the subpanels to appear in a different place on the screen, otherwise they will simply stack up on top of each other!

Well, I could swear I had tried this somewhere in all my various attempts, but it definitely does work! :-) Come to think of it, I'll bet I repeated some other part of the code in the overall "IF" statement when I shouldn't have. I know a little about programming in other languages like C (from playing with an Arduino board), but I have never used XML before. I did do a bit of searching online and found some XML tutorials that look interesting, so I may look a little deeper into it. When I first started using FS Panel Studio for FSX, I was immediately disappointed in how much I could 'not' do because of the number of aircraft panels using XML. I went on to find a statement somewhere online that said "Microsoft has provided very little information about the use of XML in gauge panels" before they shut down the whole flight sim division, so I thought I was pretty much out in the cold. But If XML can be used to do neat tricks like you just showed me, it is worth looking into. Some of the free aftermarket aircraft panels leave much to be desired. My solution to make them usable has been to provide my own popup windows with gauges I like and/or can read well enough to fly (one example is the tiny gauges on the EH101 provided by FSX Acceleration - Those need to be a lot bigger). Thanks again for all the help! Zoandar

Share this post


Link to post
Share on other sites
Thanks again for all the help!
No problem. The most difficult part for newbies to wrap their brains around is that XML uses "Reverse Polish Notation" for everything. If one grew up using the ancient and venerable HP calculators, RPN would be second nature.Just as an example, the general format for what in most any other real progamming language would be in the form:if (this condition) then (do something) else (do some other thing)takes the generic form in XML script:( this condition ) if{ do something } els{ do some other thing }In the XML script I provided earlier, the (condition) is (L:Init,bool) 0 ==. Because all L:variables are zero by default when the aircraft is first loaded, the actions listed following the if{ statement are executed.The last statement is 1 (>L:Init,bool) which sets the L:variable to one, which of course means that the control statements will never be run again until the aircraft is reloaded.Some fairly easy to follow tutorials are available here:http://www.fs2x.com/Tutorials.htmMore help is of course available here at AVSIM, but some additional help is available at FS-Developer:http://www.fsdeveloper.com/forum/forumdisplay.php?f=64

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
No problem. The most difficult part for newbies to wrap their brains around is that XML uses "Reverse Polish Notation" for everything. If one grew up using the ancient and venerable HP calculators, RPN would be second nature.Just as an example, the general format for what in most any other real progamming language would be in the form:if (this condition) then (do something) else (do some other thing)takes the generic form in XML script:( this condition ) if{ do something } els{ do some other thing }In the XML script I provided earlier, the (condition) is (L:Init,bool) 0 ==. Because all L:variables are zero by default when the aircraft is first loaded, the actions listed following the if{ statement are executed.The last statement is 1 (>L:Init,bool) which sets the L:variable to one, which of course means that the control statements will never be run again until the aircraft is reloaded.Some fairly easy to follow tutorials are available here:http://www.fs2x.com/Tutorials.htmMore help is of course available here at AVSIM, but some additional help is available at FS-Developer:http://www.fsdevelop...isplay.php?f=64
Thanks for this information. That does help make sense out of what seemed like cryptic statements in the code. I have encountered the term RPN before, but I have always tried to stay away from it as much as possible. Yet, I do remember way back when early calculators worked that way. Very confusing to get used to. I am really surprised that XML was set up this way. Everything I have read online about XML so far has made mention of the underlying concept that it is supposed to be "easily understood" just by looking at it (to put it in my own words). So why they did RPN is a mystery to me, when so many other languages do the operations as IF/THEN/ELSE. I did read one person's opinion that the "greater than" symbol "should always be replaced" by, was it "gt;" or something like that? Even still, the statement 1 (>L:Init,bool) does leave me scratching my head. L:init.bool == 1 would make more sense to me. :) But as I said I don't know much about XML yet. So does (L:Init,bool) 0 == mean that variable "L" is being initialized to Boolean 0? Maybe if I pretend I am talking with Yoda it might help. :-) "Equal to Boolean zero, it is". I have run into one helicopter download with which I can not make this auto-open script work. I have successfully applied it to 22 other models I use, and am preparing to start adding it to the fixed wing planes in my collection. But I did everything exactly the same way on this one and the windows do not open. I can open them with the SHIFT+ keys, so I know I have the panel.cfg windows set up correctly. I can only guess that something within the code of the model itself is working against this XML script and not letting it work. Since I have the other 22 helos to fly I am not going to worry about it, and have deleted the model from my setup. But if you are curious, I can send you the files ( I have the original ZIP download) for it to see if you can find the problem. It is an S-70B-6 Aegean Hawk. It flies OK and I don't have any problems manually adding or operating windows listed in the panel.cfg file. So I have no idea what the issue is.

Share this post


Link to post
Share on other sites
I did read one person's opinion that the "greater than" symbol "should always be replaced" by, was it "gt;" or something like that? Even still, the statement 1 (>L:Init,bool) does leave me scratching my head. L:init.bool == 1 would make more sense to me. :) But as I said I don't know much about XML yet. So does (L:Init,bool) 0 == mean that variable "L" is being initialized to Boolean 0? Maybe if I pretend I am talking with Yoda it might help. :-) "Equal to Boolean zero, it is".
XML isn't technically a "programming language" at all; it is a "script" that is parsed by the XML engine, and translated internally into a "dynamic link library" in one form or another. XML is also "stack based" which is why it uses RPN for its structure.The expression formed by (L:Init,bool) 0 == is a "binary conditional test" that when evaluated will result in either TRUE or FALSE (1 or 0). Translated into pseudo-code it takes the form:if (L:Init,bool) = 0, then (return TRUE) else (return FALSE).
 if ( (L:Init , bool) == 0 )  {	 dosomething  } else  {	 dosomethingelse  } 

The example shown in the "code box" above is the output of a nifty tool in the FSX SDK named Infix2Postfix.exe. It will "translate" XML into a more familiar form of pseudo-code that sort of resembles C if an XML script is supplied, or the reverse if a C type expression is entered.Generally speaking, the symbols < and > should NOT be used, but instead the "escaped versions" < and > should be used...However, in the singular case of assigning a value to an L:variable or K:command, I use the convention n (>L:Variable,unit) and (>K:Event), because it works and is also quite distinctive. I call it the "stuffit" symbol, because that is essentially just what it does......it "stuffs" the preceding numeric value "into" the L:var or K:Event. Technically it places the numeric value on top of the expression's stack, but that's too much technical twaddle, IMHO. :( To be honest, I've far too much work to get done to get involved in anything else at the moment, but I'm available to answer questions most of the time. ;)


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
XML isn't technically a "programming language" at all; it is a "script" that is parsed by the XML engine, and translated internally into a "dynamic link library" in one form or another. XML is also "stack based" which is why it uses RPN for its structure.The expression formed by (L:Init,bool) 0 == is a "binary conditional test" that when evaluated will result in either TRUE or FALSE (1 or 0). Translated into pseudo-code it takes the form:if (L:Init,bool) = 0, then (return TRUE) else (return FALSE).
 if ( (L:Init , bool) == 0 )  { 	dosomething  } else  { 	dosomethingelse  } 

The example shown in the "code box" above is the output of a nifty tool in the FSX SDK named Infix2Postfix.exe. It will "translate" XML into a more familiar form of pseudo-code that sort of resembles C if an XML script is supplied, or the reverse if a C type expression is entered.Generally speaking, the symbols < and > should NOT be used, but instead the "escaped versions" < and > should be used...However, in the singular case of assigning a value to an L:variable or K:command, I use the convention n (>L:Variable,unit) and (>K:Event), because it works and is also quite distinctive. I call it the "stuffit" symbol, because that is essentially just what it does......it "stuffs" the preceding numeric value "into" the L:var or K:Event. Technically it places the numeric value on top of the expression's stack, but that's too much technical twaddle, IMHO. :( To be honest, I've far too much work to get done to get involved in anything else at the moment, but I'm available to answer questions most of the time. ;)

Thanks for that clarification. :) I understand the position of having a large workload, as I have been there myself many times. Thankfully I am retired now so my life is more "mine" than "theirs". I appreciate the answers, and will forget about that single heli that wasn't cooperating. Being a lifelong "experiential" learner, I usually prefer to "cut to the chase" of the solution I seek, rather than go the traditional route of learning large volumes of surrounding fringe material over a long period of time before I can uncover the solution to the single problem in front of me. That said, your "stuffit" explanation is much preferred over the "technical twaddle". You accomplished the goal of explaining to me what that statement does. ;-) Thanks!Zoandar

Share this post


Link to post
Share on other sites
Thanks for that clarification. :) I understand the position of having a large workload, as I have been there myself many times. Thankfully I am retired now so my life is more "mine" than "theirs". I appreciate the answers, and will forget about that single heli that wasn't cooperating. <snipped for brevity>That said, your "stuffit" explanation is much preferred over the "technical twaddle". You accomplished the goal of explaining to me what that statement does. ;-)
I have been retired for so many years that by now I'm simply "tired..." My current "work" is the end result of what began as an extension of my flightsim "hobby," modeling and gauge/system programming! :( My years of teaching "Introduction to Computer Programming" at the University of Florida Gainesville back in the 60's forced me to learn ways to explain complex concepts in simpler terms. I've always enjoyed teaching. It was the paperwork that did me in! LOL.gif

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
I have been retired for so many years that by now I'm simply "tired..." My current "work" is the end result of what began as an extension of my flightsim "hobby," modeling and gauge/system programming! :( My years of teaching "Introduction to Computer Programming" at the University of Florida Gainesville back in the 60's forced me to learn ways to explain complex concepts in simpler terms. I've always enjoyed teaching. It was the paperwork that did me in! LOL.gif
My personal opinion is that someone who can take a complex concept and explain it in simpler terms makes a very good teacher! I'll bet you had a lot of students who enjoyed your classes. My interests in FSX have taken a slight detour, and I thought maybe you can help me find the answer to my current wonder. In the Textures folder of most of the FSX aircraft I have installed there a lots of bitmap files. But some of them have no thumbnail. And when I try to open one which has no thumbnail I get variations on the following message, depending upon which application I try to use to open it. In a nutshell it tells me the file is too big to be opened, or else is corrupt, or is of a format that is unfamiliar to the application. So what's the skinny on those files? What program was used to open/create them? The reason I wanted to look at one is that I have a really nice rendition of a UH60 Blackhawk. It flies sweet, looks really nice on the outside, and even has impressive sound files. But the VC has one 'flaw' I was wondering if I could somehow fix or at least improve upon. The right side "A" post for the windshield (where it meets the RH cockpit door) is extremely jagged and appears very poorly drawn. It looks more like sharks' teeth than a nice smooth angular part of the fuselage. I thought perhaps if I could open the file named "cockpit.bmp" I could play with a copy of it and perhaps smooth that out. But I don't know anything at all about how these files are used to formulate a virtual cockpit image. So it might be way harder than I imagine (which may be why it didn't turn out as nice as the creator may have wanted). But I was hoping I could leave all that to FSX and simply give it a better image file to use in its wizardry when it creates the aircraft. Those bitmap files which do have thumbnails and allow me to open and view them seem to be a mosaic of elements. So I am guessing the segment of FSX that creates the aircraft uses these images as some sort of map and takes a portion of the 'map' and wraps it around the defined airframe, not unlike how scenery is created in FSX and other games. I've read a little about it over the years, but video games have gotten pretty complex these days so I am sure there is a lot happening I have yet to even encounter, let alone understand. Anyway, if nothing else I'd like to know why the files can't be opened like a 'normal' bitmap with a typical image editing app.

Share this post


Link to post
Share on other sites

The bitmap files to which you refer are compressed using various algorithims. Both FS9 and FSX Software Development Kits (SDKs) have a tool named Imagetool.exe that will uncompress/compress the bitmaps to either 24bit .bmp or 32bit .bmp type files.DXTBMP.exe from Martin Wright will also uncompress/compress these files.http://www.btinternet.com/~mnwright/Since I have Adobe Photoshop CS4, I use a plugin file from nVidia that allows me to directly load compressed .dds files into Photoshop, and export new or edited files back to .dds format.http://developer.nvidia.com/nvidia-texture-tools-adobe-photoshopThere is also a .dll file available that will allow Windows Explorer to display thumbnails for compressed .dds files.http://developer.nvidia.com/legacy-texture-tools


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...