mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Merge: branch 'master' into 'scenarios'.
This commit is contained in:
commit
74ab3aa522
312 files changed
+82851
-9744
No files matched your search
@@ -60,7 +60,7 @@ class PlotXY(PamhyrPlot):
|
||||
def onpick(self, event):
|
||||
if event.mouseevent.inaxes != self.canvas.axes:
|
||||
return
|
||||
if event.mouseevent.button.value not in [1, 3]:
|
||||
if event.mouseevent.button not in [1, 3]:
|
||||
return
|
||||
|
||||
closest = self._closest_section(event)
|
||||
@@ -70,9 +70,9 @@ class PlotXY(PamhyrPlot):
|
||||
index = tableView.selectedIndexes()
|
||||
rk = self.data.get_rk()
|
||||
if self.parent._table is not None:
|
||||
if event.mouseevent.button.value == 1:
|
||||
if event.mouseevent.button == 1:
|
||||
table.setData(index[3], rk[closest[0]])
|
||||
if event.mouseevent.button.value == 3:
|
||||
if event.mouseevent.button == 3:
|
||||
table.setData(index[4], rk[closest[0]])
|
||||
|
||||
return
|
||||
@@ -141,7 +141,8 @@ class PlotXY(PamhyrPlot):
|
||||
if self._highlight_data is not None:
|
||||
rk_min, rk_max = self._highlight_data
|
||||
|
||||
colors = [self.color_plot for row in range(len(self._data))]
|
||||
colors = [self.color_plot_river_bottom
|
||||
for row in range(len(self._data))]
|
||||
for i, rk in enumerate(self.data.get_rk_complete_profiles()):
|
||||
if rk_min <= rk <= rk_max:
|
||||
colors[i] = self.color_plot_current
|
||||
|
||||
@@ -114,16 +114,20 @@ class ComboBoxDelegate(QItemDelegate):
|
||||
self.editor.currentTextChanged.connect(self.currentItemChanged)
|
||||
|
||||
def setModelData(self, editor, model, index):
|
||||
value = str(editor.currentText())
|
||||
text = str(editor.currentText())
|
||||
|
||||
if self._mode == "rk":
|
||||
value = next(
|
||||
profiles = list(
|
||||
filter(
|
||||
lambda p: p.display_name() == value,
|
||||
lambda p: p.display_name() == text,
|
||||
self._data.reach.profiles
|
||||
)
|
||||
)
|
||||
|
||||
value = profiles[0].rk if len(profiles) > 0 else None
|
||||
else:
|
||||
value = text
|
||||
|
||||
model.setData(index, value)
|
||||
editor.close()
|
||||
editor.deleteLater()
|
||||
|
||||
Reference in new issue
Block a user