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.

69 lines
1.9 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: DataStreamsServer.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of DataStreamsServer.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "boardreceiver.h"
  16. #include "DataStreamsServer.h"
  17. /*
  18. #ifdef _DEBUG
  19. #undef THIS_FILE
  20. static char THIS_FILE[]=__FILE__;
  21. #define new DEBUG_NEW
  22. #endif
  23. */
  24. CDataStreamsServer::CDataStreamsServer()
  25. {
  26. }
  27. CDataStreamsServer::~CDataStreamsServer()
  28. {
  29. }
  30. BOOL CDataStreamsServer::RegisterChannel( CBoardReceiverDoc *pDoc )
  31. {
  32. CLgLocker Lock( &m_ChannelArray );
  33. return m_ChannelArray.Add( pDoc );
  34. }
  35. BOOL CDataStreamsServer::UnregisterChannel( CBoardReceiverDoc *pDoc )
  36. {
  37. CLgLocker Lock( &m_ChannelArray );
  38. return m_ChannelArray.Remove( m_ChannelArray.Find( pDoc ) );
  39. }
  40. BOOL CDataStreamsServer::DoRemoteBRChannelConnect( INT nChannel )
  41. {
  42. return FALSE;
  43. }
  44. BOOL CDataStreamsServer::DoRemoteBRGetChannelProperties()
  45. {
  46. CLgLocker Lock( &m_ChannelArray );
  47. INT nChannelCount = m_ChannelArray.GetCount();
  48. LG_TCP_PACKET_BOARD_RECEIVER::PCHANNEL_PROPERTIES pChannelProperties =
  49. (LG_TCP_PACKET_BOARD_RECEIVER::PCHANNEL_PROPERTIES)malloc( sizeof(LG_TCP_PACKET_BOARD_RECEIVER::CHANNEL_PROPERTIES) * nChannelCount );
  50. if( !pChannelProperties )
  51. return FALSE;
  52. for( INT i = 0; i < m_ChannelArray.GetCount(); i++ )
  53. {
  54. pChannelProperties[i].nChannelID = m_ChannelArray[i]->GetChannelID();
  55. strcpy( pChannelProperties[i].pCommPort, m_ChannelArray[i]->GetChannelName() );
  56. }
  57. return OnRemoteBRGetChannelProperties( nChannelCount, pChannelProperties );
  58. }