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