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.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -4
- data/.rubocop_todo.yml +2 -7
- data/Gemfile.lock +1 -1
- data/README.md +36 -6
- data/lib/uddf/base/models/deco.rb +102 -0
- data/lib/uddf/base/models/dive_computer.rb +193 -0
- data/lib/uddf/base/models/generic.rb +787 -0
- data/lib/uddf/base/models/media.rb +66 -0
- data/lib/uddf/base/models.rb +6 -69
- data/lib/uddf/v300/models.rb +563 -0
- data/lib/uddf/v301/models.rb +564 -0
- data/lib/uddf/v310/models.rb +611 -0
- data/lib/uddf/v320/models.rb +632 -0
- data/lib/uddf/v321/models.rb +10 -0
- data/lib/uddf/v322/models.rb +636 -0
- data/lib/uddf/v323/models.rb +113 -1087
- data/lib/uddf/v330/models.rb +122 -1083
- data/lib/uddf/v331/models.rb +124 -1085
- data/lib/uddf/version.rb +1 -1
- data/lib/uddf.rb +7 -12
- metadata +11 -1
@@ -0,0 +1,66 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module UDDF
|
4
|
+
module Base
|
5
|
+
module Models
|
6
|
+
class ImageData
|
7
|
+
include HappyMapper
|
8
|
+
|
9
|
+
tag "imagedata"
|
10
|
+
|
11
|
+
has_one :aperture, Float
|
12
|
+
has_one :datetime, DateTime
|
13
|
+
has_one :exposure_compensation, Float, tag: "exposurecompensation"
|
14
|
+
has_one :film_speed, Integer, tag: "filmspeed"
|
15
|
+
has_one :focal_length, Float, tag: "focallength"
|
16
|
+
has_one :focusing_distance, Float, tag: "focusingdistance"
|
17
|
+
has_one :metering_method, String, tag: "meteringmethod"
|
18
|
+
has_one :shutter_speed, Float, tag: "shutterspeed"
|
19
|
+
end
|
20
|
+
|
21
|
+
class Image
|
22
|
+
include HappyMapper
|
23
|
+
|
24
|
+
tag "image"
|
25
|
+
|
26
|
+
attribute :id, String
|
27
|
+
attribute :height, Integer
|
28
|
+
attribute :width, Integer
|
29
|
+
attribute :format, String
|
30
|
+
has_one :image_data, ImageData, tag: "imagedata"
|
31
|
+
has_one :object_name, String, tag: "objectname"
|
32
|
+
has_one :title, String
|
33
|
+
end
|
34
|
+
|
35
|
+
class Video
|
36
|
+
include HappyMapper
|
37
|
+
|
38
|
+
tag "video"
|
39
|
+
|
40
|
+
attribute :id, String
|
41
|
+
has_one :object_name, String, tag: "objectname"
|
42
|
+
has_one :title, String
|
43
|
+
end
|
44
|
+
|
45
|
+
class Audio
|
46
|
+
include HappyMapper
|
47
|
+
|
48
|
+
tag "audio"
|
49
|
+
|
50
|
+
attribute :id, String
|
51
|
+
has_one :object_name, String, tag: "objectname"
|
52
|
+
has_one :title, String
|
53
|
+
end
|
54
|
+
|
55
|
+
class MediaData
|
56
|
+
include HappyMapper
|
57
|
+
|
58
|
+
tag "mediadata"
|
59
|
+
|
60
|
+
has_many :audio_files, Audio, tag: "audio"
|
61
|
+
has_many :image_files, Image, tag: "image"
|
62
|
+
has_many :video_files, Video, tag: "video"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/lib/uddf/base/models.rb
CHANGED
@@ -1,75 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "uddf/base/models/generic"
|
4
|
+
require "uddf/base/models/deco"
|
5
|
+
require "uddf/base/models/media"
|
6
|
+
require "uddf/base/models/dive_computer"
|
7
|
+
|
3
8
|
module UDDF
|
4
9
|
module Base
|
5
|
-
module Models
|
6
|
-
##
|
7
|
-
# Inside <address> the own (<owner> element) address data,
|
8
|
-
# or that of dive buddies (<buddy> element),
|
9
|
-
# or that of a shop (<shop> element) etc., are given.
|
10
|
-
class Address
|
11
|
-
include HappyMapper
|
12
|
-
|
13
|
-
tag "address"
|
14
|
-
|
15
|
-
has_one :street, String
|
16
|
-
has_one :city, String
|
17
|
-
has_one :postcode, String
|
18
|
-
has_one :country, String
|
19
|
-
has_one :province, String
|
20
|
-
end
|
21
|
-
|
22
|
-
##
|
23
|
-
# Inside <contact> data concerning getting in touch with some one are
|
24
|
-
# given, like phone number, email address, language etc.
|
25
|
-
class Contact
|
26
|
-
include HappyMapper
|
27
|
-
|
28
|
-
tag "contact"
|
29
|
-
|
30
|
-
has_many :emails, String, tag: "email"
|
31
|
-
has_many :faxes, String, tag: "fax"
|
32
|
-
has_many :homepages, String, tag: "homepage"
|
33
|
-
has_many :languages, String, tag: "language"
|
34
|
-
has_many :mobile_phones, String, tag: "mobilephone"
|
35
|
-
has_many :phones, String, tag: "phone"
|
36
|
-
end
|
37
|
-
|
38
|
-
class DateTimeField
|
39
|
-
include HappyMapper
|
40
|
-
|
41
|
-
element :raw, String, tag: "datetime"
|
42
|
-
|
43
|
-
# Lazily parse on first access; memoize in @date_time
|
44
|
-
def date_time
|
45
|
-
return @date_time if @date_time
|
46
|
-
|
47
|
-
content = raw.to_s.strip
|
48
|
-
return nil if content.empty?
|
49
|
-
|
50
|
-
@date_time =
|
51
|
-
case content
|
52
|
-
when /^\d{4}$/ # "YYYY"
|
53
|
-
DateTime.new(content.to_i, 1, 1)
|
54
|
-
when /^\d{4}-\d{2}$/ # "YYYY-MM"
|
55
|
-
y, m = content.split("-").map!(&:to_i)
|
56
|
-
DateTime.new(y, m, 1)
|
57
|
-
else
|
58
|
-
begin
|
59
|
-
DateTime.iso8601(content)
|
60
|
-
rescue ArgumentError, Date::Error
|
61
|
-
begin
|
62
|
-
DateTime.rfc3339(content)
|
63
|
-
rescue ArgumentError, Date::Error
|
64
|
-
DateTime.parse(content)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
# Allow manual assignment if you ever need it
|
71
|
-
attr_writer :date_time
|
72
|
-
end
|
73
|
-
end
|
10
|
+
module Models; end
|
74
11
|
end
|
75
12
|
end
|
@@ -0,0 +1,563 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "happymapper"
|
4
|
+
require "uddf/base/models"
|
5
|
+
|
6
|
+
module UDDF
|
7
|
+
module V300
|
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
|
+
content :value, Float
|
75
|
+
end
|
76
|
+
|
77
|
+
class Decostop
|
78
|
+
include HappyMapper
|
79
|
+
|
80
|
+
tag "decostop"
|
81
|
+
|
82
|
+
attribute :kind, String
|
83
|
+
attribute :deco_depth, Float, tag: "decodepth"
|
84
|
+
attribute :duration, Float
|
85
|
+
end
|
86
|
+
|
87
|
+
class BatteryChargeCondition
|
88
|
+
include HappyMapper
|
89
|
+
|
90
|
+
tag "batterychargecondition"
|
91
|
+
|
92
|
+
attribute :device_ref, String, tag: "deviceref"
|
93
|
+
attribute :tank_ref, String, tag: "tankref"
|
94
|
+
content :value, Float
|
95
|
+
end
|
96
|
+
|
97
|
+
class Alarm
|
98
|
+
include HappyMapper
|
99
|
+
|
100
|
+
tag "alarm"
|
101
|
+
|
102
|
+
attribute :value_attr, Float
|
103
|
+
attribute :tank_ref, String, tag: "tankref"
|
104
|
+
content :value, String
|
105
|
+
end
|
106
|
+
|
107
|
+
class Waypoint
|
108
|
+
include HappyMapper
|
109
|
+
|
110
|
+
tag "waypoint"
|
111
|
+
|
112
|
+
has_many :alarms, Alarm, tag: "alarm"
|
113
|
+
has_many :battery_charge_conditions, BatteryChargeCondition, tag: "batterychargecondition"
|
114
|
+
has_one :cns, Float
|
115
|
+
has_many :deco_stops, Decostop, tag: "decostop"
|
116
|
+
has_one :depth, Float
|
117
|
+
has_one :dive_time, Float, tag: "divetime"
|
118
|
+
has_one :heading, Float
|
119
|
+
has_one :otu, Float
|
120
|
+
has_one :remaining_bottom_time, Float, tag: "remainingbottomtime"
|
121
|
+
has_one :remaining_o2_time, Float, tag: "remainingo2time"
|
122
|
+
has_many :set_po2s, SetPo2, tag: "setpo2"
|
123
|
+
has_one :switch_mix, SwitchMix, tag: "switchmix"
|
124
|
+
has_many :tank_pressures, TankPressure, tag: "tankpressure"
|
125
|
+
has_one :temperature, Float
|
126
|
+
end
|
127
|
+
|
128
|
+
class InformationBeforeDive
|
129
|
+
include HappyMapper
|
130
|
+
|
131
|
+
tag "informationbeforedive"
|
132
|
+
|
133
|
+
has_one :air_temperature, Float, tag: "airtemperature"
|
134
|
+
has_one :alcohol_before_dive, Base::Models::AlcoholBeforeDive, tag: "alcoholbeforedive"
|
135
|
+
has_one :altitude, Float
|
136
|
+
has_one :apparatus, String
|
137
|
+
has_one :datetime, DateTime
|
138
|
+
has_one :dive_number, Integer, tag: "divenumber"
|
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 :platform, String
|
144
|
+
has_one :price, Base::Models::Price
|
145
|
+
has_one :purpose, String
|
146
|
+
has_one :state_of_rest_before_dive, String, tag: "stateofrestbeforedive"
|
147
|
+
has_one :surface_interval_before_dive, SurfaceIntervalBeforeDive, tag: "surfaceintervalbeforedive"
|
148
|
+
has_one :trip_membership, String, tag: "tripmembership"
|
149
|
+
end
|
150
|
+
|
151
|
+
class GlobalAlarmsGiven
|
152
|
+
include HappyMapper
|
153
|
+
|
154
|
+
tag "globalalarmsgiven"
|
155
|
+
|
156
|
+
has_many :global_alarms, String, tag: "globalalarm"
|
157
|
+
end
|
158
|
+
|
159
|
+
class EquipmentUsed
|
160
|
+
include HappyMapper
|
161
|
+
|
162
|
+
tag "equipmentused"
|
163
|
+
|
164
|
+
has_one :lead_quantity, Float, tag: "leadquantity"
|
165
|
+
has_many :links, Base::Models::Link, tag: "link"
|
166
|
+
end
|
167
|
+
|
168
|
+
class InformationAfterDive
|
169
|
+
include HappyMapper
|
170
|
+
|
171
|
+
tag "informationafterdive"
|
172
|
+
|
173
|
+
has_one :any_symptoms, Base::Models::AnySymptoms, tag: "anysymptoms"
|
174
|
+
has_one :current, String
|
175
|
+
has_one :desaturation_time, Float, tag: "desaturationtime"
|
176
|
+
has_one :dive_duration, Float, tag: "diveduration"
|
177
|
+
has_one :dive_plan, String, tag: "diveplan"
|
178
|
+
has_one :dive_table, String, tag: "divetable"
|
179
|
+
has_one :equipment_malfunction, String, tag: "equipmentmalfunction"
|
180
|
+
has_one :equipment_used, EquipmentUsed, tag: "equipmentused"
|
181
|
+
has_one :global_alarms_given, GlobalAlarmsGiven, tag: "globalalarmsgiven"
|
182
|
+
has_one :greatest_depth, Float, tag: "greatestdepth"
|
183
|
+
has_one :highest_po2, Float, tag: "highestpo2"
|
184
|
+
has_one :lowest_temperature, Float, tag: "lowesttemperature"
|
185
|
+
has_one :no_flight_time, Float, tag: "noflighttime"
|
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, 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::ApplicationDataV300, 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::ApplicationDataV300, tag: "applicationdata"
|
300
|
+
has_one :deco_model, Base::Models::DecoModel, 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, SurfaceIntervalAfterDive, tag: "surfaceintervalafterdive"
|
309
|
+
has_one :surface_interval_before_dive, 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::ApplicationDataV300, 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 EquipmentPart
|
401
|
+
include HappyMapper
|
402
|
+
|
403
|
+
tag "equipmentpart"
|
404
|
+
|
405
|
+
attribute :id, String
|
406
|
+
has_many :alias_names, String, tag: "aliasname"
|
407
|
+
has_one :manufacturer, Base::Models::Manufacturer
|
408
|
+
has_one :model, String
|
409
|
+
has_one :name, String
|
410
|
+
has_one :next_service_date, Base::Models::DateTimeField, tag: "nextservicedate"
|
411
|
+
has_one :notes, Base::Models::Notes
|
412
|
+
has_one :purchase, Base::Models::Purchase
|
413
|
+
has_one :serial_number, String, tag: "serialnumber"
|
414
|
+
has_one :service_interval, Integer, tag: "serviceinterval"
|
415
|
+
end
|
416
|
+
|
417
|
+
class Lead < EquipmentPart
|
418
|
+
include HappyMapper
|
419
|
+
|
420
|
+
tag "lead"
|
421
|
+
|
422
|
+
has_one :lead_quantity, Integer, tag: "leadquantity"
|
423
|
+
end
|
424
|
+
|
425
|
+
class Rebreather < EquipmentPart
|
426
|
+
include HappyMapper
|
427
|
+
|
428
|
+
tag "rebreather"
|
429
|
+
end
|
430
|
+
|
431
|
+
class Suit < EquipmentPart
|
432
|
+
include HappyMapper
|
433
|
+
|
434
|
+
tag "suit"
|
435
|
+
|
436
|
+
has_one :suit_type, String, tag: "suittype"
|
437
|
+
end
|
438
|
+
|
439
|
+
class Tank < EquipmentPart
|
440
|
+
include HappyMapper
|
441
|
+
|
442
|
+
tag "tank"
|
443
|
+
|
444
|
+
has_one :tank_material, String, tag: "tankmaterial"
|
445
|
+
has_one :tank_volume, Float, tag: "tankvolume"
|
446
|
+
end
|
447
|
+
|
448
|
+
class Camera
|
449
|
+
include HappyMapper
|
450
|
+
|
451
|
+
tag "camera"
|
452
|
+
|
453
|
+
has_one :body, EquipmentPart
|
454
|
+
has_many :flashes, EquipmentPart, tag: "flash"
|
455
|
+
has_one :housing, EquipmentPart
|
456
|
+
has_one :lens, EquipmentPart
|
457
|
+
end
|
458
|
+
|
459
|
+
class EquipmentContent
|
460
|
+
include HappyMapper
|
461
|
+
|
462
|
+
has_many :boots, EquipmentPart, tag: "boots"
|
463
|
+
has_many :buoyancy_control_devices, EquipmentPart, tag: "buoyancycontroldevice"
|
464
|
+
has_many :cameras, Camera, tag: "camera"
|
465
|
+
has_many :compasses, EquipmentPart, tag: "compass"
|
466
|
+
has_many :dive_computers, EquipmentPart, tag: "divecomputer"
|
467
|
+
has_many :fins, EquipmentPart, tag: "fins"
|
468
|
+
has_many :gloves, EquipmentPart, tag: "gloves"
|
469
|
+
has_many :knives, EquipmentPart, tag: "knife"
|
470
|
+
has_many :leads, Lead, tag: "lead"
|
471
|
+
has_many :lights, EquipmentPart, tag: "light"
|
472
|
+
has_many :masks, EquipmentPart, tag: "mask"
|
473
|
+
has_many :rebreathers, Rebreather, tag: "rebreather"
|
474
|
+
has_many :regulators, EquipmentPart, tag: "regulator"
|
475
|
+
has_many :scooters, EquipmentPart, tag: "scooter"
|
476
|
+
has_many :suits, Suit, tag: "suit"
|
477
|
+
has_many :tanks, Tank, tag: "tank"
|
478
|
+
has_many :various_pieces, EquipmentPart, tag: "variouspieces"
|
479
|
+
has_many :video_cameras, EquipmentPart, tag: "videocamera"
|
480
|
+
has_many :watches, EquipmentPart, tag: "watch"
|
481
|
+
end
|
482
|
+
|
483
|
+
class EquipmentConfiguration < EquipmentContent
|
484
|
+
include HappyMapper
|
485
|
+
|
486
|
+
tag "equipmentconfiguration"
|
487
|
+
|
488
|
+
has_many :alias_names, String, tag: "aliasname"
|
489
|
+
has_many :links, Base::Models::Link, tag: "link"
|
490
|
+
has_one :name, String
|
491
|
+
has_one :notes, Base::Models::Notes
|
492
|
+
end
|
493
|
+
|
494
|
+
class Equipment < EquipmentContent
|
495
|
+
include HappyMapper
|
496
|
+
|
497
|
+
tag "equipment"
|
498
|
+
|
499
|
+
has_many :compressors, EquipmentPart, tag: "compressor"
|
500
|
+
has_one :equipment_configuration, EquipmentConfiguration, tag: "equipmentconfiguration"
|
501
|
+
end
|
502
|
+
|
503
|
+
class BuddyOwnerShared
|
504
|
+
include HappyMapper
|
505
|
+
|
506
|
+
attribute :id, String
|
507
|
+
has_one :address, Base::Models::Address
|
508
|
+
has_one :contact, Base::Models::Contact
|
509
|
+
has_one :dive_insurances, Base::Models::DiveInsurances, tag: "diveinsurances"
|
510
|
+
has_one :dive_permissions, Base::Models::DivePermissions, tag: "divepermissions"
|
511
|
+
has_one :equipment, Equipment
|
512
|
+
has_one :medical, Base::Models::Medical
|
513
|
+
has_one :notes, Base::Models::Notes
|
514
|
+
has_one :personal, Base::Models::Personal
|
515
|
+
end
|
516
|
+
|
517
|
+
class Buddy < BuddyOwnerShared
|
518
|
+
include HappyMapper
|
519
|
+
|
520
|
+
tag "buddy"
|
521
|
+
|
522
|
+
attribute :id, String
|
523
|
+
has_one :certification, Base::Models::Certification
|
524
|
+
has_one :student, String
|
525
|
+
end
|
526
|
+
|
527
|
+
class Owner < BuddyOwnerShared
|
528
|
+
include HappyMapper
|
529
|
+
|
530
|
+
tag "owner"
|
531
|
+
|
532
|
+
attribute :id, String
|
533
|
+
has_one :education, Base::Models::Education
|
534
|
+
end
|
535
|
+
|
536
|
+
class Diver
|
537
|
+
include HappyMapper
|
538
|
+
|
539
|
+
tag "diver"
|
540
|
+
|
541
|
+
has_many :buddies, Buddy, tag: "buddy"
|
542
|
+
has_one :owner, Owner
|
543
|
+
end
|
544
|
+
|
545
|
+
class Uddf
|
546
|
+
include HappyMapper
|
547
|
+
|
548
|
+
tag "uddf"
|
549
|
+
|
550
|
+
attribute :version, String
|
551
|
+
has_one :dive_computer_control, Base::Models::DiveComputerControlV300, tag: "divecomputercontrol"
|
552
|
+
has_one :diver, Diver
|
553
|
+
has_one :dive_site, Base::Models::DiveSite, tag: "divesite"
|
554
|
+
has_one :dive_trip, Base::Models::DiveTrip, tag: "divetrip"
|
555
|
+
has_one :gas_definitions, Base::Models::GasDefinitions, tag: "gasdefinitions"
|
556
|
+
has_one :generator, Base::Models::Generator
|
557
|
+
has_one :media_data, Base::Models::MediaData, tag: "mediadata"
|
558
|
+
has_one :profile_data, ProfileData, tag: "profiledata"
|
559
|
+
has_one :table_generation, TableGeneration, tag: "tablegeneration"
|
560
|
+
end
|
561
|
+
end
|
562
|
+
end
|
563
|
+
end
|