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