From bcbb440ad4a2867473a968a0dbd3e8dfcf954ec9 Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Tue, 21 Oct 2025 15:11:28 +0200 Subject: [PATCH] debug import friction --- src/View/Frictions/Table.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/View/Frictions/Table.py b/src/View/Frictions/Table.py index 64a3e18f..7b5d278c 100644 --- a/src/View/Frictions/Table.py +++ b/src/View/Frictions/Table.py @@ -274,15 +274,14 @@ class FrictionTableModel(PamhyrTableModel): with open(file_name, encoding="utf-8") as rug_file: for line in rug_file: if line.upper().startswith("K"): - line = line.split() - if int(line[1]) == reach_id: - data.append(line[1:]) + if int(line[1:4]) == reach_id: + data.append(line[4:].split()) new_data = [] for d in data: new = None - minor = float(d[3]) - medium = float(d[4]) + minor = float(d[2]) + medium = float(d[3]) for s in self._study.river.stricklers.stricklers: if s.minor == minor and s.medium == medium: new = s @@ -292,5 +291,5 @@ class FrictionTableModel(PamhyrTableModel): self._study.river.stricklers)) new.minor = minor 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)