PreOr 2.2, build 2023-03-06
Program description and users's guide
Program PreOr allowes manipulation and management of TrailO competition data (PreO and TempO) with using theSportIDENT even without it (paper control cards). Especially is useful in building the several kinds of result withmultiday competition support. Competition may consists with PreO races, TempO races and its combinations up to 5
stages. Program alowes putting the results to the internet online.

List of contents

1.0 Data management
2.0 Main window
2.1 Competition data
2.1.1 Race
2.1.2 Competitors
2.2 Start lists
2.3 Results
2.4 FTP
2.4.1 Orienteering Adventure webservice
2.4.2 Downloading TC files
2.4.3 Automatic upload/download
2.4.4 Another FTP server
2.5 Reading out the SI and results manipulation
2.5.1 Reading out the CSV file
2.5.2 Manual input of results
2.6 Print

3.0 TempO Station
3.1 Collecting screen

1.0 Data management
Data is stored according the given directory structure this way.

Main directory:
File *.PreOr
In this file there is a competition data. Data structure is prepared for 5 stages, each stage contains
info about given stage (date, place, controls, SI, ...)
File *.zavodnici
Here is the competitors data.
Subdirectories E1-E5
Each stage directories. In these dirs are stored data of SI punching, Time controls data and all HTM
exports of the stage (*.htm, *.csv)
File *.si
Text file where the punching is stored. Name of the file correspond with ID in competitors table.
File structure:
INFO;SI-Card;CN;Mode;Source;DayOfWeek;PunchDate;PunchTime;No;Cnt
INFO - could be an race's ID setted in SIReader or a text "MANUAL" if the results were manuallychanged.
SI-Card - SI card number
CN - number of control
Mode - type of punched SI unit. It could be: STA = start; CLR = clear, CHK = check;
FIN = finish, CN = control.
Source - usually RDO, no impact to anything
DayOfWeek - day of the week, , no impact to anything
PunchDate - race date
PunchTime - punching timeNo - oder in punch list, no impact to anything
Cnt - sum of records, no impact to anything
File *.tc2
Text file where the Time controls data is stored.
Structure of the data: each cluster is on one line, first cluster=first line, etc.
One line structure: answ1answ2answ3answ4answ5answ6answ7answ8answ9answ10;time;
answ1-10 - single task answers (amount of answers is optional, if there is only one task, tren there
will be only one answer + time)
time - total time in cluster in seconds
In case of ID change in competitors table it is urgent to manually rename the *.si and *.tc2 files to keep thelink of data to the correct competitor!
Subdirectory Flags
Contains a flags (or other graphics representations). All files must be the JPG files. This subdirectoryis optional, PreOr works fine even without it.
If we want to use the flags, is necessary to copy this directory directly to the subdirs E1-E5. Files in it
are used for HTM exports, where could be in column Flag displayed. To make this happend, is necessary to keep thenames of the files (excluding JPG extension) = if we want to display the flag of Czech Republic, we shall fill thecolumn 'Flag' in competitors table with "CZE" (in dir Flags there is a file named CZE.jpg)

File preor.ini
Text file with several program settings. Each line represents one setted value. Data are stored in this order:- language (CZE or GBR)
- path to SI-log file- nothing- FTP host
- FTP user
- FTP password (open)- FTP local directory on server- Zoom of print.

Read-out SI
Program itself is not able to operate the read-out SI unit. Because of this there is a need if installed SIReader
produced by SportIDENT (it's been tested with version 2.7). SIReader can read-out the SI card and store the tada in
CSV file (with the same structure as the *.si file - ReaderUI list format)
To reading-out the SI cards during the race you have to start SIReader and PreOr together. In both programs
you need to set the same path to the generated CSV file. When competitor reads-out his SI card, this data are stored
in CSV file. This file is then checked by PreOr.
There is a possibility that sometimes can meet the SI-reading with CSV checking interval. In this case the
SIReader stops with an error. Just click to OK and read-out the SI again.

2.0 Main window
Main window shows up after the program is lunched. You can swith between czech and english by clicking topropriete flag. Just after the program starts there is not much things operable, because there is no open race yet.

Main window consists of several boxes:

2.1 Competition data
You can acces a previously stored competition data with standart Windows open dialog where you pick given*.PreOr file.
If you need to open a brand new file, use button New and to dialog SaveAs fill a name of your file. This namemust be written without extension *.PreOr. Only this way the program knows that you want to create this new file.
Is good if you prepare yourself some directory, where your data will be stored later.

2.1.1 Race
Here ia a table with all race data. Data should be stored right away, but still if you want to close the window
and not to lost the data in it, click to button Save.

Name – text field, name ot the competition
Box Stage
combobox near Stage with buttons + and –When start, the file includes only one stage. More stages can be added by clicking on button +, orstages could be puttet out by clicking on button -. The maximum amount of stages is 5.
Date, Place: textfield, input here a date and place of the race. Date must be in format YYYY-MM-DD.
Start 00: Start in given stage. It's a textfield, format HH:MM should be kept. In case that you won't
start by punching SI unit Start, the time stored here + starttime in startlist is taken as a daytime startfor a given competitor
Box Class list
Program allows to operate up to 9 different classes. Here you can fill in their names Be precise, for the rightfunction the names shall be filled from up to down without leaving any line empty.
Box ClassHighlighted class is active and can its data be edited. If no class is highlighted, you still can edit TC andcontrols, but the data won't be stored anywhere!
Is possible to copy the class data to another class. Highlight the class you want to copy the data in and incombobox "Copy data according to" pick the class you want to get the data from. By clicking on button OK
the data will be copied.

Time controls
Program allows to have in one race up to 20 clusters, each with up to 9 tasks. In table you fill in the rightanswers of the tasks. Start with Cluster 1, then 2, etc. Don't start with Cluster 2 or higher and don't left any
empty cluster between already filled!
Last column in this box is green. You can use it if during the race go something wrong and you want thiscluster to get out from the results. To make it, fill in here a „X“ and the cluster will be disabled.
Controls
Program allows operate the race with up to 40 controls with flags A-F. In yellow collumns fill in theamount of flags on each control by standart form (A, A-B, A-C, ... Is possible to write only a letter B,C,... andthe program complete it to A-B, A-C, ...) and the right answer (A,B,Z,...). In case that some control iscancelled, just rewrite the correct answer to X and recompute the results.
The rest collumns are for corresponding SI units numbers. You can fill them automaticaly by clicking
on button "Sport Ident". You can set a first number on SI you want to use. The next ones are increased byone.
Box Break 1 and Break 2
The race (the course time) could be interrupted. You can arrange it by punching SI unit (for example) "Break"and continue by punching the "Continue" SI unit. Numbers of these SI units shall be filled in a propriete
fields. Time between "From" and "To" will be deducted of the finish time.

2.1.2 Competitors
Competitors data table. You can edit all, just be careful with your edits to not put the program to someunstadart condition. Otherwise there could be some cases that you will need manually update the data.

New line you add to the table by clicking on "Add one row to the table" placed under the table.
Table can import a textfiles. You can import in fact any TXT file by clicking on "Import TXT". You need thenkeep the projected order and widths of each column in entry dialog (model line is over the table). DO NOT USE atabelator! For a free space use a space bar. TXT files are not imported directy by windows dialog Open, but you must
use Copy-Paste method from for example Notepad, where your textfile is open.
Table can import IOF XML file of entries downloaded from Eventor webpage too.
If you organize a multiday event with special entries for every day, import them to PreOr this way:
1) In ComboBox Stage set the stage you want to import competitors into.
2) Pick a XML file or TXT data
PreOr import the competitors and set to all of them start at 00 for desired stage.
3) Change the stage
4) Pick a XLM file or TXT data for other stage
PreOr check duplicities in already imported data (checking the names, case sensitive). Only new competitors
are included. For all competitors in the file is set start time at 00. Competitors outside the file have no start
time then.
Lines can be deleted by clicking with right mouse button over the line you want to put away. Pick then thefirst Pop-up menu line "Delete line...". Deleting is final, no undo function is implemented!
ID – unique competitor number, is forbidden to use one ID for more then one competitor (program allows it,
but consequences are on operator's responsibility). ID's can be automaticaly filled in by clicking onbutton „ID+“
under the tabulkou.
Registration – text field (length 7) with no influence on functionality. It's just putted to HTM exports. If you
import a XML file, here is stored your IOF ID.
Class – class in where given competitor compeete. It is very suitable to keep the class name the same as it isdefined in Race dialog (Case sensitive). If you fill the class wrong, the competitor shoul not be recognised in
SI-reading process.
SI – SI card number. Same situation as at the ID, this SI can't be used more then ones in one competition. If
you don't use SI for the results (but paper competition cards), still it is good to set at least any imaginary SI
numbers.
Name – competitor's nameFlag – you can fill with a 3-letter abbreviation of the country the flag you want to use. It has influence tonothing but displaying in HTM exports. As alternative you can use some club symbols (if you have them). Stillyou use a 3-letter code and in Flags you need the same named JPG files
Relay – relay number. Relays can have up to 5 members. Filled number identificate the competitors in one
relay. It is used unly when the raly race is setted. Is possible to let it free.
E1-E5 - Start times, it is possible to generate them automaticallyE1 pts, E1 TC, E2 pts, E2 TC, … - Each stage results. Results are filled in automatically when you once
generate the HTM results. Is possible to manually overwrite them, but they are rewrited again when you
again generate the results for given stage.
May have effect when you need add some results to the race and you have no data of this race. Then you
write this data to the table as the E1 (or any other unused E?).
Disq E1, ... , Disq E5 - You can disqualify a competitor by writing “DISK” into one of these fields. Points are for
DISK competitors still counted, but at the results table this competitor is written on the bottom and marked
as Disqualified.
Box Setting the strt times
Stage – for what stage you want to set the start times
Class – pick a class for which you want to set the starttimes. You can pick all or just one...
Interval – Start interval (in minutes). Is possible to set any interval, for example 1,5 minutes
First start – since when given class starts
Checkbox „start according the prev. stage“ – doesn't set the start randomly but according to theprevious stage results. The best starts at the end. If the checkbox „1.->X.“ is checked, the order is
opposite = the best starts first.
Swith times you use, wen manually setting th start list. It swiches start times between twocompetitors.
Data should have been saved right after the edit, but still before you close the dialog, save your data by click on
button Save.

2.2 Start lists
By click on button „Start lists“ the operator is asked to enter the stage for which he wants to generate thestart list. The HTM file consists of the startlist is generated for given stage.
Sorting the start list is not automatic, it used to be managed by operator. It can be done manually in dialog„Competitors“. When you click right mouse button over the table, the pop-up menu raised. There are several
variants how to order the table (according E1, E2, ..., name, ID, ...). Just ckick on one of those and the table will besorted. Combining of this sorting you can reach sorting for example by class and the start time together.
The start list is not published for competitors with empty start slot in the Competitors.

2.3 Results
By click on the button „Results“ the dialog window Results raised. There you can set the results output
format.

Is possible to generate results for single classes or for all classes together (according which classes are
selected). According the checked checkboxes you can make results with names and result order only (nothing
checked), with basic details (points, TCs, total course time and penality), extended details (answers of each control)with possibility to add a split times (how long each competitor solving a control).
There is possible to check the punching order. If controls are not punched in right order, they are notcounted into the final score (in detailed results are these answers marked green).
For multiday event, where the part of the competition is a TempO race so you need to merge the results
somehow, you can represent the PreO results as a TempO style with accorded penality (you can set the value next toa propriet combobox).
For relays is the result generating a little bit complicated. In fact it is necessary to have the data correcty
setted (each leg assigned to right course, all relays have the same amount of legs, personal data, ...). If everything isfine, you need to pick the right relay system. Program name these three systems actually used in TrailO as a Farsta,
Motala and Teams. It is not exact, but I don’t know that anybody named these systems yet.
Farsta = each competitor has his own given course. Usually the race is setted the way that there are several clusters,
each leg solve each cluster, but with different answers. For results you should pick from the classes list all“legs” (each leg is represented by one “class”). Program then calculate the results automatically. Beware,there is a lot of possibilities how to produce a fake results (you miss to pick all the legs in class list,...). Always
check the results, if they contain all you want!
Limit for this relay should be set for each leg as for the whole relay! It means if you have 3 legs and limit forwhole relay is 100 minutes, don’t fill into a “Race” dialog the limit is 33.3, but fill there a 100.
Motala = there is only one setted course and competitors on each leg are picking up from all the controls several ofthem to solve. Results of the relay is in fact merging these answers to one for whole course. For results you
pick only one course from the class list.
Teams = simple merge of results of all members of the relay.
Each results recalculation is written and saved to a „Competitors“ table. No matter what kind of HTM files
you want to do.
Overall results – Works as a simple merge of selected one stage results. HTM file is then saved to a root (where is
the *.PreOr file saved)
Automatic result generation – It is useful in case that there is any device where you want to display the actual
results. Generated HTM file should be updated in the Webbrowser window automatically, no need ofadditional personal to manage it. All you need is to generate the results again and again. If the checkbox„repeating“ is checked and you click on button „Results“, this action would be saved and will be recalled ininterval you can set there. Is possible to generate multiple kinds of results (one stage only, total results, oneclass only, basic results for one class and detailed results for other one, ...). What result shall be generated
you can check by click on button „Info“. On main window in information area are then displayed information
about all these actions.
All actions are canceled by click on button „Stop“

2.4 FTP
Program can sending the data on internet. This is because of online results. No internet=no online results.
The idea has been this: Program in offline mode generate the HTM result file and conditionally it can upload the files
to some server. And because it’s quite simple operation, it can be done automatically.
Previous version PreOr 2.0 operate with stable connection to any server. Because making the program
dumbproof is in this case quite rough, especially when you need automatic and stable transfers (with access rights
checking, user settings, etc.), I decided to leave this idea with any server and I provide my own one. PreOr needs toconnect to the internet (specificly to server www.o-adventure.cz) for upload the time controls from the web service(more about it at 3.0 TempO station web service). Data are stored in specific data structure. To be sure about it,
there should be several things setted:

2.4.1 Orienteering adventure webservice
Fill in the User and the Password. User can be the „OAuser“, what is a public account, where everybody canmake whatever he wants (in PreOr app of course = creating the race directories and fill it by race data). If you wantyour oun account, mail me at tomas.lestinsky@atlas.cz and I’ll make it through as soon as possible.
Personal account is good to have in case that in one date there is more competitions and you don’t wantdata from another competition fit into yours. Nobody can access your own account. All functionalities are the same.
In textfield „User“ you fill the name of your account. Password is for protection of your data. Of course you
don’t need it, but consequences are up to you. The same password is then used for enter to TempO Station. In PreOr
the password has no impact for anything.
If there is no dir structure for the race on the server (you are trying to access it for the first time), PreOr
offers in FTP dialog window in blue field „OA webservice“ only one button „Create the race web folder“. Clicking on
it you create on the server the data structure for the race. Race data needed for TempO Station are saved there too.
These data include competitors IDs, names, amount of clusters and tasks in it. No right answers are saved on theserver! Only the counts.
When this happend, PreOr hides the button „Create the race web folder“ and shows buttons for
Downloading Time Controls files („All“, „New“ and „Merge TC_*“) and „Update race into the web“.

2.4.2 Downloading TC files
To download the TC files from TempO Staton click on one of two buttons „All“ or „New“. Difference between
them is obvious. „All“ always downloads all the TC data. It could take some time according to connection speed, but
usually when you have more then 50 competitors, you can wait in minutes. And it is very long time when the PreOr
is technically blocked.
„New“ button downloads only the data which are new, it means since last download. It’s much faster... ofcourse it is when you download only a few data. Technically it works this way: PreOr tries to connect to server andcheck out the directory where it expect the TC data. If the data are there (named „CompetitorID_ClusterNo.tc2“).
PreOr downloads them, merge them to one *.tc2 file and save it to PreOr data structure together with *.si files.

When TC is downloaded, you can work with it in Manual results, print it for competitor, ... TC original data
stays on server. If you make any manual changes in already downloaded data, PreOr save a sign to *.tc2 file. It
protect the file against a repeated download and overwriting.
If you make any changes in race or competitors data, you should update them to web to make it accesablefor TempO Station. For this here is the button „Update race data into the web“.
In the blue field there is a textfield Address. It is the internet address where you can find the HTM files for
publishing.
Button „Connection test“ is here if you have suspicion that internet connection doesn’t work properly. Clickon it and on PreOr main window the result of the test is displayed.
Last button there is an „Upload selected HTM files“. It does what it says. HTM files in PreOr directory aredisplayed on the right in list. Select some of them and click to this button. Selected files will be uploaded to server.

2.4.3 Automatic upload/download
Box Automatic upload/download allows repeat the sending in interval you can set (10 minutes in basic
setting). This function is up if there is checked a checbox „repeating“ when you click on „Upload“ button. What files
are uploaded you can find out by click on button „Info“. In main window in info box there will be displayed all
automatically uploaded files.

2.4.4 Another FTP server
Sometimes you may want to save the data to another server. If so, fill in the proper data to box „Another FTP
server“ (host, user, password, path). About the path you should be very precise. PreOr doesn’t checking it, if thepath is given somehow wrong. If it is so, your data will be saved to root (if you have rights to doing it). The pathshould look something like this: „./dir/dir/dir/“ . The dot at the beginnig is important!

2.5 Reading out the SI and results manipulation

2.5.1 Reading out the CSV file
There is a very important to set the right stage! If you forget it, easily you can rewrite your previous day
results. It is very important to backup the read-out CSV file to have a possibility to rebuild the results of accidentaly
rewrited data again.
File to read-out is entered in textfield "Path to CSV file“.

Sometimes when the SI units are not programmed properly, there can be a different date. You can rewrite itby check the checkbox „Rewrite in SI log the race date“ and fill in the right one. Keep the date format YYYY-MM-DD.
Then you can simply click on button „Assign CSV only 1x“ or „CSV automatically“. Program goes through the
CSV file and if it finds some new data, it select them and save them to the stage subdirectory as „competitor’s ID“.si.
„CSV automatically“ starts automatic testing of the CSV file in interval given by textfield „Automatic assignment
interval“. Click on „STOP“ to stop it.
If the printer is connected, you can print the splits right after the read-out. Just check the checkbox „Print
splits after SI read-out“. If there is in CSV a new record, program prepare the print and send it to printer.
If you read-out the SI card which number is not associated to any competitor, you are warned about it ininformation area in main window. This SI number is added to a „Unassigned SI“ list. You don’t need to stop the CSV
checking, just go to „Competitor“ dialog and set the SI number to a correct competitor. During next CSV check the SI
shall be assigned automatically.

2.5.2 Manual results
Program allows you to manually input results data (punching, time controls) and correct SI punching if you
need to. You can during this manage the races you organise without SI. You can get into this dialog by click on large
button „Manual results“ in main window.

Dialog window contains:- two comboboxes for competitor selection (according ID or name), whose results you want to manage- textfield for competitor‘s start time
- textfield for competitor‘s finish time
- if there is setted an interruption, a textfield for times „From“ and „To“ shows up- you can edit additional SI data (not important)- box "Competitor punching"- box "Time controls"Competitor punching
In this table you can see primary two lines of data. It’s an answers line and assigned SI line (SI unit is assigned
according the entered answer). Program primary operate with SportIdent, so if there is no use of SportIdent, you stillneed to assign a fictive SI-unit numbers to your controls in „Race“ dialog. The SI-unit number is added automaticallywhile editing the answers.
If there is a mispunch (two and more answers for one control), two or more SI numbers are shown.
In this table there are more two hidden lines. To get them out, you need to click somewhere to table and roll
your mouse wheel (or use your „down arrow“ on keyboard). Third line is filled by times of punching of each control.
Not so important data, you can miss it.

In the fourth line there is an order of punching. It is important data if you want to checking it. In ideal casethere are numbers 1,2,3,... This sequence is corrupted when you punch in different order... obviously. If you edit thisline, the *.si file will be rewrited. To get it back just delete this file and let the program assign the CSV read-out fileagain.
Time controls
Here you simply fill in the answers and the time in seconds of each setted cluster.The time must be integer!

2.6 Print
The print output is optimized for thermoprinter Zonerich AB320, but shall befunctional for all Windows printers.
IMPORTANT! Before you run the program, you have to set the default printerto printer you want to use for the split times! There is no setting for selecting a printerin PreOr.
Because not all printers has the same width/height of paper, is there
implemented a bar Zoom which alowes you to optimize the output for your printer. For
AB320 the ideal value is 10. For PDF Creator seems ideal the value 30. It’s about testing.
There is possible to print any of splits later. Just pick one competitor from theprint list and click on button „Print“.
You can set, if you want on the splits mark the bad answers. Check thecheckbox „Print answers“ – in this case each mistake is marked by a small star.
„Print to printer“ you can turn off. It has sense only if the last checkbox „Print
to window“ is checked. It will show the splits in special window. It can be used forcontrol what’s going to print without wasting the paper. Or of course, you can want not
to print the splits... ;)Some printer drivers may need to rotate the printer data clockwise. If it is yourcase, check „Rotate 90°“.

3.0 TempO Station
TempO Station is a web application which communicate with PreOr and is here because of recording theanswers on TempO controls/clusters and sending them to web. This app you can launch on every device with ability
to browse the internet = no need to install anything. App is here: http://o-adventure.cz/index.php?stranka=softwareon the right side.
For entry to the app you need your Username, the same you use in PreOr. Then click on Start.
Opening page is very simple, just a title and datums of your competitions (which you uploaded into web
before by PreOr). Pick a race and click on Select.
The app loads data stored on server and goes to the next page. Here you put your password (given by PreOr,case sensitive) and select a cluster of the race where you want to pick the data from. Then click on Select and you
will go to the final screen for collecting the answers (collecting screen, described later). Lower there is a button
named „Clear local storage“. TempO Station uses the Local Storage of the device for storing the collected data and it
is good to clear it up before you start the work. So click on it if you don’t have any important data in it (like previous
measurement). Any data in Local Storage will be now gone.

3.1 Collecting screen

In the collecting screen there are:- identification, what cluster you are in and how many tasks are there.
- 2 fields for Competitor, where you select in the list the competitor who are you going to record. You canpick him by name or by ID. Doesn’t matter which way you pick him, both work the same way. You canmeasure one competitor many times, but the last data are saved only. Or in another words... by new
measure the old ones are rewrited. As the last competitor there is a Dummy. It is for measuring competitors
who are not in the list (for any reasons, like last time entering, etc.). This data are not stored, you shoud keepthem on paper.
- button START. By clicking on this you start the timer (measuring in seconds) and in the box next to it you
see the clock is on.
- Answers buttons. During the measurement you’re picking letters A-F+Z according answers of thecompetitor. If the answer is somehow corrupted, you may mark X. Timer stops right after the last answer ismarked. Recorded data shows in textfield under the Answers buttons. Here you can correct it as usual text
handling before you save it.
- Save to Local Storage. If you are lucky with your recording, click on „Save to Local Storage“. Success of thisyou can check by the number in the button. It is increased. The record is saved even when you change therecorded competitor or ID.
- Post storage to web. This text link send all Local Storage data on web, where the PreOr can download themfrom. PreOr TempoStation automatically sends the data in interval 5 minutes. Last upload is visible in infoline
below all the buttons. If you can’t see this line, probably during the sending procedure something went
wrong. Click on link “Post storage to web”. The infoline should return and keep sending the data.
Technically, the infoline is an I-frame, floating frame with the Posting script only. It means that every
5 minutes this script automatically posting all data to server without disturbing the operator. It has one
weekness – internet connection. If you lose the connection in time when this script is trying to send the data,
this operation is aborted and works no more. No data since this are posted. But no stress, you can uploadthem manually when you reach the internet again... by click on the button „Post storage to web“.
The application has been written in PHP with parts in JavaScript (aspecially the collecting screen). It
means that in some cases you can work without the internet.
When you have the connection, you start the recording (step on the collecting screen). The script
downloads all necessary data (competitors, number of clusters, ...) and have it all in memory. You can lose
the internet now and the JavaScrip doesn’t recognize it. All data management working offline (picking
competitors, saving records to Local Storage). Of course, Post storage to web won’t work.
BUT! If you accidently click „Back“ on the web, the app will try to connect. It leave the collecting
screen, but without the internet it stops with an error. And you won’t be able to return to recording!

Not only for this, it is good to have an sheet of paper with table of competitors and room for theiranswers. Every answer recorded in TempO Station you should keep as backup in the paper too! Anythingwith your device can go wrong and you don’t want to corrupt your race because of device malfunction.