Thank you for your knowledge.
I have progressed in XML code and I have manager the default fsx autopilot with custom fonction thanks to you.
Now; I began to create a new gauge for managed the VNAV of my aircraft.
So, I would like take in consideration the mass of the aircraft to set the differents rates to climb.
I have to way for that:
First is several G:Var use by time of climb and set at startup, to these G:VAR a value by weight like this :
Code:
(G:Var2) 0 == if{
(A:TOTAL WEIGHT, kilograms) 50000 < if{ 3800 (>G:Var2) 3000 (>G:Var3) 2500 (>G:Var4) 2000 (>G:Var5) 1600 (>G:Var6) }
50000 65000 (A:TOTAL WEIGHT, kilograms) rng if{ 3700 (>G:Var2) 2800 (>G:Var3) 2400 (>G:Var4) 1800 (>G:Var5) 1500 (>G:Var6) }
65000 68000 (A:TOTAL WEIGHT, kilograms) rng if{ 3500 (>G:Var2) 2600 (>G:Var3) 2200 (>G:Var4) 1600 (>G:Var5) 1400 (>G:Var6) }
68000 75000 (A:TOTAL WEIGHT, kilograms) rng if{ 3000 (>G:Var2) 2400 (>G:Var3) 2000 (>G:Var4) 1400 (>G:Var5) 1200 (>G:Var6) }
}
So , I don't know if it is possible to place a condition into an other condition like this.
If yes, I would like set the Vertical speed like this :
Code:
(G:Var1) 4 ==
(L:CSTRVnav) 1 == and
(A:Airspeed Select Indicated or True, Knots) 240 > and
if{ (g:Var2) (>K:AP_VS_VAR_SET_ENGLISH) 5 (>G:Var1) }
(G:Var1) 5 ==
(L:CSTRVnav) 1 == and
10000 11000 (A:Indicated Altitude, feet) rng and
if{ 2000 (>K:AP_VS_VAR_SET_ENGLISH) 300 (>K:AP_SPD_VAR_SET) 6 (>G:Var1) }
(G:Var1) 6 ==
(L:CSTRVnav) 1 == and
11000 18000 (A:Indicated Altitude, feet) rng and
if{ (G:Var3) (>K:AP_VS_VAR_SET_ENGLISH) 7 (>G:Var1) }
(G:Var1) 7 ==
(L:CSTRVnav) 1 == and
18000 25100 (A:Indicated Altitude, feet) rng and
if{ (G:Var4) (>K:AP_VS_VAR_SET_ENGLISH) 77 (>K:AP_MACH_VAR_SET) }
(G:Var1) 7 ==
(L:CSTRVnav) 1 == and
25100 28000 (A:Indicated Altitude, feet) rng and
if{ (G:Var5) (>K:AP_VS_VAR_SET_ENGLISH) }
(G:Var1) 7 ==
(L:CSTRVnav) 1 == and
28000 34000 (A:Indicated Altitude, feet) rng and
if{ (G:Var6) (>K:AP_VS_VAR_SET_ENGLISH) }
(G:Var1) 7 ==
(L:CSTRVnav) 1 == and
(A:Indicated Altitude, feet) 34000 > and
if{ 1000 (>K:AP_VS_VAR_SET_ENGLISH) }
Is this code is permit (assign the value of a G:Var to a K:event like this --> (G:Var5) (>K:AP_VS_VAR_SET_ENGLISH) ?
The second method is to create a coefficent with the aircraft weight and use a single G:Var :
My calculation :
((mass of the aircraft / 100000) * 2 ) -0.20
60000kg will be the 1 coefficient.
example with aircraft that weight 75 000kg :
75000/100000 = 0.75
0.75 * 2 = 1.50
1.50 - 0.20 = 1.30
1.30 is my coefficent.
like this :
Code:
(G:Var2, number) 0 == if{
(A:Total Weight, kilograms) 100000 / 2 * 0.20 - (>G:Var2)
}
And use this G:Var like this
If standart vertical speed be 1800ft/mn (60000kg aircraft) I want that the coefficient 1.3 it will be 1800 / 1.3 = 1384 rounded to 1400
I have tried this code :
Code:
(G:Var1) 5 ==
(L:CSTRVnav) 1 == and
10000 11000 (A:Indicated Altitude, feet) rng and
if{ 18 (G:Var2) / 100 * int (>K:AP_VS_VAR_SET_ENGLISH) 300 (>K:AP_SPD_VAR_SET) 6 (>G:Var1) }
In my head :
18 (G:Var2) / ----> 18 / 1.30 = 13.846
13.846 * 100 = 1384
int of 1384 = 1400
But It doesn't work.
The two methods do not work
All this code is in an invisible gauge without bitmap, so I have placed it between <Update> .....</Update>
At this time , only this code works :
Code:
........
(G:Var1) 4 ==
(L:CSTRVnav) 1 == and
(A:Airspeed Select Indicated or True, Knots) 240 > and
if{ 3500 (>K:AP_VS_VAR_SET_ENGLISH) 5 (>G:Var1) }
(G:Var1) 5 ==
(L:CSTRVnav) 1 == and
10000 11000 (A:Indicated Altitude, feet) rng and
if{ 1800 (>K:AP_VS_VAR_SET_ENGLISH) 310 (>K:AP_SPD_VAR_SET) 6 (>G:Var1) }
(G:Var1) 6 ==
(L:CSTRVnav) 1 == and
10500 18000 (A:Indicated Altitude, feet) rng and
(A:Airspeed Select Indicated or True, Knots) 290 > and
if{ 2500 (>K:AP_VS_VAR_SET_ENGLISH) 7 (>G:Var1) }
........
....
For now, I had to assign a fixed rate at each stage of the ascent to the gauge works, but I'd really like it fits the weight
Thank you for your help ....