Skip to content

Commit

Permalink
Merge pull request #6 from gisce/FIX_embarrats
Browse files Browse the repository at this point in the history
Ara LAT i LBT no tenen en compte els embarrats
  • Loading branch information
guilleJB committed Sep 17, 2014
2 parents 1cb21fe + 711f2f6 commit 4bb11f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions libcnmc/res_4603/LAT.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ def consumer(self):
)
for tram in linia['trams']:
tram = O.GiscedataAtTram.read(tram, fields_to_read)

#Comprovar el tipus del cable
cable = O.GiscedataAtCables.read(tram['cable'][0],
['tipus'])
tipus = O.GiscedataAtTipuscable.read(cable['tipus'][0],
['codi'])
#Si el tram tram es embarrat no l'afegim
if tipus['codi'] == 'E':
continue

#Si el tram es de baixa no l'afegim
if tram['baixa']:
continue
Expand Down
2 changes: 1 addition & 1 deletion libcnmc/res_4603/LBT.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, **kwargs):
self.report_name = 'CNMC INVENTARI BT'

def get_sequence(self):
search_params = [('baixa', '!=', True)]
search_params = [('baixa', '!=', True), ('cable.tipus.codi', '!=', 'E')]
return self.connection.GiscedataBtElement.search(search_params)

def consumer(self):
Expand Down

0 comments on commit 4bb11f8

Please sign in to comment.