% runLRAUV_syslog.m
% Last modified Dec 25, 2014
% Ben Raanan

% This script runs a sequance of scripts designed to create a record of all
% CRITICAL failiures found in 900739.LRAUV.data syslogs


clear 

global yr workd vh 
workd = '~/Documents/MATLAB/MBARI/mat/syslog/';
yr    = 2010:2014;
vh    = { 'Tethys', 'Daphne', 'Makai' };


%% 1) Locate syslog files from server folders and logs thier paths:
find_syslog 
% Comment: output is saved to: syslog_(year).mat

% 2) Scan syslog files for CRITICAL messeges (updates syslog_(year).mat)
get_syslog_CRITICAL
% Comment: this script takes the longest to run

% -> compleated for 2010-2014 (Dec, 29 2014)



%% 3) Sort syslog critical faults by component and extract
% time-stamp for each log
process_syslog_CRITICAL
% Comment: output is saved to syslog_(year)_comp.mat

% 4) Eliminate redundent critical faults and count critical 
% errors by log, mission and component (updates syslog_(year)_comp.mat)
syslog_eliminateRedundant


% 5) Locate and log "dropping drop weight" critical messages
%    (updates syslog_(year)_comp.mat)
syslog_dropweight


% 6) Calculate run time and MTBCF for each log and mission 
%    (updates syslog_(year)_comp.mat)
syslog_RunTime


% 7) Calculate annual TBCF and MTBCF in logs and compute  
% stats for vertical plain critical errors (updates syslog_(year)_comp.mat)
syslog_stats

% 8) Consolidate data into single struct
syslog_concatAll
% output is saved to: syslog_All_comp.mat

% -> compleated for 2010-2014 (Dec, 29 2014)