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.

221 lines
6.0 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: BoardReceiver.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of BoardReceiver.cpp
  13. //----------------------------------------------------------------------------
  14. // BoardReceiver.cpp : Defines the class behaviors for the application.
  15. //
  16. #include "stdafx.h"
  17. #include "BoardReceiver.h"
  18. #include "MainFrm.h"
  19. #include "ChildFrm.h"
  20. #include "BoardReceiverDoc.h"
  21. #include "BoardReceiverView.h"
  22. /*
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. */
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CBoardReceiverApp
  31. BEGIN_MESSAGE_MAP(CBoardReceiverApp, CWinApp)
  32. //{{AFX_MSG_MAP(CBoardReceiverApp)
  33. ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  34. // NOTE - the ClassWizard will add and remove mapping macros here.
  35. // DO NOT EDIT what you see in these blocks of generated code!
  36. //}}AFX_MSG_MAP
  37. // Standard file based document commands
  38. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  39. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CBoardReceiverApp construction
  43. CBoardReceiverApp::CBoardReceiverApp()
  44. {
  45. m_bFastIdleMode = FALSE;
  46. }
  47. /////////////////////////////////////////////////////////////////////////////
  48. // The one and only CBoardReceiverApp object
  49. CBoardReceiverApp theApp;
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CBoardReceiverApp initialization
  52. BOOL CBoardReceiverApp::InitInstance()
  53. {
  54. AfxEnableControlContainer();
  55. // Standard initialization
  56. // If you are not using these features and wish to reduce the size
  57. // of your final executable, you should remove from the following
  58. // the specific initialization routines you do not need.
  59. #ifdef _AFXDLL
  60. Enable3dControls(); // Call this when using MFC in a shared DLL
  61. #else
  62. Enable3dControlsStatic(); // Call this when linking to MFC statically
  63. #endif
  64. // Change the registry key under which our settings are stored.
  65. // TODO: You should modify this string to be something appropriate
  66. // such as the name of your company or organization.
  67. SetRegistryKey(_T("Local AppWizard-Generated Applications"));
  68. LoadStdProfileSettings(); // Load standard INI file options (including MRU)
  69. // Register the application's document templates. Document templates
  70. // serve as the connection between documents, frame windows and views.
  71. CMultiDocTemplate* pDocTemplate;
  72. pDocTemplate = new CMultiDocTemplate(
  73. IDR_BOARDRTYPE,
  74. RUNTIME_CLASS(CBoardReceiverDoc),
  75. RUNTIME_CLASS(CChildFrame), // custom MDI child frame
  76. RUNTIME_CLASS(CBoardReceiverView));
  77. AddDocTemplate(pDocTemplate);
  78. /*
  79. pDocTemplate = new CMultiDocTemplate(
  80. IDR_BOARDRTYPE,
  81. RUNTIME_CLASS(CBoardReceiverDoc),
  82. RUNTIME_CLASS(CChildFrame), // custom MDI child frame
  83. RUNTIME_CLASS(CBoardReceiverList));
  84. AddDocTemplate(pDocTemplate);
  85. */
  86. // create main MDI Frame window
  87. CMainFrame* pMainFrame = new CMainFrame;
  88. if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  89. return FALSE;
  90. m_pMainWnd = pMainFrame;
  91. // Parse command line for standard shell commands, DDE, file open
  92. CCommandLineInfo cmdInfo;
  93. ParseCommandLine(cmdInfo);
  94. // Dispatch commands specified on the command line
  95. // if (!ProcessShellCommand(cmdInfo))
  96. // return FALSE;
  97. // The main window has been initialized, so show and update it.
  98. pMainFrame->ShowWindow(m_nCmdShow);
  99. pMainFrame->UpdateWindow();
  100. /*
  101. // link server with client
  102. m_DataStreamsServer.LinkRemoteInterfaceBR( &m_TcpIpClient );
  103. m_TcpIpClient.Create( NULL, 2000 );
  104. */
  105. return TRUE;
  106. }
  107. /////////////////////////////////////////////////////////////////////////////
  108. // CAboutDlg dialog used for App About
  109. class CAboutDlg : public CDialog
  110. {
  111. public:
  112. CAboutDlg();
  113. // Dialog Data
  114. //{{AFX_DATA(CAboutDlg)
  115. enum { IDD = IDD_ABOUTBOX };
  116. //}}AFX_DATA
  117. // ClassWizard generated virtual function overrides
  118. //{{AFX_VIRTUAL(CAboutDlg)
  119. protected:
  120. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  121. //}}AFX_VIRTUAL
  122. // Implementation
  123. protected:
  124. //{{AFX_MSG(CAboutDlg)
  125. // No message handlers
  126. //}}AFX_MSG
  127. DECLARE_MESSAGE_MAP()
  128. };
  129. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  130. {
  131. //{{AFX_DATA_INIT(CAboutDlg)
  132. //}}AFX_DATA_INIT
  133. }
  134. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  135. {
  136. CDialog::DoDataExchange(pDX);
  137. //{{AFX_DATA_MAP(CAboutDlg)
  138. //}}AFX_DATA_MAP
  139. }
  140. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  141. //{{AFX_MSG_MAP(CAboutDlg)
  142. // No message handlers
  143. //}}AFX_MSG_MAP
  144. END_MESSAGE_MAP()
  145. // App command to run the dialog
  146. void CBoardReceiverApp::OnAppAbout()
  147. {
  148. CAboutDlg aboutDlg;
  149. aboutDlg.DoModal();
  150. }
  151. /////////////////////////////////////////////////////////////////////////////
  152. // CBoardReceiverApp message handlers
  153. BOOL CBoardReceiverApp::OnIdle( LONG lCount )
  154. {
  155. POSITION posDT = GetFirstDocTemplatePosition();
  156. while( posDT )
  157. {
  158. CDocTemplate* pDT = GetNextDocTemplate( posDT );
  159. POSITION posD = pDT->GetFirstDocPosition();
  160. while( posD )
  161. {
  162. CDocument *pD = pDT->GetNextDoc( posD );
  163. if( pD->IsKindOf( RUNTIME_CLASS( CBoardReceiverDoc ) ) )
  164. {
  165. CBoardReceiverDoc *pBRD = (CBoardReceiverDoc*) pD;
  166. pBRD->OnIdle();
  167. }
  168. }
  169. }
  170. BOOL bResult = CWinApp::OnIdle( lCount );
  171. return m_bFastIdleMode ? TRUE : bResult;
  172. }
  173. void CBoardReceiverApp::SetIdleMode( BOOL bFast )
  174. {
  175. m_bFastIdleMode = bFast;
  176. }
  177. /*
  178. BOOL CBoardReceiverApp::RegisterDocument( CBoardReceiverDoc *pDoc )
  179. {
  180. return m_DataStreamsServer.RegisterChannel( pDoc );
  181. }
  182. BOOL CBoardReceiverApp::UnregisterDocument( CBoardReceiverDoc *pDoc )
  183. {
  184. return m_DataStreamsServer.UnregisterChannel( pDoc );
  185. }
  186. */