📄 curvewnddlg.cpp
字号:
// CurveWndDlg.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "CurveWndDlg.h"
#include "FLADS.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCurveWndDlg dialog
extern CFLADSApp theApp;
CCurveWndDlg::CCurveWndDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCurveWndDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCurveWndDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CCurveWndDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCurveWndDlg)
DDX_Control(pDX, IDC_CECURVE, m_cecurve);
DDX_Control(pDX, IDC_CURVEDATA, m_curvedata);
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCurveWndDlg, CDialog)
//{{AFX_MSG_MAP(CCurveWndDlg)
ON_WM_CTLCOLOR()
ON_MESSAGE(WM_STARTSAMPLE,OnStartSample)
ON_MESSAGE(WM_STOPSAMPLE, OnStopSample)
ON_MESSAGE(WM_LEVELPLAY, OnLevelPlay)
ON_MESSAGE(WM_VERTYPLAY, OnVertyPlay)
ON_MESSAGE(WM_ESCFILE, OnEscPlay)
ON_MESSAGE(WM_FLASHCURVE, OnFlashCurve)
ON_WM_DESTROY()
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCurveWndDlg message handlers
HBRUSH CCurveWndDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if( pWnd->m_hWnd == m_cecurve.m_hWnd)
{
pDC->SetBkMode(TRANSPARENT);
return hblackbrush;
}
// TODO: Return a different brush if the default is not desired
return hbr;
}
BOOL CCurveWndDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
hblackbrush=CreateSolidBrush(RGB(0,0,0));
theApp.ControlMode= Curve_Window;
SetTimer (Curve_TIMER,500,NULL);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CCurveWndDlg::OnStartSample()
{
double dx;
int i;
theApp.FSTATE=FileNewCreate;
theApp.TSamplefg=0xff;
theApp.startYear = theApp.Year;
theApp.startMonth = theApp.Month;
theApp.startDay = theApp.Day;
theApp.startHour = theApp.Hour;
theApp.startMinute = theApp.Minute;
theApp.startSecond = theApp.Second;
theApp.CTransConSpeed=theApp.trans_speed_set;
theApp.curve_rh1_set = theApp.rh1_temper_set;
theApp.curve_rh2_set = theApp.rh2_temper_set;
theApp.curve_rh3_set = theApp.rh3_temper_set;
theApp.curve_sl_set = theApp.sl_temper_set;
theApp.curve_ws1_set = theApp.ws1_temper_set;
theApp.curve_ws2_set = theApp.ws2_temper_set;
m_cecurve.SendMessage(WM_TIMER);
m_curvedata.SendMessage(WM_TIMER);
}
void CCurveWndDlg::OnStopSample()
{
theApp.TSamplefg=0x00;
theApp.finishYear = theApp.Year;
theApp.finishMonth = theApp.Month;
theApp.finishDay = theApp.Day;
theApp.finishHour = theApp.Hour;
theApp.finishMinute = theApp.Minute ;
theApp.finishSecond = theApp.Second;
m_curvedata.SendMessage(WM_TIMER);
}
void CCurveWndDlg::OnLevelPlay()
{
if(theApp.lTESTfg==0) theApp.lTESTfg=0xff;
else{
theApp.lTESTfg=0;
theApp.init_curve_flag=0xff;
}
m_cecurve.SendMessage(WM_TIMER);
m_curvedata.SendMessage(WM_TIMER);
}
void CCurveWndDlg::OnVertyPlay()
{
if(theApp.vTESTfg==0) theApp.vTESTfg=0xff;
else {
theApp.vTESTfg=0;
theApp.init_curve_flag=0xff;
}
m_cecurve.SendMessage(WM_TIMER);
m_curvedata.SendMessage(WM_TIMER);
}
void CCurveWndDlg::OnEscPlay()
{
int i,j;
CString string;
theApp.TSamplefg=0x00;
theApp.init_curve_flag=0xff;
theApp.TDisplayfg=0x00;
theApp.vTESTfg=0;
theApp.lTESTfg=0;
m_curvedata.SendMessage(WM_TIMER);
for (i=0; i<600; i++)
{
theApp.TEMT[0][i]=0;
theApp.TEMT[1][i]=0;
theApp.TEMT[2][i]=0;
}
}
void CCurveWndDlg::OnFlashCurve()
{
m_curvedata.SendMessage(WM_TIMER);
}
void CCurveWndDlg::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
KillTimer(Curve_TIMER);
DeleteObject(hblackbrush);
}
void CCurveWndDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
m_curvedata.SendMessage(WM_TIMER);
CDialog::OnTimer(nIDEvent);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -