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.

94 lines
2.1 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: VideoDevice.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of VideoDevice.cpp
  13. //----------------------------------------------------------------------------
  14. // VideoDevice.cpp: implementation of the CVideoDevice class.
  15. //
  16. //////////////////////////////////////////////////////////////////////
  17. #include "stdafx.h"
  18. //#include "chicago.h"
  19. #include "VideoDevice.h"
  20. #include "..\..\LgLib\Version.h"
  21. #ifdef _DEBUG
  22. #undef THIS_FILE
  23. static char THIS_FILE[]=__FILE__;
  24. #define new DEBUG_NEW
  25. #endif
  26. //////////////////////////////////////////////////////////////////////
  27. // Construction/Destruction
  28. //////////////////////////////////////////////////////////////////////
  29. CVideoDevice::CVideoDevice()
  30. {
  31. m_nOutput = 0;
  32. m_pOutput = NULL;
  33. m_nInput = 0;
  34. m_pInput = NULL;
  35. m_pSensorArray = NULL;
  36. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CVideoDevice::CVideoDevice") );
  37. }
  38. CVideoDevice::~CVideoDevice()
  39. {
  40. Destroy();
  41. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CVideoDevice::~CVideoDevice") );
  42. }
  43. void CVideoDevice::Destroy()
  44. {
  45. if( m_pInput )
  46. {
  47. delete [] m_pInput;
  48. m_pInput = NULL;
  49. }
  50. if( m_pOutput )
  51. {
  52. delete [] m_pOutput;
  53. m_pOutput = NULL;
  54. }
  55. m_nOutput = 0;
  56. m_nInput = 0;
  57. }
  58. void CVideoDevice::SetIOCount( int nInput, int nOutput )
  59. {
  60. Destroy();
  61. m_nOutput = nOutput;
  62. if( m_nOutput )
  63. {
  64. m_pOutput = new CVideoPin[ m_nOutput ];
  65. for( int i = 0; i < m_nOutput; i++ )
  66. {
  67. m_pOutput[ i ].SetPinDir( CVideoPin::PD_OUTPUT );
  68. m_pOutput[ i ].SetVideoDevice( this, i );
  69. }
  70. }
  71. m_nInput = nInput;
  72. if( m_nInput )
  73. {
  74. m_pInput = new CVideoPin[ m_nInput ];
  75. for( int i = 0; i < m_nInput; i++ )
  76. {
  77. m_pInput[ i ].SetPinDir( CVideoPin::PD_INPUT );
  78. m_pInput[ i ].SetVideoDevice( this, i );
  79. }
  80. }
  81. }