debug import friction

master
Theophile Terraz 2025-10-21 15:11:28 +02:00
parent 7ef3184699
commit bcbb440ad4
1 changed files with 5 additions and 6 deletions

View File

@ -274,15 +274,14 @@ class FrictionTableModel(PamhyrTableModel):
with open(file_name, encoding="utf-8") as rug_file: with open(file_name, encoding="utf-8") as rug_file:
for line in rug_file: for line in rug_file:
if line.upper().startswith("K"): if line.upper().startswith("K"):
line = line.split() if int(line[1:4]) == reach_id:
if int(line[1]) == reach_id: data.append(line[4:].split())
data.append(line[1:])
new_data = [] new_data = []
for d in data: for d in data:
new = None new = None
minor = float(d[3]) minor = float(d[2])
medium = float(d[4]) medium = float(d[3])
for s in self._study.river.stricklers.stricklers: for s in self._study.river.stricklers.stricklers:
if s.minor == minor and s.medium == medium: if s.minor == minor and s.medium == medium:
new = s new = s
@ -292,5 +291,5 @@ class FrictionTableModel(PamhyrTableModel):
self._study.river.stricklers)) self._study.river.stricklers))
new.minor = minor new.minor = minor
new.medium = medium new.medium = medium
new_data.append([self._data, float(d[1]), float(d[2]), new, new]) new_data.append([self._data, float(d[0]), float(d[1]), new, new])
self.replace_data(new_data) self.replace_data(new_data)