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

Generated on Mon 03-Sep-2007 12:12:34 by m2html © 2003