Table of contents
- Writing your own scripts
- Contributing Guidelines
Writing your own scripts
Scripts for daily results
SeeYou will calculate the day performance items like Marking Distance, speed, start and finish times etc. It is the responsibility of the script to determine how many POINTS are awarded for the achieved performance.
SeeYou Competition scripts are implemented using the Innerfuse Pascal Scripts. They are very basic Pascal routines with some exceptions.
You can write scripts in Notepad or any other Text editor of your choice. You can assign scripts to each class of competition separately through Edit > Competition Properties > Scripts.
It is important to keep the general structure of the script:
Program Scoring_Script_Name; begin // Your script here end.
There are many variables available to the scoring script. See "Available variables for daily points script".
Scripts for total rsults
You can also write a script for Total results. Procedure is the same way as for daily scripts except that they are located in Edit > Competition Properties > Total Script. See "Available variables for total points script".
How does it work?
A TPilots record is provided by SeeYou to the Scoring script. TPilots record and a couple other fields determine all the information required to calculate the scoring for a given contest day. This is the definition of the TPilot record:
Available variables for daily points scripts
All variable values are double if not indicated otherwise All times are seconds since midnight if not indicated otherwise
|sstart||start time displayed in results sets||s|
|sfinish||finish time displayed in results sets||s||negative values - no finish|
|sdis||distance shown in results||m||negative values will be shown in parenthesis|
|sspeed||speed shown in results||m/s||negative values will be shown in parenthesis|
|points||points shown in results|
|pointString||a string representation of points for custom output||string|
|Hcap||handicap factor as declared in pilot setup|
|penalty||penalty points defined in "Day performance" dialog|
|start||start time of task||s||-1 if no start|
|finish||finish time of task||s||-1 if no finish|
|speed||speed of finished taks||m/s||-1 if no finish, takes into account task time|
|tstart||start time of task with time||s||-1 if no start|
|tfinish||finish time of task with time||s|
|tdis||flown distance in task time||m|
|tspeed||flown distance divided by task time||m/s|
|takeoff||takeoff time||s||-1 if no takeoff|
|landing||landing time||s||-1 if no landing|
|phototime||outlanding time||s||-1 if no outlanding|
|isHc||set to TRUE if not competing is used||bool|
|FinishAlt||altitude of task finish||m|
|DisToGoal||distance between Task landing point and flight landing point||m|
|Tag||string value as defined in Day performace dialog||string|
|Leg, LegT||array of TLeg records||array|
|Warning||used to set up a user warning||string|
|CompID||Competition ID of the glider||string|
|PilotTag||string value as defined in Pilot edit dialog||string|
|user_str1, user_str2, user_str3||user strings, use for anything||string|
|td1, td2, td3||temprary variables, use for anything|
|Markers||array of TMarker (see definition for TMarker below)||array|
|PotStarts||Array of all valid crossings of the start line. In seconds since midnight||s||array of integers|
Task leg information
|start||leg start time||s|
|finish||leg finish time||s|
Records of Pilot Event Marker (PEM) events - created when pilot depressed "Event Marker" button.
|Tsec||time of the PEM||s||integer|
|Msg||optional message stored with the PEM in IGC file||string|
|info1, info2||information shown in the results||string|
|DatTag||value as defined in "Day properties" dialog||string|
|ShowMessage||string for debugging purposes||string|
Basic information about task
|Point||array of TTaskPoints||array|
|ClassID||enum of existing glider classes||string|
ClassName: string; Optional nice name for the given class - as entered at Soaring Spot.
Basic information about taskpoint and leg
|d||distance to next point||m|
|crs||course to next point||rad|
|td1, td2, td3||optional, used as temporary variables|
Available variables for total results script
|Total||total points||default value is sum of DayPoints, not 0|
|TotalString||format of the total points when shown as string||string|
|DayPts||Points from each day as calculated in daily scripts||array of doubles|
|DayPtsString||format of the day points when shown as string||string|
You wrote a great script, found a bug and corrected it? Great! To incorportate changes to existing scripts or adding your own scripts, please fork the repo, make your changes in a new branch and create a pull request. Pull requests from forks are described in pull request from fork article.