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.

91 lines
2.4 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: 30/06/2002
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: LgRemoteInterfaceBR.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of LgRemoteInterfaceBR.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "..\Version.h"
  16. #include "LgRemoteInterfaceBR.h"
  17. CLgRemoteInterfaceBR::CLgRemoteInterfaceBR()
  18. {
  19. m_Link.SetData( this );
  20. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, "CLgRemoteInterfaceBR::CLgRemoteInterfaceBR" );
  21. }
  22. CLgRemoteInterfaceBR::~CLgRemoteInterfaceBR()
  23. {
  24. UnlinkRemoteInterfaceBR();
  25. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, "CLgRemoteInterfaceBR::~CLgRemoteInterfaceBR" );
  26. }
  27. BOOL CLgRemoteInterfaceBR::LinkRemoteInterfaceBR( CLgRemoteInterfaceBR *pInterface )
  28. {
  29. if( !pInterface )
  30. return FALSE;
  31. return m_Link.Link( &pInterface->m_Link );
  32. }
  33. void CLgRemoteInterfaceBR::UnlinkRemoteInterfaceBR()
  34. {
  35. m_Link.UnlinkAll();
  36. }
  37. BOOL CLgRemoteInterfaceBR::DoRemoteBRGetChannelProperties()
  38. {
  39. CLgLocker Lock( &m_Link );
  40. if( !m_Link.GetCount() )
  41. return FALSE;
  42. CLgRemoteInterfaceBR *pInterface = (CLgRemoteInterfaceBR*)m_Link[0]->GetData();
  43. return pInterface->DoRemoteBRGetChannelProperties();
  44. }
  45. BOOL CLgRemoteInterfaceBR::OnRemoteBRGetChannelProperties( INT nChannelCount, LG_TCP_PACKET_BOARD_RECEIVER::PCHANNEL_PROPERTIES pProperties )
  46. {
  47. CLgLocker Lock( &m_Link );
  48. if( !m_Link.GetCount() )
  49. return FALSE;
  50. CLgRemoteInterfaceBR *pInterface = (CLgRemoteInterfaceBR*)m_Link[0]->GetData();
  51. return pInterface->OnRemoteBRGetChannelProperties( nChannelCount, pProperties );
  52. }
  53. BOOL CLgRemoteInterfaceBR::DoRemoteBRChannelConnect( INT nChannel )
  54. {
  55. CLgLocker Lock( &m_Link );
  56. if( !m_Link.GetCount() )
  57. return FALSE;
  58. CLgRemoteInterfaceBR *pInterface = (CLgRemoteInterfaceBR*)m_Link[0]->GetData();
  59. return pInterface->DoRemoteBRChannelConnect( nChannel );
  60. }
  61. BOOL CLgRemoteInterfaceBR::OnRemoteBRChannelConnect( INT nChannel, BOOL bResult )
  62. {
  63. CLgLocker Lock( &m_Link );
  64. if( !m_Link.GetCount() )
  65. return FALSE;
  66. CLgRemoteInterfaceBR *pInterface = (CLgRemoteInterfaceBR*)m_Link[0]->GetData();
  67. return pInterface->OnRemoteBRChannelConnect( nChannel, bResult );
  68. }