[GRASS-SVN] r63939 - in grass/branches/releasebranch_7_0: . gui/wxpython/vnet
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 2 20:43:23 PST 2015
Author: annakrat
Date: 2015-01-02 20:43:23 -0800 (Fri, 02 Jan 2015)
New Revision: 63939
Modified:
grass/branches/releasebranch_7_0/
grass/branches/releasebranch_7_0/gui/wxpython/vnet/dialogs.py
grass/branches/releasebranch_7_0/gui/wxpython/vnet/vnet_core.py
grass/branches/releasebranch_7_0/gui/wxpython/vnet/vnet_data.py
Log:
wxGUI/vnet: update to new parameter names (#2409), merge from trunk r63736
Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
- /grass/trunk:60817,61096,61141,61994,62105,62179-62180,62182,62190,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750-62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62828,62831,62838,62845,62847,62850,62856,62879,62881,62886,62904,62907-62908,62910,62912,62914,62916,62918,62920,62925,62932-62933,62935,62940,62942,62944-62946,62949,62955-62956,62958,62960,62962,62964,62966-62968,62970,62973,62975,62977,62981,62983,62985,62987,62989,62991,62993,62995,62997,62999-63000,63003,63005,63007,63009,63011,63013,63015,63017,63020,63022,63024,63026,63028-63031,63033,63035,63037,63040,63043-63044,63047,63049,63051,63053,63055,63057,63060,63062-63064,63066,63068,63070-63071,63074,
63076,63079,63081,63083,63085,63087,63089,63091,63093,63095,63098,63100,63102,63105,63107,63109,63111,63113-63114,63116,63119,63121,63123,63125,63130,63132-63133,63135,63137,63140,63143,63145,63147,63149,63151,63153-63154,63157,63160,63165,63170,63173,63175,63187,63192-63193,63196,63199-63200,63202,63209,63216,63220-63221,63224,63227,63240,63246,63250,63255,63259,63261,63275-63276,63279,63281,63283,63287,63290,63292,63297,63302,63304-63307,63315,63319,63327,63330,63332,63339,63342,63345,63361-63363,63367,63379,63389,63391,63393,63402,63408-63409,63416-63417,63425,63427,63429,63431,63433,63448,63451,63453,63457,63459,63464-63470,63473,63482,63497,63505,63508,63510,63515,63521-63524,63526,63536-63537,63551-63552,63554,63556,63558-63559,63562,63570,63576,63582,63589-63593,63602,63604,63608-63609,63616,63618,63624,63626,63628,63630,63634,63639,63642,63644,63650,63652,63656,63679,63685,63689,63691,63693,63695,63698,63700-63702,63704,63706-63707,63709,63711,63713,63715,63717-63718
,63721-63727,63731,63733,63740-63742,63744-63749,63751-63752,63756,63758,63760-63761,63767,63777,63780,63783,63787,63793,63796-63798,63801,63803,63807-63808,63812,63814,63816,63821,63823-63824,63827-63828,63830-63831,63834-63835,63837-63839,63841,63843-63844,63846-63847,63849,63851,63853,63855-63856,63858-63859,63862,63865,63869,63871,63882,63884,63889-63890,63892-63895,63897-63898,63900,63902-63903,63905,63907,63909-63911,63913-63914,63927
+ /grass/trunk:60817,61096,61141,61994,62105,62179-62180,62182,62190,62403,62422,62424,62437,62466,62469,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62566,62570,62573,62575,62585,62588,62597,62603,62606,62608-62609,62614,62618,62628,62632,62638,62642,62648-62649,62652,62654-62657,62666,62691,62705,62709,62723,62730,62739,62741,62743,62746,62750-62752,62757,62762,62785,62798,62800-62801,62803,62805,62812,62822,62824,62828,62831,62838,62845,62847,62850,62856,62879,62881,62886,62904,62907-62908,62910,62912,62914,62916,62918,62920,62925,62932-62933,62935,62940,62942,62944-62946,62949,62955-62956,62958,62960,62962,62964,62966-62968,62970,62973,62975,62977,62981,62983,62985,62987,62989,62991,62993,62995,62997,62999-63000,63003,63005,63007,63009,63011,63013,63015,63017,63020,63022,63024,63026,63028-63031,63033,63035,63037,63040,63043-63044,63047,63049,63051,63053,63055,63057,63060,63062-63064,63066,63068,63070-63071,63074,
63076,63079,63081,63083,63085,63087,63089,63091,63093,63095,63098,63100,63102,63105,63107,63109,63111,63113-63114,63116,63119,63121,63123,63125,63130,63132-63133,63135,63137,63140,63143,63145,63147,63149,63151,63153-63154,63157,63160,63165,63170,63173,63175,63187,63192-63193,63196,63199-63200,63202,63209,63216,63220-63221,63224,63227,63240,63246,63250,63255,63259,63261,63275-63276,63279,63281,63283,63287,63290,63292,63297,63302,63304-63307,63315,63319,63327,63330,63332,63339,63342,63345,63361-63363,63367,63379,63389,63391,63393,63402,63408-63409,63416-63417,63425,63427,63429,63431,63433,63448,63451,63453,63457,63459,63464-63470,63473,63482,63497,63505,63508,63510,63515,63521-63524,63526,63536-63537,63551-63552,63554,63556,63558-63559,63562,63570,63576,63582,63589-63593,63602,63604,63608-63609,63616,63618,63624,63626,63628,63630,63634,63639,63642,63644,63650,63652,63656,63679,63685,63689,63691,63693,63695,63698,63700-63702,63704,63706-63707,63709,63711,63713,63715,63717-63718
,63721-63727,63731,63733,63736,63740-63742,63744-63749,63751-63752,63756,63758,63760-63761,63767,63777,63780,63783,63787,63793,63796-63798,63801,63803,63807-63808,63812,63814,63816,63821,63823-63824,63827-63828,63830-63831,63834-63835,63837-63839,63841,63843-63844,63846-63847,63849,63851,63853,63855-63856,63858-63859,63862,63865,63869,63871,63882,63884,63889-63890,63892-63895,63897-63898,63900,63902-63903,63905,63907,63909-63911,63913-63914,63927
Modified: grass/branches/releasebranch_7_0/gui/wxpython/vnet/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/vnet/dialogs.py 2015-01-03 04:41:43 UTC (rev 63938)
+++ grass/branches/releasebranch_7_0/gui/wxpython/vnet/dialogs.py 2015-01-03 04:43:23 UTC (rev 63939)
@@ -321,13 +321,13 @@
label = {}
dataSelects = [
['input', "Choose vector map for analysis:", Select],
- ['alayer', "Arc layer number or name:", LayerSelect],
- ['nlayer', "Node layer number or name:", LayerSelect],
- #['tlayer', "Layer with turntable:", LayerSelect],
- #['tuclayer', "Layer with unique categories for turntable:", LayerSelect],
- ['afcolumn', "", ColumnSelect],
- ['abcolumn', "", ColumnSelect],
- ['ncolumn', "", ColumnSelect],
+ ['arc_layer', "Arc layer number or name:", LayerSelect],
+ ['node_layer', "Node layer number or name:", LayerSelect],
+ #['turn_layer', "Layer with turntable:", LayerSelect],
+ #['turn_cat_layer', "Layer with unique categories for turntable:", LayerSelect],
+ ['arc_column', "", ColumnSelect],
+ ['arc_backward_column', "", ColumnSelect],
+ ['node_column', "", ColumnSelect],
]
#self.useTurns = wx.CheckBox(parent = dataPanel, id=wx.ID_ANY,
@@ -351,7 +351,7 @@
self.addToTreeBtn.Disable()
self.addToTreeBtn.Bind(wx.EVT_BUTTON, self.OnToTreeBtn)
elif dataSel[0] != 'input':
- #if dataSel[0] == "tlayer":
+ #if dataSel[0] == "turn_layer":
# self.createTtbBtn = wx.Button(parent = selPanels[dataSel[0]],
# label = _("Create turntable"))
# self.createTtbBtn.Bind(wx.EVT_BUTTON, self.OnCreateTtbBtn)
@@ -363,10 +363,10 @@
label[dataSel[0]].SetLabel(dataSel[1])
self.inputData['input'].Bind(wx.EVT_TEXT, self.OnVectSel)
- self.inputData['alayer'].Bind(wx.EVT_TEXT, self.OnALayerSel)
- self.inputData['nlayer'].Bind(wx.EVT_TEXT, self.OnNLayerSel)
+ self.inputData['arc_layer'].Bind(wx.EVT_TEXT, self.OnALayerSel)
+ self.inputData['node_layer'].Bind(wx.EVT_TEXT, self.OnNLayerSel)
- for params in ["afcolumn", "abcolumn", "ncolumn"]:#, "tlayer", "tuclayer"]:
+ for params in ["arc_column", "arc_backward_column", "node_column"]:#, "turn_layer", "turn_cat_layer"]:
self.inputData[params].Bind(wx.EVT_TEXT, lambda event : self._setInputData())
#self.useTurns.Bind(wx.EVT_CHECKBOX,
@@ -381,14 +381,14 @@
mainSizer.Add(item = bsizer, proportion = 0,
flag = wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border = 5)
- for sel in ['input', 'alayer', 'nlayer']:#, 'tlayer', 'tuclayer']:
+ for sel in ['input', 'arc_layer', 'node_layer']:#, 'turn_layer', 'turn_cat_layer']:
if sel == 'input':
btn = self.addToTreeBtn
- #elif sel == "tlayer":
+ #elif sel == "turn_layer":
# btn = self.createTtbBtn
else:
btn = None
- #if sel == 'tlayer':
+ #if sel == 'turn_layer':
# bsizer.Add(item = self.useTurns, proportion = 0,
# flag = wx.TOP | wx.LEFT | wx.RIGHT, border = 5)
@@ -404,7 +404,7 @@
mainSizer.Add(item = bsizer, proportion = 0,
flag = wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border = 5)
- for sel in ['afcolumn', 'abcolumn', 'ncolumn']:
+ for sel in ['arc_column', 'arc_backward_column', 'node_column']:
selPanels[sel].SetSizer(self._doSelLayout(title = label[sel], sel = self.inputData[sel]))
bsizer.Add(item = selPanels[sel], proportion = 0,
flag = wx.EXPAND)
@@ -531,7 +531,7 @@
wx.BeginBusyCursor()
self.inpDbMgrData['dbMgr'].ChangeVectorMap(vectorName = inpSel)
self.inpDbMgrData['input'] = inpSel
- for layerName in ['alayer', 'nlayer']:
+ for layerName in ['arc_layer', 'node_layer']:
try:
layer = int(self.inputData[layerName].GetValue())
except ValueError:
@@ -542,7 +542,7 @@
else:
needLayers = []
browseLayers = self.inpDbMgrData['browse'].GetAddedLayers()
- for layerName in ['alayer', 'nlayer']:
+ for layerName in ['arc_layer', 'node_layer']:
try:
inpLayer = int(self.inputData[layerName].GetValue())
except ValueError:
@@ -601,13 +601,13 @@
def UseTurns(self):
if self.useTurns.IsChecked():
- self.inputData["tlayer"].GetParent().Show()
- self.inputData["tuclayer"].GetParent().Show()
+ self.inputData["turn_layer"].GetParent().Show()
+ self.inputData["turn_cat_layer"].GetParent().Show()
self.vnet_mgr.SetParams(params = {}, flags = {"t" : True})
else:
- self.inputData["tlayer"].GetParent().Hide()
- self.inputData["tuclayer"].GetParent().Hide()
+ self.inputData["turn_layer"].GetParent().Hide()
+ self.inputData["turn_cat_layer"].GetParent().Hide()
self.vnet_mgr.SetParams(params = {}, flags = {"t" : False})
@@ -661,31 +661,31 @@
vectMapName, mapSet = self._parseMapStr(self.inputData['input'].GetValue())
vectorMap = vectMapName + '@' + mapSet
- for sel in ['alayer', 'nlayer']:#, 'tlayer', 'tuclayer']:
+ for sel in ['arc_layer', 'node_layer']:#, 'turn_layer', 'turn_cat_layer']:
self.inputData[sel].Clear()
self.inputData[sel].InsertLayers(vector = vectorMap)
- items = self.inputData['alayer'].GetItems()
+ items = self.inputData['arc_layer'].GetItems()
itemsLen = len(items)
if itemsLen < 1:
self.addToTreeBtn.Disable()
if hasattr(self, 'inpDbMgrData'):
self._updateInputDbMgrPage(show = False)
- self.inputData['alayer'].SetValue("")
- self.inputData['nlayer'].SetValue("")
- for sel in ['afcolumn', 'abcolumn', 'ncolumn']:
+ self.inputData['arc_layer'].SetValue("")
+ self.inputData['node_layer'].SetValue("")
+ for sel in ['arc_column', 'arc_backward_column', 'node_column']:
self.inputData[sel].SetValue("")
return
elif itemsLen == 1:
- self.inputData['alayer'].SetSelection(0)
- self.inputData['nlayer'].SetSelection(0)
+ self.inputData['arc_layer'].SetSelection(0)
+ self.inputData['node_layer'].SetSelection(0)
elif itemsLen >= 1:
if unicode("1") in items:
iItem = items.index(unicode("1"))
- self.inputData['alayer'].SetSelection(iItem)
+ self.inputData['arc_layer'].SetSelection(iItem)
if unicode("2") in items:
iItem = items.index(unicode("2"))
- self.inputData['nlayer'].SetSelection(iItem)
+ self.inputData['node_layer'].SetSelection(iItem)
self.addToTreeBtn.Enable()
if hasattr(self, 'inpDbMgrData'):
@@ -699,17 +699,17 @@
def _updateParamsTab(self, params, flags):
#TODO flag
- #'tlayer', 'tuclayer',
- for k in ['input', 'alayer', 'nlayer', 'afcolumn', 'abcolumn', 'ncolumn']:
+ #'turn_layer', 'turn_cat_layer',
+ for k in ['input', 'arc_layer', 'node_layer', 'arc_column', 'arc_backward_column', 'node_column']:
self.inputData[k].SetValue(params[k])
def OnALayerSel(self, event):
"""When arc layer from vector map is selected, populates corespondent columns selects"""
- self.inputData['afcolumn'].InsertColumns(vector = self.inputData['input'].GetValue(),
- layer = self.inputData['alayer'].GetValue(),
+ self.inputData['arc_column'].InsertColumns(vector = self.inputData['input'].GetValue(),
+ layer = self.inputData['arc_layer'].GetValue(),
type = self.columnTypes)
- self.inputData['abcolumn'].InsertColumns(vector = self.inputData['input'].GetValue(),
- layer = self.inputData['alayer'].GetValue(),
+ self.inputData['arc_backward_column'].InsertColumns(vector = self.inputData['input'].GetValue(),
+ layer = self.inputData['arc_layer'].GetValue(),
type = self.columnTypes)
self._setInputData()
@@ -719,8 +719,8 @@
if self.vnet_mgr.IsSnappingActive():
self.vnet_mgr.Snapping(activate = True)
- self.inputData['ncolumn'].InsertColumns(vector = self.inputData['input'].GetValue(),
- layer = self.inputData['nlayer'].GetValue(),
+ self.inputData['node_column'].InsertColumns(vector = self.inputData['input'].GetValue(),
+ layer = self.inputData['node_layer'].GetValue(),
type = self.columnTypes)
self._setInputData()
@@ -794,16 +794,16 @@
GMessage(parent = self,
message = _("Input vector map does not exists."))
- if ["tlayer", "tuclayer"] in err_params:
+ if ["turn_layer", "turn_cat_layer"] in err_params:
GMessage(parent = self, message = "Please choose existing turntable layer and unique categories layer in Parameters tab.")
- cat = GetNearestNodeCat(e, n, int(params['tuclayer']), snapTreshDist, params["input"])
+ cat = GetNearestNodeCat(e, n, int(params['turn_cat_layer']), snapTreshDist, params["input"])
if not self.def_isec_turns:
self.def_isec_turns = DefIntesectionTurnCostDialog(self, self.parent)
self.def_isec_turns.SetSize((500, 400))
- self.def_isec_turns.SetData(params["input"], params["tlayer"])
+ self.def_isec_turns.SetData(params["input"], params["turn_layer"])
self.def_isec_turns.SetIntersection(cat)
self.def_isec_turns.Show()
@@ -916,7 +916,7 @@
skip.append(colInptF)
used_cols.append(colInptF)
- for col in ["abcolumn", "afcolumn", "ncolumn"]:
+ for col in ["arc_backward_column", "arc_column", "node_column"]:
if col not in used_cols:
inputPanel = self.inputData[colInptF].GetParent()
inputPanel.Hide()
@@ -1332,9 +1332,9 @@
dataSelects = [
['input', "Choose vector map for analysis:", Select],
['output', "Name of vector map with turntable:", Select],
- ['alayer', "Arc layer which will be expanded by turntable:", LayerSelect],
- ['tlayer', "Layer with turntable:", LayerSelect],
- ['tuclayer', "Layer with unique categories for turntable:", LayerSelect],
+ ['arc_layer', "Arc layer which will be expanded by turntable:", LayerSelect],
+ ['turn_layer', "Layer with turntable:", LayerSelect],
+ ['turn_cat_layer', "Layer with unique categories for turntable:", LayerSelect],
]
self.inputData = {}
@@ -1371,7 +1371,7 @@
flag = wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, border = 5)
btn = None
- for sel in ['input', 'output', 'alayer', 'tlayer', 'tuclayer']:
+ for sel in ['input', 'output', 'arc_layer', 'turn_layer', 'turn_cat_layer']:
selPanels[sel].SetSizer(self._doSelLayout(title = label[sel],
sel = self.inputData[sel],
@@ -1431,24 +1431,24 @@
vectMapName, mapSet = self._parseMapStr(self.inputData['input'].GetValue())
vectorMap = vectMapName + '@' + mapSet
- for sel in ['alayer', 'tlayer', 'tuclayer']:
+ for sel in ['arc_layer', 'turn_layer', 'turn_cat_layer']:
self.inputData[sel].Clear()
self.inputData[sel].InsertLayers(vector = vectorMap)
- items = self.inputData['alayer'].GetItems()
+ items = self.inputData['arc_layer'].GetItems()
itemsLen = len(items)
if itemsLen < 1:
self.addToTreeBtn.Disable()
if hasattr(self, 'inpDbMgrData'):
self._updateInputDbMgrPage(show = False)
- self.inputData['alayer'].SetValue("")
+ self.inputData['arc_layer'].SetValue("")
return
elif itemsLen == 1:
- self.inputData['alayer'].SetSelection(0)
+ self.inputData['arc_layer'].SetSelection(0)
elif itemsLen >= 1:
if unicode("1") in items:
iItem = items.index(unicode("1"))
- self.inputData['alayer'].SetSelection(iItem)
+ self.inputData['arc_layer'].SetSelection(iItem)
self.addToTreeBtn.Enable()
if hasattr(self, 'inpDbMgrData'):
self._updateInputDbMgrPage(show = True)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/vnet/vnet_core.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/vnet/vnet_core.py 2015-01-03 04:41:43 UTC (rev 63938)
+++ grass/branches/releasebranch_7_0/gui/wxpython/vnet/vnet_core.py 2015-01-03 04:43:23 UTC (rev 63939)
@@ -99,7 +99,7 @@
params, err_params, flags = self.vnet_data.GetParams()
relevant_params = self.vnet_data.GetRelevantParams(analysis)
-
+
if not relevant_params:
return -1
@@ -272,9 +272,9 @@
"v.net.turntable",
"input=" + params["input"],
"output=" + params["output"],
- "alayer=" + params["alayer"],
- "tlayer=" + params["tlayer"],
- "tuclayer=" + params["tuclayer"],
+ "arc_layer=" + params["arc_layer"],
+ "turn_layer=" + params["turn_layer"],
+ "turn_cat_layer=" + params["turn_cat_layer"],
"--overwrite",
]
@@ -441,7 +441,7 @@
overwrite = True)
self._updateTtbByGlobalCosts(self.tmpTurnAn.GetVectMapName(),
- int(params["tlayer"]))
+ int(params["turn_layer"]))
#self._prepareCmd(cmdCopy)
#self.goutput.RunCmd(command = cmdCopy)
@@ -492,7 +492,7 @@
for coor in pts_coor:
cat_num = str(GetNearestNodeCat(e = coor[0],
n = coor[1],
- field = int(params["tuclayer"],
+ field = int(params["turn_cat_layer"],
tresh = params["max_dist"]),
vectMap = params["input"]))
if cat_num < 0:
@@ -526,7 +526,7 @@
overwrite = True)
self._updateTtbByGlobalCosts(self.tmpTurnAn.GetVectMapName(),
- int(params["tlayer"]))
+ int(params["turn_layer"]))
self._setCmdForSpecificAn(cmdParams)
@@ -630,7 +630,7 @@
maxCat = int(cat[4])
break
- layerNum = params["nlayer"]
+ layerNum = params["node_layer"]
pt_ascii, catsNums = self._getAsciiPts (catPts = catPts,
maxCat = maxCat,
@@ -678,8 +678,8 @@
"points=" + self.tmpInPts.GetVectMapName(),
"input=" + params['input'],
"output=" + self.tmpInPtsConnected.GetVectMapName(),
- "alayer=" + params["alayer"],
- "nlayer=" + params["nlayer"],
+ "arc_layer=" + params["arc_layer"],
+ "node_layer=" + params["node_layer"],
"operation=connect",
"thresh=" + str(params["max_dist"]),
"--overwrite"
@@ -705,7 +705,7 @@
def _setInputParams(self, analysis, params, flags):
"""Return list of chosen values (vector map, layers).
- The list items are in form to be used in command for analysis e.g. 'alayer=1'.
+ The list items are in form to be used in command for analysis e.g. 'arc_layer=1'.
"""
inParams = []
@@ -718,12 +718,12 @@
inParams.append(col + '=' + params[colInptF])
- for layer in ['alayer', 'nlayer', 'tlayer', 'tuclayer']:
- if not flags["t"] and layer in ['tlayer', 'tuclayer']:
+ for layer in ['arc_layer', 'node_layer', 'turn_layer', 'turn_cat_layer']:
+ if not flags["t"] and layer in ['turn_layer', 'turn_cat_layer']:
continue
# TODO
- if flags["t"] and layer == 'nlayer':
- inParams.append(layer + "=" + params['tuclayer'])
+ if flags["t"] and layer == 'node_layer':
+ inParams.append(layer + "=" + params['turn_cat_layer'])
continue
inParams.append(layer + "=" + params[layer])
@@ -1026,7 +1026,7 @@
params = params,
inv_params = inv_params,
flags = flags,
- relevant_params = ["input", "nlayer"]):
+ relevant_params = ["input", "node_layer"]):
return -1
if not self.tmp_maps.HasTmpVectMap("vnet_snap_points"):
Modified: grass/branches/releasebranch_7_0/gui/wxpython/vnet/vnet_data.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/vnet/vnet_data.py 2015-01-03 04:41:43 UTC (rev 63938)
+++ grass/branches/releasebranch_7_0/gui/wxpython/vnet/vnet_data.py 2015-01-03 04:43:23 UTC (rev 63939)
@@ -13,7 +13,7 @@
- vnet_data::History
- vnet_data::VNETGlobalTurnsData
-(C) 2013 by the GRASS Development Team
+(C) 2013-2014 by the GRASS Development Team
This program is free software under the GNU General Public License
(>=v2). Read the file COPYING that comes with GRASS for details.
@@ -141,7 +141,7 @@
:return: False if some of checked inputs is not ok
"""
- if flags["t"] and "tlayer" not in relevant_params:
+ if flags["t"] and "turn_layer" not in relevant_params:
GMessage(parent = self.guiparent, message = _("Module <%s> does not support turns costs." % analysis))
return False
@@ -159,12 +159,12 @@
return False
errLayerStr = ""
- for layer, layerLabel in {'alayer' : _("arc layer"),
- 'nlayer' : _("node layer"),
- 'tlayer' : _("turntable layer"),
- 'tuclayer' : _("unique categories layer")}.iteritems():
+ for layer, layerLabel in {'arc_layer' : _("arc layer"),
+ 'node_layer' : _("node layer"),
+ 'turn_layer' : _("turntable layer"),
+ 'turn_cat_layer' : _("unique categories layer")}.iteritems():
- if layer in ["tlayer", "tuclayer"] and not flags["t"]:
+ if layer in ["turn_layer", "turn_cat_layer"] and not flags["t"]:
continue
if layer in inv_params:
if params[layer]:
@@ -179,8 +179,8 @@
return False
errColStr = ""
- for col in ["afcol", "abcol", "ncol"]:
- if col and col in inv_params and col in relevant_params:
+ for col in ["arc_column", "arc_backward_column", "node_column"]:
+ if params[col] and col in inv_params and col in relevant_params:
errColStr += _("Chosen column '%s' does not exist in attribute table of layer '%s' of vector map '%s'.\n") % \
(params[col], params[layer], params['input'])
@@ -543,13 +543,13 @@
self.params = {"analysis" : self.an_props.used_an[0],
"input" : "",
- "alayer" : "",
- "nlayer" : "",
- "afcolumn" : "",
- "abcolumn" : "",
- "ncolumn" : "",
- "tlayer" : "",
- "tuclayer" : "",
+ "arc_layer" : "",
+ "node_layer" : "",
+ "arc_column" : "",
+ "arc_backward_column" : "",
+ "node_column" : "",
+ "turn_layer" : "",
+ "turn_cat_layer" : "",
"iso_lines" : "", #TODO check validity
"max_dist" : 0} #TODO check validity
@@ -589,8 +589,8 @@
def GetParam(self, param):
invParams = []
- if param in ["input", "alayer", "nlayer", "afcolumn",
- "abcolumn", "ncolumn", "tlayer", "tuclayer"]:
+ if param in ["input", "arc_layer", "node_layer", "arc_column",
+ "arc_backward_column", "node_column", "turn_layer", "turn_cat_layer"]:
invParams = self._getInvalidParams(self.params)
if invParams:
@@ -621,23 +621,23 @@
# check arc/node layer
layers = utils.GetVectorNumberOfLayers(params["input"])
- for l in ['alayer', 'nlayer', 'tlayer', 'tuclayer']:
+ for l in ['arc_layer', 'node_layer', 'turn_layer', 'turn_cat_layer']:
if not layers or params[l] not in layers:
invParams.append(l)
dbInfo = VectorDBInfo(params["input"])
try:
- table = dbInfo.GetTable(int(params["alayer"]))
+ table = dbInfo.GetTable(int(params["arc_layer"]))
columnchoices = dbInfo.GetTableDesc(table)
except (KeyError, ValueError):
table = None
-
+
# check costs columns
- for col in ["afcolumn", "abcolumn", "ncolumn"]:
- if col == "ncolumn":
+ for col in ["arc_column", "arc_backward_column", "node_column"]:
+ if col == "node_column":
try:
- table = dbInfo.GetTable(int(params["nlayer"]))
+ table = dbInfo.GetTable(int(params["node_layer"]))
columnchoices = dbInfo.GetTableDesc(table)
except (KeyError, ValueError):
table = None
@@ -645,7 +645,7 @@
if not table or not params[col] in columnchoices.keys():
invParams.append(col)
continue
-
+
if not columnchoices[col].value['type'] not in ['integer', 'double precision']:
invParams.append(col)
continue
@@ -658,20 +658,20 @@
# initialization of v.net.* analysis parameters (data which characterizes particular analysis)
self.attrCols = {
- 'afcolumn' : {
+ 'arc_column' : {
"label" : _("Arc forward/both direction(s) cost column:"),
"name" : _("arc forward/both")
},
- 'abcolumn' : {
+ 'arc_backward_column' : {
"label" : _("Arc backward direction cost column:"),
"name" : _("arc backward")
},
'acolumn' : {
"label" : _("Arcs' cost column (for both directions):"),
"name" : _("arc"),
- "inputField" : 'afcolumn',
+ "inputField" : 'arc_column',
},
- 'ncolumn' : {
+ 'node_column' : {
"label" : _("Node cost column:"),
"name" : _("node")
}
@@ -686,9 +686,9 @@
["end_pt", _("End point")]
],
"cols" : [
- 'afcolumn',
- 'abcolumn',
- 'ncolumn'
+ 'arc_column',
+ 'arc_backward_column',
+ 'node_column'
],
},
"resultProps" : {
@@ -701,10 +701,10 @@
"v.net.salesman" : {
"label" : _("Traveling salesman %s") % "(v.net.salesman)",
"cmdParams" : {
- "cats" : [["ccats", None]],
+ "cats" : [["center_cats", None]],
"cols" : [
- 'afcolumn',
- 'abcolumn'
+ 'arc_column',
+ 'arc_backward_column'
],
},
"resultProps" : {
@@ -722,9 +722,9 @@
["sink_cats", _("Sink point")]
],
"cols" : [
- 'afcolumn',
- 'abcolumn',
- 'ncolumn'
+ 'arc_column',
+ 'arc_backward_column',
+ 'node_column'
]
},
"resultProps" : {
@@ -736,11 +736,11 @@
"v.net.alloc" : {
"label" : _("Subnets for nearest centers %s") % "(v.net.alloc)",
"cmdParams" : {
- "cats" : [["ccats", None]],
+ "cats" : [["center_cats", None]],
"cols" : [
- 'afcolumn',
- 'abcolumn',
- 'ncolumn'
+ 'arc_column',
+ 'arc_backward_column',
+ 'node_column'
]
},
"resultProps" : {
@@ -752,7 +752,7 @@
"v.net.steiner" : {
"label" : _("Steiner tree for the network and given terminals %s") % "(v.net.steiner)",
"cmdParams" : {
- "cats" : [["tcats", None]],
+ "cats" : [["terminal_cats", None]],
"cols" : [
'acolumn',
]
@@ -771,9 +771,9 @@
["to_cats", "To point"]
],
"cols" : [
- 'afcolumn',
- 'abcolumn',
- 'ncolumn'
+ 'arc_column',
+ 'arc_backward_column',
+ 'node_column'
],
},
"resultProps" : {
@@ -785,11 +785,11 @@
"v.net.iso" : {
"label" : _("Cost isolines %s") % "(v.net.iso)",
"cmdParams" : {
- "cats" : [["ccats", None]],
+ "cats" : [["center_cats", None]],
"cols" : [
- 'afcolumn',
- 'abcolumn',
- 'ncolumn'
+ 'arc_column',
+ 'arc_backward_column',
+ 'node_column'
]
},
"resultProps" : {
@@ -830,10 +830,10 @@
if not self.vnetProperties.has_key(analysis):
return None
- relevant_params = ["input", "alayer", "nlayer"]
+ relevant_params = ["input", "arc_layer", "node_layer"]
if self.vnetProperties[analysis]["turns_support"]:
- relevant_params += ["tlayer", "tuclayer"]
+ relevant_params += ["turn_layer", "turn_cat_layer"]
cols = self.vnetProperties[analysis]["cmdParams"]["cols"]
More information about the grass-commit
mailing list