-
Notifications
You must be signed in to change notification settings - Fork 1
/
YFS2CSV_Documentation.txt
325 lines (281 loc) · 18 KB
/
YFS2CSV_Documentation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
YFS2CSV
Version 0.1
By Decaff_42
Copyright (c) 2017 by Decaff_42
-------------------------------------------------------------------------------
YFS2CSV Program Documentation
-------------------------------------------------------------------------------
1. Introduction
2. How It Works
A. Opening The Program
B. Preamble
C. Initial Checks
D. Grabbing YFS Files
E. Extracting Sortie Information
F. Writing CSV File
3. Output Data
A. Time Step
B. Parameter Descriptions
4. Software License
5. Version History
-------------------------------------------------------------------------------
1. Introduction
-------------------------------------------------------------------------------
YFS2CSV is a Python 3.4 program that converts a specific sortie recorded in a
YFS file to a csv file. This CSV file has data names and Units embedded in two
header rows. There are three sub-folders included in the program release. The
Documentation Folder holds this file and any other documentation needed to
properly operate the program. The Input YFS Files folder is where the YFS files
saved by the user need to be placed. Currently in this folder there is a short
test YFS file named 'test.yfs'. You can practice running the code on this file.
In the Output CSV Files, there is a sample output csv file.
To successfully run YFS2CSV, please make sure you have Python 3 installed on
your computer. This code was written and tested with Python 3.4.2, so if you do
not already have a version of Python 3 installed, Python 3.4.2 is the preferred
option.
-------------------------------------------------------------------------------
2. How It Works
-------------------------------------------------------------------------------
Operating YFS2CSV is straight forward. Everything should appear in either the
Python Shell window or the Command window depending on the operating system
installed on the computer.
A. Opening The Program
-------------------------------------------------------------------------------
To open YFS2CSV, open the converter.py file in Python 3 and press F5 or select
Run to start the program. Note that while each time the program runs to
completion you will need to press F5 or select Run to start the program again,
you do not need to re-open converter.py.
Time
YFS2CSV Converter
Version 0.1
By Decaff_42
Copyright (c) 2017 by Decaff_42.
Licensed under GNU GPLv3
---------------------------------------------------------
Refer to the Reference Document for License information,
instructions and for any questions about the output of
this program. Further questions may be addressed to
decaff_42 via a Private Message on YSFlight Headquarters.
---------------------------------------------------------
C. Initial Checks
-------------------------------------------------------------------------------
Every time the program opens, it will run a check to make sure that the
appropriate folders (for file input and output) are present. If it detects that
these folders are not available, it will attempt to create them. Make sure you
store the YFS2CSV folder in a location where you have read and write
permissions.
D. Grabbing YFS Files
-------------------------------------------------------------------------------
All files that end with .yfs will be detected by YFS2CSV and be displayed for
user selection. To select a file, enter the corresponding number next to the
file name when prompted by the program. The only inputs that YFS2CSV can accept
are numbers between 0 and the highest number shown in the list of YFS files.
YFS2CSV will continue to prompt the user for a valid answer until one is
provided.
---------------------------------------------------------
Select a File to Load
(0) test.yfs
Enter File Number Here:0
---------------------------------------------------------
E. Extracting Sortie Information
-------------------------------------------------------------------------------
Once the YFS file has been identified by the user, YFS2CSV will find all the
sorties in the replay file. A sortie is the flight data generated by an
aircraft from between the time it spawns into the game and the time it is
either destroyed or the pilot leaves the aircraft. These will be listed in
order of appearance in the YFS file, but this does not necessarily mean they
will be in chronological order. Each sortie will list the name of the aircraft,
and if the .yfs file is from an online flight, it will also list the username
of the pilot.
---------------------------------------------------------
Extracting data from test.yfs
Raw Data Extracted...
Looking for sorties to convert.
Select Sortie to convert to CSV.
(0) F-18E_SUPERHORNET
Enter File Number Here:0
Parsing Sortie Data.
---------------------------------------------------------
In a similar manner to how the YFS file was selected, enter the number of the
sortie you wish to process and convert to a CSV file. Once selected, the data
will be parsed and ready to be written to a file.
F. Writing CSV File
-------------------------------------------------------------------------------
When prompted by YFS2CSV, you may enter a custom filename for the output CSV
file. It does not need to end with .csv, but you may include that if you wish.
If you do not enter a filename (as shown below), a default name will be
generated based on the date and current local time. All files will be saved to
the Output CSV File folder in the program directory.
---------------------------------------------------------
Please enter a name for the output csv file.
CSV Name:
Data Written to File: YFS2CSV_22-July-2017_17.55.34.csv
---------------------------------------------------------
-------------------------------------------------------------------------------
3. Output Data
-------------------------------------------------------------------------------
The output data generated by this program is a simple parse and re-alignment of
the raw data contained in the YFS file. Waspe414 from YSFHQ posted a large
repository of knowledge of the YFS file
(https://forum.ysfhq.com/viewtopic.php?p=90235#p90235), which proved helpful
for determining some particulars about the variables.
A. Time Step
-------------------------------------------------------------------------------
Looking at any output data it is possible to see that the YFS recording does
not proceed with a consistant time change between recorded data. This is a
method of space-saving and only when there are change to the aircraft's state,
position or orientation, will data be recorded.
B. Parameter Descriptions
-------------------------------------------------------------------------------
+-----------+---------+------------------------------------------------------+
| Parameter | Units | Description |
+-----------+---------+------------------------------------------------------+
| Time | Seconds | The truncated time of the recorded slice of data. |
| | | Time may go out to three decimal places. |
+-----------+---------+------------------------------------------------------+
| X-Pos | Meters | The X-direction coordinate of the aircraft's |
| | | position. Positive X values are to the East of the |
| | | map center, while negative X values are to the |
| | | West of the map center. |
+-----------+---------+------------------------------------------------------+
| Y-Pos | Meters | The Y-direction coordinate of the aircraft's |
| | | position. Also the altitude of the aircraft. |
+-----------+---------+------------------------------------------------------+
| Z-Pos | Meters | The Z-direction coordinate of the aircraft's |
| | | position. Positive Z values are to the North of |
| | | the map center, while negative Z values are to |
| | | the South of the map center. |
+-----------+---------+------------------------------------------------------+
| Compass | Radians | The Compass Heading of the aircraft with 0 being |
| Heading | | due North. Value ranges between -pi/2 to pi/2, |
| | | which both represent due south. Positive values are |
| | | for when the aircraft is pointed east of north. |
+-----------+---------+------------------------------------------------------+
| Pitch | Radians | The Pitch Angle of the aircraft. Positive when nose |
| Angle | | is towards the sky, negative when the nose is |
| | | pointed towards the ground. 0 is when the |
| | | aircraft is pointed at the horizon. Value ranges |
| | | from -pi/2 to pi/2. |
+-----------+---------+------------------------------------------------------+
| Bank | Radians | Rotation of aircraft about nose-to-tail axis. |
| Angle | | Turn to the left is a positive value and a turn |
| | | to the right is a negative value. 0 is when the |
| | | aircraft is upright and wings-level. Value |
| | | ranges from -pi/2 to pi/2. |
+-----------+---------+------------------------------------------------------+
| G | N/A | The G-load on the aircraft. Positive or negative. |
| | | Only goes to one decimal place. |
+-----------+---------+------------------------------------------------------+
| Flight | N/A | 0 = Flying |
| State | | 1 = Rolling |
| | | 2 = Stalled |
| | | 3 = [Unknown] |
| | | 4 = Dead |
| | | 5 = [Unknown] |
| | | 6 = Stopped |
+-----------+---------+------------------------------------------------------+
| VGW | N/A | The position of the Variable Geometry Wing on the |
| | | aircraft. Value goes from 0 (Swept back) to 255 |
| | | (Swept forward). |
+-----------+---------+------------------------------------------------------+
| Airbrake | N/A | Position of the spoilers. 0 is retracted, 255 is |
| | | fully deployed. |
+-----------+---------+------------------------------------------------------+
| Flaps | N/A | Position of the flaps. 0 is retracted, 255 is fully |
| | | deployed. Default Values: |
| | | 0 = Flaps Retracted |
| | | 63 = 1/4 Deployed |
| | | 127 = Half Deployed |
| | | 191 = 3/4 Deployed |
| | | 255 = Fully Deployed |
+-----------+---------+------------------------------------------------------+
| Landing | N/A | Position of the landing gear. 0 is fully retracted |
| Gear | | and 255 is fully deployed down. |
+-----------+---------+------------------------------------------------------+
| Brakes | N/A | Value of brake application from 0 (not on) to |
| | | 255 (full braking). |
+-----------+---------+------------------------------------------------------+
| Smoke | N/A | Boolean Value: 0 = OFF, 1 = ON. |
+-----------+---------+------------------------------------------------------+
| Vapor | N/A | Boolean Value: 0 = OFF, 1 = ON. |
| Trail | | |
+-----------+---------+------------------------------------------------------+
| Misc | N/A | The SUM of the following values to determine |
| | | other aircraft conditions: |
| | | 1 = Afterburner ON |
| | | 4 = Velocity Indicator |
| | | 8 = Overrun |
| | | 16 = Beacon Lights ON |
| | | 32 = Navigation Lights ON |
| | | 64 = Strobe Lights ON |
| | | 128 = Landing Lights ON |
+-----------+---------+------------------------------------------------------+
| Strength | N/A | Strength of the aircraft. When this value reaches |
| | | 0, the aircraft is "killed". |
+-----------+---------+------------------------------------------------------+
| Throttle | N/A | The throttle position of the aircraft. Note this is |
| | | slaved to the thrust reverser, so as that spools |
| | | up, so will the throttle. Values from 0 (No Thrust) |
| | | to 99 (Maximum Thrust). Even in different stages |
| | | of Afterburner, these values will still be used. |
+-----------+---------+------------------------------------------------------+
| Elevator | N/A | The position of the Elevator. Values go from |
| | | -99 to +99 with 0 being the neutral position. |
| | | Positive values indicated a pitch up elevator |
| | | position. |
+-----------+---------+------------------------------------------------------+
| Aileron | N/A | Aileron Position with 0 being neutral. Left roll |
| | | is a positive value, right roll is a negative value. |
| | | Values are from -99 to 99. |
+-----------+---------+------------------------------------------------------+
| Rudder | N/A | Ruder Position with 0 being neutral. Left turn |
| | | is a positive value, right turn is a negative value. |
| | | Values are from -99 to 99. |
+-----------+---------+------------------------------------------------------+
| Thrust | N/A | Thrust Vectoring Control. Values from 0 to 99: |
| Vector | | 0 = Forward Thrust |
| | | 9 = 1st Step |
| | | 19 = 2nd Step |
| | | 29 = 3rd Step |
| | | 39 = 4th Step |
| | | 49 = 5th Step |
| | | 59 = 6th Step |
| | | 69 = 7th Step |
| | | 79 = 8th Step |
| | | 89 = 9th Step |
| | | 99 = Full Thrust Vector |
+-----------+---------+------------------------------------------------------+
| Reverse | N/A | Thrust Reverse Command. Requires DAT file |
| Thrust | | to slave in the Throttle. 0 (No Reverse) to 99 |
| | | (Full Reverse). |
+-----------+---------+------------------------------------------------------+
| Bomb | N/A | Bomb Bay Position (0 = Closed, 99 = Open) |
| Bay | | |
+-----------+---------+------------------------------------------------------+
| Turrets | N/A | [Unknown] Aircraft with more turrets will have |
| | | extra columns with no header. |
+-----------+---------+------------------------------------------------------+
-------------------------------------------------------------------------------
4. Software License
-------------------------------------------------------------------------------
YFS2CSV is licensed under the GNU GPLv3. A full copy of this license can be
found at: https://www.gnu.org/licenses/gpl-3.0.en.html
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-------------------------------------------------------------------------------
5. Version History
-------------------------------------------------------------------------------
+---------+--------------------------------------------------------+
| Version | Description |
+---------+--------------------------------------------------------+
| 0.1 | Basic .yfs file and sortie detection algorithm |
| | adapted from Flight Data Recorder to find all sorties |
| | in .yfs file. New class created to facilitate handling |
| | data from each sortie and then parse the selected |
| | sortie into data that could be placed into a .csv file |
+---------+--------------------------------------------------------+