16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_nominalResolution.rb', line 16
def self.unpack(hResolution, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hResolution.empty?
@MessagePath.issueWarning(960, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intResolution = intMetadataClass.newNominalResolution
outContext = 'nominal resolution'
outContext = inContext + ' > ' + outContext unless inContext.nil?
haveRequired = 0
if hResolution.has_key?('scanningResolution')
hMeasure = hResolution['scanningResolution']
unless hMeasure.empty?
hMeasure['type'] = 'distance'
hReturn = Measure.unpack(hMeasure, responseObj, outContext)
unless hReturn.nil?
intResolution[:scanningResolution] = hReturn
haveRequired += 1
end
end
end
if hResolution.has_key?('groundResolution')
hMeasure = hResolution['groundResolution']
unless hMeasure.empty?
hMeasure['type'] = 'distance'
hReturn = Measure.unpack(hMeasure, responseObj, outContext)
unless hReturn.nil?
intResolution[:groundResolution] = hReturn
haveRequired += 1
end
end
end
unless haveRequired > 0
@MessagePath.issueError(961, responseObj, inContext)
end
if haveRequired == 2
@MessagePath.issueError(962, responseObj, inContext)
end
return intResolution
end
|