0001 function [obj] = vb_timeseries_viewer_plot_trigger_data(obj, window_from, window_to)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if ~exist('obj', 'var')
0017 error('obj is a required parameter.');
0018 end
0019
0020
0021
0022
0023
0024 H = obj.H;
0025
0026 cla(H.trigger_axes);
0027
0028
0029 if isfield(obj, 'ext_legend_handle')
0030 try
0031 delete(obj.ext_legend_handle);
0032 catch
0033 end
0034 end
0035 if ~isempty(obj.trig_ch_list_plot_ix)
0036 freq = vb_continuous_file_get_sample_freq(obj.trigger_obj);
0037 [obj.trigger_obj, trig_data, from, to, read_ch_name] = vb_continuous_file_get_sample(obj.trigger_obj, ...
0038 obj.trig_ch_list(obj.trig_ch_list_plot_ix), ...
0039 ceil(freq*window_from), ceil(freq*window_to));
0040 if ~isempty(trig_data)
0041
0042 step = 1;
0043 t = [from-1:to-1]/freq;
0044 ix = [1:step:size(trig_data,2)];
0045 obj.handle_ext_lines = ...
0046 plot(H.trigger_axes, t(1:step:length(t)), trig_data(:, ix));
0047
0048
0049 l_h = legend(H.trigger_axes, read_ch_name);
0050 try
0051 set(l_h, 'FontSize', 10.5, 'FontUnit', 'points');
0052 catch
0053 set(l_h, 'FontSize', 10.5);
0054 end
0055
0056
0057
0058 obj.ext_legend_handle = l_h;
0059 end
0060
0061
0062
0063
0064
0065
0066
0067 end
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098 set(H.trigger_axes, 'XGrid', 'on');
0099 set(H.trigger_axes, 'YGrid', 'on');
0100
0101
0102
0103 range = ylim(H.trigger_axes);
0104 set(H.ylimit_trigger_low_edit, 'String', num2str(range(1)));
0105 set(H.ylimit_trigger_high_edit, 'String', num2str(range(2)));
0106
0107 xlim(H.trigger_axes, [window_from, window_to]);