Skip to content

Commit 98bb77f

Browse files
authored
Merge 2bf0e3f into a57099f
2 parents a57099f + 2bf0e3f commit 98bb77f

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

poetry.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pulse/interface/user_input/model/geometry/geometry_designer_widget.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from PyQt5 import uic
33
from PyQt5.QtCore import Qt
44

5+
from itertools import chain
56
import re
67
from numbers import Number
78
import numpy as np
@@ -146,8 +147,8 @@ def _create_connections(self):
146147
self.y_line_edit.editingFinished.connect(self.xyz_apply_evaluation_callback)
147148
self.z_line_edit.editingFinished.connect(self.xyz_apply_evaluation_callback)
148149

149-
self.bending_options_combobox.currentIndexChanged.connect(self.xyz_changed_callback)
150-
self.bending_radius_line_edit.textChanged.connect(self.xyz_changed_callback)
150+
self.bending_options_combobox.currentIndexChanged.connect(self.bending_options_changed_callback)
151+
self.bending_radius_line_edit.textChanged.connect(self.bending_options_changed_callback)
151152

152153
self.division_combobox.currentTextChanged.connect(self.division_type_changed_callback)
153154
self.division_slider.valueChanged.connect(self.division_slider_callback)
@@ -190,6 +191,7 @@ def selection_callback(self):
190191
self._set_xyz_to_selected_point()
191192

192193
if not self.pipeline.selected_structures:
194+
self.pipeline.main_editor.remove_collapsed_bends()
193195
self.cancel_division_callback()
194196

195197
self._update_permissions()
@@ -353,6 +355,15 @@ def get_pipe_diameter(self):
353355

354356
return diameter
355357

358+
def bending_options_changed_callback(self):
359+
if self.pipeline.selected_structures:
360+
self._update_bending_radius_of_selected_structures()
361+
self.update_bending_radius_visibility()
362+
self._update_permissions()
363+
self.render_widget.update_plot(reset_camera=False)
364+
else:
365+
self.xyz_changed_callback()
366+
356367
def xyz_changed_callback(self):
357368
try:
358369
self.update_bending_radius_visibility()
@@ -607,6 +618,18 @@ def _xyz_point_callback(self, xyz):
607618
def _update_material_of_selected_structures(self):
608619
for structure in self.pipeline.selected_structures:
609620
structure.extra_info["material_info"] = self.current_material_info
621+
622+
def _update_bending_radius_of_selected_structures(self):
623+
if not isinstance(self.current_options, PipeOptions):
624+
return
625+
626+
for structure in self.pipeline.selected_structures:
627+
if not isinstance(structure, Bend):
628+
pass
629+
bending_radius = self.pipe_options._get_bending_radius(structure.diameter)
630+
structure.curvature = bending_radius
631+
632+
self.pipeline.recalculate_curvatures()
610633

611634
def _unit_abreviation(self, unit):
612635
if self.length_unit == "meter":

pulse/launch.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010

1111
def custom_exception_hooks(exc_type, exc_value, exc_traceback):
12+
if issubclass(exc_type, KeyboardInterrupt):
13+
sys.exit()
14+
1215
# Logs unhandled errors for future checks
1316
logging.error("Unhandled error", exc_info=(exc_type, exc_value, exc_traceback))
1417

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pulse"
3-
version = "2.0.8"
3+
version = "2.0.9"
44
description = "Open Source Software for Pulsation Analysis of Pipeline Systems"
55
authors = [
66
"Olavo Silva <[email protected]>",

0 commit comments

Comments
 (0)