• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX View Control

Dietmar

Resource contributor
Messages
198
Country
germany
I was wondering if it would be possible to develop a gauge which controls the pilots view according to the pitch angle/AoA ( in a certain range ) of the aircraft in order to have always best forward view mainly during landing. I currently adjust the view with the keyin VIEW_ALWAYS_PAN_UP or VIEW_ALWAYS_PAN_DOWN . This moves the seat of the pilot into a position up or down for the best view through the cockpit window. This I want auto controlled by a gauge for a 2D panel.
Any good ideas ?

Dietmar
 
Can't you issue these commands from a 2D gauge and then trigger them accoring to gear position?
 
Thanks Bjoern for your reply.
What I want has nothing to do with the gear position or function. If you assign the VIEW_ALWAYS_PAN_UP and the VIEW_ALWAYS_PAN_DOWN function to a button on your stick or to a key on your board and use it, you will see that your view through the cockpit will move up or down. It is the same effect as if the pilot moves his seat up/down in order to have better front outside view through his cockpit window.
Sure, I can trigger the function e.g (>K:VIEW_ALWAYS_PAN_DOWN) at a certain AoA value and my view moves accordingly. However, I do not know when to stop it because I have no VAR which tells me in what position my "Seat" is in order to stop it.
Hope I was able to explain it better what I am looking for.

Dietmar
 
Would something like this work? (Pseudocode.)

Code:
(A:AoA...) 7 >
if{
(A:AoA...) (L:AoA past,...) - 1 >
if{ (>K:VIEW_ALWAYS_PAN_DOWN)
(A:AoA...) (>L:AoA past,...) }
(A:AoA...) (L:AoA past,...) - -1 <
if{ (>K:VIEW_ALWAYS_PAN_UP)
(A:AoA...) (>L:AoA past,...) }
}

This should theoretically move the view angle up or down for every degree of AoA change if the AoA is greater than 7 degrees.
 
And then during testing you could change the 1 degree to something else, if necessary.
 
Bjoern,
I converted your code to my FSX format. Looks like this:

Code:
(A:INCIDENCE ALPHA,degrees)  7  >
if{ (A:INCIDENCE ALPHA, degrees)    (L:AoA past,enum) - 1 >
if{ (>K:VIEW_ALWAYS_PAN_DOWN)  (A:INCIDENCE ALPHA, degrees)  (>L:AoA past,enum) }
(A:INCIDENCE ALPHA, degrees)  (L:AoA past,enum) - - 1 <
if{ (>K:VIEW_ALWAYS_PAN_UP)   (A:INCIDENCE ALPHA, degrees)    (>L:AoA past,enum)  }

Is it correct ? The view starts moving up if the AoA value is 7 >. So far so good. The trouble is it does not stop. If the AoA moves further up to 8 or stays at 7 +
the view move does not stop. I think it can be done only with a one OFF trigger at a certain time period. So the PAN moves during this time only, and stops if the time is over.
I tested with this code and it worked OK during my landing approach. Here the code:

Code:
 (A:INCIDENCE ALPHA, degrees)  6  >  

if{   (G:Var1)   ++     (>G:Var1)  }            (*increment count.=One tick id 60 ms *)
(G:Var1)  2  >                                                                
if{  0 (>G:Var1)   1  (>G:Var2)   }                                  
(G:Var2)   1  ==                                                                 
if{  (G:Var3)  ++   (>G:Var3,enum)  }                          
(G:Var3)  6  >                                                               
if{  0 (>G:Var2)    }                                                          
(G:Var2)  1  ==  
if{ (>K:VIEW_ALWAYS_PAN_DOWN)  }
(A:INCIDENCE ALPHA, degrees)  6  <    (A:SIM ON GROUND,bool)  1 ==   ||  (* trigger even to reset all LVARs to 0 and view reset*)
if{  0 (>G:Var1)  0 (>G:Var2)   0 (>G:Var3)  (>K:VIEW_RESET)  }

GVAR3 value controls the time for the pan down. May be not very elegant solution, however I got the pan move under control.
I need to test with other criteria like airspeed/vertical speed etc. for a proper pan move if in-flight condition and low speed etc.

Thanks a lot for your comments and ideas.

Dietmar
 
There was an excess space in the "-1" and the closing bracket for the AoA condition was missing.
To avoid flooding, you may put the entire code into a timer to evaluate it every few seconds.

Code:
(P:ABSOLUTE TIME, seconds) (L:View Adjust Start Time, seconds) - 3 &gt;
(A:INCIDENCE ALPHA,degrees) 7 &gt; and
if{ (P:ABSOLUTE TIME, seconds) (>L:View Adjust Start Time, seconds)
(A:INCIDENCE ALPHA, degrees) (L:AoA past,degrees) - 1 &gt; if{ (>K:VIEW_ALWAYS_PAN_DOWN) (A:INCIDENCE ALPHA, degrees) (>L:AoA past,degrees) }
(A:INCIDENCE ALPHA, degrees) (L:AoA past,degrees) - -1 &lt; if{ (>K:VIEW_ALWAYS_PAN_UP) (A:INCIDENCE ALPHA, degrees) (>L:AoA past,degrees) } }
 
OK back on my PC today.
I tested with your proposed code and here my conversion to FSX XML. The code is in the Update element of the gauge:

(P:ABSOLUTE TIME, seconds) (L:View Adjust Start Time,seconds) - 3 >
(A:INCIDENCE ALPHA,degrees) 7 >
if{ (P:ABSOLUTE TIME, seconds) (>L:View Adjust Start Time, seconds)
(A:INCIDENCE ALPHA, degrees) (L:AoA past,degrees) - 1 >
if{ (>K:VIEW_ALWAYS_PAN_Down) 1 (>L:PanDown,enum) 0 (>L:PanUP,enum) (A:INCIDENCE ALPHA, degrees) (>L:AoA past,degrees)
(A:INCIDENCE ALPHA, degrees) (L:AoA past,degrees) - -1 <
if{ (>K:VIEW_ALWAYS_PAN_UP) 0 (>L:PanDown,enum) 1 (>L:PanUP,enum) (A:INCIDENCE ALPHA, degrees) (>L:AoA past,degrees) }}

I did the code not in a "code insert function" for better reading. Is the syntax OK ?

I inserted two extra LVARs ( (L:PanDown,enum) , (L:PanUP,enum) ) to use it for a readout in order to check if the PAN command has been issued.
As soon as the AoA is 7 > the PAN DOWN LVAR goes to 1 and I assume the (>K:VIEW_ALWAYS_PAN_Down) command has been activated too.
However, the panel view does NOT move down. The view up is not triggered at all. There are two difficulties with this PAN commands. If they are to short, you don't see the move.
If they are to long you will see the earth or the heaven. A activation time of a full second is already to long. So, working with full seconds timer may be a problem in general.
I am not sure if it is possible to adjust it smoothly enough by < or > and seconds timer. My initial code with the GVARs worked fine at least for the landing approach. However, I will test/experiment with your proposed code also. So thanks for that.

Dietmar
 
I did the code not in a "code insert function" for better reading. Is the syntax OK

Nein. (As you can see for yourself.)

You also forgot an "and" for the time and initial alpha conditions.

If they are to long you will see the earth or the heaven. A activation time of a full second is already to long. So, working with full seconds timer may be a problem in general.
I am not sure if it is possible to adjust it smoothly enough by < or > and seconds timer. My initial code with the GVARs worked fine at least for the landing approach. However, I will test/experiment with your proposed code also. So thanks for that.

The timer interval can be adjusted down to 0.055555 seconds (18 Hz 1/18th second per update) since 2D gauges do not update more frequently.

And you're welcome!
 
Back
Top