diff --git a/cave/build/static/common/cave/etc/gfe/userPython/procedures/MergeHazards.py b/cave/build/static/common/cave/etc/gfe/userPython/procedures/MergeHazards.py index 337454975f..6981218183 100644 --- a/cave/build/static/common/cave/etc/gfe/userPython/procedures/MergeHazards.py +++ b/cave/build/static/common/cave/etc/gfe/userPython/procedures/MergeHazards.py @@ -1,61 +1,70 @@ ## # This software was developed and / or modified by Raytheon Company, -# pursuant to Contract DG133W-05-CQ-1067 with the US Government. -# -# U.S. EXPORT CONTROLLED TECHNICAL DATA +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non-U.S. persons whether in the United States or abroad requires # an export license or other authorization. # -# Contractor Name: Raytheon Company -# Contractor Address: 6825 Pine Street, Suite 340 -# Mail Stop B8 -# Omaha, NE 68106 -# 402.291.0100 -# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# # See the AWIPS II Master Rights File ("Master Rights File.pdf") for # further licensing information. ## -# ---------------------------------------------------------------------------- -# This software is in the public domain, furnished "as is", without technical -# support, and with no warranty, express or implied, as to its usefulness for -# any purpose. -# -# MergeHazards -# -# Author: lefebvre -# -# This procedure reads all of the temporary hazard grids and selectively -# loads them in the the "Hazards" grid. -# ---------------------------------------------------------------------------- - -# The MenuItems list defines the GFE menu item(s) under which the -# Procedure is to appear. -# Possible items are: Populate, Edit, Consistency, Verify, Hazards -MenuItems = ["Hazards"] - -#import Tkinter -import SmartScript -import string -import HazardUtils -import VTECTable -import LogStream -import numpy -from MessageBox import MessageBox - -from HazardUtils import MODEL -from HazardUtils import ELEMENT -from HazardUtils import LEVEL - -######################### CONFIGURATION SECTION ###################### -# -# This dictionary defines which hazards cannot be combined with other -# Hazards. The structure lists each hazard in the VTECTable followed -# by a list of VTEC codes that may not be combined with it at the same -# grid point. For example "DS.W" : ["DU.Y"] means that DS.W may not -# be combined with a DU.Y hazard at the same grid point. - +# ---------------------------------------------------------------------------- +# This software is in the public domain, furnished "as is", without technical +# support, and with no warranty, express or implied, as to its usefulness for +# any purpose. +# +# MergeHazards +# +# Author: lefebvre +# +# This procedure reads all of the temporary hazard grids and selectively +# loads them in the the "Hazards" grid. +# ---------------------------------------------------------------------------- +# +# SOFTWARE HISTORY +# +# Date Ticket# Engineer Description +# ------------ ---------- ----------- -------------------------- +# Dec 23, 2013 16893 ryu Check in njensen's change to removeTempHazards() +# to call SmartScript.unloadWEs(). +# +######################################################################## + +# The MenuItems list defines the GFE menu item(s) under which the +# Procedure is to appear. +# Possible items are: Populate, Edit, Consistency, Verify, Hazards +MenuItems = ["Hazards"] + +#import Tkinter +import SmartScript +import string +import HazardUtils +import VTECTable +import LogStream +import numpy +from MessageBox import MessageBox + +from HazardUtils import MODEL +from HazardUtils import ELEMENT +from HazardUtils import LEVEL + +######################### CONFIGURATION SECTION ###################### +# +# This dictionary defines which hazards cannot be combined with other +# Hazards. The structure lists each hazard in the VTECTable followed +# by a list of VTEC codes that may not be combined with it at the same +# grid point. For example "DS.W" : ["DU.Y"] means that DS.W may not +# be combined with a DU.Y hazard at the same grid point. + HazardsConflictDict = { "AF.W" : ["AF.Y"], "AF.Y" : ["AF.W"], @@ -187,301 +196,303 @@ HazardsConflictDict = { "ZR.Y" : ["BZ.A", "LE.A", "WS.A", "BZ.W", "IS.W", "WS.W", "LE.W", "WW.Y", "LE.Y"], } - -########################## END OF CONFIGURATION SECTION ######################## - -class Procedure(SmartScript.SmartScript): - def __init__(self, dbss): - SmartScript.SmartScript.__init__(self, dbss) - self._dbss = dbss - - ## - # Get the list of loaded temporary hazard parms - # @return: Temporary hazard parm names, i.e., ["hazAFY"] - # @rtype: List of Strings - def getHazardParmNames(self): - parms = self.loadedParms() - hazParms = [] - for weName, level, dbID in parms: - if string.find(weName, "haz") == 0: - # TODO: Why is this back/forth xform needed? - key = self._hazUtils._tempWENameToKey(weName) - index = string.find(key, ":") - if index != -1: - mkey = key[0:index] - segNum = key[index+1:] - else: - mkey = key - segNum = "" - - # append the hazard and a description - parmName = "haz" + key - parmName = string.replace(parmName, ".", "") - parmName = string.replace(parmName, ":", "") - hazParms.append(parmName) - - return hazParms - - ## - # Unload (delete) all the temporary hazards - def removeTempHazards(self): - parms = self.loadedParms() - - for weName, level, dbID in parms: - if string.find(weName, "haz") == 0: - self.unloadWE(MODEL, weName, level) - - return - - ## - # The action performed when the user opts to cancel a merge. - # This was a callback under Tcl/tk; now displayDialog invokes - # it directly. - def cancelCommand(self): - LogStream.logEvent("MergeHazards: cancel") - return - - ## - # The action performed when the user opts to continue a merge. - # This was a callback under Tcl/tk; now displayDialog invokes - # it directly. - def continueCommand(self): - LogStream.logEvent("MergeHazards: continue") - parm = self.getParm(MODEL, ELEMENT, LEVEL) - parm.setMutable(True) - self.mergeHazardGrids() - return - - ## - # Displays a dialog box and queries the user to continue to merge or - # abort the merge - def displayDialog(self, message): - messageBox = MessageBox(style=MessageBox.ICON_WARNING) - messageBox.setText("MakeHazard") - messageBox.setMessage(message) - messageBox.setButtonLabels(["Continue Merge", "Cancel Merge"]) - messageBox.setDefaultIndex(1) - if (messageBox.open() == 0): - self.continueCommand() - else: - self.cancelCommand() - - return - - ## - # Returns the set of hazParms grids that overlap with the specified - # timeRange. - # @param hazParms: Hazard parm names to check - # @type hazParms: Sequence of string - # @param timeRange: The time range to check for overlap with - # @type timeRange: Python TimeRange - # @return: Byte grids and keys of the overlapping parms - # @rtype: 2-tuple: list of byte arrays, list of list of strings - def getOverlappingHazGrids(self, hazParms, timeRange): - byteGridList = [] - keyList = [] - for hazParm in hazParms: - trList = self._hazUtils._getWEInventory(hazParm) - for tr in trList: - if tr.overlaps(timeRange): - byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, - tr, mode="First") - if isinstance(hazKey, str): - hazKey = eval(hazKey) - byteGridList.append(byteGrid) - keyList.append(hazKey) - - return byteGridList, keyList - - ## - # Returns the first non-None key it finds in the keyList - # @param keyList: Keys to search - # @type keyList: Sequence of string - # @return: First key that is not "" - # @rtype: string - def getHazardKey(self, keyList): - for k in keyList: - if k != "": - return k - - ## - # Checks the specified hazard grids to see if they are conflicting - # Each grid is a tuple (byteGrid, key). Uses the configurable - # HazardConflictDict to determine whether two hazards can be combined - # at the same grid point. Returns an empty list if no conflict or - # the list of hazards if they do. - # - # This method should really only be used internally; it assumes that - # there is at most one key other than "", and that it contains - # a single subkey. - # - # @param hazGrid1: The first hazard grid - # @type hazGrid1: 2-tuple: numpy array of int8, list of String - # @param hazGrid2: The second hazard grid - # @type hazGrid2: 2-tuple: numpy array of int8, list of String - # @return: conflicting hazard names or empty list - # @rtype: list - def conflictingHazards(self, hazGrid1, hazGrid2): - byteGrid1, hazKey1 = hazGrid1 - byteGrid2, hazKey2 = hazGrid2 - - key1 = self.getHazardKey(hazKey1) - key2 = self.getHazardKey(hazKey2) - phenSig1 = key1[0:4] # remove the etn - phenSig2 = key2[0:4] - - keyConflict = False - if phenSig1 == phenSig2 and key1 != key2: - keyConflict = True - elif HazardsConflictDict.has_key(phenSig1): - if phenSig2 in HazardsConflictDict[phenSig1]: - keyConflict = True - - if keyConflict: - # calculate the overlap, adding the grids together will tell us if - # there is any overlap. Any grid points > 1 are overlapped - totalGrid = byteGrid1 + byteGrid2 - overlapMask = numpy.greater(totalGrid, 1) - if numpy.any(overlapMask): - return [key1, key2] - - return [] - - ## - # See if there are any temporary hazards for the same position and time - # that conflict with one another. - # - # @param hazParms: Temporary hazard parm names to check. - # @type hazParms: sequence of string - # @return: The first conflict, or None if there are no conflicts - # @rtype: 2-tuple(TimeRange, list of string) or NoneType - def checkForHazardConflicts(self, hazParms): - timeList = [] - for hazParm in hazParms: - trList = self._hazUtils._getWEInventory(hazParm) - for tr in trList: - if tr.startTime().unixTime() not in timeList: - timeList.append(tr.startTime().unixTime()) - if tr.endTime().unixTime() not in timeList: - timeList.append(tr.endTime().unixTime()) - - timeList.sort() # sort the list - - for t in xrange(len(timeList) - 1): - start = timeList[t] - end = timeList[t+1] - timeRange = self._hazUtils._makeTimeRange(start, end) - byteGridList = [] - keyList = [] - byteGridList, keyList = self.getOverlappingHazGrids(hazParms, timeRange) - # compare each grid to all other grids at this timeRange - for firstIndex in xrange(len(byteGridList) - 1): - for secondIndex in xrange(firstIndex + 1, len(byteGridList)): - grid1 = (byteGridList[firstIndex], keyList[firstIndex]) - grid2 = (byteGridList[secondIndex], keyList[secondIndex]) - conflictList = self.conflictingHazards(grid1, grid2) - if conflictList != []: - return (timeRange, conflictList) - - # if we made it to here, all is well - return None - - ## - # Perform checks to see if it's OK to merge hazards. If there are no conflicting - # locks or incompatible hazards, do the merge. If there are conflicting locks, - # generate a status bar message and quit. If there incompatible - # hazards, show a warning and let the user decide whether to continue. - def checkForMerge(self): - # get the hazards selected by the forecaster - hazParms = self.getHazardParmNames() - - # check for empty list of hazards - if hazParms == []: - self.statusBarMsg("No temporary grids to merge.", "S") - return - - # FIXME: Lock race condition - # check for conflicting locks - if self._hazUtils._conflictingLocks(hazParms): - self.statusBarMsg("There are conflicting locks. " + - "Please resolve these before merging any hazards", "S") - return - - conflicts = self.checkForHazardConflicts(hazParms) - if conflicts is None: - # if no conflicts, merge the grids - # We made the hazards parm immutable when we separated hazard grids. - # It has to be made mutable to do the merge. - parm = self.getParm(MODEL, ELEMENT, LEVEL) - parm.setMutable(True) - self.mergeHazardGrids() - else: - haz1 = string.replace(conflicts[1][0], ".", "") - haz2 = string.replace(conflicts[1][1], ".", "") - timeRange = str(conflicts[0]) - msg = "Hazard conflict detected!\n\n" - msg += "Time: " + timeRange + " \n\n" - msg += "with Hazard grids haz" + haz1 + " and haz" + haz2 + ".\n" - - LogStream.logEvent("Merge conflict: "+ msg) - self.displayDialog(msg) - - return - - ## - # Performs the actual merge of the temp hazards grids into the "Hazards" grid. - def mergeHazardGrids(self): - # get the hazards selected by the forecaster - hazParms = self.getHazardParmNames() - - self._hazUtils._removeAllHazardsGrids() - - for hazParm in hazParms: - trList = self._hazUtils._getWEInventory(hazParm) - - for tr in trList: - byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, tr, - mode="First") - if isinstance(hazKey, str): - hazKey = eval(hazKey) - - uniqueKeys = self._hazUtils._getUniqueKeys(byteGrid, hazKey) - for uKey in uniqueKeys: - if uKey == "": - continue - subKeys = self._hazUtils._getSubKeys(uKey) - for subKey in subKeys: - # make the mask - find all areas that contain the subKey - mask = numpy.zeros(byteGrid.shape) - for haz in hazKey: - if string.find(haz, subKey) >= 0: - hazIndex = self.getIndex(haz, hazKey) - mask = numpy.logical_or(numpy.equal(byteGrid, hazIndex), mask) - - # make the grid - self._hazUtils._addHazard(ELEMENT, tr, subKey, mask) - LogStream.logEvent("merge: " + \ - str(self._hazUtils._printTime(tr.startTime().unixTime())) + " " + \ - str(self._hazUtils._printTime(tr.endTime().unixTime())) + " " + \ - subKey + "\n") - - self.removeTempHazards() - - return - - ## - # The main entry point of the procedure. - def execute(self): - self.setToolType("numeric") - - self._hazUtils = HazardUtils.HazardUtils(self._dbss, None) - - # see if the Hazards WE is loaded in the GFE, if not abort the tool - if not self._hazUtils._hazardsLoaded(): - self.statusBarMsg("Hazards Weather Element must be loaded in " +\ - "the GFE before running MergeHazards", "S") - self.cancel() - - self.checkForMerge() - return - + +########################## END OF CONFIGURATION SECTION ######################## + +class Procedure(SmartScript.SmartScript): + def __init__(self, dbss): + SmartScript.SmartScript.__init__(self, dbss) + self._dbss = dbss + + ## + # Get the list of loaded temporary hazard parms + # @return: Temporary hazard parm names, i.e., ["hazAFY"] + # @rtype: List of Strings + def getHazardParmNames(self): + parms = self.loadedParms() + hazParms = [] + for weName, level, dbID in parms: + if string.find(weName, "haz") == 0: + # TODO: Why is this back/forth xform needed? + key = self._hazUtils._tempWENameToKey(weName) + index = string.find(key, ":") + if index != -1: + mkey = key[0:index] + segNum = key[index+1:] + else: + mkey = key + segNum = "" + + # append the hazard and a description + parmName = "haz" + key + parmName = string.replace(parmName, ".", "") + parmName = string.replace(parmName, ":", "") + hazParms.append(parmName) + + return hazParms + + ## + # Unload (delete) all the temporary hazards + def removeTempHazards(self): + parms = self.loadedParms() + + toRemovePairs = [] + for weName, level, dbID in parms: + if string.find(weName, "haz") == 0: + toRemovePairs.append((weName, level)) + self.unloadWEs(MODEL, toRemovePairs) + + return + + ## + # The action performed when the user opts to cancel a merge. + # This was a callback under Tcl/tk; now displayDialog invokes + # it directly. + def cancelCommand(self): + LogStream.logEvent("MergeHazards: cancel") + return + + ## + # The action performed when the user opts to continue a merge. + # This was a callback under Tcl/tk; now displayDialog invokes + # it directly. + def continueCommand(self): + LogStream.logEvent("MergeHazards: continue") + parm = self.getParm(MODEL, ELEMENT, LEVEL) + parm.setMutable(True) + self.mergeHazardGrids() + return + + ## + # Displays a dialog box and queries the user to continue to merge or + # abort the merge + def displayDialog(self, message): + messageBox = MessageBox(style=MessageBox.ICON_WARNING) + messageBox.setText("MakeHazard") + messageBox.setMessage(message) + messageBox.setButtonLabels(["Continue Merge", "Cancel Merge"]) + messageBox.setDefaultIndex(1) + if (messageBox.open() == 0): + self.continueCommand() + else: + self.cancelCommand() + + return + + ## + # Returns the set of hazParms grids that overlap with the specified + # timeRange. + # @param hazParms: Hazard parm names to check + # @type hazParms: Sequence of string + # @param timeRange: The time range to check for overlap with + # @type timeRange: Python TimeRange + # @return: Byte grids and keys of the overlapping parms + # @rtype: 2-tuple: list of byte arrays, list of list of strings + def getOverlappingHazGrids(self, hazParms, timeRange): + byteGridList = [] + keyList = [] + for hazParm in hazParms: + trList = self._hazUtils._getWEInventory(hazParm) + for tr in trList: + if tr.overlaps(timeRange): + byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, + tr, mode="First") + if isinstance(hazKey, str): + hazKey = eval(hazKey) + byteGridList.append(byteGrid) + keyList.append(hazKey) + + return byteGridList, keyList + + ## + # Returns the first non-None key it finds in the keyList + # @param keyList: Keys to search + # @type keyList: Sequence of string + # @return: First key that is not "" + # @rtype: string + def getHazardKey(self, keyList): + for k in keyList: + if k != "": + return k + + ## + # Checks the specified hazard grids to see if they are conflicting + # Each grid is a tuple (byteGrid, key). Uses the configurable + # HazardConflictDict to determine whether two hazards can be combined + # at the same grid point. Returns an empty list if no conflict or + # the list of hazards if they do. + # + # This method should really only be used internally; it assumes that + # there is at most one key other than "", and that it contains + # a single subkey. + # + # @param hazGrid1: The first hazard grid + # @type hazGrid1: 2-tuple: numpy array of int8, list of String + # @param hazGrid2: The second hazard grid + # @type hazGrid2: 2-tuple: numpy array of int8, list of String + # @return: conflicting hazard names or empty list + # @rtype: list + def conflictingHazards(self, hazGrid1, hazGrid2): + byteGrid1, hazKey1 = hazGrid1 + byteGrid2, hazKey2 = hazGrid2 + + key1 = self.getHazardKey(hazKey1) + key2 = self.getHazardKey(hazKey2) + phenSig1 = key1[0:4] # remove the etn + phenSig2 = key2[0:4] + + keyConflict = False + if phenSig1 == phenSig2 and key1 != key2: + keyConflict = True + elif HazardsConflictDict.has_key(phenSig1): + if phenSig2 in HazardsConflictDict[phenSig1]: + keyConflict = True + + if keyConflict: + # calculate the overlap, adding the grids together will tell us if + # there is any overlap. Any grid points > 1 are overlapped + totalGrid = byteGrid1 + byteGrid2 + overlapMask = numpy.greater(totalGrid, 1) + if numpy.any(overlapMask): + return [key1, key2] + + return [] + + ## + # See if there are any temporary hazards for the same position and time + # that conflict with one another. + # + # @param hazParms: Temporary hazard parm names to check. + # @type hazParms: sequence of string + # @return: The first conflict, or None if there are no conflicts + # @rtype: 2-tuple(TimeRange, list of string) or NoneType + def checkForHazardConflicts(self, hazParms): + timeList = [] + for hazParm in hazParms: + trList = self._hazUtils._getWEInventory(hazParm) + for tr in trList: + if tr.startTime().unixTime() not in timeList: + timeList.append(tr.startTime().unixTime()) + if tr.endTime().unixTime() not in timeList: + timeList.append(tr.endTime().unixTime()) + + timeList.sort() # sort the list + + for t in xrange(len(timeList) - 1): + start = timeList[t] + end = timeList[t+1] + timeRange = self._hazUtils._makeTimeRange(start, end) + byteGridList = [] + keyList = [] + byteGridList, keyList = self.getOverlappingHazGrids(hazParms, timeRange) + # compare each grid to all other grids at this timeRange + for firstIndex in xrange(len(byteGridList) - 1): + for secondIndex in xrange(firstIndex + 1, len(byteGridList)): + grid1 = (byteGridList[firstIndex], keyList[firstIndex]) + grid2 = (byteGridList[secondIndex], keyList[secondIndex]) + conflictList = self.conflictingHazards(grid1, grid2) + if conflictList != []: + return (timeRange, conflictList) + + # if we made it to here, all is well + return None + + ## + # Perform checks to see if it's OK to merge hazards. If there are no conflicting + # locks or incompatible hazards, do the merge. If there are conflicting locks, + # generate a status bar message and quit. If there incompatible + # hazards, show a warning and let the user decide whether to continue. + def checkForMerge(self): + # get the hazards selected by the forecaster + hazParms = self.getHazardParmNames() + + # check for empty list of hazards + if hazParms == []: + self.statusBarMsg("No temporary grids to merge.", "S") + return + + # FIXME: Lock race condition + # check for conflicting locks + if self._hazUtils._conflictingLocks(hazParms): + self.statusBarMsg("There are conflicting locks. " + + "Please resolve these before merging any hazards", "S") + return + + conflicts = self.checkForHazardConflicts(hazParms) + if conflicts is None: + # if no conflicts, merge the grids + # We made the hazards parm immutable when we separated hazard grids. + # It has to be made mutable to do the merge. + parm = self.getParm(MODEL, ELEMENT, LEVEL) + parm.setMutable(True) + self.mergeHazardGrids() + else: + haz1 = string.replace(conflicts[1][0], ".", "") + haz2 = string.replace(conflicts[1][1], ".", "") + timeRange = str(conflicts[0]) + msg = "Hazard conflict detected!\n\n" + msg += "Time: " + timeRange + " \n\n" + msg += "with Hazard grids haz" + haz1 + " and haz" + haz2 + ".\n" + + LogStream.logEvent("Merge conflict: "+ msg) + self.displayDialog(msg) + + return + + ## + # Performs the actual merge of the temp hazards grids into the "Hazards" grid. + def mergeHazardGrids(self): + # get the hazards selected by the forecaster + hazParms = self.getHazardParmNames() + + self._hazUtils._removeAllHazardsGrids() + + for hazParm in hazParms: + trList = self._hazUtils._getWEInventory(hazParm) + + for tr in trList: + byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, tr, + mode="First") + if isinstance(hazKey, str): + hazKey = eval(hazKey) + + uniqueKeys = self._hazUtils._getUniqueKeys(byteGrid, hazKey) + for uKey in uniqueKeys: + if uKey == "": + continue + subKeys = self._hazUtils._getSubKeys(uKey) + for subKey in subKeys: + # make the mask - find all areas that contain the subKey + mask = numpy.zeros(byteGrid.shape) + for haz in hazKey: + if string.find(haz, subKey) >= 0: + hazIndex = self.getIndex(haz, hazKey) + mask = numpy.logical_or(numpy.equal(byteGrid, hazIndex), mask) + + # make the grid + self._hazUtils._addHazard(ELEMENT, tr, subKey, mask) + LogStream.logEvent("merge: " + \ + str(self._hazUtils._printTime(tr.startTime().unixTime())) + " " + \ + str(self._hazUtils._printTime(tr.endTime().unixTime())) + " " + \ + subKey + "\n") + + self.removeTempHazards() + + return + + ## + # The main entry point of the procedure. + def execute(self): + self.setToolType("numeric") + + self._hazUtils = HazardUtils.HazardUtils(self._dbss, None) + + # see if the Hazards WE is loaded in the GFE, if not abort the tool + if not self._hazUtils._hazardsLoaded(): + self.statusBarMsg("Hazards Weather Element must be loaded in " +\ + "the GFE before running MergeHazards", "S") + self.cancel() + + self.checkForMerge() + return + diff --git a/cave/build/static/common/cave/etc/gfe/userPython/utilities/SmartScript.py b/cave/build/static/common/cave/etc/gfe/userPython/utilities/SmartScript.py index 15e984f5ac..648e66139c 100644 --- a/cave/build/static/common/cave/etc/gfe/userPython/utilities/SmartScript.py +++ b/cave/build/static/common/cave/etc/gfe/userPython/utilities/SmartScript.py @@ -47,6 +47,7 @@ # Jun 21, 2013 14983 ryu Fixed encodeEditArea() to evaluate query # when necessary # Oct 07, 2013 2424 randerso remove use of pytz +# Dec 23, 2013 16893 ryu Added unloadWEs() method (created by njensen) # ######################################################################## import types, string, time, sys @@ -1788,6 +1789,19 @@ class SmartScript(BaseTool.BaseTool): parmJA[0] = parm self.__parmMgr.deleteParm(parmJA) + def unloadWEs(self, model, elementLevelPairs, mostRecent=0): + jparms = [] + for element, level in elementLevelPairs: + exprName = self.getExprName(model, element, level, mostRecent) + parm = self.__parmMgr.getParmInExpr(exprName, 1) + if parm: + jparms.append(parm) + if jparms: + parmJA = jep.jarray(len(jparms), jparms[0]) + for i in xrange(len(jparms)): + parmJA[i] = jparms[i] + self.__parmMgr.deleteParm(parmJA) + def saveElements(self, elementList): # Save the given Fcst elements to the server # Example: diff --git a/edexOsgi/build.edex/esb/conf/modes.xml b/edexOsgi/build.edex/esb/conf/modes.xml index 04e4ad1713..b054a28b61 100644 --- a/edexOsgi/build.edex/esb/conf/modes.xml +++ b/edexOsgi/build.edex/esb/conf/modes.xml @@ -86,6 +86,7 @@ .*datadelivery.* .*bandwidth.* excludeDpaAndOgc + obs-ingest-metarshef.xml aww-ingest.xml ncairep-ingest.xml @@ -120,7 +121,8 @@ shef-ingest.xml persist-ingest.xml obs-common.xml - obs-ingest.xml + obs-ingest.xml + obs-ingest-metarshef.xml metartohmdb-plugin.xml pointdata-common.xml shef-common.xml diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-decode.xml b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-decode.xml new file mode 100644 index 0000000000..f225ad374e --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-decode.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + obs + + + + + + + + + + + + + + + java.lang.Throwable + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-metarshef.xml b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-metarshef.xml new file mode 100644 index 0000000000..3fa8f85c54 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest-metarshef.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + obs + + + + + + + + + + + + + java.lang.Throwable + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml index f86f783477..876404ccac 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - + @@ -14,40 +14,5 @@ - - - - - - - - - - - obs - - - - - - - - - - - - - - - java.lang.Throwable - - - - - \ No newline at end of file