mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Geometry: Fix profile modifications.
This commit is contained in:
1 parent
7774d2d7af
commit
1457db721b
5 files changed
+17
-5
No files matched your search
@@ -216,7 +216,6 @@ class Plot(PamhyrPlot):
|
||||
return event.ydata
|
||||
|
||||
def rect_select_callback(self, eclick, erelease):
|
||||
|
||||
hyd = self.highlight
|
||||
x1, y1 = eclick.xdata, eclick.ydata
|
||||
x2, y2 = erelease.xdata, erelease.ydata
|
||||
|
||||
@@ -107,7 +107,7 @@ class GeometryProfileTableModel(PamhyrTableModel):
|
||||
SetXCommand(
|
||||
self._data, row,
|
||||
self._data.point(row).x,
|
||||
value
|
||||
value.replace(",", ".")
|
||||
)
|
||||
)
|
||||
elif column == 1:
|
||||
@@ -115,7 +115,7 @@ class GeometryProfileTableModel(PamhyrTableModel):
|
||||
SetYCommand(
|
||||
self._data, row,
|
||||
self._data.point(row).y,
|
||||
value
|
||||
value.replace(",", ".")
|
||||
)
|
||||
)
|
||||
elif column == 2:
|
||||
@@ -123,7 +123,7 @@ class GeometryProfileTableModel(PamhyrTableModel):
|
||||
SetZCommand(
|
||||
self._data, row,
|
||||
self._data.point(row).z,
|
||||
value
|
||||
value.replace(",", ".")
|
||||
)
|
||||
)
|
||||
elif column == 3:
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import logging
|
||||
|
||||
from tools import trace, timer
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
@@ -24,6 +26,8 @@ from PyQt5.QtWidgets import (
|
||||
|
||||
from Model.Geometry.Profile import Profile
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
|
||||
class SetDataCommand(QUndoCommand):
|
||||
def __init__(self, profile, index, old_value, new_value):
|
||||
@@ -107,6 +111,7 @@ class AddCommand(QUndoCommand):
|
||||
self._point = self._profile.insert(self._index)
|
||||
else:
|
||||
self._profile.insert_point(self._index, self._point)
|
||||
|
||||
self._profile.modified()
|
||||
|
||||
|
||||
|
||||
@@ -201,11 +201,13 @@ class ProfileWindow(PamhyrWindow):
|
||||
|
||||
def add(self):
|
||||
table = self.find(QTableView, "tableView")
|
||||
|
||||
if len(table.selectedIndexes()) == 0:
|
||||
self._tablemodel.insert_row(self._tablemodel.rowCount())
|
||||
else:
|
||||
row = self.index_selected_row()
|
||||
self._tablemodel.insert_row(row + 1)
|
||||
|
||||
self.update()
|
||||
|
||||
def delete(self):
|
||||
|
||||
Reference in new issue
Block a user