2022-03-20 15:14:44 +08:00
|
|
|
|
// ControlView.cpp: 实现文件
|
|
|
|
|
//
|
|
|
|
|
#include "pch.h"
|
|
|
|
|
|
|
|
|
|
#include "MCA.h"
|
|
|
|
|
#include "MCADoc.h"
|
|
|
|
|
#include "MainFrm.h"
|
2022-06-02 18:01:18 +08:00
|
|
|
|
#include "DetailView.h"
|
2022-03-20 15:14:44 +08:00
|
|
|
|
#include "ControlView.h"
|
|
|
|
|
|
|
|
|
|
// CControlView
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_DYNCREATE(CControlView, CFormView)
|
|
|
|
|
|
|
|
|
|
CControlView::CControlView()
|
|
|
|
|
: CFormView(IDD_DIALOG_CONTROL)
|
2022-05-31 22:21:20 +08:00
|
|
|
|
, m_nCond(100)
|
|
|
|
|
, m_nT0(0)
|
|
|
|
|
, m_nTime(0)
|
|
|
|
|
, m_nTimeStr((CString)'0')
|
|
|
|
|
, m_nTotalCount(0)
|
|
|
|
|
, m_nPartCount(0)
|
|
|
|
|
, m_nMaxCount(0)
|
2022-06-02 10:08:38 +08:00
|
|
|
|
, m_nLC(4)
|
2022-05-31 22:21:20 +08:00
|
|
|
|
, m_nCursor1(0)
|
|
|
|
|
, m_nCursor2(1023)
|
|
|
|
|
, m_nCursorROI(0)
|
|
|
|
|
, m_nCursorROICount(0)
|
2022-03-20 15:14:44 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CControlView::~CControlView()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CControlView::DoDataExchange(CDataExchange* pDX)
|
|
|
|
|
{
|
2022-05-31 22:21:20 +08:00
|
|
|
|
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);
|
2022-06-02 10:08:38 +08:00
|
|
|
|
DDX_Text(pDX, IDC_RANGE, m_nLC);
|
2022-05-31 22:21:20 +08:00
|
|
|
|
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);
|
2022-03-20 15:14:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CControlView, CFormView)
|
2022-05-30 16:36:01 +08:00
|
|
|
|
ON_WM_SIZE()
|
2022-06-02 10:08:38 +08:00
|
|
|
|
END_MESSAGE_MAP()
|
2022-03-20 15:14:44 +08:00
|
|
|
|
|
|
|
|
|
// CControlView 诊断
|
|
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
|
|
|
void CControlView::AssertValid() const
|
|
|
|
|
{
|
|
|
|
|
CFormView::AssertValid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef _WIN32_WCE
|
|
|
|
|
void CControlView::Dump(CDumpContext& dc) const
|
|
|
|
|
{
|
|
|
|
|
CFormView::Dump(dc);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif //_DEBUG
|
|
|
|
|
|
2022-06-02 18:01:18 +08:00
|
|
|
|
void CControlView::SetCond(BOOL flag)
|
2022-06-02 10:08:38 +08:00
|
|
|
|
{
|
2022-06-02 18:01:18 +08:00
|
|
|
|
((CEdit*)GetDlgItem(IDC_COND))->EnableWindow(flag);
|
2022-06-02 14:57:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-03-20 15:14:44 +08:00
|
|
|
|
// CControlView 消息处理程序
|
2022-05-30 16:36:01 +08:00
|
|
|
|
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的大小设置为当前客户区大小
|
2022-05-31 22:21:20 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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*/)
|
|
|
|
|
{
|
|
|
|
|
}
|