Compare commits

...
Author SHA1 Message Date
Pierre-Antoine Rouby a8c71e475e Pep8: Fix. 2024-02-07 11:26:29 +01:00
Pierre-Antoine Rouby 41673145ee Translate: Minor change. 2024-02-07 11:23:15 +01:00
Pierre-Antoine Rouby 4757c7d051 Translate: Update. 2024-02-07 11:22:22 +01:00
Pierre-Antoine Rouby 5619b98468 Solver: Run: Close checklist at solver run, resize solver window and fix empty message. 2024-02-07 10:23:02 +01:00
Pierre-Antoine Rouby 630eb98343 SL: Fix default name. 2024-02-07 10:09:18 +01:00
Pierre-Antoine Rouby 5412cb4d2d HS: Add default name. 2024-02-07 10:06:18 +01:00
Pierre-Antoine Rouby 8f46f128ff SL: Add default name. 2024-02-07 10:00:30 +01:00
Pierre-Antoine Rouby 8807d4d98b Reservoir: Add default name. 2024-02-07 09:59:22 +01:00
Pierre-Antoine Rouby 7719f5270d BC, LC: Add default name. 2024-02-07 09:57:23 +01:00
Pierre-Antoine Rouby afb4c1b61e Friction: Add id to friction and default name to stricklers. 2024-02-07 09:52:43 +01:00
Pierre-Antoine Rouby 28bea42b15 River: Add default reach at study creation. 2024-02-07 09:43:13 +01:00
Pierre-Antoine Rouby 955af412ea MainWindow: Make toolbar run launch the lasest solver used and add sc on F6. 2024-02-06 15:21:51 +01:00
Pierre-Antoine Rouby 49dd3c65e1 ci: Set tag message to release message and minor change. 2024-02-05 13:38:54 +01:00
Pierre-Antoine Rouby b2f41f88c9 ci: Minor change to fix sha256 path. 2024-02-05 13:25:19 +01:00
Pierre-Antoine Rouby f3500c7f24 ci: Add sha256 to release artefact. 2024-02-05 11:52:56 +01:00
Pierre-Antoine Rouby 1cbdc9deff ci: Disable PDF of user documentations. 2024-02-05 11:42:43 +01:00
Pierre-Antoine Rouby 89652cc080 ci: Add packages checksum. 2024-02-05 11:39:56 +01:00
Pierre-Antoine Rouby fe3f151e0b ci: Minor change. 2024-02-05 11:18:33 +01:00
Pierre-Antoine Rouby 16caae9d40 ci: Add build check. 2024-02-05 11:14:14 +01:00
Pierre-Antoine Rouby d541becb1a ci: Add antivirus check with clamav scan. 2024-02-02 11:23:39 +01:00
Pierre-Antoine Rouby 21e97d4e30 Solvers: Disable generic solver. 2024-02-02 10:25:41 +01:00
Pierre-Antoine Rouby 9fd9bd95f4 SolverParameters: Minor change. 2024-02-02 10:17:54 +01:00
27 changed files with 609 additions and 377 deletions

No files matched your search

+149 -29
View File
@@ -20,6 +20,8 @@ stages:
- test
- build
- package
- hash
- antivirus
- release
#############
@@ -148,23 +150,22 @@ test-pep8:
# BUILD #
#########
build-users-doc:
stage: build
tags:
- linux
needs:
- job: set-version
artifacts: true
script:
- cd ./doc/users/
- ./build.sh
artifacts:
paths:
- doc/users/documentation.pdf
- doc/users/documentation.html
- doc/users/images/
allow_failure: true
# build-users-doc:
# stage: build
# tags:
# - linux
# needs:
# - job: set-version
# artifacts: true
# script:
# - cd ./doc/users/
# - ./build.sh
# artifacts:
# paths:
# - doc/users/documentation.pdf
# - doc/users/documentation.html
# - doc/users/images/
# allow_failure: true
build-td:
stage: build
@@ -231,8 +232,8 @@ build-linux:
artifacts: true
- job: build-developers-doc
artifacts: true
- job: build-users-doc
artifacts: true
# - job: build-users-doc
# artifacts: true
- job: build-td
artifacts: true
script:
@@ -322,14 +323,15 @@ build-windows:
artifacts: true
- job: build-developers-doc
artifacts: true
- job: build-users-doc
artifacts: true
# - job: build-users-doc
# artifacts: true
- job: build-td
artifacts: true
script:
- mkdir windows
- cd windows
# Setup env
- python -m pip install -U pip
- python -m pip install -r ..\requirements.txt
- python -m pip install -U -r ..\requirements.txt
# Run Pyinstaller
@@ -403,6 +405,111 @@ windows-package-exe:
- copy ..\packages\pamhyr.nsi pamhyr.nsi
- .\make-windows-exe.bat
########
# HASH #
########
linux-build-hash:
stage: hash
tags:
- release
- linux
needs:
- job: build-linux
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == 'ci-test' || $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
script:
- cd linux
- sha256sum -b pamhyr/pamhyr/pamhyr > pamhyr/pamhyr/pamhyr.sha256
artifacts:
paths:
- linux/pamhyr/pamhyr/pamhyr.sha256
windows-build-hash:
stage: hash
tags:
- release
- linux
needs:
- job: build-windows
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == 'ci-test' || $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
script:
- cd windows
- sha256sum -b pamhyr/pamhyr/pamhyr.exe > pamhyr/pamhyr/pamhyr.exe.sha256
artifacts:
paths:
- windows/pamhyr/pamhyr/pamhyr.exe.sha256
pkg-hash:
stage: hash
tags:
- release
- linux
needs:
- job: linux-package-tar
artifacts: true
- job: windows-package-zip
artifacts: true
- job: windows-package-exe
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == 'ci-test' || $CI_COMMIT_TAG
script:
- cd windows
- sha256sum -b pamhyr-windows.exe > pamhyr-windows.exe.sha256
- sha256sum -b pamhyr-windows.zip > pamhyr-windows.zip.sha256
- cd ..
- cd linux
- sha256sum -b pamhyr-gnulinux.tar.xz > pamhyr-gnulinux.tar.xz.sha256
artifacts:
paths:
- windows/pamhyr-windows.exe.sha256
- windows/pamhyr-windows.zip.sha256
- linux/pamhyr-gnulinux.tar.xz.sha256
#############
# ANTIVIRUS #
#############
build-check-clamav:
stage: antivirus
tags:
- release
- linux
needs:
- job: build-linux
artifacts: true
- job: build-windows
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == 'ci-test' || $CI_COMMIT_BRANCH == 'master' || $CI_COMMIT_TAG
script:
- cd packages
- ./clamav-scan.sh builds
allow_failure: true
pkg-check-clamav:
stage: antivirus
tags:
- release
- linux
needs:
- job: linux-package-tar
artifacts: true
- job: windows-package-zip
artifacts: true
- job: windows-package-exe
artifacts: true
rules:
- if: $CI_COMMIT_BRANCH == 'ci-test' || $CI_COMMIT_TAG
script:
- cd packages
- ./clamav-scan.sh packages
allow_failure: true
###########
# RELEASE #
###########
@@ -419,10 +526,12 @@ tag-release:
artifacts: true
- job: windows-package-exe
artifacts: true
- job: build-users-doc
artifacts: true
# - job: build-users-doc
# artifacts: true
- job: build-developers-doc
artifacts: true
- job: pkg-hash
artifacts: true
rules:
- if: $CI_COMMIT_TAG
artifacts:
@@ -430,33 +539,44 @@ tag-release:
- linux/pamhyr-gnulinux.tar.xz
- windows/pamhyr-windows.zip
- windows/pamhyr-windows.exe
- linux/pamhyr-gnulinux.tar.xz.sha256
- windows/pamhyr-windows.zip.sha256
- windows/pamhyr-windows.exe.sha256
- doc/dev/documentation.pdf
- doc/users/documentation.pdf
# - doc/users/documentation.pdf
script:
- cd packages
release:
name: '$CI_COMMIT_TAG'
description: 'Automatic release from tag $CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG_MESSAGE'
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
assets:
links:
- name: 'GNU/Linux CHECKSUM SHA256 (tar.xz)'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/linux/pamhyr-gnulinux.tar.xz.sha256'
filepath: '/linux/pamhyr-gnulinux.tar.xz.sha256'
link_type: 'package'
- name: 'GNU/Linux (tar.xz)'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/linux/pamhyr-gnulinux.tar.xz'
filepath: '/linux/pamhyr-gnulinux.tar.xz'
link_type: 'package'
- name: 'Windows CHECKSUM SHA256 (exe)'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/windows/pamhyr-windows.exe.sha256'
filepath: '/windows/pamhyr-windows.exe.sha256'
link_type: 'package'
- name: 'Windows (exe)'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/windows/pamhyr-windows.exe'
filepath: '/windows/pamhyr-windows.exe'
link_type: 'package'
- name: 'Windows CHECKSUM SHA256 (zip)'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/windows/pamhyr-windows.zip.sha256'
filepath: '/windows/pamhyr-windows.zip.sha256'
link_type: 'package'
- name: 'Windows (zip)'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/windows/pamhyr-windows.zip'
filepath: '/windows/pamhyr-windows.zip'
link_type: 'package'
- name: 'User documentations (pdf)'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/doc/users/documentation.pdf'
filepath: '/doc/users/documentation.pdf'
link_type: 'other'
- name: 'Dev documentations (pdf)'
url: '${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/doc/dev/documentation.pdf'
filepath: '/doc/dev/documentation.pdf'
+21
View File
@@ -0,0 +1,21 @@
#! /bin/bash
set +x
OPTS="-r -a -i"
if [ "$1" == "builds" ]; then
FILES="../windows/ ../linux/"
else
FILES="../windows/pamhyr-windows.exe ../windows/pamhyr-windows.zip ../linux/pamhyr-gnulinux.tar.xz"
fi
clamscan $OPTS $FILES | tee clamav.log
RES=$(cat clamav.log | grep "Infected files: 0")
if [ -z "$RES" ]; then
echo "Infected files"
exit -1
else
echo "OK"
exit 0
fi
@@ -200,6 +200,9 @@ class BoundaryCondition(SQLSubModel):
@property
def name(self):
if self._name == "":
return f"B{self.id + 1}"
return self._name
@name.setter
+25 -12
View File
@@ -26,11 +26,21 @@ logger = logging.getLogger()
class Friction(SQLSubModel):
def __init__(self, name: str = "", status=None):
_id_cnt = 0
def __init__(self, id: int = -1, name: str = "",
status=None):
super(Friction, self).__init__()
self._status = status
if id == -1:
self.id = Friction._id_cnt
else:
self.id = id
Friction._id_cnt = max(self.id, Friction._id_cnt+1)
self._name = name
self._edge = None
self._begin_kp = 0.0
@@ -42,7 +52,7 @@ class Friction(SQLSubModel):
def _db_create(cls, execute):
execute("""
CREATE TABLE friction(
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
id INTEGER NOT NULL PRIMARY KEY,
ind INTEGER NOT NULL,
begin_kp REAL NOT NULL,
end_kp REAL NOT NULL,
@@ -70,28 +80,30 @@ class Friction(SQLSubModel):
stricklers = data["stricklers"].stricklers
table = execute(
"SELECT ind, begin_kp, end_kp, begin_strickler, end_strickler " +
"SELECT id, ind, begin_kp, end_kp, " +
"begin_strickler, end_strickler " +
f"FROM friction WHERE reach = {reach.id}"
)
for row in table:
ind = row[0]
id = row[0]
ind = row[1]
# Get stricklers
if int(row[3]) == -1:
if int(row[4]) == -1:
bs = None
else:
bs = next(filter(lambda s: s.id == row[3], stricklers))
bs = next(filter(lambda s: s.id == row[4], stricklers))
if int(row[4]) == -1:
if int(row[5]) == -1:
es = None
else:
es = next(filter(lambda s: s.id == row[4], stricklers))
es = next(filter(lambda s: s.id == row[5], stricklers))
# Create friction
sec = cls(status=status)
sec.edge = reach
sec.begin_kp = row[1]
sec.end_kp = row[2]
sec.begin_kp = row[2]
sec.end_kp = row[3]
sec.begin_strickler = bs
sec.end_strickler = es
@@ -112,10 +124,11 @@ class Friction(SQLSubModel):
execute(
"INSERT INTO " +
"friction(ind, begin_kp, end_kp, " +
"friction(id, ind, begin_kp, end_kp, " +
"reach, begin_strickler, end_strickler) " +
"VALUES (" +
f"{ind}, {self._begin_kp}, {self._end_kp}, " +
f"{self.id}, {ind}, " +
f"{self._begin_kp}, {self._end_kp}, " +
f"{self._edge.id}, " +
f"{b_s_id}, {e_s_id}" +
")"
@@ -158,6 +158,9 @@ class BasicHS(SQLSubModel):
@property
def name(self):
if self._name == "":
return f"{self._type}{self.id + 1}"
return self._name
@name.setter
@@ -187,6 +187,9 @@ class HydraulicStructure(SQLSubModel):
@property
def name(self):
if self._name == "":
return f"HS{self.id + 1}"
return self._name
@name.setter
@@ -200,6 +200,9 @@ class LateralContribution(SQLSubModel):
@property
def name(self):
if self._name == "":
return f"L{self.id + 1}"
return self._name
@name.setter
+3
View File
@@ -152,6 +152,9 @@ class Reservoir(SQLSubModel):
@property
def name(self):
if self._name == "":
return f"R{self.id + 1}"
return self._name
@name.setter
+6
View File
@@ -372,6 +372,12 @@ class River(Graph, SQLSubModel):
except Exception as e:
logger_exception(e)
def init_default(self):
n1 = self.add_node(880.0, 950.0)
n2 = self.add_node(1120.0, 1020.0)
e = self.add_edge(n1, n2)
@property
def boundary_condition(self):
return self._boundary_condition
+6
View File
@@ -37,6 +37,9 @@ class Layer(SQLSubModel):
@property
def name(self):
if self._name == "":
return f"Layer{self.id + 1}"
return self._name
@name.setter
@@ -204,6 +207,9 @@ class SedimentLayer(SQLSubModel):
@property
def name(self):
if self._name == "":
return f"SL{self.id + 1}"
return self._name
@name.setter
+2
View File
@@ -120,6 +120,8 @@ class Stricklers(SQLSubModel):
@property
def name(self):
if self._name == "":
return f"K{self.id + 1}"
return self._name
@name.setter
+5 -1
View File
@@ -90,7 +90,7 @@ class Mage(CommandLineSolver):
("mage_compute_reach_volume_balance", "y"),
("mage_max_reach_volume_balance", "0.001"),
("mage_min_reach_volume_to_check", "1000.0"),
("mage_init_internal", " "),
("mage_init_internal", "n"),
]
return lst
@@ -792,6 +792,10 @@ class Mage8(Mage):
value = ("p" if value.lower() in ["y", "yes", "true"]
else "")
logger.debug(
f"export: PAR: {name}: {value} ({p.value})"
)
f.write(f"{name} {value}\n")
return files
+2 -2
View File
@@ -24,13 +24,13 @@ from Solver.Mage import Mage7, Mage8
_translate = QCoreApplication.translate
solver_long_name = {
"generic": "Generic",
# "generic": "Generic",
# "mage7": "Mage v7",
"mage8": "Mage v8",
}
solver_type_list = {
"generic": GenericSolver,
# "generic": GenericSolver,
# "mage7": Mage7,
"mage8": Mage8,
}
+1
View File
@@ -167,6 +167,7 @@ class CheckListWindow(PamhyrWindow):
self.find(QPushButton, "pushButton_ok").setEnabled(True)
if self._autorun:
self._parent.solver_log(self._solver)
self.end()
self.update_statusbar()
+1 -1
View File
@@ -44,6 +44,6 @@ class GeometryTranslate(PamhyrTranslate):
self._sub_dict["table_headers"] = {
"name": _translate("Geometry", "Name"),
"kp": _translate("Geometry", "KP"),
"kp": _translate("Geometry", "KP (m)"),
"poins": _translate("Geometry", "Points"),
}
@@ -41,22 +41,22 @@ hydraulic structure values?"
# BHSValues translation
self._dict['width'] = _translate(
"BasicHydraulicStructures", "Width"
"BasicHydraulicStructures", "Width (m)"
)
self._dict['height'] = _translate(
"BasicHydraulicStructures", "Height"
"BasicHydraulicStructures", "Thickness (m)"
)
self._dict['elevation'] = _translate(
"BasicHydraulicStructures", "Elevation"
"BasicHydraulicStructures", "Elevation (m)"
)
self._dict['diameter'] = _translate(
"BasicHydraulicStructures", "Diameter"
"BasicHydraulicStructures", "Diameter (m)"
)
self._dict['discharge_coefficient'] = _translate(
"BasicHydraulicStructures", "Discharge coefficient"
)
self._dict['loading_elevation'] = _translate(
"BasicHydraulicStructures", "Loading elevation"
"BasicHydraulicStructures", "Upper elevation (m)"
)
self._dict['half-angle_tangent'] = _translate(
"BasicHydraulicStructures", "Half-angle tangent"
@@ -65,13 +65,13 @@ hydraulic structure values?"
"BasicHydraulicStructures", "Maximal loading elevation"
)
self._dict['siltation_height'] = _translate(
"BasicHydraulicStructures", "Siltation height"
"BasicHydraulicStructures", "Siltation height (m)"
)
self._dict['top_of_the_vault'] = _translate(
"BasicHydraulicStructures", "Top of the vault"
"BasicHydraulicStructures", "Top of the vault (m)"
)
self._dict['bottom_of_the_vault'] = _translate(
"BasicHydraulicStructures", "Bottom of the vault"
"BasicHydraulicStructures", "Bottom of the vault (m)"
)
self._dict['opening'] = _translate(
"BasicHydraulicStructures", "Opening"
+1 -1
View File
@@ -30,5 +30,5 @@ class HydraulicStructuresTranslate(PamhyrTranslate):
self._sub_dict["table_headers"] = {
"name": _translate("HydraulicStructures", "Name"),
"reach": _translate("HydraulicStructures", "Reach"),
"kp": _translate("HydraulicStructures", "Kp"),
"kp": _translate("HydraulicStructures", "Kp (m)"),
}
+32 -22
View File
@@ -175,7 +175,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
self.findChild(QAction, action).setEnabled(enable)
def setup_sc(self):
# self._run_sc = QShortcut(QKeySequence("F5"), self)
self._run_sc = QShortcut(QKeySequence("F6"), self)
return
def setup_connection(self):
@@ -202,7 +202,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
"action_menu_initial_conditions": self.open_initial_conditions,
"action_menu_edit_friction": self.open_frictions,
"action_menu_edit_lateral_contribution": self.open_lateral_contrib,
"action_menu_run_solver": self.run_solver,
"action_menu_run_solver": self.select_and_run_solver,
"action_menu_sediment_layers": self.open_sediment_layers,
"action_menu_edit_reach_sediment_layers":
self.open_reach_sediment_layers,
@@ -222,7 +222,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
"action_toolBar_open": self.open_model,
"action_toolBar_save": self.save_study,
"action_toolBar_close": self.close_model,
"action_toolBar_run_solver": self.run_solver,
"action_toolBar_run_solver": self.run_lasest_solver,
# Current actions
"action_toolBar_network": self.open_network,
"action_toolBar_geometry": self.open_geometry,
@@ -243,7 +243,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
.triggered.connect(actions[action])
# action.triggered.connect(actions[action])
# self._run_sc.activated.connect(self.run_solver)
self._run_sc.activated.connect(self.run_lasest_solver)
def changeEvent(self, event):
if event.type() == QEvent.LanguageChange:
@@ -808,7 +808,13 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
)
sl.show()
def run_solver(self):
def run_lasest_solver(self):
if self._last_solver is None:
return
self.run_solver(self._last_solver)
def select_and_run_solver(self):
if self._study is None:
return
@@ -818,25 +824,29 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
parent=self
)
if run.exec():
solver = run.solver
self.run_solver(run.solver)
if self.sub_window_exists(
CheckListWindow,
data=[
self._study,
self.conf,
solver
]
):
return
def run_solver(self, solver):
if self._study is None:
return
check = CheckListWindow(
study=self._study,
config=self.conf,
solver=solver,
parent=self
)
check.show()
if self.sub_window_exists(
CheckListWindow,
data=[
self._study,
self.conf,
solver
]
):
return
check = CheckListWindow(
study=self._study,
config=self.conf,
solver=solver,
parent=self
)
check.show()
def solver_log(self, solver):
sol = SolverLogWindow(
+2 -2
View File
@@ -36,7 +36,7 @@ class CustomPlotTranslate(ResultsTranslate):
"CustomPlot", "Kp (m)"
)
self._dict['elevation'] = _translate(
"CustomPlot", "Elevation (m)"
"CustomPlot", "Bed load elevation (m)"
)
self._dict['water_elevation'] = _translate(
"CustomPlot", "Water elevation (m)"
@@ -48,7 +48,7 @@ class CustomPlotTranslate(ResultsTranslate):
# Unit corresponding long name (plot axes display)
self._dict['0-meter'] = _translate(
"CustomPlot", "Elevation (m)"
"CustomPlot", "Bed load elevation (m)"
)
self._dict['1-m3s'] = _translate(
"CustomPlot", "Discharge (m³/s)"
+4 -1
View File
@@ -225,8 +225,11 @@ class SolverLogWindow(PamhyrWindow):
self._log_int(msg, color)
def _log_str(self, msg, color=None):
if msg == "":
return
logger.info(f"solver: {msg}")
msg = msg.rsplit('\n')[0]
msg = msg.rsplit('\n', 1)[0]
if color is not None:
msg = f"<font color=\"{color}\">" + msg + "</font>"
+2 -2
View File
@@ -11,12 +11,12 @@ class SedimentEditTranslate(SedimentTranslate):
def __init__(self):
super(SedimentEditTranslate, self).__init__()
self._dict["height"] = _translate("SedimentLayers", "Height (m)"),
self._dict["height"] = _translate("SedimentLayers", "Thickness (m)"),
self._sub_dict["table_headers"] = {
"name": _translate("SedimentLayers", "Name"),
# "type": _translate("SedimentLayers", "Type"),
"height": _translate("SedimentLayers", "Height"),
"height": _translate("SedimentLayers", "Thickness (m)"),
"d50": _translate("SedimentLayers", "D50"),
"sigma": _translate("SedimentLayers", "Sigma"),
"critical_constraint": _translate("SedimentLayers",
-70
View File
@@ -96,76 +96,6 @@ class TableModel(PamhyrTableModel):
self.dataChanged.emit(index, index)
return True
# def add(self, row, parent=QModelIndex()):
# self.beginInsertRows(parent, row, row - 1)
# self._undo.push(
# AddCommand(
# self._lst, row
# )
# )
# self.endInsertRows()
# self.layoutChanged.emit()
# def delete(self, rows, parent=QModelIndex()):
# self.beginRemoveRows(parent, rows[0], rows[-1])
# self._undo.push(
# DelCommand(
# self._lst, rows
# )
# )
# self.endRemoveRows()
# self.layoutChanged.emit()
# def sort(self, _reverse, parent=QModelIndex()):
# self.layoutAboutToBeChanged.emit()
# self._undo.push(
# SortCommand(
# self._lst, False
# )
# )
# self.layoutAboutToBeChanged.emit()
# self.layoutChanged.emit()
# def move_up(self, row, parent=QModelIndex()):
# if row <= 0:
# return
# target = row + 2
# self.beginMoveRows(parent, row - 1, row - 1, parent, target)
# self._undo_stack.push(
# MoveCommand(
# self._lst, "up", row
# )
# )
# self.endMoveRows()
# self.layoutChanged.emit()
# def move_down(self, index, parent=QModelIndex()):
# if row > len(self._lst):
# return
# target = row
# self.beginMoveRows(parent, row + 1, row + 1, parent, target)
# self._undo_stack.push(
# MoveCommand(
# self._lst, "down", row
# )
# )
# self.endMoveRows()
# self.layoutChanged.emit()
def undo(self):
self._undo.undo()
self.layoutChanged.emit()
+2 -2
View File
@@ -29,7 +29,7 @@ class StricklersTranslate(PamhyrTranslate):
self._sub_dict["table_headers"] = {
"name": _translate("LateralContribution", "Name"),
"minor": _translate("LateralContribution", "Minor bed"),
"medium": _translate("LateralContribution", "Medium bed"),
"minor": _translate("LateralContribution", "Main channel"),
"medium": _translate("LateralContribution", "Floodway"),
"comment": _translate("LateralContribution", "Comment"),
}
+2
View File
@@ -89,6 +89,8 @@ class NewStudyWindow(PamhyrDialog):
if self._study is None:
study = Study.new(name, description)
study.river.init_default()
if self.get_radio_button("radioButton_date"):
date = self.get_datetime_edit("dateTimeEdit_date")
study.use_date(date)
+7 -7
View File
@@ -35,13 +35,6 @@
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_run">
<property name="text">
@@ -53,6 +46,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_cancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
+3 -3
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>480</height>
<width>1152</width>
<height>648</height>
</rect>
</property>
<property name="windowTitle">
@@ -43,7 +43,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<width>1152</width>
<height>22</height>
</rect>
</property>
+313 -214
View File
File diff suppressed because it is too large. Load diff