Skip to content

Commit

Permalink
AbsoluteTime, set_file, WaveformSelection, PlotPanel changes should b…
Browse files Browse the repository at this point in the history
…e added to master branch
  • Loading branch information
hmogensen committed Nov 18, 2014
1 parent 7f0f63e commit ab097a5
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 3 deletions.
4 changes: 2 additions & 2 deletions functions/modify_threshold.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion panelcomponents/@WaveformSelection/WaveformSelection.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
32 changes: 32 additions & 0 deletions panelcomponents/AbsoluteTime.m
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions panels/@PlotPanel/PlotPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
4 changes: 4 additions & 0 deletions viewers/@SequenceViewer/set_file.m
Original file line number Diff line number Diff line change
Expand Up @@ -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([]);
Expand Down

0 comments on commit ab097a5

Please sign in to comment.