예제 #1
0
파일: iscUtil.py 프로젝트: leexhwhy/awips2
def saveEditAreaGrid(maskName, iscMask, siteID):
    iscMask.getPolygons(CoordinateType.LATLON)

    pathMgr = PathManagerFactory.getPathManager()
    commonStaticConfig = pathMgr.getContext(LocalizationType.COMMON_STATIC,
                                            LocalizationLevel.CONFIGURED)
    commonStaticConfig.setContextName(siteID)
    sitePath = pathMgr.getFile(commonStaticConfig, "gfe/editAreas").getPath()
    editAreaPath = str(sitePath) + "/" + maskName + ".xml"
    ReferenceData.getJAXBManager().marshalToXmlFile(iscMask, editAreaPath)
예제 #2
0
파일: iscUtil.py 프로젝트: leexhwhy/awips2
def getEditArea(name, siteID):

    pathMgr = PathManagerFactory.getPathManager()

    commonStaticConfig = pathMgr.getContext(LocalizationType.COMMON_STATIC,
                                            LocalizationLevel.SITE)
    commonStaticConfig.setContextName(siteID)
    file = pathMgr.getFile(commonStaticConfig,
                           "gfe/editAreas" + File.separator + name + ".xml")

    if not os.path.exists(file.getPath()):
        commonStaticConfig = pathMgr.getContext(LocalizationType.COMMON_STATIC,
                                                LocalizationLevel.CONFIGURED)
        commonStaticConfig.setContextName(siteID)
        file = pathMgr.getFile(
            commonStaticConfig,
            "gfe/editAreas" + File.separator + name + ".xml")

    refData = None

    try:
        if os.path.exists(file.getPath()):
            refData = ReferenceData.getJAXBManager().unmarshalFromXmlFile(
                file.getPath())
        else:
            LogStream.logProblem("EDIT AREA NOT FOUND: ", name, " for site ",
                                 siteID)
    except:
        LogStream.logProblem("Unable to unmarshal " + name + " in iscExtract")

    return refData