Old fashion design for PC-104
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.

58 lines
1.2 KiB

4 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. {
  18. m_pBoard = NULL;
  19. memset( &m_RelayParameters, 0, sizeof( m_RelayParameters ) );
  20. m_dwAutoDelayTime = 0;
  21. m_lAutoDelayTimeout = 0;
  22. m_bOutput = 0;
  23. }
  24. CRelay::~CRelay()
  25. {
  26. Destroy();
  27. }
  28. BOOL CRelay::Create( CBoard *pBoard, LGS::PRELAY_PARAMETERS pParameters )
  29. {
  30. Destroy();
  31. if( !pParameters || !pBoard )
  32. return FALSE;
  33. // store parameters
  34. m_RelayParameters = *pParameters;
  35. m_pBoard = pBoard;
  36. // initiate relay
  37. SetRelay( FALSE );
  38. return TRUE;
  39. }
  40. void CRelay::Destroy()
  41. {
  42. // reset pointer
  43. m_pBoard = NULL;
  44. // reset prameters
  45. memset( &m_RelayParameters, 0, sizeof( m_RelayParameters ) );
  46. m_dwAutoDelayTime = 0;
  47. m_lAutoDelayTimeout = 0;
  48. m_bOutput = 0;
  49. }