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

© Copyright 2020 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
--[[---------------------------------------------------------------------------------------]]
-- Comments start with two dashes
--[[
Mulitline comments
start with two dashes and two left brackets.
They end with two right brackets. ]]
title = "BUtton and Tabs Test";

-- configuration variables
AutoBellWhistle = true;

ON = true;
OFF = false;

CLOSED = true; -- AIU = Switch = State
THROWN = false;

--[[---------------------------------------------------------------------------------------]]
function setup(Engine, TIU)
--
print("setup() : TIU " .. TIU .. " Engine " .. Engine .. " Debug " .. Debug());
print("Trip Odometer " .. DTO(Engine, TIU) .. " Smiles");
return true;
end
--[[---------------------------------------------------------------------------------------]]
function loop(Engine, TIU)
--
print("loop() : TIU " .. TIU .. " Engine " .. Engine .. " Debug " .. Debug());
return false;	-- false=do not loop, true=continue to loop
end
--[[---------------------------------------------------------------------------------------]]
function cleanup(Engine, TIU)
--
print("cleanup() : TIU " .. TIU .. " Engine " .. Engine .. " Debug " .. Debug());
print("Trip Odometer " .. DTO(Engine, TIU) .. " Smiles");
return true;
end
--[[---------------------------------------------------------------------------------------]]
function PlayBell(Eng, TIU)
	print("PlayBell(): Eng " .. Eng .. " TIU " .. TIU .. " Debug " .. Debug());
	Bell(ON, 0, Eng, TIU);
	Bell(OFF, 4, Eng, TIU);
	return true;
end
Function01Name, Function01Label = PlayBell, "Sound Bell 1";
--[[---------------------------------------------------------------------------------------]]
function ShowDTO(Eng, TIU)
	print("Trip Odometer " .. DTO(Eng, TIU) .. " Smiles")
	return true;
end
Function10Name, Function10Label = ShowDTO, "Trip Odometer 10";
--[[---------------------------------------------------------------------------------------]]
Function11Name, Function11Label = PlayBell, "PlayBell 11";
--[[---------------------------------------------------------------------------------------]]
function ShowDCH(Eng, TIU)
	print("Chronometer " .. DCH(Eng, TIU) .. " Seconds")
	return true;
end
Function21Name, Function21Label = ShowDCH, "Chrono 21";
--[[---------------------------------------------------------------------------------------]]
Function16Name, Function16Label = ShowDTO, "Trip Odometer 16";
--[[---------------------------------------------------------------------------------------]]
Function23Name, Function23Label = PlayBell, "PlayBell 23";
--[[---------------------------------------------------------------------------------------]]
function ShowDOD(Eng, TIU)
	print("Odometer " .. DOD(Eng, TIU) .. " Smiles")
	return true;
end
Function30Name, Function30Label = ShowDOD, "Odometer 30";
--[[---------------------------------------------------------------------------------------]]
-- These labels appear on each of the tabs for the Function Buttons
Tab01Label = "Engine"
Tab02Label = "Destination"
Tab03Label = "Spare";
--[[---------------------------------------------------------------------------------------]]

