本文整理汇总了Python中LogStream.logUse方法的典型用法代码示例。如果您正苦于以下问题:Python LogStream.logUse方法的具体用法?Python LogStream.logUse怎么用?Python LogStream.logUse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogStream
的用法示例。
在下文中一共展示了LogStream.logUse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeHazardGrid
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logUse [as 别名]
#.........这里部分代码省略.........
mask = self.encodeEditArea(editArea)
else:
# make the mask based on the list selections
if not usingHazLocalEffect:
mask = self._hazUtils._makeMask(areaList)
else:
mask = self._makeMask(areaList, hazLocalEffect)
if usingHazLocalEffect:
# get the segment number and filter for valid characters
segNum = segmentNumber
# get the hazards currently defined as temporary grids
hazParms = self.getHazardParmNames()
# look through the list of grids and create a list of
# segment numbers (if any) that are already in use
# for the current hazard
# if len(hazParms) == 0:
# self.statusBarMsg("No temporary grids to merge.", "S")
# return 0
segList = []
print "selectedHazard=", selectedHazard
selectedPhen = selectedHazard[0:2]
selectedSig = selectedHazard[3]
print "selectedPhen,selectedSig=", selectedPhen, ".", selectedSig
for hazParm in hazParms:
print "hazParm=", hazParm
trList = self._hazUtils._getWEInventory(hazParm)
for tr in trList:
print " tr=", tr, timeRange
intersect_hours = tr.intersection(timeRange).duration()
print " intersect=", intersect_hours
intersect_percent = intersect_hours / timeRange.duration() * 100.0
print " intersect %=", intersect_percent
phen = hazParm[3:5]
sig = hazParm[5:6]
print "phen,sig=", phen, ".", sig
if len(hazParm) > 6:
if hazParm[6:].isdigit():
seg = int(hazParm[6:])
print " seg=", seg
if phen == selectedPhen and sig == selectedSig:
segList.append(seg)
print "appending ", seg
else:
seg = 0
segList.sort()
# print "looping through segList"
# for seg in segList:
# print " seg=", seg," elev=", elevation
# if str(elevation) == str(seg):
# print "adding 1 to elevation"
# elevation += 1
#
# if elevation > 400:
# print "using elevation for segNum"
# segNum = elevation
# # replace the segmentNumber field with the elevation +/- the Above/Below indicator.
# self.__dlg.setSegmentNumber(elevation)
# segmentNumber = str(elevation)
# print "*** segmentNumber=", segmentNumber
index = string.find(selectedHazard, " ")
if index != -1:
selectedHazard = selectedHazard[0:index]
if len(segmentNumber) > 0:
hazardKey = selectedHazard + ":" + segmentNumber
else:
hazardKey = selectedHazard
defaultHazKey = ""
if defaultHazard is not None:
index = string.find(defaultHazard, " ")
if index != -1:
defaultHazard = defaultHazard[0:index]
defaultHazKey = defaultHazard
if len(defaultSegment) > 0:
defaultHazKey += ":" + defaultSegment
weName = self._hazUtils._makeTempWEName(hazardKey)
# if we're modifying, remove the old grid first
if defaultAreaList != [] and hazardKey == defaultHazKey:
self.deleteCmd([weName], self.selectedTimeRange)
# if we have no selection prevent user from making an empty hazard
if 1 not in mask:
self.statusBarMsg("NO EDIT AREA SELECTED: \n Select area from map or load edit area in GFE!", "S")
return 0
self._hazUtils._addHazard(weName, timeRange, hazardKey, mask)
LogStream.logUse("Set: ", weName,
self._hazUtils._printTime(timeRange.startTime().unixTime()),
self._hazUtils._printTime(timeRange.endTime().unixTime()), hazardKey,
self._hazUtils._printAreas(areaList))
return 1