Skip to content

Commit 6496cd0

Browse files
committed
Signal tools: added HRangeTool
1 parent a0548d5 commit 6496cd0

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

cdl/core/gui/panel/base.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,12 @@
5353

5454
import guidata.dataset.qtwidgets as gdq
5555
import numpy as np
56+
import plotpy.io
5657
from guidata.configtools import get_icon
5758
from guidata.dataset import update_dataset
5859
from guidata.qthelpers import add_actions, exec_dialog
5960
from guidata.widgets.arrayeditor import ArrayEditor
6061
from plotpy.plot import PlotDialog
61-
from plotpy.tools import (
62-
HCursorTool,
63-
LabelTool,
64-
RectangleTool,
65-
SegmentTool,
66-
VCursorTool,
67-
XCursorTool,
68-
)
6962
from qtpy import QtCore as QC
7063
from qtpy import QtWidgets as QW
7164
from qtpy.compat import getopenfilename, getopenfilenames, getsavefilename
@@ -248,14 +241,7 @@ class BaseDataPanel(AbstractPanel):
248241

249242
PANEL_STR = "" # e.g. "Signal Panel"
250243
PARAMCLASS: SignalObj | ImageObj = None # Replaced in child object
251-
ANNOTATION_TOOLS = (
252-
LabelTool,
253-
VCursorTool,
254-
HCursorTool,
255-
XCursorTool,
256-
SegmentTool,
257-
RectangleTool,
258-
)
244+
ANNOTATION_TOOLS = ()
259245
DIALOGSIZE = (800, 600)
260246
# Replaced by the right class in child object:
261247
IO_REGISTRY: SignalIORegistry | ImageIORegistry | None = None

cdl/core/gui/panel/signal.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,24 @@
1111

1212
from typing import TYPE_CHECKING
1313

14+
from plotpy.tools import (
15+
HCursorTool,
16+
HRangeTool,
17+
LabelTool,
18+
RectangleTool,
19+
SegmentTool,
20+
VCursorTool,
21+
XCursorTool,
22+
)
23+
1424
from cdl.config import _
1525
from cdl.core.gui import roieditor
1626
from cdl.core.gui.actionhandler import SignalActionHandler
1727
from cdl.core.gui.panel.base import BaseDataPanel
1828
from cdl.core.gui.plothandler import SignalPlotHandler
1929
from cdl.core.gui.processor.signal import SignalProcessor
2030
from cdl.core.io.signal import SignalIORegistry
21-
from cdl.core.model.signal import (
22-
SignalObj,
23-
create_signal_from_param,
24-
new_signal_param,
25-
)
31+
from cdl.core.model.signal import SignalObj, create_signal_from_param, new_signal_param
2632

2733
if TYPE_CHECKING: # pragma: no cover
2834
import guidata.dataset as gds
@@ -38,6 +44,15 @@ class SignalPanel(BaseDataPanel):
3844

3945
PANEL_STR = _("Signal panel")
4046
PARAMCLASS = SignalObj
47+
ANNOTATION_TOOLS = (
48+
LabelTool,
49+
VCursorTool,
50+
HCursorTool,
51+
XCursorTool,
52+
SegmentTool,
53+
RectangleTool,
54+
HRangeTool,
55+
)
4156
IO_REGISTRY = SignalIORegistry
4257
H5_PREFIX = "DataLab_Sig"
4358
ROIDIALOGCLASS = roieditor.SignalROIEditor

0 commit comments

Comments
 (0)