15
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
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_coordinateResolution.rb', line 15
def self.unpack(hCoordRes, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hCoordRes.empty?
@MessagePath.issueWarning(120, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intCoordRes = intMetadataClass.newCoordinateResolution
if hCoordRes.has_key?('abscissaResolutionX')
intCoordRes[:abscissaResolutionX] = hCoordRes['abscissaResolutionX']
end
if intCoordRes[:abscissaResolutionX].nil? || intCoordRes[:abscissaResolutionX] == ''
@MessagePath.issueError(121, responseObj, inContext)
end
if hCoordRes.has_key?('ordinateResolutionY')
intCoordRes[:ordinateResolutionY] = hCoordRes['ordinateResolutionY']
end
if intCoordRes[:ordinateResolutionY].nil? || intCoordRes[:ordinateResolutionY] == ''
@MessagePath.issueError(122, responseObj, inContext)
end
if hCoordRes.has_key?('unitOfMeasure')
intCoordRes[:unitOfMeasure] = hCoordRes['unitOfMeasure']
end
if intCoordRes[:unitOfMeasure].nil? || intCoordRes[:unitOfMeasure] == ''
@MessagePath.issueError(123, responseObj, inContext)
end
return intCoordRes
end
|