uddf 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,564 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "happymapper"
4
+ require "uddf/base/models"
5
+
6
+ module UDDF
7
+ module V301
8
+ module Models
9
+ class WayAltitude
10
+ include HappyMapper
11
+
12
+ tag "wayaltitude"
13
+
14
+ attribute :way_time, Float, tag: "waytime"
15
+ content :value, Float
16
+ end
17
+
18
+ class ExposureToAltitude
19
+ include HappyMapper
20
+
21
+ tag "exposuretoaltitude"
22
+
23
+ has_one :altitude_of_exposure, Float, tag: "altitudeofexposure"
24
+ has_one :date_of_flight, Base::Models::DateTimeField, tag: "dateofflight"
25
+ has_one :surface_interval_before_altitude_exposure, Float, tag: "surfaceintervalbeforealtitudeexposure"
26
+ has_one :total_length_of_exposure, Float, tag: "totallengthofexposure"
27
+ has_one :transportation, String
28
+ end
29
+
30
+ class SurfaceIntervalBeforeDive
31
+ include HappyMapper
32
+
33
+ tag "surfaceintervalbeforedive"
34
+
35
+ has_one :exposure_to_altitude, ExposureToAltitude, tag: "exposuretoaltitude"
36
+ has_one :infinity, String
37
+ has_one :passed_time, Float, tag: "passedtime"
38
+ has_many :way_altitudes, WayAltitude, tag: "wayaltitude"
39
+ end
40
+
41
+ class SurfaceIntervalAfterDive
42
+ include HappyMapper
43
+
44
+ tag "surfaceintervalafterdive"
45
+
46
+ has_one :exposure_to_altitude, ExposureToAltitude, tag: "exposuretoaltitude"
47
+ has_one :infinity, String
48
+ has_one :passed_time, Float, tag: "passedtime"
49
+ has_many :way_altitudes, WayAltitude, tag: "wayaltitude"
50
+ end
51
+
52
+ class TankPressure
53
+ include HappyMapper
54
+
55
+ tag "tankpressure"
56
+
57
+ attribute :ref, String
58
+ content :value, Float
59
+ end
60
+
61
+ class SwitchMix
62
+ include HappyMapper
63
+
64
+ tag "switchmix"
65
+
66
+ attribute :ref, String
67
+ end
68
+
69
+ class SetPo2
70
+ include HappyMapper
71
+
72
+ tag "setpo2"
73
+
74
+ content :value, Float
75
+ end
76
+
77
+ class Decostop
78
+ include HappyMapper
79
+
80
+ tag "decostop"
81
+
82
+ attribute :kind, String
83
+ attribute :deco_depth, Float, tag: "decodepth"
84
+ attribute :duration, Float
85
+ end
86
+
87
+ class BatteryChargeCondition
88
+ include HappyMapper
89
+
90
+ tag "batterychargecondition"
91
+
92
+ attribute :device_ref, String, tag: "deviceref"
93
+ attribute :tank_ref, String, tag: "tankref"
94
+ content :value, Float
95
+ end
96
+
97
+ class Alarm
98
+ include HappyMapper
99
+
100
+ tag "alarm"
101
+
102
+ attribute :level, Float
103
+ attribute :tank_ref, String, tag: "tankref"
104
+ content :value, String
105
+ end
106
+
107
+ class Waypoint
108
+ include HappyMapper
109
+
110
+ tag "waypoint"
111
+
112
+ has_many :alarms, Alarm, tag: "alarm"
113
+ has_many :battery_charge_conditions, BatteryChargeCondition, tag: "batterychargecondition"
114
+ has_one :cns, Float
115
+ has_many :deco_stops, Decostop, tag: "decostop"
116
+ has_one :depth, Float
117
+ has_one :dive_time, Float, tag: "divetime"
118
+ has_one :heading, Float
119
+ has_one :otu, Float
120
+ has_one :remaining_bottom_time, Float, tag: "remainingbottomtime"
121
+ has_one :remaining_o2_time, Float, tag: "remainingo2time"
122
+ has_many :set_po2s, SetPo2, tag: "setpo2"
123
+ has_one :switch_mix, SwitchMix, tag: "switchmix"
124
+ has_many :tank_pressures, TankPressure, tag: "tankpressure"
125
+ has_one :temperature, Float
126
+ end
127
+
128
+ class InformationBeforeDive
129
+ include HappyMapper
130
+
131
+ tag "informationbeforedive"
132
+
133
+ has_one :air_temperature, Float, tag: "airtemperature"
134
+ has_one :alcohol_before_dive, Base::Models::AlcoholBeforeDive, tag: "alcoholbeforedive"
135
+ has_one :altitude, Float
136
+ has_one :apparatus, String
137
+ has_one :datetime, DateTime
138
+ has_one :dive_number, Integer, tag: "divenumber"
139
+ has_one :internal_dive_number, Integer, tag: "internaldivenumber"
140
+ has_many :links, Base::Models::Link, tag: "link"
141
+ has_one :medication_before_dive, Base::Models::MedicationBeforeDive, tag: "medicationbeforedive"
142
+ has_one :no_suit, String, tag: "nosuit"
143
+ has_one :platform, String
144
+ has_one :price, Base::Models::Price
145
+ has_one :purpose, String
146
+ has_one :state_of_rest_before_dive, String, tag: "stateofrestbeforedive"
147
+ has_one :surface_interval_before_dive, SurfaceIntervalBeforeDive, tag: "surfaceintervalbeforedive"
148
+ has_one :trip_membership, String, tag: "tripmembership"
149
+ end
150
+
151
+ class GlobalAlarmsGiven
152
+ include HappyMapper
153
+
154
+ tag "globalalarmsgiven"
155
+
156
+ has_many :global_alarms, String, tag: "globalalarm"
157
+ end
158
+
159
+ class EquipmentUsed
160
+ include HappyMapper
161
+
162
+ tag "equipmentused"
163
+
164
+ has_one :lead_quantity, Float, tag: "leadquantity"
165
+ has_many :links, Base::Models::Link, tag: "link"
166
+ end
167
+
168
+ class InformationAfterDive
169
+ include HappyMapper
170
+
171
+ tag "informationafterdive"
172
+
173
+ has_one :any_symptoms, Base::Models::AnySymptoms, tag: "anysymptoms"
174
+ has_one :current, String
175
+ has_one :desaturation_time, Float, tag: "desaturationtime"
176
+ has_one :dive_duration, Float, tag: "diveduration"
177
+ has_one :dive_plan, String, tag: "diveplan"
178
+ has_one :dive_table, String, tag: "divetable"
179
+ has_one :equipment_malfunction, String, tag: "equipmentmalfunction"
180
+ has_one :equipment_used, EquipmentUsed, tag: "equipmentused"
181
+ has_one :global_alarms_given, GlobalAlarmsGiven, tag: "globalalarmsgiven"
182
+ has_one :greatest_depth, Float, tag: "greatestdepth"
183
+ has_one :highest_po2, Float, tag: "highestpo2"
184
+ has_one :lowest_temperature, Float, tag: "lowesttemperature"
185
+ has_one :no_flight_time, Float, tag: "noflighttime"
186
+ has_one :notes, Base::Models::Notes
187
+ has_one :observations, Base::Models::Observations
188
+ has_one :pressure_drop, Float, tag: "pressuredrop"
189
+ has_many :problems, String, tag: "problems"
190
+ has_one :program, String
191
+ has_many :ratings, Base::Models::Rating, tag: "rating"
192
+ has_one :surface_interval_after_dive, SurfaceIntervalAfterDive, tag: "surfaceintervalafterdive"
193
+ has_one :thermal_comfort, String, tag: "thermalcomfort"
194
+ has_one :visibility, Float
195
+ has_one :workload, String
196
+ end
197
+
198
+ class Samples
199
+ include HappyMapper
200
+
201
+ tag "samples"
202
+
203
+ has_many :waypoints, Waypoint, tag: "waypoint"
204
+ end
205
+
206
+ class TankData
207
+ include HappyMapper
208
+
209
+ tag "tankdata"
210
+
211
+ attribute :id, String
212
+ has_one :breathing_consumption_volume, Float, tag: "breathingconsumptionvolume"
213
+ has_many :links, Base::Models::Link, tag: "link"
214
+ has_one :tank_pressure_begin, Float, tag: "tankpressurebegin"
215
+ has_one :tank_pressure_end, Float, tag: "tankpressureend"
216
+ has_one :tank_volume, Float, tag: "tankvolume"
217
+ end
218
+
219
+ class Dive
220
+ include HappyMapper
221
+
222
+ tag "dive"
223
+
224
+ attribute :id, String
225
+ has_one :information_after_dive, InformationAfterDive, tag: "informationafterdive"
226
+ has_one :information_before_dive, InformationBeforeDive, tag: "informationbeforedive"
227
+ has_one :application_data, Base::Models::ApplicationDataV300, tag: "applicationdata"
228
+ has_one :samples, Samples
229
+ has_many :tank_data, TankData, tag: "tankdata"
230
+ end
231
+
232
+ class RepetitionGroup
233
+ include HappyMapper
234
+
235
+ tag "repetitiongroup"
236
+
237
+ attribute :id, String
238
+ has_many :dives, Dive, tag: "dive"
239
+ end
240
+
241
+ class ProfileData
242
+ include HappyMapper
243
+
244
+ tag "profiledata"
245
+
246
+ has_many :repetition_groups, RepetitionGroup, tag: "repetitiongroup"
247
+ end
248
+
249
+ class Descent
250
+ include HappyMapper
251
+
252
+ tag "descent"
253
+
254
+ has_many :waypoints, Waypoint, tag: "waypoint"
255
+ end
256
+
257
+ class Ascent
258
+ include HappyMapper
259
+
260
+ tag "ascent"
261
+
262
+ has_many :waypoints, Waypoint, tag: "waypoint"
263
+ end
264
+
265
+ class MixChange
266
+ include HappyMapper
267
+
268
+ tag "mixchange"
269
+
270
+ has_one :ascent, Ascent
271
+ has_one :descent, Descent
272
+ end
273
+
274
+ class InputProfile
275
+ include HappyMapper
276
+
277
+ tag "inputprofile"
278
+
279
+ has_many :links, Base::Models::Link, tag: "link"
280
+ has_many :waypoints, Waypoint, tag: "waypoint"
281
+ end
282
+
283
+ class Output
284
+ include HappyMapper
285
+
286
+ tag "output"
287
+
288
+ has_one :lingo, String
289
+ has_one :file_format, String, tag: "fileformat"
290
+ has_one :file_name, String, tag: "filename"
291
+ has_one :headline, String
292
+ has_one :remark, String
293
+ end
294
+
295
+ class Profile
296
+ include HappyMapper
297
+
298
+ tag "profile"
299
+
300
+ has_one :application_data, Base::Models::ApplicationDataV300, tag: "applicationdata"
301
+ has_one :deco_model, Base::Models::DecoModel, tag: "decomodel"
302
+ has_one :deep_stop_time, Float, tag: "deepstoptime"
303
+ has_one :density, Float
304
+ has_one :input_profile, InputProfile, tag: "inputprofile"
305
+ has_many :links, Base::Models::Link, tag: "link"
306
+ has_one :maximum_ascending_rate, Float, tag: "maximumascendingrate"
307
+ has_one :mix_change, MixChange, tag: "mixchange"
308
+ has_one :output, Output
309
+ has_one :surface_interval_after_dive, SurfaceIntervalAfterDive, tag: "surfaceintervalafterdive"
310
+ has_one :surface_interval_before_dive, SurfaceIntervalBeforeDive, tag: "surfaceintervalbeforedive"
311
+ has_one :title, String
312
+ end
313
+
314
+ class TableScope
315
+ include HappyMapper
316
+
317
+ tag "tablescope"
318
+
319
+ has_one :altitude, Float
320
+ has_one :bottom_time_maximum, Float, tag: "bottomtimemaximum"
321
+ has_one :bottom_time_minimum, Float, tag: "bottomtimeminimum"
322
+ has_one :bottom_time_step_begin, Float, tag: "bottomtimestepbegin"
323
+ has_one :bottom_time_step_end, Float, tag: "bottomtimestepend"
324
+ has_one :dive_depth_begin, Float, tag: "divedepthbegin"
325
+ has_one :dive_depth_end, Float, tag: "divedepthend"
326
+ has_one :dive_depth_step, Float, tag: "divedepthstep"
327
+ end
328
+
329
+ class Table
330
+ include HappyMapper
331
+
332
+ tag "table"
333
+
334
+ has_one :table_scope, TableScope, tag: "tablescope"
335
+ end
336
+
337
+ class CalculateProfile
338
+ include HappyMapper
339
+
340
+ tag "calculateprofile"
341
+
342
+ has_many :profiles, Profile, tag: "profile"
343
+ end
344
+
345
+ class CalculateTable
346
+ include HappyMapper
347
+
348
+ tag "calculatetable"
349
+
350
+ has_many :tables, Table, tag: "table"
351
+ end
352
+
353
+ class BottomTimeTableScope
354
+ include HappyMapper
355
+
356
+ tag "bottomtimetablescope"
357
+
358
+ has_one :breathing_consumption_volume_begin, Float, tag: "breathingconsumptionvolumebegin"
359
+ has_one :breathing_consumption_volume_end, Float, tag: "breathingconsumptionvolumeend"
360
+ has_one :breathing_consumption_volume_step, Float, tag: "breathingconsumptionvolumestep"
361
+ has_one :dive_depth_begin, Float, tag: "divedepthbegin"
362
+ has_one :dive_depth_end, Float, tag: "divedepthend"
363
+ has_one :dive_depth_step, Float, tag: "divedepthstep"
364
+ has_one :tank_pressure_begin, Float, tag: "tankpressurebegin"
365
+ has_one :tank_pressure_reserve, Float, tag: "tankpressurereserve"
366
+ has_one :tank_volume_begin, Float, tag: "tankvolumebegin"
367
+ has_one :tank_volume_end, Float, tag: "tankvolumeend"
368
+ end
369
+
370
+ class BottomTimeTable
371
+ include HappyMapper
372
+
373
+ tag "bottomtimetable"
374
+
375
+ attribute :id, String
376
+ has_one :application_data, Base::Models::ApplicationDataV300, tag: "applicationdata"
377
+ has_one :bottom_time_table_scope, BottomTimeTableScope, tag: "bottomtimetablescope"
378
+ has_many :links, Base::Models::Link, tag: "link"
379
+ has_one :output, Output
380
+ has_one :title, String
381
+ end
382
+
383
+ class CalculateBottomTimeTable
384
+ include HappyMapper
385
+
386
+ tag "calculatebottomtimetable"
387
+
388
+ has_many :bottom_time_tables, BottomTimeTable, tag: "bottomtimetable"
389
+ end
390
+
391
+ class TableGeneration
392
+ include HappyMapper
393
+
394
+ tag "tablegeneration"
395
+
396
+ has_one :calculate_bottom_time_table, CalculateBottomTimeTable, tag: "calculatebottomtimetable"
397
+ has_one :calculate_profile, CalculateProfile, tag: "calculateprofile"
398
+ has_one :calculate_table, CalculateTable, tag: "calculatetable"
399
+ end
400
+
401
+ class EquipmentPart
402
+ include HappyMapper
403
+
404
+ tag "equipmentpart"
405
+
406
+ attribute :id, String
407
+ has_many :alias_names, String, tag: "aliasname"
408
+ has_one :manufacturer, Base::Models::Manufacturer
409
+ has_one :model, String
410
+ has_one :name, String
411
+ has_one :next_service_date, Base::Models::DateTimeField, tag: "nextservicedate"
412
+ has_one :notes, Base::Models::Notes
413
+ has_one :purchase, Base::Models::Purchase
414
+ has_one :serial_number, String, tag: "serialnumber"
415
+ has_one :service_interval, Integer, tag: "serviceinterval"
416
+ end
417
+
418
+ class Lead < EquipmentPart
419
+ include HappyMapper
420
+
421
+ tag "lead"
422
+
423
+ has_one :lead_quantity, Integer, tag: "leadquantity"
424
+ end
425
+
426
+ class Rebreather < EquipmentPart
427
+ include HappyMapper
428
+
429
+ tag "rebreather"
430
+ end
431
+
432
+ class Suit < EquipmentPart
433
+ include HappyMapper
434
+
435
+ tag "suit"
436
+
437
+ has_one :suit_type, String, tag: "suittype"
438
+ end
439
+
440
+ class Tank < EquipmentPart
441
+ include HappyMapper
442
+
443
+ tag "tank"
444
+
445
+ has_one :tank_material, String, tag: "tankmaterial"
446
+ has_one :tank_volume, Float, tag: "tankvolume"
447
+ end
448
+
449
+ class Camera
450
+ include HappyMapper
451
+
452
+ tag "camera"
453
+
454
+ has_one :body, EquipmentPart
455
+ has_many :flashes, EquipmentPart, tag: "flash"
456
+ has_one :housing, EquipmentPart
457
+ has_one :lens, EquipmentPart
458
+ end
459
+
460
+ class EquipmentContent
461
+ include HappyMapper
462
+
463
+ has_many :boots, EquipmentPart, tag: "boots"
464
+ has_many :buoyancy_control_devices, EquipmentPart, tag: "buoyancycontroldevice"
465
+ has_many :cameras, Camera, tag: "camera"
466
+ has_many :compasses, EquipmentPart, tag: "compass"
467
+ has_many :dive_computers, EquipmentPart, tag: "divecomputer"
468
+ has_many :fins, EquipmentPart, tag: "fins"
469
+ has_many :gloves, EquipmentPart, tag: "gloves"
470
+ has_many :knives, EquipmentPart, tag: "knife"
471
+ has_many :leads, Lead, tag: "lead"
472
+ has_many :lights, EquipmentPart, tag: "light"
473
+ has_many :masks, EquipmentPart, tag: "mask"
474
+ has_many :rebreathers, Rebreather, tag: "rebreather"
475
+ has_many :regulators, EquipmentPart, tag: "regulator"
476
+ has_many :scooters, EquipmentPart, tag: "scooter"
477
+ has_many :suits, Suit, tag: "suit"
478
+ has_many :tanks, Tank, tag: "tank"
479
+ has_many :various_pieces, EquipmentPart, tag: "variouspieces"
480
+ has_many :video_cameras, EquipmentPart, tag: "videocamera"
481
+ has_many :watches, EquipmentPart, tag: "watch"
482
+ end
483
+
484
+ class EquipmentConfiguration < EquipmentContent
485
+ include HappyMapper
486
+
487
+ tag "equipmentconfiguration"
488
+
489
+ has_many :alias_names, String, tag: "aliasname"
490
+ has_many :links, Base::Models::Link, tag: "link"
491
+ has_one :name, String
492
+ has_one :notes, Base::Models::Notes
493
+ end
494
+
495
+ class Equipment < EquipmentContent
496
+ include HappyMapper
497
+
498
+ tag "equipment"
499
+
500
+ has_many :compressors, EquipmentPart, tag: "compressor"
501
+ has_one :equipment_configuration, EquipmentConfiguration, tag: "equipmentconfiguration"
502
+ end
503
+
504
+ class BuddyOwnerShared
505
+ include HappyMapper
506
+
507
+ attribute :id, String
508
+ has_one :address, Base::Models::Address
509
+ has_one :contact, Base::Models::Contact
510
+ has_one :dive_insurances, Base::Models::DiveInsurances, tag: "diveinsurances"
511
+ has_one :dive_permissions, Base::Models::DivePermissions, tag: "divepermissions"
512
+ has_one :equipment, Equipment
513
+ has_one :medical, Base::Models::Medical
514
+ has_one :notes, Base::Models::Notes
515
+ has_one :personal, Base::Models::Personal
516
+ end
517
+
518
+ class Buddy < BuddyOwnerShared
519
+ include HappyMapper
520
+
521
+ tag "buddy"
522
+
523
+ attribute :id, String
524
+ has_one :certification, Base::Models::Certification
525
+ has_one :student, String
526
+ end
527
+
528
+ class Owner < BuddyOwnerShared
529
+ include HappyMapper
530
+
531
+ tag "owner"
532
+
533
+ attribute :id, String
534
+ has_one :education, Base::Models::Education
535
+ end
536
+
537
+ class Diver
538
+ include HappyMapper
539
+
540
+ tag "diver"
541
+
542
+ has_many :buddies, Buddy, tag: "buddy"
543
+ has_one :owner, Owner
544
+ end
545
+
546
+ class Uddf
547
+ include HappyMapper
548
+
549
+ tag "uddf"
550
+
551
+ attribute :version, String
552
+ has_one :dive_computer_control, Base::Models::DiveComputerControlV300, tag: "divecomputercontrol"
553
+ has_one :diver, Diver
554
+ has_one :dive_site, Base::Models::DiveSite, tag: "divesite"
555
+ has_one :dive_trip, Base::Models::DiveTrip, tag: "divetrip"
556
+ has_one :gas_definitions, Base::Models::GasDefinitions, tag: "gasdefinitions"
557
+ has_one :generator, Base::Models::Generator
558
+ has_one :media_data, Base::Models::MediaData, tag: "mediadata"
559
+ has_one :profile_data, ProfileData, tag: "profiledata"
560
+ has_one :table_generation, TableGeneration, tag: "tablegeneration"
561
+ end
562
+ end
563
+ end
564
+ end