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

📄 dlg_diag.cpp

📁 对日本KSG震动探测仪器编写的伴侣服务代码
💻 CPP
字号:
// (Version 1.00 :: 10-Mar-1999 :: Harutoshi Yoshida)

// Dlg_Diag.cpp : 僀儞僾儕儊儞僥乕僔儑儞 僼傽僀儖
//

//俁惉暘崌惉帪暘昩偼側偔側偭偨


#include "stdafx.h"
#include "KSG.h"
#include "Dlg_Diag.h"

#include "C_Work.h"
#include "KSG_Main.h"
#include "KSG_File.h"
#include "KSG_Print.h"
#include "C_Proc.h"
#include "CqMemDC.h"						// ver 1.30

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

/////////////////////////////////////////////////////////////////////////////
// CDlg_Diag 僟僀傾儘僌


CDlg_Diag::CDlg_Diag(CWnd* pParent /*=NULL*/)
	: CDialog(CDlg_Diag::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlg_Diag)
		// 儊儌 - ClassWizard 偼偙偺埵抲偵儅僢僺儞僌梡偺儅僋儘傪捛壛傑偨偼嶍彍偟傑偡丅
	//}}AFX_DATA_INIT
}


void CDlg_Diag::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlg_Diag)
		// 儊儌 - ClassWizard 偼偙偺埵抲偵儅僢僺儞僌梡偺儅僋儘傪捛壛傑偨偼嶍彍偟傑偡丅
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlg_Diag, CDialog)
	//{{AFX_MSG_MAP(CDlg_Diag)
	ON_WM_CLOSE()
	ON_WM_SIZE()
	ON_WM_PAINT()
	ON_BN_CLICKED(IDC_BTN_FILE, OnBtnFile)
	ON_BN_CLICKED(IDC_BTN_PRINT, OnBtnPrint)
	ON_BN_CLICKED(IDC_BTN_MENU, OnBtnMenu)
	ON_CBN_SELCHANGE(IDC_CMB_MAG, OnSelchangeCmbMag)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlg_Diag 儊僢僙乕僕 僴儞僪儔

/*=====================================
@p	<< Dialog弶婜壔 >>
=====================================*/
BOOL CDlg_Diag::OnInitDialog() 
{
	CWnd*	pWnd;
	char	buf[10];
	int		i;

	CDialog::OnInitDialog();
	pOpenDlg = this;							// Dialog Pointer奿擺

	// 儊僯儏乕儃僞儞(倃)丗柍岠
	GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, MF_DISABLED);

	#if !HY_KAI				// 18-Feb-2004 夵憿
		ShowWindow(SW_SHOWMAXIMIZED);				// 嵟戝壔昞帵
	#endif
	pWnd = GetDlgItem(IDC_CMB_MAG);
	for (i=0; i<3; i++) {
		sprintf(buf, "倃%d", Diag_mag_tbl[i]);
		((CComboBox*)pWnd)->AddString(buf);
	}
	Diag_mag = 1;								// 弶婜攞棪 -> x10
	((CComboBox*)pWnd)->SetCurSel(Diag_mag);

	return TRUE;  // 僐儞僩儘乕儖偵僼僅乕僇僗傪愝掕偟側偄偲偒丄栠傝抣偼 TRUE 偲側傝傑偡
	              // 椺奜: OCX 僾儘僷僥傿 儁乕僕偺栠傝抣偼 FALSE 偲側傝傑偡
}

/*=====================================
@p	<< Dialog Close >>
=====================================*/
void CDlg_Diag::OnClose() 
{
	dialog_close(DSP_DIAG);
	CDialog::OnOK();
}

/*=====================================
@p	<< Dialog 儕僒僀僘 >>
=====================================*/
void CDlg_Diag::OnSize(UINT nType, int cx, int cy) 
{
	CWnd*	pWnd;
	CRect	mRect, pRect, fRect, cRect;
	int		w, h, woff = -10, hoff = -10;

	CDialog::OnSize(nType, cx, cy);

	if (nType == SIZE_MINIMIZED) return;		// 傾僀僐儞昞帵?
	Area_w = cx;
	Area_h = cy;

	//-----( 儊僯儏乕儃僞儞埵抲曄峏 )-----
	pWnd = GetDlgItem(IDC_BTN_MENU);
	if (pWnd == NULL) return;
	pWnd->GetWindowRect(mRect);
	w = mRect.right  - mRect.left;
	h = mRect.bottom - mRect.top;
	mRect.top    = cy - h + hoff;
	mRect.left   = cx - w + woff;
	mRect.bottom = mRect.top  + h;
	mRect.right  = mRect.left + w;
	pWnd->MoveWindow(mRect, TRUE);

	//-----( 報嶞儃僞儞埵抲曄峏 )-----
	pWnd = GetDlgItem(IDC_BTN_PRINT);
	if (pWnd == NULL) return;
	pWnd->GetWindowRect(pRect);
	pRect.top    = mRect.top;
	pRect.left   = mRect.left - w;
	pRect.bottom = mRect.bottom;
	pRect.right  = pRect.left + w;
	pWnd->MoveWindow(pRect, TRUE);

	//-----( 抬操撉崬儃僞儞埵抲曄峏 )-----
	pWnd = GetDlgItem(IDC_BTN_FILE);
	if (pWnd == NULL) return;
	pWnd->GetWindowRect(fRect);
	fRect.top    = mRect.top;
	fRect.left   = -woff;
	fRect.bottom = mRect.bottom;
	fRect.right  = fRect.left + w;
	pWnd->MoveWindow(fRect, TRUE);

	//-----( 攞棪僐儞儃儃僢僋僗埵抲曄峏 )-----
	pWnd = GetDlgItem(IDC_CMB_MAG);
	if (pWnd == NULL) return;
	pWnd->GetWindowRect(cRect);
	cRect.top    = fRect.top;
	cRect.left   = fRect.right + 5;
	cRect.bottom = fRect.bottom + ((fRect.bottom - fRect.top) * 3);
	cRect.right  = cRect.left + w;
	pWnd->MoveWindow(cRect, TRUE);
}

/*=====================================
@p	<< Dialog 昤夋 >>
=====================================*/
void CDlg_Diag::OnPaint() 
{
	int tmp;

	CPaintDC dc(this); // 昤夋梡偺僨僶僀僗 僐儞僥僉僗僩
	// 昤夋梡儊僢僙乕僕偲偟偰 CDialog::OnPaint() 傪屇傃弌偟偰偼偄偗傑偣傫

	// ver 1.30
	CRect pRect;

	GetWindowRect(&pRect);
	ScreenToClient(&pRect);
	CCqMemDC memDC((CDC*)&dc, pRect);
	memDC.FillSolidRect(pRect, ::GetSysColor(COLOR_3DFACE));

	tmp = Print_num;
	Print_num = 0;
	// ver 1.30
	//DiagramDraw((CDC*)&dc);
	DiagramDraw(&memDC);
	Print_num = tmp;
}

/*=====================================
@p	<< 俷俲儃僞儞 >>
=====================================*/
void CDlg_Diag::OnOK() 
{
	return;
}

/*=====================================
@p	<< 僉儍儞僙儖儃僞儞 >>
=====================================*/
void CDlg_Diag::OnCancel() 
{
	return;
}

/*=====================================
@p	<< 僼傽僀儖撉傒崬傒儃僞儞 >>
=====================================*/
void CDlg_Diag::OnBtnFile() 
{
// 18-Feb-1999
//	struct S_RCV_WAV	wdat;
//	struct S_Dsp_Data	ddat;

	if (CSV_file_read(&Sel_Wave.dat, &Sel_Data) == IDOK) {	// CSV僨乕僞庢摼
		RedrawWindow(NULL, NULL, RDW_INVALIDATE);	// 夋柺嵞昞帵
	}
//	struct S_RCV_WAV	wdat;
//	struct S_Dsp_Data	ddat;
//	if (CSV_file_read(&wdat.dat, &ddat) == IDOK) {	// CSV僨乕僞庢摼
//		Sel_Wave = wdat;
//		Sel_Data = ddat;
//		RedrawWindow(NULL, NULL, RDW_INVALIDATE);	// 夋柺嵞昞帵
//	}
}

/*=====================================
@p	<< 報嶞儃僞儞 >>
=====================================*/
void CDlg_Diag::OnBtnPrint() 
{
	Print_dat[0] = 0;							// MAX/徻嵶
	Print_dat[1] = 0;							// 尰/慡儁乕僕
	Print_dat[2] = 1;							// 尰瓦凹轓o.
	Print_dat[3] = 1;							// 慡僨乕僞悢
	Print_dat[4] = 1;							// 報嶞枃悢
	Print_req = Disp.Num;
}

/*=====================================
@p	<< 栠傞儃僞儞 >>
=====================================*/
void CDlg_Diag::OnBtnMenu() 
{
	Sel_Data.File[0] = NULL;
	DspReqStack(DSP_WAVE);
}

/*=====================================
@p	<< 攞棪僐儞儃儃僢僋僗慖戰 >>
=====================================*/
void CDlg_Diag::OnSelchangeCmbMag() 
{
	CWnd*	pWnd;
	int		mag;

	pWnd = GetDlgItem(IDC_CMB_MAG);
	mag = ((CComboBox*)pWnd)->GetCurSel();
	if (Diag_mag != mag) {
		Diag_mag = mag;
		RedrawWindow(NULL, NULL, RDW_INVALIDATE);
	}
}

⌨️ 快捷键说明

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