0001 function ltpdv(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 id = findobj('Tag', 'LTPDVmainfig');
0020 if ~isempty(id)
0021 figure(id)
0022 return
0023 end
0024
0025
0026
0027 Gproperties.Gcol = [240 240 240]/255;
0028 Gproperties.Gwidth = 1100;
0029 Gproperties.Gheight = 700;
0030 Gproperties.Gborder = 10;
0031 Gproperties.fontsize = 12;
0032
0033 Gproperties.Screen = get(0,'screensize');
0034 Gproperties.Gposition = [Gproperties.Screen(3)/2-Gproperties.Gwidth/2 ...
0035 Gproperties.Screen(4)/2-Gproperties.Gheight/2 ...
0036 Gproperties.Gwidth...
0037 Gproperties.Gheight];
0038
0039
0040 mainfig = figure('Name', 'LTPDA Dataviewer',...
0041 'NumberTitle', 'off',...
0042 'Visible','off',...
0043 'Position',Gproperties.Gposition,...
0044 'Color', Gproperties.Gcol,...
0045 'Toolbar', 'none',...
0046 'MenuBar', 'none',...
0047 'Resize', 'on',...
0048 'Tag', 'LTPDVmainfig');
0049
0050
0051 set(mainfig, 'CloseRequestFcn', {'ltpdv_cb_mainfigClose', mainfig});
0052
0053
0054 setappdata(mainfig, 'Gproperties', Gproperties);
0055
0056
0057
0058 Hmargin = Gproperties.Gborder/Gproperties.Gwidth;
0059 Vmargin = Gproperties.Gborder/Gproperties.Gheight;
0060 BottomMargin = 0.2;
0061 SplitPoint = 0.35;
0062
0063
0064
0065
0066 pleft = Hmargin;
0067 phght = 1-2*Vmargin;
0068 pbot = (1 - Vmargin - phght);
0069 pwid = SplitPoint - 2*Hmargin;
0070 ph = uipanel(mainfig, 'Title','Object List','FontSize', Gproperties.fontsize,...
0071 'BackgroundColor', [0.6 0.7 0.9],...
0072 'Position',[pleft pbot pwid phght], 'Units', 'normalized');
0073
0074
0075 pmarg = 0.025;
0076 Lleft = pmarg;
0077 Lbottom = 0.4+pmarg;
0078 Lwidth = 1-2*pmarg;
0079 Lheight = 1-Lbottom-pmarg;
0080 th = uitable(ph, ...
0081 'Units', 'normalized',...
0082 'ColumnName', {'Name','Type'}, ...
0083 'ColumnWidth', {220, 100}, ...
0084 'ColumnEditable', [true false], ...
0085 'Position', [Lleft Lbottom Lwidth Lheight],...
0086 'Tag', 'LTPDVobjList', ...
0087 'CellSelectionCallback', {@ltpdv_objectList_select, mainfig}, ...
0088 'CellEditCallback', {@ltpdv_objectList_edit, mainfig});
0089
0090
0091 set(th, 'Units', 'pixel');
0092 pos = get(th, 'Position');
0093 set(th, 'Units', 'normalized');
0094 set(th, 'ColumnWidth', {0.7*pos(3), 0.2*pos(3)});
0095
0096
0097 pleft = pmarg;
0098 phght = 0.05;
0099 pbott = Lbottom - phght - pmarg;
0100 pwidt = 0.2;
0101 pbh = uicontrol(ph,'Style','pushbutton',...
0102 'String','Delete',...
0103 'Callback', {@ltpdv_delete_objects, mainfig}, ...
0104 'Units', 'normalized', ...
0105 'Position',[pleft pbott pwidt phght]);
0106
0107
0108 pleft = pmarg + pwidt + pmarg;
0109 phght = 0.05;
0110 pbott = Lbottom - phght - pmarg;
0111 pwidt = 0.2;
0112 pbh = uicontrol(ph,'Style','pushbutton',...
0113 'String','Clear',...
0114 'Callback', {@ltpdv_delete_objects, mainfig, 'all'}, ...
0115 'Units', 'normalized', ...
0116 'Position',[pleft pbott pwidt phght]);
0117
0118
0119 pleft = pleft + pwidt + pmarg;
0120 phght = 0.05;
0121 pbott = Lbottom - phght - pmarg;
0122 pwidt = 0.2;
0123 pbh = uicontrol(ph,'Style','pushbutton',...
0124 'String','Save',...
0125 'Callback', {@ltpdv_save_objects, mainfig}, ...
0126 'Units', 'normalized', ...
0127 'Position',[pleft pbott pwidt phght]);
0128
0129
0130 pleft = pleft + pwidt + pmarg;
0131 phght = 0.05;
0132 pbott = Lbottom - phght - pmarg;
0133 pwidt = 0.2;
0134 pbh = uicontrol(ph,'Style','pushbutton',...
0135 'String','Load',...
0136 'Callback', {@ltpdv_load_objects, mainfig}, ...
0137 'Units', 'normalized', ...
0138 'Position',[pleft pbott pwidt phght]);
0139
0140
0141 pleft = pmarg;
0142 phght = 0.05;
0143 pbott = pbott - phght - pmarg;
0144 pwidt = 0.2;
0145 pbh = uicontrol(ph,'Style','pushbutton',...
0146 'String','Export',...
0147 'Callback', {@ltpdv_export_objects, mainfig}, ...
0148 'Units', 'normalized', ...
0149 'Position',[pleft pbott pwidt phght]);
0150
0151
0152 pleft = pleft + pwidt + pmarg;
0153 pbh = uicontrol(ph,'Style','pushbutton',...
0154 'String','Explore',...
0155 'Callback', {@ltpdv_explore_objects, mainfig}, ...
0156 'Units', 'normalized', ...
0157 'Position',[pleft pbott pwidt phght]);
0158
0159
0160
0161
0162 bw = 0.2;
0163 bl = pmarg;
0164 bh = 0.05;
0165 bb = pmarg;
0166
0167 pbh = uicontrol(ph,'Style','pushbutton',...
0168 'String','Plot',...
0169 'Callback', {@ltpdv_plot, mainfig}, ...
0170 'Units', 'normalized', ...
0171 'Position',[bl bb bw bh]);
0172
0173
0174 bw = 0.2;
0175 bl = bl+bw+pmarg;
0176 bh = 0.05;
0177 bb = pmarg;
0178
0179 pbh = uicontrol(ph,'Style','pushbutton',...
0180 'String','Plot History',...
0181 'Callback', {@ltpdv_hist_plot, mainfig}, ...
0182 'Units', 'normalized', ...
0183 'Position',[bl bb bw bh]);
0184
0185
0186
0187 PanLeft = SplitPoint;
0188 Tleft = PanLeft + Hmargin;
0189 Theight = 1-2*Vmargin ;
0190 Tbottom = (1 - Vmargin - Theight);
0191 Twidth = (1-PanLeft)-2*Hmargin;
0192
0193 htab = uitabgroup('Parent', mainfig, ...
0194 'Units','normalized',...
0195 'Position',[Tleft Tbottom Twidth Theight], 'SelectionChangeFcn', {@ltpdv_tabChanged});
0196 t1 = uitab(htab, 'title', 'Import');
0197 t2 = uitab(htab, 'title', 'Math');
0198 t3 = uitab(htab, 'title', 'Preprocessing');
0199 t4 = uitab(htab, 'title', 'Filter');
0200 t5 = uitab(htab, 'title', 'Spectral');
0201 t6 = uitab(htab, 'title', 'Object Properties');
0202 t7 = uitab(htab, 'title', 'Plot');
0203
0204
0205 setappdata(mainfig, 'LTPDAobjects', {});
0206 setappdata(mainfig, 'ImportWorkspaceSelectedRows', []);
0207 setappdata(mainfig, 'ObjectListSelectedRows', []);
0208 setappdata(mainfig, 'Filters', []);
0209 setappdata(mainfig, 'FilterPoles', []);
0210 setappdata(mainfig, 'FilterZeros', []);
0211 setappdata(mainfig, 'TimesList', {});
0212
0213
0214
0215 ltpdv_buildImportPanel(t1, mainfig);
0216 ltpdv_buildMathPanel(t2, mainfig);
0217 ltpdv_buildPreprocessPanel(t3, mainfig);
0218 ltpdv_buildFilterPanel(t4, mainfig);
0219 ltpdv_buildSpectralPanel(t5, mainfig);
0220 ltpdv_buildPropertiesPanel(t6, mainfig);
0221 ltpdv_buildPlotPanel(t7, mainfig);
0222
0223
0224
0225
0226
0227 set(mainfig,'Visible','on')
0228
0229
0230 end
0231
0232
0233
0234
0235