Skip to content

Commit

Permalink
Merge e21166e into 28a22b0
Browse files Browse the repository at this point in the history
  • Loading branch information
FillBk committed Jun 20, 2024
2 parents 28a22b0 + e21166e commit b74954c
Show file tree
Hide file tree
Showing 28 changed files with 5,337 additions and 901 deletions.
4 changes: 2 additions & 2 deletions src/asammdf/gui/widgets/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5138,8 +5138,8 @@ def keyPressEvent(self, event):
dpi = QtWidgets.QApplication.primaryScreen().physicalDotsPerInchX()
dpc = dpi / 2.54

physical_viewbox_witdh = width / dpc # cm
time_width = physical_viewbox_witdh * HONEYWELL_SECONDS_PER_CM
physical_viewbox_width = width / dpc # cm
time_width = physical_viewbox_width * HONEYWELL_SECONDS_PER_CM

if self.cursor1.isVisible():
mid = self.cursor1.value()
Expand Down
22 changes: 22 additions & 0 deletions src/asammdf/gui/widgets/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,28 @@ def keyPressEvent(self, event):
if item.type() != item.Info:
item.color = color

elif modifiers == QtCore.Qt.KeyboardModifier.ControlModifier and key == QtCore.Qt.Key.Key_X:
event.accept()
selected_items = validate_drag_items(self.invisibleRootItem(), self.selectedItems(), [])
data = get_data(self.plot, selected_items, uuids_only=False)
data = substitude_mime_uuids(data, None, force=True)
QtWidgets.QApplication.instance().clipboard().setText(json.dumps(data))

if self.can_delete_items:
deleted = list(set(get_data(self.plot, selected_items, uuids_only=True)))
self.setUpdatesEnabled(False)
self.clearSelection()
root = self.invisibleRootItem()
for item in selected_items:
(item.parent() or root).removeChild(item)

self.setUpdatesEnabled(True)
self.refresh()

if deleted:
self.itemsDeleted.emit(deleted)
self.update_channel_groups_count()

elif modifiers == QtCore.Qt.KeyboardModifier.ControlModifier and key == QtCore.Qt.Key.Key_C:
event.accept()
selected_items = validate_drag_items(self.invisibleRootItem(), self.selectedItems(), [])
Expand Down
2 changes: 0 additions & 2 deletions test/asammdf/gui/dialogs/test_FunctionsManagerDialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from asammdf.gui.dialogs.functions_manager import FunctionsManagerDialog
from test.asammdf.gui.resources.functions import (
Function1,
Function2,
gray2dec,
maximum,
Expand Down Expand Up @@ -239,7 +238,6 @@ def test_PushButton_CheckSyntax_0(self):
QtTest.QTest.mouseClick(self.fm.widget.add_btn, QtCore.Qt.MouseButton.LeftButton)

for f in (
Function1,
gray2dec,
maximum,
rpm_to_rad_per_second,
Expand Down
83 changes: 83 additions & 0 deletions test/asammdf/gui/resources/test_insert_cfg.dspf
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
"selected_channels": [],
"windows": [
{
"title": "Plot 0",
"configuration": {
"channels": [
{
"type": "channel",
"name": "ASAM_[13][0].M.MATRIX_DIM_16_1.UBYTE.IDENTICAL",
"unit": "hours",
"flags": 0,
"enabled": true,
"individual_axis": false,
"common_axis": false,
"color": "#1f77b4",
"computed": false,
"ranges": [],
"precision": 3,
"fmt": "{}",
"format": "phys",
"mode": "phys",
"y_range": [
0.0,
255.0
],
"origin_uuid": "8b499db8ee08"
}
],
"pattern": {},
"splitter": [
364,
68,
0
],
"x_range": [
-1.2266879363388932,
13.654530499727267
],
"y_axis_width": 0.0,
"grid": [
false,
false
],
"cursor_precision": 6,
"font_size": 9,
"locked": false,
"common_axis_y_range": [
0.0,
1.0
],
"channels_header": [
364,
[
334,
83,
42,
35,
35
]
],
"hide_axes": true,
"hide_selected_channel_value_panel": false,
"focused_mode": false,
"delta_mode": "value",
"hide_bookmarks": false
},
"geometry": [
0,
0,
438,
646
],
"maximized": true,
"minimized": false,
"type": "Plot"
}
],
"active_window": "Plot 0",
"functions": {
"Function1": "def Function1(t=0):\n return 0"
}
}
Loading

0 comments on commit b74954c

Please sign in to comment.