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.23 2008/02/21 10:44:09 hewitson 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.23 2008/02/21 10:44:09 hewitson Exp $
0011 %
0012 
0013 %--------------------------------------------------------------------------
0014 % User Configurable parameters
0015 %
0016 
0017 REPOUSER   = 'hewitson';
0018 REPOPASSWD = '.pw4hewi';
0019 
0020 USE_LTPDA_PRINT_SETTINGS = 'Yes';     % Choose LTPDA Print setup
0021 USE_LTPDA_PLOT_SETTINGS  = 'Yes';     % Choose LTPDA Plot setup
0022 
0023 REPO_GUI_FONTSIZE   = 10;         % Choose Repository GUI font size
0024 PASSWD_WIN_FONTSIZE = 8;          % Choose login/passw dialog window font size
0025 
0026 DBDRIVER = 'com.mysql.jdbc.Driver';   % Set LTPDA Repository database driver
0027 
0028 WRAP_STRINGS         = 8;             % Wrap strings at this value
0029 WRAP_LEGEND_STRINGS  = 10;            % Wrap legend strings at this value
0030 XML_SET_SIZE         = 50000;         % Set the maximum line length for writing data sets to XML
0031 
0032 TIMEZONE        = 'UTC';                 % Users timezone
0033                                          % To get valid IDs use:
0034                                          % java.util.TimeZone.getAvailableIDs
0035 TIME_FORMAT_STR = 'yyyy-mm-dd HH:MM:SS.FFF'; % Users time format.
0036 
0037 DEFAULT_DATA_DIR = 'D:\lisa_activity\LTPDA\Analyses';
0038 DEFAULT_ANALYSES_DIR = 'D:\exper_data\LTPDA\data';
0039 
0040 %--------------------------------------------------------------------------
0041 %--------------------------------------------------------------------------
0042 % NO NEED TO EDIT BELOW HERE
0043 %--------------------------------------------------------------------------
0044 %--------------------------------------------------------------------------
0045 
0046 v = ver('LTPDA');
0047 
0048 logo = {...
0049 '                                        ',...
0050 '                  ****                  ',...
0051 '                   **                   ',...
0052 '              -------------             ',...
0053 '          ////       /     \\\\         ',...
0054 '       ///          /          \\\      ',...
0055 '      |            /              |     ',...
0056 '  ** |    +----+  /      +----+    | ** ',...
0057 '  ***|    |    |//-------|    |    |*** ',...
0058 '  ** |    +----+        /+----+    | ** ',...
0059 '     |                /           |     ',...
0060 '       \\\            /        ///      ',...
0061 '          \\\\      //     ////         ',...
0062 '              -------------             ',...
0063 '                   **                   ',...
0064 '                  ****                  ',...
0065 };
0066 
0067 l1 = '+----------------------------------------------------+';
0068 ll = length(l1);
0069 
0070 disp(l1);
0071 disp('|                                                    |')
0072 for j=1:length(logo)
0073   disp([strpad(sprintf('|      %s  ', char(logo{j})), ll-1) '|']);
0074 end
0075 disp([strpad('|', ll-1) '|'])
0076 disp([strpad(sprintf('|          Welcome to %s', v.Name), ll-1) '|'])
0077 disp([strpad('|', ll-1) '|'])
0078 disp([strpad(sprintf('|                 Version: %s', v.Version), ll-1) '|'])
0079 disp([strpad(sprintf('|                 Release: %s', v.Release), ll-1) '|'])
0080 disp([strpad(sprintf('|                    Date: %s', v.Date), ll-1) '|'])
0081 disp([strpad('|', ll-1) '|'])
0082 disp(l1);
0083 
0084 %--------------------------------------------------------------------------
0085 % set page properties for printing
0086 if strcmp(upper(USE_LTPDA_PRINT_SETTINGS), 'YES')
0087   set(0,'DefaultFigurePaperOrientation','portrait');
0088   set(0,'DefaultFigurePaperType','A4');
0089   set(0,'DefaultFigurePaperUnits','inches');
0090 end
0091 
0092 %--------------------------------------------------------------------------
0093 % Plot settings
0094 if strcmp(upper(USE_LTPDA_PLOT_SETTINGS), 'YES')
0095   set(0,'DefaultAxesFontSize',14);
0096   set(0,'DefaultAxesFontWeight','bold');
0097   set(0,'DefaultAxesLineWidth', 1);
0098   set(0,'DefaultLineLineWidth', 2);
0099   set(0,'defaultlinemarkersize',10)
0100   set(0,'DefaultAxesXColor',[0.2 0.2 0.8]);
0101   set(0,'DefaultAxesYColor',[0.2 0.2 0.8]);
0102   set(0,'DefaultAxesGridLineStyle','-');
0103   set(0,'DefaultAxesMinorGridLineStyle','-');
0104   set(0,'defaultfigurenumbertitle','on');
0105   set(0,'DefaultFigureColor', 'w');
0106   set(0,'DefaultFigurePosition', [100 100 800 600]);
0107   set(0,'DefaultFigurePaperPositionMode','auto')
0108 
0109 end
0110 
0111 %--------------------------------------------------------------------------
0112 % format of numbers on MATLAB terminal
0113 format long g
0114 
0115 % ------------------------------------------------------------------------
0116 % MySQL LTPDA Repository Server Settings
0117 %
0118 if exist('REPOUSER', 'var') == 0
0119   REPOUSER = '';
0120 end
0121 if exist('REPOPASSWD', 'var') == 0
0122   REPOPASSWD = '';
0123 end
0124 setappdata(0, 'ltpda_repo_user', REPOUSER);
0125 setappdata(0, 'ltpda_repo_pass', REPOPASSWD);
0126 setappdata(0, 'mysql_driver', DBDRIVER);
0127 
0128 setappdata(0, 'ltpda_repo_gui_fontsize', REPO_GUI_FONTSIZE);
0129 setappdata(0, 'ltpda_passwd_win_fontsize', PASSWD_WIN_FONTSIZE);
0130 
0131 % add mysql JDBC driver to the java path
0132 mysqldriver = [fileparts(which('ltpda_startup')) '/../mysql/mysql-connector-java-5.0.6-bin.jar'];
0133 javaaddpath(mysqldriver);
0134 
0135 %--------------------------------------------------------------------------
0136 % set default directories to load the data from and save the model in
0137 
0138 setappdata(0,'DefaultDataDirectory',DEFAULT_DATA_DIR);
0139 setappdata(0,'DefaultAnalysesDirectory',DEFAULT_ANALYSES_DIR);
0140 
0141 
0142 try
0143   setdbprefs('NullStringRead','Null');
0144   setdbprefs('NullNumberRead', 'NaN');
0145 catch
0146   warning('!!! No database toolbox is installed');
0147   warning('!!! You won''t be able to work with an LTPDA Repository');
0148 end
0149 
0150 % ------------------------------------------------------------------------
0151 % General Variables
0152 setappdata(0, 'wrapstringat', WRAP_STRINGS);  % wrap strings at this length for
0153                                               % history plot nodes
0154 setappdata(0, 'wraplegendstringat', WRAP_LEGEND_STRINGS);  % wrap strings at this length for legends
0155 setappdata(0, 'xmlsetsize', XML_SET_SIZE); % Max size of an xml data set <Set></Set>
0156 
0157 setappdata(0,'ltpda_default_plot_colors', {[0.8 0.2 0.2],     ...
0158                                            [0.2 0.2 0.8],     ...
0159                                            [0.2 0.9 0.2],     ...
0160                                            [0.37 0.9 0.83],   ...
0161                                            [0.888 0.163 0.9], ...
0162                                            [0 0 0],           ...
0163                                            [0 207 255]/255,   ...
0164                                            [255 128 0]/255,   ...
0165                                            [143 0 0]/255,     ...
0166                                            [255 207 0]/255,   ...
0167                                            [0.9 0.266 0.593]});
0168 
0169 setappdata(0, 'timezone',        TIMEZONE);
0170 setappdata(0, 'time_format_str', TIME_FORMAT_STR);
0171 
0172 
0173 % ------------------------------------------------------------------------
0174 % Version Variables
0175 
0176 vs = ver;
0177 for j=1:length(vs)
0178   v = vs(j);
0179   switch v.Name
0180     case 'MATLAB'
0181       matlab_version = [v.Version ' ' v.Release];
0182     case 'Signal Processing Toolbox'
0183       sigproc_version = [v.Version ' ' v.Release];
0184     case 'LTPDA Toolbox'
0185       ltpda_version = [v.Version ' ' v.Release];
0186   end
0187 end
0188 
0189 setappdata(0, 'matlab_version', matlab_version);
0190 setappdata(0, 'sigproc_version', sigproc_version);
0191 setappdata(0, 'ltpda_version', ltpda_version);
0192 
0193 % END

Generated on Tue 26-Feb-2008 10:52:52 by m2html © 2003