lib/adiwg/mdtranslator/readers/mdJson/modules/module_imageDescription.rb in adiwg-mdtranslator-2.13.0 vs lib/adiwg/mdtranslator/readers/mdJson/modules/module_imageDescription.rb in adiwg-mdtranslator-2.13.1
- old
+ new
@@ -1,10 +1,10 @@
# unpack image description
# Reader - ADIwg JSON to internal data structure
# History:
-# Stan Smith 2018-02-18 refactored error and warning messaging
+# Stan Smith 2018-06-21 refactored error and warning messaging
# Stan Smith 2016-10-18 original script
require_relative 'module_identifier'
module ADIWG
@@ -14,20 +14,26 @@
module ImageDescription
def self.unpack(hImageInfo, responseObj)
+ @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
+
+ inContext = 'coverage description'
+
# return nil object if input is empty
if hImageInfo.empty?
- responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: image description object is empty'
+ @MessagePath.issueWarning(460, responseObj, inContext)
return nil
end
# instance classes needed in script
intMetadataClass = InternalMetadata.new
hImage = intMetadataClass.newImageDescription
+ outContext = inContext + ' image description'
+
# image description - elevation angle of illumination
if hImageInfo.has_key?('illuminationElevationAngle')
unless hImageInfo['illuminationElevationAngle'] == ''
hImage[:illuminationElevationAngle] = hImageInfo['illuminationElevationAngle']
end
@@ -49,10 +55,10 @@
# image description - image quality - identifier
if hImageInfo.has_key?('imageQualityCode')
hObject = hImageInfo['imageQualityCode']
unless hObject.empty?
- hReturn = Identifier.unpack(hObject, responseObj)
+ hReturn = Identifier.unpack(hObject, responseObj, outContext)
unless hReturn.nil?
hImage[:imageQualityCode] = hReturn
end
end
end