Skip to content

Commit

Permalink
added status next to progressbar
Browse files Browse the repository at this point in the history
  • Loading branch information
rgerum committed Jun 14, 2024
1 parent fbf4bc1 commit f2423a2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions saenopy/gui/common/BatchEvaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ def __init__(self, parent=None):
self.list.signal_act_paths2_clicked.connect(self.path_open)
self.list.signal_act_paths3_clicked.connect(self.path_copy)
self.list.itemSelectionChanged.connect(self.listSelected)

self.progress_label2 = QtWidgets.QLabel().addToLayout()

self.progressbar = QtWidgets.QProgressBar().addToLayout()
self.progressbar.setOrientation(QtCore.Qt.Horizontal)

self.progress_label = QtWidgets.QLabel().addToLayout()
with QtShortCuts.QHBoxLayout() as layout:
layout.setContentsMargins(0, 0, 0, 0)
self.add_tabs()
Expand Down
5 changes: 5 additions & 0 deletions saenopy/gui/solver/modules/DeformationDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import inspect
import tqdm
from typing import Tuple
from pathlib import Path

import saenopy
import saenopy.multigrid_helper
Expand Down Expand Up @@ -172,6 +173,10 @@ def process(self, result: Result, piv_parameters: dict):
count -= 1

for i in range(count):
self.parent.progress_label.setText(f"{i + 1}/{count} finding deformations")
self.parent.progressbar.setRange(0, 1)
self.parent.progressbar.setValue(0)
self.parent.progress_label2.setText(f"{Path(result.output).name}")
p = ProcessSimple(getDeformation, (i, result, piv_parameters), {}, self.processing_progress, use_thread=self.use_thread)
p.start()
return_value = p.join()
Expand Down
5 changes: 5 additions & 0 deletions saenopy/gui/solver/modules/MeshCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,13 @@ def process(self, result: Result, mesh_parameters: dict):
result.mesh_parameters = mesh_parameters
# iterate over all stack pairs
for i in range(len(result.mesh_piv)):
self.parent.progress_label.setText(f"{i + 1}/{len(result.mesh_piv)} creating mesh")
self.parent.progressbar.setRange(0, 1)
self.parent.progressbar.setValue(0)
self.parent.progress_label2.setText(f"{Path(result.output).name}")
# and create the interpolated solver mesh
result.solvers[i] = saenopy.interpolate_mesh(result.mesh_piv[i], displacement_list[i], mesh_parameters)
self.parent.progressbar.setValue(1)
# save the meshes
result.save()

Expand Down
6 changes: 6 additions & 0 deletions saenopy/gui/solver/modules/Regularizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from pyvistaqt import QtInteractor
import inspect
from typing import Tuple
from pathlib import Path

import saenopy
import saenopy.multigrid_helper
Expand Down Expand Up @@ -153,6 +154,11 @@ def process(self, result: Result, material_parameters: dict, solve_parameters: d
return

for i in range(len(result.solvers)):
self.parent.progress_label.setText(f"{i + 1}/{len(result.solvers)} fitting forces")
self.parent.progressbar.setRange(0, 1)
self.parent.progressbar.setValue(0)
self.parent.progress_label2.setText(f"{Path(result.output).name}")

print(f"Current Timstep: {i}")
M = result.solvers[i]

Expand Down

0 comments on commit f2423a2

Please sign in to comment.