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

Generated on Thu 01-Nov-2007 09:42:34 by m2html © 2003