mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
5 Commits
Test_scena
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
a31e2127e7 | |
|
|
a29df8f904 | |
|
|
97ebf9324a | |
|
|
0112ad63d9 | |
|
|
bcbb440ad4 |
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -292,9 +292,27 @@ class InitialConditionTableModel(PamhyrTableModel):
|
|||
if not (line.startswith("#") or
|
||||
line.startswith("*") or
|
||||
line.startswith("$")):
|
||||
line = line.split()
|
||||
if int(line[0]) == reach_id:
|
||||
data.append([line[4], line[2], line[3]])
|
||||
line_split = line.split()
|
||||
formated = False
|
||||
if len(line_split[0]) > 3:
|
||||
formated = True
|
||||
elif len(line_split[2]) > 10:
|
||||
formated = True
|
||||
elif len(line_split[3]) > 11:
|
||||
formated = True
|
||||
elif len(line_split[4]) > 9:
|
||||
formated = True
|
||||
|
||||
if formated: # old PamHyr format
|
||||
if int(line[1:4]) == reach_id:
|
||||
data.append([line[31:40],
|
||||
line[10:20],
|
||||
line[20:31]])
|
||||
else:
|
||||
if int(line_split[0]) == reach_id:
|
||||
data.append([line_split[4],
|
||||
line_split[2],
|
||||
line_split[3]])
|
||||
|
||||
self._undo.push(
|
||||
ReplaceDataCommand(
|
||||
|
|
|
|||
|
|
@ -220,6 +220,8 @@ class InitialConditionsWindow(PamhyrWindow):
|
|||
def _update_plot(self):
|
||||
self.plot_1.draw()
|
||||
self.plot_2.draw()
|
||||
self.plot_1.idle()
|
||||
self.plot_2.idle()
|
||||
|
||||
def _propagated_update(self, key=Modules(0)):
|
||||
if Modules.GEOMETRY not in key:
|
||||
|
|
@ -315,10 +317,12 @@ class InitialConditionsWindow(PamhyrWindow):
|
|||
def _import_from_results(self, results):
|
||||
logger.debug(f"import from results: {results}")
|
||||
self._table.import_from_results(results)
|
||||
self._update()
|
||||
|
||||
def _import_from_ini_file(self, file_name):
|
||||
logger.debug(f"import from INI file: {file_name}")
|
||||
self._table.read_from_ini(file_name)
|
||||
self._update()
|
||||
|
||||
def move_up(self):
|
||||
row = self.index_selected_row()
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ class GraphWidget(QGraphicsView):
|
|||
def setup_scene(self, min_size, max_size, size):
|
||||
scene = QGraphicsScene(self)
|
||||
scene.setItemIndexMethod(QGraphicsScene.NoIndex)
|
||||
scene.setSceneRect(0, 0, 2000, 2000)
|
||||
scene.setSceneRect(0, 0, 6000, 6000)
|
||||
|
||||
self.setScene(scene)
|
||||
self.setCacheMode(QGraphicsView.CacheBackground)
|
||||
|
|
@ -486,6 +486,7 @@ class GraphWidget(QGraphicsView):
|
|||
|
||||
self.scale(1, 1)
|
||||
self.previousScale = 1
|
||||
self.centerOn(1000.0, 1000.0)
|
||||
|
||||
if min_size:
|
||||
self.setMinimumSize(*min_size)
|
||||
|
|
|
|||
Loading…
Reference in New Issue