diff --git a/functions/modify_threshold.m b/functions/modify_threshold.m index 4708a8d..9259a97 100644 --- a/functions/modify_threshold.m +++ b/functions/modify_threshold.m @@ -295,10 +295,10 @@ function update_sample_callback(thr) plot(ax2,x,sample(x),'Linestyle','None',... 'Marker','o','MarkerSize',16,'HitTest','off'); end - plot(ax2,sample,'color',[135 206 250]/255,'ButtonDownFcn',@button_dwn_fcn); + plot(ax2,sample,'color',[135 206 250]/255,'ButtonDownFcn',@(~,~) button_dwn_fcn(ax2,thr)); end - function button_dwn_fcn(~,~) + function button_dwn_fcn(ax2,thr) p = get(ax2,'currentpoint'); x_ = round(p(1,1)); y_ = p(1,2); diff --git a/panelcomponents/@WaveformSelection/WaveformSelection.m b/panelcomponents/@WaveformSelection/WaveformSelection.m index 6895a17..d56d3df 100644 --- a/panelcomponents/@WaveformSelection/WaveformSelection.m +++ b/panelcomponents/@WaveformSelection/WaveformSelection.m @@ -84,7 +84,9 @@ function waveform_callback(obj) str = get(obj.ui_waveforms,'string'); val = get(obj.ui_waveforms,'value'); obj.gui.waveform = obj.gui.main_signal.waveforms.get('tag',str{val}); - obj.show_panels(false); + if obj.gui.main_channel.plot_raw + obj.show_panels(false); + end end function export_waveform(obj) if isempty(obj.gui.waveform) diff --git a/panelcomponents/AbsoluteTime.m b/panelcomponents/AbsoluteTime.m new file mode 100644 index 0000000..766c5a5 --- /dev/null +++ b/panelcomponents/AbsoluteTime.m @@ -0,0 +1,32 @@ +classdef AbsoluteTime < PanelComponent + properties + ui_abstime + end + methods + function obj = AbsoluteTime(panel) + obj@PanelComponent(panel); + sc_addlistener(obj.gui,'sweep',@(~,~) obj.sweep_listener(),obj.uihandle); + end + function populate(obj,mgr) + mgr.newline(20); + obj.ui_abstime = mgr.add(sc_ctrl('text',[]),200); + end + function initialize(obj) + obj.sweep_listener(); + end + function updated = update(obj) + obj.sweep_listener(); + updated = update@PanelComponent(obj); + end + end + methods (Access=protected) + function sweep_listener(obj) + if numel(obj.gui.triggertimes) && numel(obj.gui.sweep) && obj.gui.sweep(1)<=numel(obj.gui.triggertimes) + time = obj.gui.triggertimes(obj.gui.sweep(1)); + set(obj.ui_abstime,'string',sprintf('t = 0 => %g s',time)); + else + set(obj.ui_abstime,'string','t = 0 => NA'); + end + end + end +end \ No newline at end of file diff --git a/panels/@PlotPanel/PlotPanel.m b/panels/@PlotPanel/PlotPanel.m index 53507ec..938a3ea 100644 --- a/panels/@PlotPanel/PlotPanel.m +++ b/panels/@PlotPanel/PlotPanel.m @@ -11,6 +11,7 @@ function setup_components(obj) obj.gui_components.add(OffsetAtTime(obj)); obj.gui_components.add(SweepOptions(obj)); + obj.gui_components.add(AbsoluteTime(obj)); obj.gui_components.add(ZoomOptions(obj)); obj.gui_components.add(ThresholdOptions(obj)); obj.gui_components.add(PlotMode(obj)); diff --git a/viewers/@SequenceViewer/set_file.m b/viewers/@SequenceViewer/set_file.m index 0b6aa29..86188ba 100644 --- a/viewers/@SequenceViewer/set_file.m +++ b/viewers/@SequenceViewer/set_file.m @@ -5,7 +5,11 @@ function set_file(obj,file) end if ~isempty(file) && file.n if isempty(obj.sequence) || ~file.contains(obj.sequence) + if sc_contains(obj.file.values('tag'),'full') + obj.set_sequence(obj.file.get('tag','full')); + else obj.set_sequence(obj.file.get(1)); + end end else obj.set_sequence([]);