16 | | 1. Create a DLL (Class Library) named "!FsSf_<formula id>.dll". |
17 | | 1. Set a reference to !FsSf.dll. |
18 | | 1. Set !AssemblyTitle to <formula id>. |
19 | | 1. Set !AssemblyDescription to the description that should show when one select scoring formula in FS. |
20 | | 1. Create a class named "Sf" implementing the interface !FsSf.Isf[[BR]] |
21 | | (`public class Sf : ISf ...`) |
22 | | 1. Compile and put the DLL in the folder where !FsComp.exe is and it should show up on the list for selecting a scoring formula. |
| 20 | Sorry, removed the rest of the description as it was not uptodate. Anyone interested, just post a msg on the forum and we'll be in contact with whatever you need. |
24 | | The "!EditScoreFormula" method is called from FsComp when one select and edits a scoring formula. |
25 | | |
26 | | The "!ScoreTask" method is called when the menuitem Tasks > Score Task is used, or when any report is created (Reports > ...) and the task needs to be scored because there has been changes. |
27 | | |
28 | | (any time one changes anything about one or more pilot's flightdata in a task, all FsResult elements for that task will be removed). |
29 | | [[BR]][[BR]][[BR]] |
30 | | From !FsSf.dll: |
31 | | {{{ |
32 | | |
33 | | /* |
34 | | |
35 | | XML elements that have usefull information about the task and flightdata: |
36 | | FsScoreFormula (attributes are set by the EditScoreFormula method) |
37 | | FsTaskScoreParams (attributes are calculated before the ScoreTask method is called) |
38 | | FsParticipants/FsParticipant/FsFlightData |
39 | | FsParticipants/FsParticipant/FsResult |
40 | | |
41 | | Example of FsTaskScoreParams: |
42 | | ss_distance="37.706" |
43 | | task_distance="39.901" |
44 | | no_of_pilots_present="46" |
45 | | no_of_pilots_flying="45" |
46 | | no_of_pilots_lo="6" |
47 | | no_of_pilots_reaching_nom_dist="45" |
48 | | no_of_pilots_reaching_es="39" |
49 | | no_of_pilots_reaching_goal="39" |
50 | | sum_flown_distance="1659.459" |
51 | | best_dist="39.902" |
52 | | best_time="0.896388888888889" |
53 | | worst_time="2.06222222222222" |
54 | | no_of_pilots_in_competition="63" |
55 | | |
56 | | */ |
57 | | |
58 | | namespace ... |
59 | | { |
60 | | public interface ISf |
61 | | { |
62 | | /// <summary> |
63 | | /// Should only change the FsParticipants/FsParticipant/FsResult under the xe_task_clone element. |
64 | | /// Remove any existing FsResult elements and add a new one for each pilot in task that has a FsFlightData element. |
65 | | /// FsParticipants/FsParticipant elements with no FsFlightData element is ABS and should not be counted in scoring. |
66 | | /// Empty FsFlightData element means DNF. DNF pilot may affect scoring. |
67 | | /// Best not to change anything else or FS might be confused. |
68 | | /// </summary> |
69 | | /// <param name="xe_task_clone">A clone of FsTask element. Should not have any parent. |
70 | | /// To access the rest of the fsdb xml document use OwnerDocument property of the param.</param> |
71 | | /// <param name="msg">any messages regarding scoring</param> |
72 | | /// <returns>true if task was scored, false if not.</returns> |
73 | | bool ScoreTask(XmlElement xe_task_clone, out string msg); |
74 | | |
75 | | /// <summary> |
76 | | /// Should provide a UI for setting scoring formula params. |
77 | | /// Should only change the xe_sf_clone element. |
78 | | /// Best not to change anything else or FS might be confused. |
79 | | /// </summary> |
80 | | /// <param name="xe_sf_clone">A clone of a FsScoreFormula element. Should not have any parent. |
81 | | /// To access the rest of the fsdb xml document use OwnerDocument property of the param.</param> |
82 | | /// <returns>Return true if any changes to xe_sf_clone where done, false if not.</returns> |
83 | | bool EditScoreFormula(XmlElement xe_sf_clone); |
84 | | } |
85 | | } |
86 | | }}} |
| 22 | This page will eventually have a description on howto ... |