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.

99 lines
2.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: DeviceVM.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of DeviceVM.cpp
  13. //----------------------------------------------------------------------------
  14. // DeviceVM.cpp: implementation of the CDeviceVM class.
  15. //
  16. //////////////////////////////////////////////////////////////////////
  17. #include "stdafx.h"
  18. //#include "chicago.h"
  19. #include "DeviceVM.h"
  20. #include "VideoMatrix.h"
  21. #include "..\..\LgLib\Version.h"
  22. #ifdef _DEBUG
  23. #undef THIS_FILE
  24. static char THIS_FILE[]=__FILE__;
  25. #define new DEBUG_NEW
  26. #endif
  27. //////////////////////////////////////////////////////////////////////
  28. // Construction/Destruction
  29. //////////////////////////////////////////////////////////////////////
  30. CDeviceVM::CDeviceVM()
  31. {
  32. m_pVideoMatrix = NULL;
  33. m_nInput = 0;
  34. m_nOutput = 0;
  35. m_pOutput = 0;
  36. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CDeviceVM::CDeviceVM") );
  37. }
  38. CDeviceVM::~CDeviceVM()
  39. {
  40. if( m_pOutput )
  41. delete [] m_pOutput;
  42. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CDeviceVM::~CDeviceVM") );
  43. }
  44. void CDeviceVM::SetIOCount( int nInputCount, int nOutputCount )
  45. {
  46. ASSERT( m_pOutput==NULL );
  47. m_nInput = nInputCount;
  48. m_nOutput = nOutputCount;
  49. m_pOutput = new int[ m_nOutput ];
  50. for( int i = 0; i < nOutputCount; i++ )
  51. m_pOutput[i] = VI_UNDEFINED;
  52. PostInit();
  53. }
  54. void CDeviceVM::SetVideoMatrix( CVideoMatrix *pVM )
  55. {
  56. m_pVideoMatrix = pVM;
  57. }
  58. void CDeviceVM::PostConnect( int nInput, int nOutput )
  59. {
  60. DVMEVENT event;
  61. event.id = DVMC_CONNECT;
  62. event.nInput = nInput;
  63. event.nOutput = nOutput;
  64. m_Queue.Push( event );
  65. }
  66. void CDeviceVM::PostGetState()
  67. {
  68. DVMEVENT event;
  69. event.id = DVMC_GET_STATE;
  70. m_Queue.Push( event );
  71. }
  72. void CDeviceVM::PostInit()
  73. {
  74. DVMEVENT event;
  75. event.id = DVMC_INIT;
  76. m_Queue.Push( event );
  77. }
  78. void CDeviceVM::SetConnect( int nInput, int nOutput )
  79. {
  80. ASSERT( m_pVideoMatrix!=NULL );
  81. m_pVideoMatrix->PostConnect( nInput, nOutput );
  82. }