//---------------------------------------------------------------------------
/*
Remote Train Control Program for Windows

© Copyright 2016 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
//---------------------------------------------------------------------------
/*

*/
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#ifndef Timer_ThreadH
#define Timer_ThreadH
//---------------------------------------------------------------------------
#include <Classes.hpp>

#define _SECOND 10000000

class TProgram_Control; 	// forward declaration
//---------------------------------------------------------------------------
class TMyTimerThread : public TThread
{
private:
	void __fastcall RunOnTerminate(TObject * Sender);
   	HANDLE ResetTimerEvent;	// for event communications with Timer
    int TenthSecondCounter;
    DWORD ThreadID;

protected:
	void __fastcall Execute();
    HANDLE MyTimer;			// Timer for WaitForMultipleObjects
public:
	__fastcall TMyTimerThread(bool CreateSuspended, TForm * Callingthis, int PCNo);
	__fastcall ~TMyTimerThread(void);
    
    void __fastcall Reset();
	void __fastcall StopRequest();

    bool Finished;
};
//---------------------------------------------------------------------------
#endif
