Rating¶
A competition essentially consists of the evaluation of the data provided by the Devices are sent. This evaluation is carried out by a so-called Reducer. This reducer is usually written by a developer and is then responsible for evaluating the data.
To write such a reducer, you need to know Javascript.
As always, a reducer has a name and a description, which are displayed in the reducer overview.
There is also a list of globally available libraries that can be can use. These are provided in the system and can be used by any Reducer can be used.
In the example, a library called Speedway Race is displayed, which
provides two versions (test
and test2
). The so-called Scratch
Version is always the current version of the library that is being edited;
this should never be used for real races. Instead, only
a fixed version can be used, as this has been explicitly released.
The area below shows how the library is used what it offers, etc. This documentation is part of the Library and should always be Up2Date.
If the library is added with Add, it appears above the Library Browsers as a list:
The library can be removed again by clicking on the “x” cross.
Note
Please note that a library can only be added once regardless of the version. If you want a different version, you must first remove the old/unwanted version.
Finally, the reducer is written in the code editor. If a library the code of this library can be viewed in the Library tab become.
However, the code of the library is read-only here, as this library is provided by the system.
The code can be saved at any time using STRG-S or the Save button.
Note
It is in no way necessary to use a library. The complete The code of the reducer can also be written completely in the code editor. Straight, if there is no library for specific types of competitions, this is the only possible solution. But of course you can also use libraries, to understand their code and derive their own logic from it.
Debugger¶
The debugger makes it possible to use an evaluation function or library code by combining test data from a predefined data source with can be combined with an event and passed to the function as a parameter become.
The code can be executed step by step to see what happens. Also it is possible to open a new window with the map view and the current To open the ranking. This ranking is updated with every step in the debugger.