Skip to content

Commit

Permalink
inicio en 1 para grupos
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoZuniga committed Apr 25, 2020
1 parent 084f813 commit 2650565
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions DN_Corrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ def inconsistencias_MT(self):
MTAerAttrIdx = self.getAttributeIndex(aereaMTLayer, 'RING')
MTAerAttrIdxConnect = self.getAttributeIndex(aereaMTLayer, 'MV_GROUP')
for feat in aereaMTLayer.getFeatures():
done = aereaMTLayer.changeAttributeValue(feat.id(), MTAerAttrIdx, 0)
done = aereaMTLayer.changeAttributeValue(feat.id(), MTAerAttrIdxConnect, 0)
done = aereaMTLayer.changeAttributeValue(feat.id(), MTAerAttrIdx, 1)
done = aereaMTLayer.changeAttributeValue(feat.id(), MTAerAttrIdxConnect, 1)
#try:

geom = feat.geometry()
Expand Down Expand Up @@ -487,7 +487,7 @@ def inconsistencias_MT(self):
cargaMTLayer.startEditing()
MTCargaAttrIdxConnect = self.getAttributeIndex(cargaMTLayer, 'MV_GROUP')
for feat in cargaMTLayer.getFeatures():
done = cargaMTLayer.changeAttributeValue(feat.id(), MTCargaAttrIdxConnect, 0)
done = cargaMTLayer.changeAttributeValue(feat.id(), MTCargaAttrIdxConnect, 1)
point = feat.geometry().asPoint()
x = int(point[0]/tolerance)
y = int(point[1]/tolerance)
Expand All @@ -508,7 +508,7 @@ def inconsistencias_MT(self):
TrafLayerEditingMode = True
trafoAttrIdxConnect = self.getAttributeIndex(trafoLayer, 'MV_GROUP')
for feat in trafoLayer.getFeatures():
done = trafoLayer.changeAttributeValue(feat.id(), trafoAttrIdxConnect, 0)
done = trafoLayer.changeAttributeValue(feat.id(), trafoAttrIdxConnect, 1)
point = feat.geometry().asPoint()
x = int(point[0]/tolerance)
y = int(point[1]/tolerance)
Expand Down Expand Up @@ -646,7 +646,7 @@ def inconsistencias_BT(self):
trafoLayer.beginEditCommand("Update group attribute")
trafoAttrIdx = self.getAttributeIndex(trafoLayer, 'LV_GROUP')
for feat in trafoLayer.getFeatures():
done = trafoLayer.changeAttributeValue(feat.id(), trafoAttrIdx, 0)
done = trafoLayer.changeAttributeValue(feat.id(), trafoAttrIdx, 1)
try:
point = feat.geometry().asPoint()
x = int(point[0]/tolerance)
Expand All @@ -671,8 +671,8 @@ def inconsistencias_BT(self):
groupAttrIdx = self.getAttributeIndex(BTLayer, 'LV_GROUP')
ringAttrIdx = self.getAttributeIndex(BTLayer, 'RING')
for feat in BTLayer.getFeatures():
done = BTLayer.changeAttributeValue(feat.id(), groupAttrIdx, 0)
done = BTLayer.changeAttributeValue(feat.id(), ringAttrIdx, 0)
done = BTLayer.changeAttributeValue(feat.id(), groupAttrIdx, 1)
done = BTLayer.changeAttributeValue(feat.id(), ringAttrIdx, 1)
try:
geom = feat.geometry()
line = self.MultiStringToMatrix(geom)
Expand Down Expand Up @@ -700,8 +700,8 @@ def inconsistencias_BT(self):
groupAttrIdx = self.getAttributeIndex(acomLayer, 'LV_GROUP')
ringAttrIdx = self.getAttributeIndex(acomLayer, 'RING')
for feat in acomLayer.getFeatures():
done = acomLayer.changeAttributeValue(feat.id(), groupAttrIdx, 0)
done = acomLayer.changeAttributeValue(feat.id(), ringAttrIdx, 0)
done = acomLayer.changeAttributeValue(feat.id(), groupAttrIdx, 1)
done = acomLayer.changeAttributeValue(feat.id(), ringAttrIdx, 1)
try:
geom = feat.geometry()
line = self.MultiStringToMatrix(geom)
Expand All @@ -728,7 +728,7 @@ def inconsistencias_BT(self):
cargaLayer.beginEditCommand("Update group attribute")
groupAttrIdx = self.getAttributeIndex(cargaLayer, 'LV_GROUP')
for feat in cargaLayer.getFeatures():
done = cargaLayer.changeAttributeValue(feat.id(), groupAttrIdx, 0)
done = cargaLayer.changeAttributeValue(feat.id(), groupAttrIdx, 1)
try:
point = feat.geometry().asPoint()
x = int(point[0]/tolerance)
Expand Down Expand Up @@ -979,9 +979,6 @@ def loadConec(self):
acomet_Layers = inputLayers["acometida"]
carga_BT_Layers = inputLayers["carga_BT"]

print( "inputLayers = ", inputLayers )
print( "carga_BT_Layers = ", carga_BT_Layers )

fid_comp_aerea, toReport, GrafoBT, NOGEOMETRY = self.inconsistencias_BT()
trafoDesc, linesBTDesc, ACODesc, loadDesc, trafParalelo, BT_lines_group, aco_group = toReport

Expand Down
Binary file modified __pycache__/DN_Corrector.cpython-37.pyc
Binary file not shown.

0 comments on commit 2650565

Please sign in to comment.