%function plotSyslog(multiple)
function plotSyslog(multiple)

if nargin,
	close all,
	d=dir('200*');
	if length(d) == 0,
		disp('No log directories found')
		return
	end
	for ii=1:length(d),
		cd(d(ii).name)
		if myPlotSyslog, return, end
		cd ..
	end
else
	myPlotSyslog;
end


%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function res = myPlotSyslog
res = 1;

[s, w] = dos('perl c:\matlabR12\work\parseSyslog.pl syslog');
if s,
	disp(['Exiting ' w])
	return
end

try,
	syslog
	sys = load('syslog.out');
catch
	disp(lasterr)
	disp(w)
	return
end

minTime = min(sys(:,2));
figure
subplot(2,1,1)
for ii=1:length(taskCell),
	jj = find(sys(:,1) == ii);
	plot(sys(jj,2)-minTime,ii,'b.'), hold on
	text(0,ii,[taskCell{ii} '     '],'HorizontalAlignment','right')
end

xpos = get(gca,'Position');
set(gca,'Position',[2*xpos(1) xpos(2) 0.9*xpos(3) xpos(4)]);
title([strip(pwd,'\','/') ' \copyright Bluefin Robotics'])
grid on
zoom xon

subplot(2,1,2)
s = sortrows(sys,2);
plot(s(:,2)-minTime,[diff(s(:,2));0],'.')
xpos = get(gca,'Position');
set(gca,'Position',[2*xpos(1) xpos(2) 0.9*xpos(3) xpos(4)]);
ylabel('Delta time (seconds)')
xlabel(['Start time = ' num2str(minTime) ' (seconds)'])
grid on

res = 0;