Jump to content

IAS gauge.


il88pp

Recommended Posts

Thank you, I was assuming right about the @variables. Good to know about the gps 'module' and that it is possible to make use of it this way.

Of course I have many more questions, but I also found the pinned gps topics so I will start by reading those.

I created an extra field in my gauge, and saved under a different name. Now it's safe to experiment a bit with expressions while I read.

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

Hi COBS,

That went quicker then expected. Now there's a version that's safe to experiment with, I quickly found what I needed. Didn't even get to reading the sticky's yet.

 

I was trying to use your expression, and push the result into an Lvar.

I was doing that in a section.

Something like:




            (L:RANDOM, bool) !
            if{ %((@c:FlightPlanWaypointsNumber) 1 - (>@c:FlightPlanWaypointIndex))%((@c:FlightPlanWaypointRemainingTotalDistance,nmiles) s0 0 !=)%{if}%(l0 (L:GALNM, decimal) *) %{end}  (>L:KGReq, decimal) }



 

Further down %((L:KGReq, decimal))%!5.2f! get's displayed in the gauge.

But that didn't work.

I varied it by putting (>L:KGReq, decimal) before the {end}

but again it didn't work, I couldn't get it to push it into the Lvar.

 

All those % signs were confusing me. In the testing section I decided to get rid of as many { and % and } symbols as I could. That worked first try.

The element now looks like this and works:




            (L:RANDOM, bool) !              
            if{ (@c:FlightPlanWaypointsNumber) 1 - (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointRemainingTotalDistance,nmiles) s0 0 != if{ l0 (L:GALNM, decimal) * (>L:KGReq, decimal) }



 

I then had a look at why the (@c:FlightPlanWaypointsNumber) and (>@c:FlightPlanWaypointIndex) were in there. I had assumed up till then it was required to add up all legs distances.

I was also confused by things such as s0 and l0:

s0 0 !=)%{if}%(l0

 

Today, after realising @variables could be used seemingly like any other variable, I tested using only: (@c:FlightPlanWaypointRemainingTotalDistance,nmiles)

and leaving the rest out of it.

 

The result:

(L:RANDOM, bool) !

if{ (@c:FlightPlanWaypointRemainingTotalDistance,nmiles) (L:GALNM, decimal) * (>L:KGReq, decimal) }

 

and lower down:

%((L:KGReq, decimal))%!5.2f!

 

Works great!

 

I will get me the guidebook as well. I see the blackbox logger is also in that link. I came across that before. Thanks for the link.

il.:)

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

I found something that maybe useful to others as well.

It's a bit difficult to explain.

 

 

In this gauge I use a variable to show distance to target. (@c:FlightPlanWaypointRemainingTotalDistance,nmiles)

In a statement like:

if{ (@c:FlightPlanWaypointRemainingTotalDistance,nmiles) (>L:TotalDistRem, Nautical miles) }

 

I do this in two areas on the gauge.

In one, I let the distance value fix on the moment of takeoff. (when reaching 10ft altitude.)

In the other spot, I keep showing the current value, and you see that decreasing in the gauge.

 

All seemed to be working fine.

But then, I reloaded the aircraft.

When you do that the flightplan is still loaded.

At that moment the "current dist to target" field appears again, showing the distance to the target. And decreasing correctly.

But, the "distance on takeoff" value, says 0. (zero).

 

To test what was wrong, I removed the code that set the "TAKENOFF" variable to 1 when 10ft or more above ground.

After that the "dist on takeoff" value showed again (dist TO). SO the expression in the if statement was not wrong, and neither was the rounding of the value.

(but of course kept distance now kept decreasing during flight.)

 

I made sure there was no error in the part that fixed the value when 10 ft above ground. Using an earlier working version. After that, the "dist TO" value again said 0. While the "current distance" value kept showing correctly.

 

I deduced, that before my my gauge can extract the @c:FlightPlanWaypointRemainingTotalDistance,nmiles) value from the gps module, the module may need to be loaded in a first gauge cycle.

And the, on the second cycle of my gauge, the value is available, and therefore shows in the "current distance"

But, that after the first gauge cycle, my variable: (L:TAKENOFF) is already 1, because the altitude is of course more then 10 ft when you reload in flight.

 

To test, I created a bit of code, to make sure the (L:TAKENOFF) is only set to 1 after several gauge cycles.

Here is what I created.

 

(A:PLANE ALT ABOVE GROUND, feet) 10 > (L:ADDING2, cow) &&

if{ 1 (>L:TAKENOFF) }

 

 

(L:ADDING, cow)

if{ 1 (>L:ADDING2, cow) }

 

(L:ADDING, cow) !

if{ 1 (>L:ADDING, cow) }

 

 

I may have to do some work now on the reset button. When I tried it, it worked fine, but I should have a think about making the reset button so it does not just set L:TAKENOFF to 1, but also L:ADDING, and L:ADDING2.

[sIGPIC][/sIGPIC]
Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...