mirror of https://gitlab.com/pamhyr/pamhyr2
debug SIN output
parent
c253ad832d
commit
d1c8e3e4f5
|
|
@ -440,6 +440,21 @@ class Mage(CommandLineSolver):
|
|||
def _export_SIN(self, study, repertory, qlog, name="0"):
|
||||
files = []
|
||||
|
||||
sin_dict = {
|
||||
"ND":"*",
|
||||
"S1":"D",
|
||||
"S2":"T",
|
||||
"S3":"T",
|
||||
"OR":"D",
|
||||
"OC":"B",
|
||||
"OV":"F",
|
||||
"V1":"V",
|
||||
"V2":"W",
|
||||
"BO":"A",
|
||||
"UD":"X",
|
||||
"PO":"P",
|
||||
}
|
||||
|
||||
hydraulic_structures = study.river.hydraulic_structures.lst
|
||||
if len(hydraulic_structures) == 0:
|
||||
return files
|
||||
|
|
@ -451,8 +466,8 @@ class Mage(CommandLineSolver):
|
|||
files.append(f"{name}.SIN")
|
||||
|
||||
for hs in hydraulic_structures:
|
||||
if hs.reach.is_enable:
|
||||
reach_id = study.river.get_edge_id(hs.reach)
|
||||
if hs.input_reach.is_enable:
|
||||
reach_id = study.river.get_edge_id(hs.input_reach)
|
||||
params = [
|
||||
p.value for p in hs.basic_hydraulic_structure.param
|
||||
]
|
||||
|
|
@ -463,7 +478,7 @@ class Mage(CommandLineSolver):
|
|||
]
|
||||
)
|
||||
f.write(
|
||||
f"{hs.basic_hydraulic_structure.type} " +
|
||||
f"{sin_dict[hs.basic_hydraulic_structure.type]} " +
|
||||
f"{reach_id} {hs.kp:>12.3f} {params} " +
|
||||
"{hs.name}\n"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue