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