Home > m > etc > ltpda_startup.m

ltpda_startup

PURPOSE ^

This is the startup file for ltpda. It should be run once in the MATLAB

SYNOPSIS ^

function ltpda_startup

DESCRIPTION ^

 This is the startup file for ltpda. It should be run once in the MATLAB
 session before using any features of ltpda. The best way to ensure this
 is to create a file called startup.m and put this somewhere in your
 MATLAB path. In this file you should have the command 'ltpda_startup'.

 M Hewitson 16-03-07

 $Id: ltpda_startup.m,v 1.41 2008/08/22 15:30:34 ingo Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function ltpda_startup
0002 
0003 % This is the startup file for ltpda. It should be run once in the MATLAB
0004 % session before using any features of ltpda. The best way to ensure this
0005 % is to create a file called startup.m and put this somewhere in your
0006 % MATLAB path. In this file you should have the command 'ltpda_startup'.
0007 %
0008 % M Hewitson 16-03-07
0009 %
0010 % $Id: ltpda_startup.m,v 1.41 2008/08/22 15:30:34 ingo Exp $
0011 %
0012 
0013 %--------------------------------------------------------------------------
0014 % User Configurable parameters
0015 %
0016 
0017 
0018 VERBOSE_LEVEL = 1;  % Choose the level of terminal output, higher numbers
0019                     % means more output; 0 is no output.
0020 
0021 USE_LTPDA_PRINT_SETTINGS = 'Yes';     % Choose LTPDA Print setup
0022 USE_LTPDA_PLOT_SETTINGS  = 'Yes';     % Choose LTPDA Plot setup
0023 
0024 REPO_GUI_SERVERLIST = {'localhost', '130.75.117.67', '130.75.117.61'}; % A list of repositories presented
0025                                                       % to the user
0026 GUI_FONTSIZE        = 12;         % Choose GUI font size
0027 REPO_GUI_FONTSIZE   = 10;         % Choose Repository GUI font size
0028 PASSWD_WIN_FONTSIZE = 12;          % Choose login/passw dialog window font size
0029 
0030 DBDRIVER = 'com.mysql.jdbc.Driver';   % Set LTPDA Repository database driver
0031 
0032 WRAP_STRINGS         = 8;             % Wrap strings at this value
0033 WRAP_LEGEND_STRINGS  = 10;            % Wrap legend strings at this value
0034 XML_SET_SIZE         = 50000;         % Set the maximum line length for writing data sets to XML
0035 
0036 TIMEZONE        = 'UTC';                 % Users timezone
0037                                          % To get valid IDs use:
0038                                          % java.util.TimeZone.getAvailableIDs
0039 TIME_FORMAT_STR = 'yyyy-mm-dd HH:MM:SS.FFF'; % Users time format.
0040 
0041 DEFAULT_DATA_DIR = 'C:\data';
0042 DEFAULT_ANALYSES_DIR = 'C:\analyses';
0043 
0044 %--------------------------------------------------------------------------
0045 %--------------------------------------------------------------------------
0046 % NO NEED TO EDIT BELOW HERE
0047 %--------------------------------------------------------------------------
0048 %--------------------------------------------------------------------------
0049 
0050 v = ver('LTPDA');
0051 
0052 logo = {...
0053 '                                        ',...
0054 '                  ****                  ',...
0055 '                   **                   ',...
0056 '              -------------             ',...
0057 '          ////       /     \\\\         ',...
0058 '       ///          /          \\\      ',...
0059 '      |            /              |     ',...
0060 '  ** |    +----+  /      +----+    | ** ',...
0061 '  ***|    |    |//-------|    |    |*** ',...
0062 '  ** |    +----+        /+----+    | ** ',...
0063 '      |               /           |     ',...
0064 '       \\\           /         ///      ',...
0065 '          \\\\     //      ////         ',...
0066 '              -------------             ',...
0067 '                   **                   ',...
0068 '                  ****                  ',...
0069 };
0070 
0071 l1 = '+----------------------------------------------------+';
0072 ll = length(l1);
0073 
0074 disp(l1);
0075 disp('|                                                    |')
0076 for j=1:length(logo)
0077   disp([utils.prog.strpad(sprintf('|      %s  ', char(logo{j})), ll-1) '|']);
0078 end
0079 disp([utils.prog.strpad('|', ll-1) '|'])
0080 disp([utils.prog.strpad(sprintf('|          Welcome to %s', v.Name), ll-1) '|'])
0081 disp([utils.prog.strpad('|', ll-1) '|'])
0082 disp([utils.prog.strpad(sprintf('|                 Version: %s', v.Version), ll-1) '|'])
0083 disp([utils.prog.strpad(sprintf('|                 Release: %s', v.Release), ll-1) '|'])
0084 disp([utils.prog.strpad(sprintf('|                    Date: %s', v.Date), ll-1) '|'])
0085 disp([utils.prog.strpad('|', ll-1) '|'])
0086 disp(l1);
0087 
0088 %--------------------------------------------------------------------------
0089 % set page properties for printing
0090 if strcmpi(USE_LTPDA_PRINT_SETTINGS, 'YES')
0091   set(0,'DefaultFigurePaperOrientation','portrait');
0092   set(0,'DefaultFigurePaperType','A4');
0093   set(0,'DefaultFigurePaperUnits','inches');
0094 end
0095 
0096 %--------------------------------------------------------------------------
0097 % Plot settings
0098 if strcmpi(USE_LTPDA_PLOT_SETTINGS, 'YES')
0099   set(0,'DefaultAxesFontSize',14);
0100   set(0,'DefaultAxesFontWeight','bold');
0101   set(0,'DefaultAxesLineWidth', 1);
0102   set(0,'DefaultLineLineWidth', 2);
0103   set(0,'defaultlinemarkersize',10)
0104   set(0,'DefaultAxesXColor',[0.2 0.2 0.8]);
0105   set(0,'DefaultAxesYColor',[0.2 0.2 0.8]);
0106   set(0,'DefaultAxesGridLineStyle','-');
0107   set(0,'DefaultAxesMinorGridLineStyle','-');
0108   set(0,'defaultfigurenumbertitle','on');
0109   set(0,'DefaultFigureColor', 'w');
0110   set(0,'DefaultFigurePosition', [100 100 800 600]);
0111   set(0,'DefaultFigurePaperPositionMode','auto')
0112 
0113 end
0114 
0115 %--------------------------------------------------------------------------
0116 % format of numbers on MATLAB terminal
0117 format long g
0118 
0119 % ------------------------------------------------------------------------
0120 % MySQL LTPDA Repository Server Settings
0121 %
0122 if exist('REPOUSER', 'var') == 0
0123   REPOUSER = '';
0124 end
0125 if exist('REPOPASSWD', 'var') == 0
0126   REPOPASSWD = '';
0127 end
0128 setappdata(0, 'ltpda_repo_user', REPOUSER);
0129 setappdata(0, 'ltpda_repo_pass', REPOPASSWD);
0130 setappdata(0, 'mysql_driver', DBDRIVER);
0131 setappdata(0, 'ltpda_repo_servers', REPO_GUI_SERVERLIST);
0132 setappdata(0, 'ltpda_gui_fontsize', GUI_FONTSIZE);
0133 setappdata(0, 'ltpda_repo_gui_fontsize', REPO_GUI_FONTSIZE);
0134 setappdata(0, 'ltpda_passwd_win_fontsize', PASSWD_WIN_FONTSIZE);
0135 
0136 % add mysql JDBC driver to the java path
0137 mysqldriver = [fileparts(which('ltpda_startup')) '/../../classes/+utils/@mysql/mysql-connector-java-5.1.6-bin.jar'];
0138 javaaddpath(mysqldriver);
0139 
0140 %--------------------------------------------------------------------------
0141 % set default directories to load the data from and save the model in
0142 
0143 setappdata(0,'DefaultDataDirectory',DEFAULT_DATA_DIR);
0144 setappdata(0,'DefaultAnalysesDirectory',DEFAULT_ANALYSES_DIR);
0145 
0146 
0147 try
0148   setdbprefs('NullStringRead','Null');
0149   setdbprefs('NullNumberRead', 'NaN');
0150 catch
0151   warning('!!! No database toolbox is installed');
0152   warning('!!! You won''t be able to work with an LTPDA Repository');
0153 end
0154 
0155 % ------------------------------------------------------------------------
0156 % General Variables
0157 setappdata(0, 'wrapstringat', WRAP_STRINGS);  % wrap strings at this length for
0158                                               % history plot nodes
0159 setappdata(0, 'wraplegendstringat', WRAP_LEGEND_STRINGS);  % wrap strings at this length for legends
0160 setappdata(0, 'xmlsetsize', XML_SET_SIZE); % Max size of an xml data set <Set></Set>
0161 
0162 setappdata(0,'ltpda_default_plot_colors', {[0.8 0.2 0.2],     ...
0163                                            [0.2 0.2 0.8],     ...
0164                                            [0.2 0.9 0.2],     ...
0165                                            [0.37 0.9 0.83],   ...
0166                                            [0.888 0.163 0.9], ...
0167                                            [0 0 0],           ...
0168                                            [0 207 255]/255,   ...
0169                                            [255 128 0]/255,   ...
0170                                            [143 0 0]/255,     ...
0171                                            [255 207 0]/255,   ...
0172                                            [0.9 0.266 0.593]});
0173 
0174 setappdata(0, 'timezone',        TIMEZONE);
0175 setappdata(0, 'time_format_str', TIME_FORMAT_STR);
0176 
0177 
0178 % ------------------------------------------------------------------------
0179 % Version Variables
0180 
0181 vs = ver;
0182 for j=1:length(vs)
0183   v = vs(j);
0184   switch v.Name
0185     case 'MATLAB'
0186       matlab_version = [v.Version ' ' v.Release];
0187     case 'Signal Processing Toolbox'
0188       sigproc_version = [v.Version ' ' v.Release];
0189     case 'Symbolic Math Toolbox'
0190       ltpda_symbolic_math = [v.Version ' ' v.Release];
0191     case 'LTPDA Toolbox'
0192       ltpda_version = [v.Version ' ' v.Release];
0193   end
0194 end
0195 
0196 setappdata(0, 'matlab_version', matlab_version);
0197 setappdata(0, 'sigproc_version', sigproc_version);
0198 setappdata(0, 'ltpda_symbolic_math', ltpda_symbolic_math);
0199 setappdata(0, 'ltpda_version', ltpda_version);
0200 setappdata(0, 'ltpda_required_matlab_version', '7.6');
0201 
0202 % --------------------------------------------------------------------
0203 % Other settings
0204 
0205 setappdata(0, 'ltpda_default_spectral_window', specwin('BH92', 10));
0206 setappdata(0, 'ltpda_verbose_level', VERBOSE_LEVEL);
0207 
0208 % -------------------------------------------------------------------------
0209 %  import some things
0210 
0211 import utils.const.*
0212 
0213 % -------------------------------------------------------------------------
0214 %  Launch some things
0215 
0216 % ltpdalauncher;
0217 
0218 
0219 % END

Generated on Mon 25-Aug-2008 22:39:29 by m2html © 2003