108 lines
2.4 KiB
C++
108 lines
2.4 KiB
C++
// ControlView.cpp: 实现文件
|
|
//
|
|
#include "pch.h"
|
|
|
|
#include "MCA.h"
|
|
#include "MCADoc.h"
|
|
#include "MainFrm.h"
|
|
#include "DetailView.h"
|
|
#include "ControlView.h"
|
|
|
|
// CControlView
|
|
|
|
IMPLEMENT_DYNCREATE(CControlView, CFormView)
|
|
|
|
CControlView::CControlView()
|
|
: CFormView(IDD_DIALOG_CONTROL)
|
|
, m_nCond(100)
|
|
, m_nT0(0)
|
|
, m_nTime(0)
|
|
, m_nTimeStr((CString)'0')
|
|
, m_nTotalCount(0)
|
|
, m_nPartCount(0)
|
|
, m_nMaxCount(0)
|
|
, m_nLC(4)
|
|
, m_nCursor1(0)
|
|
, m_nCursor2(1023)
|
|
, m_nCursorROI(0)
|
|
, m_nCursorROICount(0)
|
|
{
|
|
}
|
|
|
|
CControlView::~CControlView()
|
|
{
|
|
}
|
|
|
|
void CControlView::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CFormView::DoDataExchange(pDX);
|
|
DDX_Text(pDX, IDC_COND, m_nCond);
|
|
DDX_Text(pDX, IDC_TIME, m_nTimeStr);
|
|
DDX_Text(pDX, IDC_TCOUNT, m_nTotalCount);
|
|
DDX_Text(pDX, IDC_PCOUNT, m_nPartCount);
|
|
DDX_Text(pDX, IDC_MCOUNT, m_nMaxCount);
|
|
DDX_Control(pDX, IDC_MODE, m_ComboMode);
|
|
DDX_Control(pDX, IDC_AXIS, m_ComboAxis);
|
|
DDX_Text(pDX, IDC_RANGE, m_nLC);
|
|
DDX_Text(pDX, IDC_CURSOR1, m_nCursor1);
|
|
DDX_Text(pDX, IDC_CURSOR2, m_nCursor2);
|
|
DDX_Text(pDX, IDC_CURSORROI, m_nCursorROI);
|
|
DDX_Text(pDX, IDC_CURSORROI_COUNT, m_nCursorROICount);
|
|
}
|
|
|
|
BEGIN_MESSAGE_MAP(CControlView, CFormView)
|
|
ON_WM_SIZE()
|
|
END_MESSAGE_MAP()
|
|
|
|
// CControlView 诊断
|
|
|
|
#ifdef _DEBUG
|
|
void CControlView::AssertValid() const
|
|
{
|
|
CFormView::AssertValid();
|
|
}
|
|
|
|
#ifndef _WIN32_WCE
|
|
void CControlView::Dump(CDumpContext& dc) const
|
|
{
|
|
CFormView::Dump(dc);
|
|
}
|
|
#endif
|
|
#endif //_DEBUG
|
|
|
|
void CControlView::SetCond(BOOL flag)
|
|
{
|
|
((CEdit*)GetDlgItem(IDC_COND))->EnableWindow(flag);
|
|
}
|
|
|
|
// CControlView 消息处理程序
|
|
void CControlView::OnSize(UINT nType, int cx, int cy)
|
|
{
|
|
CFormView::OnSize(nType, cx, cy);
|
|
CRect rect;
|
|
GetClientRect(&rect); // 获取当前客户区view大小
|
|
|
|
CSize size;
|
|
size.cx = rect.right - rect.left;
|
|
size.cy = rect.bottom - rect.top;
|
|
SetScrollSizes(MM_HIMETRIC, size); // 将CScrollView的大小设置为当前客户区大小
|
|
}
|
|
|
|
void CControlView::OnInitialUpdate()
|
|
{
|
|
CFormView::OnInitialUpdate();
|
|
|
|
// 添加运行模式
|
|
m_ComboMode.AddString((CString)"时间");
|
|
m_ComboMode.AddString((CString)"计数");
|
|
m_ComboMode.SetCurSel(0);
|
|
// 添加坐标轴模式
|
|
m_ComboAxis.AddString((CString)"线性");
|
|
m_ComboAxis.AddString((CString)"对数");
|
|
m_ComboAxis.SetCurSel(0);
|
|
}
|
|
|
|
void CControlView::OnUpdate(CView* /*pSender*/, LPARAM /*lHint*/, CObject* /*pHint*/)
|
|
{
|
|
}
|