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

📄 graphdlg.cpp

📁 用can传输图像
💻 CPP
字号:
// GraphDlg.cpp : implementation file
//

#include "stdafx.h"
#include "zzMon.h"
#include "GraphDlg.h"

//添加mschart相关的头文件
#include "cwaxes.h"
#include "cwaxis.h"
#include "cwbinding.h"
#include "cwbindings.h"
#include "cwcursor.h"
#include "cwcursors.h"
#include "cwgraph.h"
#include "cwimage.h"
#include "cwlabels.h"
#include "cwpicturedisp.h"
#include "cwplot.h"
#include "cwplots.h"
#include "cwticks.h"
#include "cwvaluepair.h"
#include "cwvaluepairs.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CGraphDlg dialog


CGraphDlg::CGraphDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CGraphDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CGraphDlg)
	//}}AFX_DATA_INIT
	m_ulxVar = 0;
}


void CGraphDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CGraphDlg)
	DDX_Control(pDX, IDC_CWGRAPH1, m_graph);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CGraphDlg, CDialog)
	//{{AFX_MSG_MAP(CGraphDlg)
		// NOTE: the ClassWizard will add message map macros here
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGraphDlg message handlers

void CGraphDlg::DrawGraph(float f)
{
	BYTE tItemN;
	//	double x,y;
	//	x = (double)m_ulxVar*(double)1/24/60/60;
	VARIANT tVarPval;
	tVarPval.vt = VT_R8;
	VARIANT xVar;
	xVar.vt = VT_R8;
	xVar.dblVal = (double)m_ulxVar*(double)1/24/60/60;
	
	tItemN = 1;
	tVarPval.dblVal = (double)f;
	m_graph.GetPlots().Item(COleVariant(tItemN)).ChartXvsY(xVar,tVarPval);
	
//	tItemN = 2;
//	tVarPval.dblVal = (double)m_fT2;
//	m_graph.GetPlots().Item(COleVariant(tItemN)).ChartXvsY(xVar,tVarPval);
	
//	tItemN = 3;
//	tVarPval.dblVal = (double)m_uiH;
//	m_graph.GetPlots().Item(COleVariant(tItemN)).ChartXvsY(xVar,tVarPval);
	
	m_ulxVar++;
}

⌨️ 快捷键说明

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