⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intmgt.cpp

📁 通过VC源代码
💻 CPP
字号:
// intmgt.cpp: functions associated solely with interupt/error management
#include "stdafx.h"
#include "Simulator.h"
#include <sys\timeb.h>
#include "TraceWnd.h"
#include "Regvars.h"
#include "NumericEdit.h"
  #include "InterruptMgt.h"
#include "SpinnerButton.h"
#include "register.h"
#include "RegData.h"
  #include "RegDisplay.h"
    #include "SimulatorDlg.h"
#include "buzzword.h"
#include "SetupDlg.h"
#include "About.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/****************************************************************************
*                           CSimulatorDlg::OnOvrund
* Result: void
*       
* Effect: 
*       Enables overrun (input) and underrun (output) errors to be injected
*	automatically during free running
****************************************************************************/

void CSimulatorDlg::OnOvrund() 
{
 logErrorChange(c_OverUnder);
}

/****************************************************************************
*                        CSimulatorDlg::OnInterruptMgt
* Result: void
*       
* Effect: 
*       If the Interrupt Management dialog is up, switches to it; otherwise
*	brings it up
****************************************************************************/

void CSimulatorDlg::OnInterruptMgt() 
{
 if(imgr == NULL)
    { /* create it */
     imgr = new CInterruptMgt;
     imgr->Create(IDD_INTERRUPTS, this);
    } /* create it */
 else
    { /* focus */
     imgr->SetFocus();
    } /* focus */
}

/****************************************************************************
*                          CSimulatorDlg::OnSetupIrq
* Result: void
*       
* Effect: 
*       Brings up the IRQ setup dialog
****************************************************************************/

void CSimulatorDlg::OnSetupIrq() 
{
 CSetupDlg dlg;
 dlg.DoModal();

 RegistryInt interval(IDS_POLLING_INTERVAL);
 interval.load(50);
 pollInterval = interval.value;

 RegistryInt regIRQ(IDS_IRQ);
 regIRQ.load(irq); // default to current setting in case not set
 irq = regIRQ.value;
 registers.setIRQ(irq);

 RegistryInt minimum(IDS_GODONEMIN);
 minimum.load(GoDoneMinimum); // default to current setting in case not set
 GoDoneMinimum = minimum.value;

 RegistryInt variance(IDS_GODONEVAR);
 variance.load(GoDoneVariance); // default to current setting in case not set
 GoDoneVariance = variance.value;
}

void CSimulatorDlg::OnErrors() 
{
 logErrorChange(c_Errors);
	// TODO: Add your control notification handler code here
	
}

void CSimulatorDlg::OnInterrupt() 
{
 logErrorChange(c_Interrupt);
	// TODO: Add your control notification handler code here
	
}

/****************************************************************************
*                         CSimulatorDlg::OnImgrClose
* Inputs:
*       WPARAM: ignored
*	LPARAM: ignored
* Result: LRESULT
*       0, always
* Effect: 
*       The imgr has closed
****************************************************************************/

LRESULT CSimulatorDlg::OnImgrClose(WPARAM, LPARAM)
    {
     imgr = NULL;
     return 0;
    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -