For DOS Protected Mode version of sensor core software
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.0 KiB

3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: relay_.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of relay_.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "Relay.h"
  16. CRelay::CRelay(){
  17. Destroy();
  18. };
  19. CRelay::~CRelay(){
  20. Destroy();
  21. };
  22. bool CRelay::Create( CBoard *pBoard, LGS::PRELAY_PARAMETERS pParameters ){
  23. Destroy();
  24. if( !pParameters || !pBoard ) return false;
  25. // store parameters
  26. memcpy( &m_RelayParameters, pParameters, sizeof( LGS::PRELAY_PARAMETERS ) );
  27. m_pBoard = pBoard;
  28. // initiate relay
  29. SetRelay( false );
  30. return true;
  31. };
  32. void CRelay::Destroy(){
  33. // reset pointer
  34. m_pBoard = NULL;
  35. memset( &m_RelayParameters, 0, sizeof( LGS::PRELAY_PARAMETERS ) );
  36. m_dwAutoDelayTime = 0;
  37. m_lAutoDelayTimeout = 0;
  38. m_bOutput = 0;
  39. };