--[[
---------------------------------------------------------------------------
Remote Train Control Program for Windows

© Copyright 2019 by Mark DiVecchio

	This file is part of Remote Train Control.

	Remote Train Control is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	Remote Train Control is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with Remote Train Control.  If not, see <http://www.gnu.org/licenses/>.

 Home Page : http://www.silogic.com/trains/RTC_Running.html
---------------------------------------------------------------------------]]
-- Semicolons are not required in Lua code
title = "Sleep Test from setup()"

require("defines");
require("functions");

--[[---------------------------------------------------------------------------------------]]
function setup(Engine, TIU)
	-- the setup() function is called once at the beginning of the run
	print("setup(): Engine Number " .. Engine .. " TIU Number " .. TIU .. " Debug " .. Debug());
	print(string.format("setup %.2f", RunTime()))
	print("begin setup() Sleep(5) call");
	Sleep(5);
	print("end setup() Sleep(5) call");
	print(string.format("setup %.2f", RunTime()))
	return true;		-- false=setup failed, true=setup succeeded
	end
--[[---------------------------------------------------------------------------------------]]
function cleanup(Engine, TIU)
	-- the cleanup() function is called once when the [STOP] button is pressed
	print(string.format("cleanup %.2f - Please Wait", RunTime()));
	print("begin cleanup() Sleep(5) call");
	retv = Sleep(5);
	print("end cleanup() Sleep(5) call (" .. (retv and "true" or "false") .. ")");
	print(string.format("cleanup %.2f", RunTime()));
	return true;		-- false=cleanup failed, true=cleanup succeeded
	end
--[[---------------------------------------------------------------------------------------]]
