adiwg-mdtranslator 2.20.0.pre.beta.10 → 2.21.0.pre.beta.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +46 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_acquisition.rb +133 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_environment.rb +47 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_event.rb +88 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrument.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEvent.rb +77 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEventList.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +11 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_objective.rb +104 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_operation.rb +119 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_pass.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_plan.rb +80 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_platform.rb +87 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requestedDate.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requirement.rb +98 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_revision.rb +50 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_acquisition.rb +199 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_environment.rb +58 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_event.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrument.rb +98 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEvent.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEventList.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_objective.rb +155 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_operation.rb +178 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_pass.rb +72 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_plan.rb +93 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_platform.rb +117 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_requestedDate.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_requirement.rb +139 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_revision.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_acquisition.rb +103 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_environment.rb +82 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_event.rb +123 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrument.rb +92 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrumentationEvent.rb +83 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrumentationEventList.rb +73 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_mdMetadata.rb +11 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_objective.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_operation.rb +131 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_pass.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_plan.rb +76 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_platform.rb +102 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_requestedDate.rb +44 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_requirement.rb +111 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_revision.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_acquisition.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_environment.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_event.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrument.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEvent.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEventList.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +2 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_objective.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_operation.rb +34 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_pass.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_plan.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_platform.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requestedDate.rb +26 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requirement.rb +36 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_revision.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_acquisition.rb +195 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb +18 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_environment.rb +58 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_event.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrument.rb +98 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEvent.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEventList.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_objective.rb +155 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_operation.rb +178 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_pass.rb +72 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_plan.rb +93 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_platform.rb +117 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requestedDate.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requirement.rb +139 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_revision.rb +55 -0
- metadata +72 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6d6f205260d7cd279df45c873810e05a328d4fd8915be617b29c4c57044af13
|
4
|
+
data.tar.gz: fcfc19da4c41bc3b93b528f57122119cc12d8f988e3afc9553f4275f639cd833
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '097c2bf2ffdcfc10e63b16d44cdf72fc9e30c0cdebeab4366e07eae6d0c13dc52b782c3882d17516c8843cb19e7cecc2c064aa8e89dd56cbeccb254acae4e8f1'
|
7
|
+
data.tar.gz: 14fab38df050287ba08b0337aeaf9ebc4c2e42a113a63709cff0019f7dc3ba761534c35586e055aef57b5b147cfb4571eb466cd5a208f90da431aa3e09742309
|
data/Gemfile.lock
CHANGED
@@ -143,7 +143,8 @@ class InternalMetadata
|
|
143
143
|
associatedResources: [],
|
144
144
|
additionalDocuments: [],
|
145
145
|
funding: [],
|
146
|
-
dataQuality: []
|
146
|
+
dataQuality: [],
|
147
|
+
acquisitions: []
|
147
148
|
}
|
148
149
|
end
|
149
150
|
|
@@ -158,6 +159,7 @@ class InternalMetadata
|
|
158
159
|
# acquisition ----------------------------
|
159
160
|
def newAcquisition
|
160
161
|
{
|
162
|
+
scope: {},
|
161
163
|
plans: [],
|
162
164
|
requirements: [],
|
163
165
|
objectives: [],
|
@@ -175,19 +177,23 @@ class InternalMetadata
|
|
175
177
|
averageAirTemperature: nil,
|
176
178
|
maxRelativeHumidity: nil,
|
177
179
|
maxAltitude: nil,
|
178
|
-
meteorologicalConditions: nil
|
180
|
+
meteorologicalConditions: nil,
|
181
|
+
solarAzimuth: nil,
|
182
|
+
solarElevation: nil
|
183
|
+
|
179
184
|
}
|
180
185
|
end
|
181
186
|
|
182
187
|
def newEvent
|
183
188
|
{
|
184
189
|
eventId: nil,
|
190
|
+
identifier: {},
|
185
191
|
trigger: nil,
|
186
192
|
context: nil,
|
187
193
|
sequence: nil,
|
188
194
|
dateTime: nil,
|
189
195
|
expectedObjectives: [],
|
190
|
-
relatedPass:
|
196
|
+
relatedPass: {},
|
191
197
|
relatedSensors: []
|
192
198
|
}
|
193
199
|
end
|
@@ -199,7 +205,29 @@ class InternalMetadata
|
|
199
205
|
identifier: {},
|
200
206
|
instrumentType: nil,
|
201
207
|
description: nil,
|
202
|
-
mountedOn:
|
208
|
+
mountedOn: {},
|
209
|
+
histories: [],
|
210
|
+
hostId: {}
|
211
|
+
}
|
212
|
+
end
|
213
|
+
|
214
|
+
def newInstrumentationEvent
|
215
|
+
{
|
216
|
+
citations: [],
|
217
|
+
description: nil,
|
218
|
+
extent: {},
|
219
|
+
eventType: nil,
|
220
|
+
revisionHistories: [],
|
221
|
+
}
|
222
|
+
end
|
223
|
+
|
224
|
+
def newInstrumentationEventList
|
225
|
+
{
|
226
|
+
citation: {},
|
227
|
+
description: nil,
|
228
|
+
locale: {},
|
229
|
+
constraints: [],
|
230
|
+
instrumentationEvents: []
|
203
231
|
}
|
204
232
|
end
|
205
233
|
|
@@ -240,14 +268,15 @@ class InternalMetadata
|
|
240
268
|
def newOperation
|
241
269
|
{
|
242
270
|
operationId: nil,
|
271
|
+
description: nil,
|
243
272
|
citation: {},
|
244
273
|
identifier: {},
|
245
274
|
status: nil,
|
246
275
|
operationType: nil,
|
247
276
|
objectives: [],
|
248
|
-
|
277
|
+
parentOperation: {},
|
249
278
|
childOperations: [],
|
250
|
-
plan:
|
279
|
+
plan: {},
|
251
280
|
platforms: [],
|
252
281
|
significantEvents: []
|
253
282
|
}
|
@@ -267,6 +296,14 @@ class InternalMetadata
|
|
267
296
|
}
|
268
297
|
end
|
269
298
|
|
299
|
+
def newRevision
|
300
|
+
{
|
301
|
+
description: nil,
|
302
|
+
responsibleParty: {},
|
303
|
+
dateInfo: []
|
304
|
+
}
|
305
|
+
end
|
306
|
+
|
270
307
|
def newPlatform
|
271
308
|
{
|
272
309
|
platformId: nil,
|
@@ -274,7 +311,8 @@ class InternalMetadata
|
|
274
311
|
identifier: {},
|
275
312
|
description: nil,
|
276
313
|
sponsors: [],
|
277
|
-
instruments: []
|
314
|
+
instruments: [],
|
315
|
+
history: []
|
278
316
|
}
|
279
317
|
end
|
280
318
|
|
@@ -541,6 +579,7 @@ class InternalMetadata
|
|
541
579
|
# data dictionary ------------------------
|
542
580
|
def newDataDictionary
|
543
581
|
{
|
582
|
+
dictionaryId: nil,
|
544
583
|
description: nil,
|
545
584
|
subjects: [],
|
546
585
|
citation: {},
|
@@ -0,0 +1,133 @@
|
|
1
|
+
require_relative 'module_scope'
|
2
|
+
require_relative 'module_objective'
|
3
|
+
require_relative 'module_requirement'
|
4
|
+
require_relative 'module_platform'
|
5
|
+
require_relative 'module_instrument'
|
6
|
+
require_relative 'module_operation'
|
7
|
+
require_relative 'module_pass'
|
8
|
+
require_relative 'module_event'
|
9
|
+
require_relative 'module_environment'
|
10
|
+
require_relative 'module_plan'
|
11
|
+
|
12
|
+
module ADIWG
|
13
|
+
module Mdtranslator
|
14
|
+
module Readers
|
15
|
+
module MdJson
|
16
|
+
|
17
|
+
module Acquisition
|
18
|
+
|
19
|
+
def self.unpack(hAcquisition, responseObj, inContext = nil)
|
20
|
+
|
21
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
22
|
+
|
23
|
+
outContext = 'acquisition'
|
24
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
25
|
+
|
26
|
+
# instance classes needed in script
|
27
|
+
intMetadataClass = InternalMetadata.new
|
28
|
+
intAcquisition = intMetadataClass.newAcquisition
|
29
|
+
|
30
|
+
if hAcquisition.has_key?('scope')
|
31
|
+
unless hAcquisition['scope'].empty?
|
32
|
+
hReturn = Scope.unpack(hAcquisition['scope'], responseObj, outContext)
|
33
|
+
unless hReturn.nil?
|
34
|
+
intAcquisition[:scope] = hReturn
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
if hAcquisition.has_key?('plan')
|
40
|
+
aItems = hAcquisition['plan']
|
41
|
+
aItems.each do |item|
|
42
|
+
hReturn = Plan.unpack(item, responseObj, outContext)
|
43
|
+
unless hReturn.nil?
|
44
|
+
intAcquisition[:plans] << hReturn
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
if hAcquisition.has_key?('requirement')
|
50
|
+
aItems = hAcquisition['requirement']
|
51
|
+
aItems.each do |item|
|
52
|
+
hReturn = Requirement.unpack(item, responseObj, outContext)
|
53
|
+
unless hReturn.nil?
|
54
|
+
intAcquisition[:requirements] << hReturn
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
if hAcquisition.has_key?('objective')
|
60
|
+
aItems = hAcquisition['objective']
|
61
|
+
aItems.each do |item|
|
62
|
+
hReturn = Objective.unpack(item, responseObj, outContext)
|
63
|
+
unless hReturn.nil?
|
64
|
+
intAcquisition[:objectives] << hReturn
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
if hAcquisition.has_key?('platform')
|
70
|
+
aItems = hAcquisition['platform']
|
71
|
+
aItems.each do |item|
|
72
|
+
hReturn = Platform.unpack(item, responseObj, outContext)
|
73
|
+
unless hReturn.nil?
|
74
|
+
intAcquisition[:platforms] << hReturn
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
if hAcquisition.has_key?('instrument')
|
80
|
+
aItems = hAcquisition['instrument']
|
81
|
+
aItems.each do |item|
|
82
|
+
hReturn = Instrument.unpack(item, responseObj, outContext)
|
83
|
+
unless hReturn.nil?
|
84
|
+
intAcquisition[:instruments] << hReturn
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
if hAcquisition.has_key?('operation')
|
90
|
+
aItems = hAcquisition['operation']
|
91
|
+
aItems.each do |item|
|
92
|
+
hReturn = Operation.unpack(item, responseObj, outContext)
|
93
|
+
unless hReturn.nil?
|
94
|
+
intAcquisition[:operations] << hReturn
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
if hAcquisition.has_key?('event')
|
100
|
+
aItems = hAcquisition['event']
|
101
|
+
aItems.each do |item|
|
102
|
+
hReturn = Event.unpack(item, responseObj, outContext)
|
103
|
+
unless hReturn.nil?
|
104
|
+
intAcquisition[:events] << hReturn
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
if hAcquisition.has_key?('pass')
|
110
|
+
aItems = hAcquisition['pass']
|
111
|
+
aItems.each do |item|
|
112
|
+
hReturn = Pass.unpack(item, responseObj, outContext)
|
113
|
+
unless hReturn.nil?
|
114
|
+
intAcquisition[:passes] << hReturn
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
if hAcquisition.has_key?('environment')
|
120
|
+
intAcquisition[:environment] = Environment.unpack(hAcquisition['environment'], responseObj, outContext)
|
121
|
+
end
|
122
|
+
|
123
|
+
return intAcquisition
|
124
|
+
|
125
|
+
end
|
126
|
+
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module ADIWG
|
2
|
+
module Mdtranslator
|
3
|
+
module Readers
|
4
|
+
module MdJson
|
5
|
+
|
6
|
+
module Environment
|
7
|
+
def self.unpack(hEnvironment, responseObj, inContext = nil)
|
8
|
+
|
9
|
+
intMetadataClass = InternalMetadata.new
|
10
|
+
intEnvironment = intMetadataClass.newEnvironment
|
11
|
+
|
12
|
+
outContext = 'environment'
|
13
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
14
|
+
|
15
|
+
if hEnvironment.has_key?('averageAirTemperature')
|
16
|
+
intEnvironment[:averageAirTemperature] = hEnvironment['averageAirTemperature']
|
17
|
+
end
|
18
|
+
|
19
|
+
if hEnvironment.has_key?('maxRelativeHumidity')
|
20
|
+
intEnvironment[:maxRelativeHumidity] = hEnvironment['maxRelativeHumidity']
|
21
|
+
end
|
22
|
+
|
23
|
+
if hEnvironment.has_key?('maxAltitude')
|
24
|
+
intEnvironment[:maxAltitude] = hEnvironment['maxAltitude']
|
25
|
+
end
|
26
|
+
|
27
|
+
if hEnvironment.has_key?('meteorologicalConditions')
|
28
|
+
intEnvironment[:meteorologicalConditions] = hEnvironment['meteorologicalConditions']
|
29
|
+
end
|
30
|
+
|
31
|
+
if hEnvironment.has_key?('solarAzimuth')
|
32
|
+
intEnvironment[:solarAzimuth] = hEnvironment['solarAzimuth']
|
33
|
+
end
|
34
|
+
|
35
|
+
if hEnvironment.has_key?('solarElevation')
|
36
|
+
intEnvironment[:solarElevation] = hEnvironment['solarElevation']
|
37
|
+
end
|
38
|
+
|
39
|
+
intEnvironment
|
40
|
+
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
require_relative 'module_identifier'
|
2
|
+
require_relative 'module_dateTime'
|
3
|
+
require_relative 'module_objective'
|
4
|
+
require_relative 'module_pass'
|
5
|
+
require_relative 'module_instrument'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Readers
|
10
|
+
module MdJson
|
11
|
+
|
12
|
+
module Event
|
13
|
+
def self.unpack(hEvent, responseObj, inContext = nil)
|
14
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
15
|
+
|
16
|
+
intMetadataClass = InternalMetadata.new
|
17
|
+
intEvent = intMetadataClass.newEvent
|
18
|
+
|
19
|
+
outContext = 'Event'
|
20
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
21
|
+
|
22
|
+
if hEvent.has_key?('eventId')
|
23
|
+
intEvent[:eventId] = hEvent['eventId']
|
24
|
+
else
|
25
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
26
|
+
end
|
27
|
+
|
28
|
+
if hEvent.has_key?('identifier')
|
29
|
+
intEvent[:identifier] = Identifier.unpack(hEvent['identifier'], responseObj, outContext)
|
30
|
+
else
|
31
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
32
|
+
end
|
33
|
+
|
34
|
+
if hEvent.has_key?('trigger')
|
35
|
+
intEvent[:trigger] = hEvent['trigger']
|
36
|
+
else
|
37
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
38
|
+
end
|
39
|
+
|
40
|
+
if hEvent.has_key?('context')
|
41
|
+
intEvent[:context] = hEvent['context']
|
42
|
+
else
|
43
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
44
|
+
end
|
45
|
+
|
46
|
+
if hEvent.has_key?('sequence')
|
47
|
+
intEvent[:sequence] = hEvent['sequence']
|
48
|
+
else
|
49
|
+
@MessagePath.issueWarning(40, responseObj, outContext,)
|
50
|
+
end
|
51
|
+
|
52
|
+
if hEvent.has_key?('time')
|
53
|
+
intEvent[:time] = DateTime.unpack(hEvent['time'], responseObj, outContext)
|
54
|
+
else
|
55
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
56
|
+
end
|
57
|
+
|
58
|
+
if hEvent.has_key?('expectedObjective')
|
59
|
+
hEvent['expectedObjective'].each do |item|
|
60
|
+
hReturn = Objective.unpack(item, responseObj, outContext)
|
61
|
+
unless hReturn.nil?
|
62
|
+
intEvent[:expectedObjectives] << hReturn
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
if hEvent.has_key?('relatedPass')
|
68
|
+
intEvent[:relatedPass] = Pass.unpack(hEvent['relatedPass'], responseObj, outContext)
|
69
|
+
end
|
70
|
+
|
71
|
+
if hEvent.has_key?('relatedSensor')
|
72
|
+
hEvent['relatedSensor'].each do |item|
|
73
|
+
hReturn = Instrument.unpack(item, responseObj, outContext)
|
74
|
+
unless hReturn.nil?
|
75
|
+
intEvent[:relatedSensors] << hReturn
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
intEvent
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require_relative 'module_citation'
|
2
|
+
require_relative 'module_platform'
|
3
|
+
require_relative 'module_instrumentationEventList'
|
4
|
+
require_relative 'module_identifier'
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Readers
|
9
|
+
module MdJson
|
10
|
+
|
11
|
+
module Instrument
|
12
|
+
def self.unpack(hInstrument, responseObj, inContext = nil)
|
13
|
+
|
14
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
15
|
+
|
16
|
+
intMetadataClass = InternalMetadata.new
|
17
|
+
intInstrument = intMetadataClass.newInstrument
|
18
|
+
|
19
|
+
outContext = 'instrument'
|
20
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
21
|
+
|
22
|
+
if hInstrument.has_key?('instrumentId')
|
23
|
+
intInstrument[:instrumentId] = hInstrument['instrumentId']
|
24
|
+
else
|
25
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
26
|
+
end
|
27
|
+
|
28
|
+
if hInstrument.has_key?('citation')
|
29
|
+
intInstrument[:citation] = Citation.unpack(hInstrument['citation'], responseObj, outContext)
|
30
|
+
end
|
31
|
+
|
32
|
+
if hInstrument.has_key?('identifier')
|
33
|
+
intInstrument[:identifier] = Identifier.unpack(hInstrument['identifier'], responseObj, outContext)
|
34
|
+
else
|
35
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
36
|
+
end
|
37
|
+
|
38
|
+
if hInstrument.has_key?('instrumentType')
|
39
|
+
intInstrument[:instrumentType] = hInstrument['instrumentType']
|
40
|
+
else
|
41
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
42
|
+
end
|
43
|
+
|
44
|
+
if hInstrument.has_key?('description')
|
45
|
+
intInstrument[:description] = hInstrument['description']
|
46
|
+
end
|
47
|
+
|
48
|
+
if hInstrument.has_key?('mountedOn')
|
49
|
+
intInstrument[:mountedOn] = Platform.unpack(hInstrument['mountedOn'], responseObj, outContext)
|
50
|
+
end
|
51
|
+
|
52
|
+
if hInstrument.has_key?('history')
|
53
|
+
hInstrument['history'].each do |item|
|
54
|
+
hReturn = InstrumentationEventList.unpack(item, responseObj, outContext)
|
55
|
+
unless hReturn.nil?
|
56
|
+
intInstrument[:histories] << hReturn
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
if hInstrument.has_key?('hostId')
|
62
|
+
intInstrument[:hostId] = Identifier.unpack(hInstrument['hostId'], responseObj, outContext)
|
63
|
+
end
|
64
|
+
|
65
|
+
intInstrument
|
66
|
+
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require_relative 'module_citation'
|
2
|
+
require_relative 'module_extent'
|
3
|
+
require_relative 'module_revision'
|
4
|
+
|
5
|
+
module ADIWG
|
6
|
+
module Mdtranslator
|
7
|
+
module Readers
|
8
|
+
module MdJson
|
9
|
+
|
10
|
+
module InstrumentationEvent
|
11
|
+
def self.unpack(hInstrumentationEvent, responseObj, inContext = nil)
|
12
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
13
|
+
|
14
|
+
intMetadataClass = InternalMetadata.new
|
15
|
+
intInstrumentationEvent = intMetadataClass.newInstrumentationEvent
|
16
|
+
|
17
|
+
outContext = 'instrumentation event'
|
18
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
19
|
+
|
20
|
+
eventTypeArray = [
|
21
|
+
"announcement",
|
22
|
+
"calibration",
|
23
|
+
"calibrationCoefficientUpdate",
|
24
|
+
"dataLoss",
|
25
|
+
"fatal",
|
26
|
+
"manoeuvre",
|
27
|
+
"missingData",
|
28
|
+
"notice",
|
29
|
+
"prelaunch",
|
30
|
+
"severe",
|
31
|
+
"switchOff",
|
32
|
+
"switchOn",
|
33
|
+
"clean"
|
34
|
+
]
|
35
|
+
|
36
|
+
if hInstrumentationEvent.has_key?('citation')
|
37
|
+
hInstrumentationEvent['citation'].each do |citation|
|
38
|
+
hReturn = Citation.unpack(citation, responseObj, outContext)
|
39
|
+
unless hReturn.nil?
|
40
|
+
intInstrumentationEvent[:citations] << hReturn
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
if hInstrumentationEvent.has_key?('description')
|
46
|
+
intInstrumentationEvent[:description] = hInstrumentationEvent['description']
|
47
|
+
else
|
48
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
49
|
+
end
|
50
|
+
|
51
|
+
if hInstrumentationEvent.has_key?('extent')
|
52
|
+
intInstrumentationEvent[:extent] = Extent.unpack(hInstrumentationEvent['extent'], responseObj, outContext)
|
53
|
+
end
|
54
|
+
|
55
|
+
if hInstrumentationEvent.has_key?('eventType') && eventTypeArray.include?(hInstrumentationEvent['eventType'])
|
56
|
+
intInstrumentationEvent[:eventType] = hInstrumentationEvent['eventType']
|
57
|
+
else
|
58
|
+
@MessagePath.issueWarning(41, responseObj, outContext)
|
59
|
+
end
|
60
|
+
|
61
|
+
if hInstrumentationEvent.has_key?('revisionHistory')
|
62
|
+
hInstrumentationEvent['revisionHistory'].each do |item|
|
63
|
+
hReturn = Revision.unpack(item, responseObj, outContext)
|
64
|
+
unless hReturn.nil?
|
65
|
+
intInstrumentationEvent[:revisionHistories] << hReturn
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
intInstrumentationEvent
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require_relative 'module_citation'
|
2
|
+
require_relative 'module_locale'
|
3
|
+
require_relative 'module_constraint'
|
4
|
+
require_relative 'module_instrumentationEvent'
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Readers
|
9
|
+
module MdJson
|
10
|
+
|
11
|
+
module InstrumentationEventList
|
12
|
+
def self.unpack(hInstrumentationEventList, responseObj, inContext = nil)
|
13
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
14
|
+
|
15
|
+
intMetadataClass = InternalMetadata.new
|
16
|
+
intInstrumentationEventList = intMetadataClass.newInstrumentationEventList
|
17
|
+
|
18
|
+
outContext = 'instrumentation event list'
|
19
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
20
|
+
|
21
|
+
if hInstrumentationEventList.has_key?('citation')
|
22
|
+
intInstrumentationEventList[:citation] = Citation.unpack(hInstrumentationEventList['citation'], responseObj, outContext)
|
23
|
+
end
|
24
|
+
|
25
|
+
if hInstrumentationEventList.has_key?('description')
|
26
|
+
intInstrumentationEventList[:description] = hInstrumentationEventList['description']
|
27
|
+
else
|
28
|
+
@MessagePath.issueWarning(40, responseObj, outContext, 'instrumentation event description')
|
29
|
+
end
|
30
|
+
|
31
|
+
if hInstrumentationEventList.has_key?('locale')
|
32
|
+
hReturn = Locale.unpack(hInstrumentationEventList['locale'], responseObj, outContext)
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
if hInstrumentationEventList.has_key?('constraint')
|
37
|
+
constraints = hInstrumentationEventList['constraint']
|
38
|
+
constraints.each do |constraint|
|
39
|
+
hReturn = Constraint.unpack(hInstrumentationEventList['constraint'], responseObj, outContext)
|
40
|
+
unless hReturn.nil?
|
41
|
+
intInstrumentationEventList[:constraints] << hReturn
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
if hInstrumentationEventList.has_key?('instrumentationEvent')
|
47
|
+
hInstrumentationEventList['instrumentationEvent'].each do |item|
|
48
|
+
hReturn = InstrumentationEvent.unpack(item, responseObj, outContext)
|
49
|
+
unless hReturn.nil?
|
50
|
+
intInstrumentationEventList[:instrumentationEvents] << hReturn
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
intInstrumentationEventList
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -13,6 +13,7 @@ require_relative 'module_associatedResource'
|
|
13
13
|
require_relative 'module_additionalDocumentation'
|
14
14
|
require_relative 'module_funding'
|
15
15
|
require_relative 'module_dataQuality'
|
16
|
+
require_relative 'module_acquisition'
|
16
17
|
|
17
18
|
module ADIWG
|
18
19
|
module Mdtranslator
|
@@ -128,6 +129,16 @@ module ADIWG
|
|
128
129
|
end
|
129
130
|
end
|
130
131
|
|
132
|
+
if hMetadata.has_key?('acquisition')
|
133
|
+
aItems = hMetadata['acquisition']
|
134
|
+
aItems.each do |item|
|
135
|
+
hReturn = Acquisition.unpack(item, responseObj)
|
136
|
+
unless hReturn.nil?
|
137
|
+
intMetadata[:acquisitions] << hReturn
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
131
142
|
return intMetadata
|
132
143
|
|
133
144
|
end
|