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