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