Skip to content

Commit

Permalink
Merge pull request #644 from gisce/b1-exploure-embarrats
Browse files Browse the repository at this point in the history
B1: Opció per excloure embarrats
  • Loading branch information
ecarreras authored Apr 15, 2024
2 parents ce81c88 + 233d2f2 commit 9b70cfd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions libcnmc/cir_8_2021/FB1.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ def get_sequence(self):
'|', ('data_baixa', '>=', data_baixa),
('data_baixa', '=', False)]

if not self.embarrats:
search_params += [
('cable.tipus.codi', '!=', 'E')
]

# Revisem que si està de baixa ha de tenir la data informada
search_params += ['|',
'&', ('active', '=', False),
Expand All @@ -99,6 +104,11 @@ def get_sequence(self):
'|', ('data_baixa', '>=', data_baixa),
('data_baixa', '=', False)]

if not self.embarrats:
search_params += [
('cable.tipus.codi', '!=', 'E')
]

# Revisem que si està de baixa ha de tenir la data informada
search_params += ['|',
'&', ('active', '=', False),
Expand Down
4 changes: 3 additions & 1 deletion libcnmc/cli_8_2021.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ def cir_8_2021_fa5(**kwargs):
@click.option("--reducir-cups/--no-reducir-cups",default=False)
@click.option('--prefix_at', help="Prefix dels Trams AT")
@click.option('--prefix_bt', help="Prefix dels Trams BT")
@click.option('--embarrats/--no-embarrats', default=True, help="Afegir embarrats")
@click.option('--div/--no-div', default=False, help="Dividir la longitud dels Trams AT entre el núm. de circuits")
def cir_8_2021_fb1(**kwargs):
"""
Expand All @@ -297,7 +298,8 @@ def cir_8_2021_fb1(**kwargs):
reducir_cupss=kwargs["reducir_cups"],
prefix_at=kwargs['prefix_at'],
prefix_bt=kwargs['prefix_bt'],
div=kwargs['div']
div=kwargs['div'],
embarrats=kwargs['embarrats'],
)
proc.calc()

Expand Down

0 comments on commit 9b70cfd

Please sign in to comment.