uddf 0.3.0 → 0.4.1

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