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

📄 output.cpp

📁 针对工业无线传感器网络的应用特点
💻 CPP
字号:
// OUTPUT.cpp : implementation file
//

#include "stdafx.h"
#include "LJ.h"
#include "OUTPUT.h"
#include "OMP.h"
#include "LJDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// OUTPUT dialog
extern CLJDlg *pLJDlg;

OUTPUT::OUTPUT(CWnd* pParent /*=NULL*/)
	: CDialog(OUTPUT::IDD, pParent)
{
	//{{AFX_DATA_INIT(OUTPUT)
	m_KKX = 0.0f;
	m_KYX = 0.0f;
	m_SCX = 0.0f;
	m_YXX = 0.0f;
	//}}AFX_DATA_INIT
	m_KKX = pLJDlg ->KKX;
	m_KYX = pLJDlg ->KYX;
	m_SCX = pLJDlg ->SCX;
	m_YXX = pLJDlg ->YXX;
}


void OUTPUT::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(OUTPUT)
	DDX_Text(pDX, IDC_KKX, m_KKX);
	DDX_Text(pDX, IDC_KYX, m_KYX);
	DDX_Text(pDX, IDC_SCX, m_SCX);
	DDX_Text(pDX, IDC_YXX, m_YXX);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(OUTPUT, CDialog)
	//{{AFX_MSG_MAP(OUTPUT)
	ON_BN_CLICKED(IDC_COMP, OnComp)
	ON_BN_CLICKED(IDC_SAVE, OnSave)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// OUTPUT message handlers

void OUTPUT::OnComp() 
{
	// TODO: Add your control notification handler code here
	
	FILE *fp;
	if (NULL == (fp = fopen("abc","r")))
	{
		MessageBox(_T("请先保存比较对象!"));
		return;
	}
	COMP comp;
	comp.DoModal();
}

BOOL OUTPUT::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void OUTPUT::OnSave() 
{
	// TODO: Add your control notification handler code here
	FILE *fp;
	fp = fopen("abc","w");
	if (fp == NULL)
	{
		AfxMessageBox("打开文件失败!");
		return;
	}
	fprintf(fp,"%f,%f,%f,%f",m_KKX, m_KYX, m_SCX, m_YXX);
	fclose(fp);
}

⌨️ 快捷键说明

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