//---------------------------------------------------------------------------
#ifndef Track_Signal_ThreadH
#define Track_Signal_ThreadH
//---------------------------------------------------------------------------
#include <Classes.hpp>

class TTrackSignal;
//---------------------------------------------------------------------------
class TTrackSignalThread : public TThread
{
private:
	unsigned char EngineNo, TIUNo, RemoteNo;
	bool bRepeatParameter;
	DWORD DelayValue;
	TTrackSignal * CallingTSScreen; 	// this pointer must be local to each Thread
	HWND ParentHandle;					// for messages back to the Parent
	TOp * CallingOpScreen;				// Operations window that called the Track Signal window
	int PingNum;
	int p4count, p4ave, p4total;

	byte PingbyteResp[CMDMAX]; 	// Array for decoded binary response
    int iPingCount;

	String PrintLine;
    DWORD ThreadID;

    __fastcall TTrackSignalThread(bool CreateSuspended);

protected:
	void __fastcall Execute();
    void __fastcall TS();
    void __fastcall CleanUp();
    void __fastcall Initialize();
    void __fastcall RunOnTerminate(TObject * Sender);

public:
    __fastcall TTrackSignalThread(bool CreateSuspended, TTrackSignal * CallingTS, HWND Parent,
		TOp * CallingOp, int Eng, int TIU, int Remote, DWORD delay, bool RepeatParameter);
	__fastcall ~TTrackSignalThread();
    void __fastcall ClearCounts();

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