//---------------------------------------------------------------------------- // Laser Guard Ltd. // Copyright © 2000-2002. All Rights Reserved. // Version 1.0 01/01/2000 // Last modification: 08/10/2003 // PROJECT: // SUBSYSTEM: // FILE: DeviceDI.h // AUTHOR: Sergey Chizhevskiy // OVERVIEW // ~~~~~~~~ // Header file of DeviceDI.h //---------------------------------------------------------------------------- // DeviceIN.h: interface for the CDeviceIN class. // ////////////////////////////////////////////////////////////////////// #ifndef __DEVICE__IN__H__INCLUDED__ #define __DEVICE__IN__H__INCLUDED__ #include "DirectInput.h" #include "..\..\LgLib\Templ.h" #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Device direct input class CDeviceDI { public: CDeviceDI(); virtual ~CDeviceDI(); public: void SetNC( int nBit, BOOL bNC ); protected: void PostEnable( BOOL bEnable, int nBit = -1 ); void PostGetState(); public: enum{ DDIC_GET_STATE = 0, DDIC_ENABLE = 1, DDIC_COUNT = 2 }; struct DDIEVENT { BYTE id; union { BOOL bEnable; int nBit; }; }; CLgQueueP m_Queue; protected: void SetCount( int nCount ); int GetCount() { return m_arrInput.GetCount(); } BOOL GetBit( int nBit ); friend class CSocketRS232DI; void SetBit( int nBit, BOOL bOn ); protected: friend class CDirectInput; BOOL SetDirectInput( CDirectInput *pDirectInput, int nBit ); protected: typedef CLgArray CDirectInputArray; typedef struct INPUT_INFO { BOOL bOn; BOOL bNC; BOOL bFirstTime; CDirectInputArray arrDirectInput; }INPUT_INFO; CLgArray m_arrInput; }; #endif