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