Jump to content

Archived

This topic is now archived and is closed to further replies.

n4gix

Get the current view in FSX

Recommended Posts

I am trying to know what view is currently used in FSX (2D, VC or other). In fs9, I could use "ACTIVE VIEW MODE", but this does not work in FSX. Bill suggested to associate an ident to the [VCockpitXX] section and check if they are visible with "is_panel_visible_window_ident", but this does not work either.I someone has another solution, I would be happy to know about it :)Eric

Share this post


Link to post
Share on other sites

Hi EricI'm successfully using the "is_panel_visible_window_ident" method to detect whether a given panel is open and if it is, to ensure that all associated sub-panels are closed when the parent panel is closed. So the question is, are you getting an error or does it simply not work for you?-Dai

Share this post


Link to post
Share on other sites

I also used this function several times, and it has always worked fine on fs9 and FSX, for the 2D panel windows. The problem here is that it does NOT work for virtual cockpit. In fact, it returns "false" even when the virtual cockpit is visible.For information, here is what I have in the [VCockpitXX] section of the panel.cfg:[VCockpit01]size_mm=512,512pixel_size=512,512texture=$XXXbackground_color=0,0,0ident=12000gauge00=...Whatever happens, "is_panel_visible_window_ident(12000)" always returns "false", even when the VC is visible.Eric

Share this post


Link to post
Share on other sites

> virtual cockpitWell, that'll teach *me* to read the topic correctly. I've never tried closing the VC window from code.... "sorry" for getting your hopes up.-Dai

Share this post


Link to post
Share on other sites

Hello Dai,I'm sorry to say that you should read the topic again ;-) I am not trying to close the VC window from code (this would be quite strange), I am just trying to know if the VC is visible or not. IOW, I am trying to know if the user is in 2D panel mode, Virtual Cockpit mode, or other (spot, tower, ...).Eric

Share this post


Link to post
Share on other sites

As I've stated previously, anytime the 2d panel ident=0 isn't visible, the VC is loaded and active.I've always used this as my test:if ( !is_panel_window_visible_ident(0) ){ vc_active = 1 ; }else{ vc_active = 0 ; }Among other things, I've used this technique to shut down GDI+ gauge drawing whenever they aren't being used.By sending the same flag to an XML L:var,unit I've also used it to suspend XML gauge drawing taking place... ;)

Share this post


Link to post
Share on other sites

>As I've stated previously, anytime the 2d panel ident=0 isn't>visible, the VC is loaded and active.>Sorry Bill, this is not true...If you press the W key, you get the mini-panel view. The 2D main panel is not visible, and the VC is not visible either ;-)I guess you don't use the mini-panel very often, but if , like me, you were a happy user of the head-up displays (HUD) from SimScape, you would use it more often.Eric

Share this post


Link to post
Share on other sites

>>As I've stated previously, anytime the 2d panel ident=0>isn't>>visible, the VC is loaded and active.>>>>Sorry Bill, this is not true...>If you press the W key, you get the mini-panel view. The 2D>main panel is not visible, and the VC is not visible either>;-)>>I guess you don't use the mini-panel very often, but if , like>me, you were a happy user of the head-up displays (HUD) from>SimScape, you would use it more often.Then include a check for ident=100 (which is the actual id for the MINIPANEL)......or IDENT_MINI_CONTROLS_PANEL...either one will tell you if the mini-panel window is active.

Share this post


Link to post
Share on other sites

Yes, I thought about this, and it solves the proble... partially. Because again, if the user swiches to spot view, the main panel and the mini-panel are not visible, but it does not mean the VC is visible. This is why I would like to test the visibility of the VC.But if it is not possible, I will use this workaround...EricPS. The ident for the mini-panel is not 100, it is 20000 :)

Share this post


Link to post
Share on other sites

>Yes, I thought about this, and it solves the proble...>partially. Because again, if the user swiches to spot view,>the main panel and the mini-panel are not visible, but it does>not mean the VC is visible. This is why I would like to test>the visibility of the VC.>>But if it is not possible, I will use this workaround...>>Eric>>PS. The ident for the mini-panel is not 100, it is 20000 :)Not according to the latest gauges.h file it isn't...20000 is the IDENT_AIRCRAFT_HUD_3D_PANEL!// Panel identifiers#define IDENT_MAIN_PANEL 0#define IDENT_THROTTLE_PANEL 10#define IDENT_RADIO_STACK_PANEL 50#define IDENT_COMPASS_PANEL 75#define IDENT_MINI_CONTROLS_PANEL 100#define IDENT_ANNUNCIATOR_PANEL 125#define IDENT_ANNUNCIATOR2_PANEL 150#define IDENT_IFR_MAIN_PANEL 175#define IDENT_COLLECTIVE_PANEL 200#define IDENT_GPS_PANEL 225#define IDENT_OVERHEAD_PANEL 250#define IDENT_USER 10000#define IDENT_USER_MAX 19999#define IDENT_AIRCRAFT_HUD_3D_PANEL 20000#define IDENT_HELICOPTER_HUD_3D_PANEL 20001#define IDENT_CONTROLS_HUD_3D_PANEL 20002#define IDENT_TEXT_HUD_3D_PANEL 20003#define IDENT_DAMAGE_HUD_3D_PANEL 20004#define IDENT_SCORE_HUD_3D_PANEL 20005#define IDENT_LSO_WINDOW 22000#define IDENT_INVALID 4294967295

Share this post


Link to post
Share on other sites

You should give it a try, and you would see I'm right :-)The content of gauhes.h often needs to be "decrypted".Eric

Share this post


Link to post
Share on other sites

>You should give it a try, and you would see I'm right :-)>The content of gauhes.h often needs to be "decrypted".Say what? What's in the gauges.h is simply a very straight-forward table that defines a 1:1 relationship between the "text name" and the actual numbers used......now I will grant you that not everything does work as expected, but still! :)

Share this post


Link to post
Share on other sites

>You should give it a try, and you would see I'm right :-)>The content of gauhes.h often needs to be "decrypted".>>Eric>You're wrong. The gauges.h defines the variable Bill mentioned as having a value of 100. No decryption required... zip, zilch, nada. However... the panel ID VALUE is defined in the panel.cfg file. It is something the USER can change at a whim.

Share this post


Link to post
Share on other sites

OK guys, sorry about this, I don't want to argue endlessly.I don't know why my code does NOT work when I use the ident 100, and it WORKS when I use 20000... But the most important is that it works, and that everyone is happy.Eric

Share this post


Link to post
Share on other sites

>OK guys, sorry about this, I don't want to argue endlessly.>I don't know why my code does NOT work when I use the ident>100, and it WORKS when I use 20000... But the most important>is that it works, and that everyone is happy.>>Eric>I DO know... and I attempted to explain it to you.

Share this post


Link to post
Share on other sites

>OK guys, sorry about this, I don't want to argue endlessly.>I don't know why my code does NOT work when I use the ident>100, and it WORKS when I use 20000... But the most important>is that it works, and that everyone is happy.>>Eric>Eric, MINIPANEL has an ident of 20000 as you've noticed, and I'll try to explain why this works as it does: First, there isn't an exact define for MINIPANEL in gauges.h panel #defines, because MINIPANEL is a special keywork only recognized by FS panel interpreter, and has not direct relationship with the standard gauges.h defines. The W key is associated with a "change view" mode that cycles between main panel (MAIN PANEL); its derivatives ..PANEL_ALT1 to ..PANEL_ALT9; MINIPANEL and main panel off (invisible); all of them related to main 2d panel view. Alternative panels 1 to 9 won't cycle if not defined in panel.cfg, but MINIPANEL will always cycle. You can define your own MINIPANEL window and add as many gauges as you wish, even leave it with no gauges. If you don't define any, a default configuration is taken from minipanel.cfg located in Gauges folder, and depends on aircraft/engine type. Specific gauges are loaded from Minipanel.cab located in the same folder.MINIPANEL has the particularity that is not displayed as a selectable option of Instrument Panels in View menu.If you use an ID of 100 (IDENT_MINI_CONTROLS_PANEL), the window will be treated as a regular popup window and NOT as a MINIPANEL reference.Hope this makes sense and helps a bit :-)Tom

Share this post


Link to post
Share on other sites

>Hope this makes sense and helps a bit :-)Actually if makes no sense whatever and is completely contrary to what is in the SDK...The very first MINIPANEL definition in the FS9 ..defaultpanelpanel.cfg file is:[MiniPanel00]position=7size_mm=600,100window_size=0.9,0.20child_3d=1background_color=0,0,0ident=MINIPANELWhat is the ident?MINIPANELThe same entry from the FSX minipanel.cfg file is:[MiniPanel00]position=7size_mm=600,100window_size=0.9,0.20child_3d=1background_color=0,0,0ident=MINIPANELWhat is the ident?MINIPANELWhat is the integer equivalent for MINIPANEL as defined in the gauges.h file?#define IDENT_MINI_CONTROLS_PANEL 100What is 20000 defined to be?#define IDENT_AIRCRAFT_HUD_3D_PANEL 20000Clearly an ident=20000 entry would be the "AIRCRAFT_HUD_3D_PANEL" and not MINIPANEL...In the Panels and Gauges SDKPanel Configuration Files.htm file, every one of the ident=xxx examples given have a 1:1 correspondence with the same list of #defines in gauges.h......so the question is, why would MINIPANEL be an exception?These have not changed since first appearing in FS2k's gauges.h file... Now, that is how it is SUPPOSED to work; how it works in actual practice is another matter altogether...

Share this post


Link to post
Share on other sites

>Actually if makes no sense whatever and is completely contrary>to what is in the SDK...>It is not contrary at all Bill. You are departing from a wrong assumption that IDENT_MINI_CONTROLS_PANEL is the same as MINIPANEL, which is clearly not.Actually MINI_CONTROLS is a carry over from FS2K era where Minicontrol window and gauge did exist, with the only purpose to show that tiny white double scale with the word "Knots", remember that? :-)But MINIPANELS is another thing, associated with the idea of a main 2D default and fixed cycle of MAIN ON - HUD ON - MAIN OFF.I guess that't the reason for using IDENT_AIRCRAFT_HUD_3D_PANEL as a pnemonic define. This applies both for FS2004 (FS9) and FSX as well.Tom

Share this post


Link to post
Share on other sites

The 'W' key has nothing to do with panels that have IDs at all. In FS2004, it's in the Views menu labeled as "Maximize View". Not MINIPANEL.What you call the MINIPANEL has nothing to do with aircraft configuration, it's not even touchable from within the panel.cfg or aircraft.cfg. If FS is returning a value of 20000, it's something hard-coded within FS and, like I've already stated, has nothing to do with PANELS at all.When it is "active"... all other gauge rendering is completely and totally disabled. Thus a "test" to see if the user is in "Maximize View" mode would be of little value... your could wouldn't be called to draw any gauges to begin with. You can not trigger this view from within the VC, either.All panels are defined within the panel.cfg file. All. This thing being called a MINIPANEL is not part of the model, not part of the panel configuration. It is an FS "feature" that is non-aircraft specific.What Bill has stated, repeatedly... is 100% correct. The window that you are calling the MINIPANEL is a whole separate window... it has NO PANEL. It uses "classic" default analog gauges that have little to do with the actual aircraft.

Share this post


Link to post
Share on other sites

(...)Ed, please...I do respect you, really, but sometimes you should avoid posting like above :-). I gave a clear explanation on the meaning and working of MINIPANEL on my previous posts. I strongly recommend you to read them carefully.Tom

Share this post


Link to post
Share on other sites

>But MINIPANELS is another thing, associated with the idea of a>main 2D default and fixed cycle of MAIN ON - HUD ON - MAIN>OFF.>I guess that't the reason for using>IDENT_AIRCRAFT_HUD_3D_PANEL as a pnemonic define. This applies>both for FS2004 (FS9) and FSX as well.Now that explanation makes a lot of sense. Thanks for the elucidation, Tom. I've made a formal request through my channels for ACES to devote more effort to the SDK for FSvNext.In particular, they need to cull the depecrated "crud" from both gauges.h and and the SDK. They also must really update the SDK to make such basic concepts more explicit.

Share this post


Link to post
Share on other sites

×
×
  • Create New...