|
| ... | Среда, 25.12.2024, 20:36
Приветствую Вас Гость | RSS |
Panel popups and view changes
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:27 | Сообщение # 1 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Someone asked the question how to make the panel popup stay in FSX even when switching views. Unfortuanately I cannot find the post this morning.
I add a line to panel entry as example below that contain line type=SPECIAL:
Code [Window04] size_mm=1000,100 position=0 BACKGROUND_COLOR=0,0,0 VISIBLE=1 ident=10022 type=SPECIAL With this line added the panel popup stay locked even if i change views.
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:27 | Сообщение # 2 |
Группа: Удаленные
| Quote (cassini-m) Someone asked the question how to make the panel popup stay in FSX even when switching views. Unfortuanately I cannot find the post this morning. I add a line to panel entry as example below that contain line type=SPECIAL: Code[Window04] size_mm=1000,100 position=0 BACKGROUND_COLOR=0,0,0 VISIBLE=1 ident=10022 type=SPECIAL With this line added the panel popup stay locked even if i change views Great tip - It also works in FS2004 too.
Thanks for sharing!
EDIT Added:
I thought so much of the tip that I posted it in the Tips and Tricks forum also - hope you don't mind.
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:27 | Сообщение # 3 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| not a problem.. stumbled onto this one a while ago..
I for one searched very long to get this right, so I am sure there are other that also would like this tip.
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:27 | Сообщение # 4 |
Группа: Удаленные
| Great tip -
From what I understand, you are to add this "window" as an "additional" window entry to you panel.cfg?
Example: C172 - has 5 window entries already. I "add" this new window as 6 - I make an entry in the top of config under windows - AS - Window 6=Special?
Am I correct?
Thanks so very much.
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:28 | Сообщение # 5 |
Группа: Удаленные
| No, you just add the line to any existing entries you wish to work that way - example:
[Window05] //Digital Compass option size_mm=101,103 background_color=0,0,0 position=2 visible=0 ident=COMPASS_PANEL type=special
gauge00=mag_compass!compass_popup_A,6,6,95,97
In this example I am using a replacement compass which has a digital display added.
http://library.avsim...gau&DLID=154834
Hope that helps clarify the useage,
|
|
| |
Purton | Дата: Вторник, 16.08.2011, 04:28 | Сообщение # 6 |
Группа: Удаленные
| That must be a holdover from a very distant ancestor, as there is nothing documented for this entry in any SDK from FS98 onward... :Thinking:
Makes me wonder what would have led anyone into "guessing" that it would work?
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:29 | Сообщение # 7 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Opa, Thanks so much. I completely understand now.
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:29 | Сообщение # 8 |
Группа: Удаленные
| You are right sir. I have read everything in the SDK documentation and believe me when I say I went through it with a fine comb, and could not find anything on this subject. It drove me completely nuts to have popup panels dissapear when switching views.. Been searching this thing for more then 2 years..
Well at least now it work and I think there will be a number of people who would enjoy this ability to have a popups "stuck"
Unfortunately I cannot give credit to who figured it out as I really cannot remember where I saw this line in a panel.cfg file the first time. I once saw a panel stay stuck, when switching views, and on further investigation I found this entry. As this has been found a couple of months ago already, and all my planes have this line added somewhere in the mean time, it is just impossible to now go back and say it was here or here that I saw it first. I never thought much about this otherwise I would have shared it long ago.
Saw post of someone asking for this, and maybe it was not even on this site, but I could not find the post this morning so I thought I will just post answer and hope the guy see it who asked for this. Well I must say I have had a good time with it last couple of months.
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:29 | Сообщение # 9 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| I have been looking for a way to do this for months! I can't wait to try it!
Thanks!!
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:29 | Сообщение # 10 |
Группа: Удаленные
| Hi,
From the fs9 SDK, window section:
type = Specifies the type of the panel window. Valid entries are PANEL for aircraft panels, MINIPANEL for gauge windows shown in the “minipanel” mode, or SPECIAL for pseudo panel windows.
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:29 | Сообщение # 11 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| This information is much appreciated! Thanks!
I wonder, is there anything along these lines that can cause a popup window, or 'psuedo panel window', as it were, to open itself when the aircraft is first loaded? :)
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:29 | Сообщение # 12 |
Группа: Удаленные
| Try this:
In each "window" in the panel.cfg file there should be a line which says - visible=0
Change it to read visible=1 (1 meaning yes - 0 (zero) meaning no)
The window in question should then be visible when you load the aircraft.
Hope that is what you were referring to.
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:29 | Сообщение # 13 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Yes, that is what I wanted to achieve, but my experimenting with visible= today has shown me that it doesn't seem to do anything at all no matter which way it is set. I read on some post somewhere that the visible= command was meant only for the "Main_Panel" window, and I never use 2D, so that might be why it isn't working for me. The windows I would like to have open are the kind I access by pressing, for example, Shift+5, and are thus overlaid on either the virtual cockpit or external view. I don't like the 2D panels for several reasons.
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:30 | Сообщение # 14 |
Группа: Удаленные
| Unfortunately, visible=1 only works if you load the a/c to the 2d panel.
If you want the subpanel to open automatically, simply script a tiny, invisible XML gauge to open it, and place a copy in both the [VCockpit01] section and the [Window00] section of the panel.cfg file.
<Gauge Name="AutoOpen" Version="1.0"> <Image Name="Transparent.bmp" /> <Update Hidden="Yes"> (L:Init,bool) 0 == if{ 10040 (>K:PANEL_ID_TOGGLE) 1 (>L:Init,bool) } </Update> </Gauge>
Transparent.bmp is simply a tiny 64x64 pixel bitmap with pure black (0,0,0) for the color.
Substitute whatever number you've chosen for the ident= in the panel.cfg file.
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:30 | Сообщение # 15 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| 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?
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:30 | Сообщение # 16 |
Группа: Удаленные
| 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.bmp
The panel.cfg entry would be: gaugenn=Mygauges!AutoOpen, 0,0,1,1
Whatever 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)
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:30 | Сообщение # 17 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| It works!! :smile: 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!!
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:30 | Сообщение # 18 |
Группа: Удаленные
| You can have as many as you want!
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:31 | Сообщение # 19 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| 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?
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:31 | Сообщение # 20 |
Группа: Удаленные
| 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].
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:31 | Сообщение # 21 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| Code <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!
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:31 | Сообщение # 22 |
Группа: Удаленные
| 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!
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:31 | Сообщение # 23 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| 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.htm
More help is of course available here at AVSIM, but some additional help is available at FS-Developer: http://www.fsdevelop...isplay.php?f=64
|
|
| |
Robert | Дата: Вторник, 16.08.2011, 04:31 | Сообщение # 24 |
Группа: Удаленные
| 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.
|
|
| |
cassini-m | Дата: Вторник, 16.08.2011, 04:32 | Сообщение # 25 |
Полковник
Группа: Персонал
Сообщений: 113
Награды: 0
Репутация: 6
Замечания: 0%
Статус: Не в сети
| 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. :Big Grin:
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. ;)
|
|
| |
|