Custom Pilot Currency Example: 10 Hours as PIC or SIC in Last 90 Days

From ZuluLog Wiki
Revision as of 20:26, 6 November 2014 by Roger Bright (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In this example, we will create a custom currency definition that checks for a total of at least 10 hours of flight time as either PIC or SIC within the last 90 days.

Creating the definition

1. Go to the Custom Pilot Currency Definition screen.
2. Under "Currency Name", enter a name for this currency, for example, "10hr PIC/SIC in 90 Days".
3. Under "Currency Period", enter 90 in the field and select "Days" from the drop-down.
4. Enter the initialization script as shown below:
var tottime = 0.0;

5. Enter the loop script as shown below:
var flttime = getfieldnum("Day Flight Time") + 
   getfieldnum("Night Flight Time"); 
 var role = getfieldstr("Crew Role"); 

if (strequal(role, "PIC") || strequal(role, "SIC")) 
  tottime = tottime + flttime; 

if (tottime >= 10.0) 
  currency_ok = 1; 

6. Enter a description for this currency if you wish, and then save it.
7. After saving the definition, you can check the status of your custom currency from the View Pilot Currency Detail screen.

How it works

Since we're interested in total flight time for each flight, we get the "Day Flight Time" and "Night Flight Time" fields and add them together, putting them into a variable called flttime.

Next, we put the value of the "Crew Role" field into a variable called role. Then, we check whether the value of role equals either "PIC" or "SIC". If it does, we add the total time for this flight to our overall total in tottime.

If tottime is greater than or equal to 10 hours, then our currency is valid.

Personal tools