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

📄 dlg_entry.cpp

📁 对日本KSG震动探测仪器编写的伴侣服务代码
💻 CPP
字号:
// (Version 1.00 :: 10-Mar-1999 :: Harutoshi Yoshida)
/*===================================================================
	俲俽俧(恔搙忣曬僱僢僩儚乕僋)
	-----------------------------------
		娤應揰搊榐堦棗
	-----------------------------------
	Program Name        : Dlg_Entry.cpp
	Program Start       : 26-Dec-1998
===================================================================*/

#include "stdafx.h"
#include "MSdefine.h"
#include "KSG.h"
#include "Dlg_Entry.h"

#include "msflexgrid.h"

#include "C_Proc.h"
#include "C_Work.h"
#include "KSG_Main.h"
#include "C_File.h"

#if !C_DEFINE_INC
	#include	"C_Define.h"
#endif


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

#define	GRID_COL_MAX	10						// 僌儕僢僪嵟戝悢

char	*EM_Grid_title[GRID_COL_MAX] = {		// 僌儕僢僪偺僞僀僩儖
	// ver 1.30
	///*00*/	"屌桳斣崋",
	///*01*/	"抂枛斣崋",
	///*02*/	"億乕僩斣崋",
	///*03*/	"巗挰懞喊霓",
	///*04*/	"娤應揰柤徧",
	///*05*/	"柤徧(杜)",
	///*06*/	"揹榖斣崋侾",
	///*07*/	"揹榖斣崋俀",
	///*08*/	"棙梡宍懺",
	///*09*/	"晅壛婡擻"
	/*00*/	"屌桳斣崋",
	/*01*/	"抂枛斣崋",
	/*02*/	"Port斣崋",
	/*03*/	"巗嬫奨曇崋",
	/*04*/	"娤應揰柤徧",
	/*05*/	"柤徧(敿妏)",
	/*06*/	"揹榖斣崋侾",
	/*07*/	"揹榖斣崋俀",
	/*08*/	"棙梡宍懺",
	/*09*/	"晅壛婡擻"
};

/////////////////////////////////////////////////////////////////////////////
// CDlg_Entry 僟僀傾儘僌


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


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


BEGIN_MESSAGE_MAP(CDlg_Entry, CDialog)
	//{{AFX_MSG_MAP(CDlg_Entry)
	ON_WM_CLOSE()
	ON_BN_CLICKED(IDC_BTN_EDIT, OnBtnEdit)
	ON_BN_CLICKED(IDC_BTN_MENU, OnBtnMenu)
	ON_BN_CLICKED(IDC_BTN_PRINT, OnBtnPrint)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

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

/*=====================================
						m:25-Dec-1998
@p	<< initialize >>
=====================================*/
void	CDlg_Entry::Work2String(char buf[11][30], int enp)
{
	int a;

	// 屌桳斣崋
	sprintf(buf[0], "%d", AdrEntDat[enp].DevNum+1);
	// 抂枛斣崋
	sprintf(buf[1], "%d", AdrEntDat[enp].TrmNo);
	// 億乕僩斣崋
	a = AdrEntDat[enp].PorNo;
	if (a){
		if (a > 2){		// comm 3 ~ = modem
			// ver 1.30
			//sprintf(buf[2], "儌僨儉 %d", AdrEntDat[enp].PorNo-2);
			sprintf(buf[2], "Modem %d", AdrEntDat[enp].PorNo-2);
		}
		else{			// comm 1 / comm 2
			sprintf(buf[2], "Com%d", AdrEntDat[enp].PorNo);
		}
	}
	else{
		sprintf(buf[2], "NONE", AdrEntDat[enp].PorNo);
	}
	// 巗挰懞僐乕僪
	sprintf(buf[3], "%d", AdrEntDat[enp].CityNo);
	// 娤應揰柤徧
	sprintf(buf[4], "%s", AdrEntDat[enp].AdrName);

	// 10-Feb-1999
	// 柤徧(杜)
	sprintf(buf[5], "%s", AdrEntDat[enp].KanaName);

	// 揹榖斣崋侾
	sprintf(buf[6], "%s", AdrEntDat[enp].Tel_1);
	buf[6][0] = NULL;			// 尰嵼枹巊梡
	// 揹榖斣崋俀
	sprintf(buf[7], "%s", AdrEntDat[enp].Tel_2);
	buf[7][0] = NULL;			// 尰嵼枹巊梡
	// 棙梡宍懺
	sprintf(buf[8], "%d", AdrEntDat[enp].WavEnb);
	buf[8][0] = NULL;			// 尰嵼枹巊梡
	// 晅壛婡擻
	sprintf(buf[9], "%d", AdrEntDat[Ent_p].WavSav);
}

/*=====================================
						m:25-Dec-1998
@p	<< initialize >>
=====================================*/
BOOL CDlg_Entry::OnInitDialog() 
{
	CDialog::OnInitDialog();
	int err, row, col;
	CMSFlexGrid*	pGrid;
	CC_File cFile;
	char buf[11][30];

	// 嶲徠僷儔儊乕僞撉崬傒
	err  = cFile.C_ParaLoad(2);		// 06:庴怣僷儔儊乕僞

	pOpenDlg = this;

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

	pGrid = (CMSFlexGrid*)GetDlgItem(IDC_MSFLEXGRID);
	pGrid->SetCols(GRID_COL_MAX);
	pGrid->SetRow(0);
	for (col=0;col<GRID_COL_MAX;col++){
		pGrid->SetCol(col);
		pGrid->SetCellAlignment(flexAlignCenterCenter);
		pGrid->SetText(EM_Grid_title[col]);
		pGrid->SetColWidth(col, 1140);
	}

	for (row=1;row<MAX_CH+1;row++){
		pGrid->SetRow(row);
		Work2String(buf, row-1);
		for (col=0;col<GRID_COL_MAX;col++){
			pGrid->SetCol(col);
			pGrid->SetCellAlignment(flexAlignCenterCenter);
			pGrid->SetText(buf[col]);
		}
	}
	pGrid->SetRow(Ent_p+1);
	pGrid->SetCol(0);
	OnClickMsflexgrid();

	return (TRUE);
}

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

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

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

/*=====================================
@p	<< 曇廤儃僞儞 >>
=====================================*/
void CDlg_Entry::OnBtnEdit() 
{
	DspReqStack(DSP_EDT);
}

/*=====================================
@p	<< 報嶞儃僞儞 >>
=====================================*/
void CDlg_Entry::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_Entry::OnBtnMenu() 
{
	DspReqStack(DSP_MNT);
}

BEGIN_EVENTSINK_MAP(CDlg_Entry, CDialog)
    //{{AFX_EVENTSINK_MAP(CDlg_Entry)
	ON_EVENT(CDlg_Entry, IDC_MSFLEXGRID, -600 /* Click */, OnClickMsflexgrid, VTS_NONE)
	ON_EVENT(CDlg_Entry, IDC_MSFLEXGRID, -605 /* MouseDown */, OnMouseDownMsflexgrid, VTS_I2 VTS_I2 VTS_I4 VTS_I4)
	//}}AFX_EVENTSINK_MAP
END_EVENTSINK_MAP()

/*=====================================
						m:25-Dec-1999
@p	<< 僌儕僢僪巜掕 >>
=====================================*/
void	CDlg_Entry::OnClickMsflexgrid() 
{
	CMSFlexGrid* fxGrid;
	long col, row;

	fxGrid = (CMSFlexGrid*)this->GetDlgItem(IDC_MSFLEXGRID);
	col = fxGrid->GetColSel();
	if (col != (GRID_COL_MAX-1) ){
		row = fxGrid->GetRow();
		fxGrid->SetRow(row);
		fxGrid->SetCol(0);
		fxGrid->SetRowSel(row);
		fxGrid->SetColSel(GRID_COL_MAX-1);
		Ent_p = row - 1;
	}
}

/*=====================================
@p	<< 僌儕僢僪儅僂僗僟僂儞 >>
=====================================*/
void CDlg_Entry::OnMouseDownMsflexgrid(short Button, short Shift, long x, long y) 
{
	OnClickMsflexgrid();
}

⌨️ 快捷键说明

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