亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? settingview.cpp

?? 保護裝置的mbpc軟件
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// SettingView.cpp : implementation file
//

#include "stdafx.h"
#include "mbpc.h"
#include "SettingView.h"
#include "OnOffDlg.h"
#include "CSpreadSheet.h"

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

/////////////////////////////////////////////////////////////////////////////
// CSettingView

IMPLEMENT_DYNCREATE(CSettingView, CFormView)

CSettingView::CSettingView()
	: CFormView(CSettingView::IDD)
{
	//{{AFX_DATA_INIT(CSettingView)
	m_nSetId = 0;
	m_nSetSecId = 0;
	m_bNew = 0;
	m_bSaved = TRUE;
	//}}AFX_DATA_INIT
}

CSettingView::~CSettingView()
{
}

void CSettingView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CSettingView)
	DDX_Control(pDX, IDC_CURSET, m_ListCurrent);
	DDX_Control(pDX, IDC_EDIT1, m_EditId);
	DDX_Control(pDX, IDC_COMBSET2, m_CombSecId);
	DDX_Control(pDX, IDC_COMBSET, m_CombSet);
	DDX_Control(pDX, IDC_SETLIST, m_ListSet);
	DDX_CBIndex(pDX, IDC_COMBSET, m_nSetId);
	DDX_CBIndex(pDX, IDC_COMBSET2, m_nSetSecId);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CSettingView, CFormView)
	//{{AFX_MSG_MAP(CSettingView)
	ON_BN_CLICKED(IDC_CALL, OnCallSetting)
	ON_BN_CLICKED(IDC_CHGSET, OnChgset)
	ON_BN_CLICKED(IDC_ADDSEC, OnAddsec)
	ON_BN_CLICKED(IDC_SWITCHSET, OnSwitchset)
	ON_NOTIFY(NM_CLICK, IDC_SETLIST, OnClickSetlist)
	ON_BN_CLICKED(IDC_NEWSEC, OnNewsec)
	ON_BN_CLICKED(IDC_PRINT, OnPrint)
	ON_BN_CLICKED(IDC_CALLALL, OnCallall)
	ON_BN_CLICKED(IDC_PRINT2, OnPrint2)
	ON_WM_CLOSE()
	ON_WM_CANCELMODE()
	ON_WM_DESTROY()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSettingView diagnostics

#ifdef _DEBUG
void CSettingView::AssertValid() const
{
	CFormView::AssertValid();
}

void CSettingView::Dump(CDumpContext& dc) const
{
	CFormView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CSettingView message handlers

CMbpcDoc* CSettingView::GetDocument()
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMbpcDoc)));
	return (CMbpcDoc*)m_pDocument;
}

void CSettingView::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	int i;
	for(i = 0; i < GetDocument()->m_device_info.setting_sect_count; i++)
	{
		m_CombSet.DeleteString(0);
		m_CombSecId.DeleteString(0);
	}
	if(GetDocument()->m_bSetuped)
	{
		for(i = 0; i < GetDocument()->m_device_info.used_setting_sec_count; i++)
		{
			CString str;
			str.Format("%d",i + 1);
			m_CombSet.AddString(str);
			m_CombSecId.AddString(str);
		}
	}
	m_nSetSecId = GetDocument()->m_device_info.current_sect;
	CString str;
	str.Format("%d",m_nSetSecId + 1);
	this->m_EditId.SetWindowText(str);
	UpdateData(FALSE);

	LONG lStyle;
	m_ListSet.DeleteAllItems();
	m_ListCurrent.DeleteAllItems();
	for(i = 0; i < 4; i++)
	{
		m_ListCurrent.DeleteColumn(0);
		m_ListSet.DeleteColumn(0);
	}

	lStyle = GetWindowLong(m_ListSet.m_hWnd, GWL_STYLE);//獲取當前窗口style
	lStyle &= ~LVS_TYPEMASK; //清除顯示方式位
	lStyle |= LVS_REPORT; //設置style
	SetWindowLong(m_ListSet.m_hWnd, GWL_STYLE, lStyle);//設置style
	SetWindowLong(m_ListCurrent.m_hWnd, GWL_STYLE, lStyle);

	DWORD dwStyle = m_ListSet.GetExtendedStyle();
	dwStyle |= LVS_EX_FULLROWSELECT;//選中某行使整行高亮(只適用與report風格的listctrl)
	dwStyle |= LVS_EX_GRIDLINES;//網格線(只適用與report風格的listctrl)
	m_ListSet.SetExtendedStyle(dwStyle); //設置擴展風格
	m_ListCurrent.SetExtendedStyle(dwStyle); //設置擴展風格

	m_ListSet.InsertColumn(0, "定值ID", LVCFMT_LEFT, 50);
	m_ListSet.InsertColumn(1, "名稱", LVCFMT_LEFT, 100);
	m_ListSet.InsertColumn(2, "值", LVCFMT_LEFT, 85);
	m_ListSet.InsertColumn(3, "類型", LVCFMT_LEFT, 65);

	m_ListCurrent.InsertColumn(0, "定值ID", LVCFMT_LEFT, 50);
	m_ListCurrent.InsertColumn(1, "名稱", LVCFMT_LEFT, 100);
	m_ListCurrent.InsertColumn(2, "值", LVCFMT_LEFT, 85);
	m_ListCurrent.InsertColumn(3, "類型", LVCFMT_LEFT, 65);

	if(GetDocument()->m_bSetuped)
	{
		for(int i = 0; i < GetDocument()->m_device_info.item_in_sect; i++)
		{
			CString str;
			
			str.Format("%d",i + 1);
			int nRow = m_ListCurrent.InsertItem(i,str);

			m_ListCurrent.SetItemText(nRow, 1, (CString)GetDocument()->m_SettingInfo[i].setting_name);
			
			m_ListSet.InsertItem(i,str);
			
			switch(GetDocument()->m_SettingInfo[i].data_type)
			{
			case 0:
				{
					str.Format("%d %s", GetDocument()->m_Pk_value[GetDocument()->m_device_info.current_sect][i].bValue, GetDocument()->m_SettingInfo[i].setting_unit);
					m_ListCurrent.SetItemText(nRow, 2, str);

					m_ListCurrent.SetItemText(i, 3, "布爾型");
					break;
				}
			case 1:
				{
					str.Format("%d %s", GetDocument()->m_Pk_value[GetDocument()->m_device_info.current_sect][i].nValue, GetDocument()->m_SettingInfo[i].setting_unit);
					m_ListCurrent.SetItemText(nRow, 2, str);

					m_ListCurrent.SetItemText(i, 3, "整型");
					break;
				}
			case 2:
				{
					str.Format("%f %s", GetDocument()->m_Pk_value[GetDocument()->m_device_info.current_sect][i].fValue, GetDocument()->m_SettingInfo[i].setting_unit);
					m_ListCurrent.SetItemText(nRow, 2, str);

					m_ListCurrent.SetItemText(i, 3, "浮點型");
					break;
				}
			}
			if(GetDocument()->m_bSetSaved == FALSE)
			{
				m_ListSet.SetItemText(i, 1, (CString)GetDocument()->m_SettingInfo[i].setting_name);

				switch(GetDocument()->m_SettingInfo[i].data_type)
				{
				case 0:
					{
						str.Format("%d %s",GetDocument()->m_SetBuf[i].bValue, GetDocument()->m_SettingInfo[i].setting_unit);
						m_ListSet.SetItemText(i, 2, str);

						m_ListSet.SetItemText(i, 3, "布爾型");
						break;
					}
				case 1:
					{
						str.Format("%d %s",GetDocument()->m_SetBuf[i].nValue, GetDocument()->m_SettingInfo[i].setting_unit);
						m_ListSet.SetItemText(i, 2, str);

						m_ListSet.SetItemText(i, 3, "整型");
						break;
					}
				case 2:
					{
						str.Format("%f %s",GetDocument()->m_SetBuf[i].fValue, GetDocument()->m_SettingInfo[i].setting_unit);
						m_ListSet.SetItemText(i, 2, str);

						m_ListSet.SetItemText(i, 3, "浮點型");
						break;
					}
				}
			}
		}
	}
}

void CSettingView::OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView) 
{
	// TODO: Add your specialized code here and/or call the base class
	UpdateData();
	if(bActivate == FALSE)
	{
		//KillTimer(1);
	}
	else
	{
		if(m_bSaved == TRUE)
		{
			OnInitialUpdate();
		}
		//SetTimer(1,500,NULL);
	}
	CFormView::Invalidate();
	
	CFormView::OnActivateView(bActivate, pActivateView, pDeactiveView);
}

void CSettingView::OnCallSetting() 
{
	// TODO: Add your control notification handler code here
	CString str;
	if(GetDocument()->m_bSetuped)
	{
		UpdateData();
		if(GetDocument()->BuildSetFrame(this->m_nSetId))
		{
			memcpy(&GetDocument()->m_SetBuf,&GetDocument()->m_Pk_value[m_nSetId],sizeof(GetDocument()->m_SetBuf));

			for(int i = 0; i < GetDocument()->m_device_info.item_in_sect; i++)
			{				
				m_ListSet.SetItemText(i, 1, (CString)GetDocument()->m_SettingInfo[i].setting_name);

				switch(GetDocument()->m_SettingInfo[i].data_type)
				{
				case 0:
					{
						str.Format("%d %s",GetDocument()->m_SetBuf[i].bValue, GetDocument()->m_SettingInfo[i].setting_unit);
						m_ListSet.SetItemText(i, 2, str);

						m_ListSet.SetItemText(i, 3, "布爾型");
						break;
					}
				case 1:
					{
						str.Format("%d %s",GetDocument()->m_SetBuf[i].nValue, GetDocument()->m_SettingInfo[i].setting_unit);
						m_ListSet.SetItemText(i, 2, str);

						m_ListSet.SetItemText(i, 3, "整型");
						break;
					}
				case 2:
					{
						str.Format("%f %s",GetDocument()->m_SetBuf[i].fValue, GetDocument()->m_SettingInfo[i].setting_unit);
						m_ListSet.SetItemText(i, 2, str);

						m_ListSet.SetItemText(i, 3, "浮點型");
						break;
					}
				}
				GetDocument()->m_bSetSaved = FALSE;
			}
			if(m_nSetId == GetDocument()->m_device_info.current_sect)
			{
				for(int i = 0; i < GetDocument()->m_device_info.item_in_sect; i++)
				{
					CString str;

					m_ListSet.SetItemText(i, 1, (CString)GetDocument()->m_SettingInfo[i].setting_name);

					switch(GetDocument()->m_SettingInfo[i].data_type)
					{
					case 0:
						{
							str.Format("%d %s",GetDocument()->m_SetBuf[i].bValue, GetDocument()->m_SettingInfo[i].setting_unit);
							m_ListCurrent.SetItemText(i, 2, str);

							m_ListCurrent.SetItemText(i, 3, "布爾型");
							break;
						}
					case 1:
						{
							str.Format("%d %s",GetDocument()->m_SetBuf[i].nValue, GetDocument()->m_SettingInfo[i].setting_unit);
							m_ListCurrent.SetItemText(i, 2, str);

							m_ListCurrent.SetItemText(i, 3, "整型");
							break;
						}
					case 2:
						{
							str.Format("%f %s",GetDocument()->m_SetBuf[i].fValue, GetDocument()->m_SettingInfo[i].setting_unit);
							m_ListCurrent.SetItemText(i, 2, str);

							m_ListCurrent.SetItemText(i, 3, "浮點型");
							break;
						}
					}
				}
				UpdateData(FALSE);
			}
		}
	}
}

void CSettingView::OnChgset() 
{
	// TODO: Add your control notification handler code here
	if(GetDocument()->m_bSetuped)
	{
		UpdateData();
		if(this->MessageBox("確定要保存嗎?",NULL,MB_OKCANCEL) == IDOK)
		{
			if(GetDocument()->ChgSetCmd(this->m_nSetId, 1))
			{
				memcpy(&GetDocument()->m_Pk_value[m_nSetId],&GetDocument()->m_SetBuf,sizeof(GetDocument()->m_SetBuf));
				GetDocument()->m_bSetSaved = TRUE;
				if(m_bNew == 1)
				{
					CString str;
					str.Format("%d", m_nSetId);
					this->m_CombSecId.AddString(str);
					m_bNew = 0;
				}
				if(m_nSetId == GetDocument()->m_device_info.current_sect)
				{
					for(int i = 0; i < GetDocument()->m_device_info.item_in_sect; i++)
					{
						CString str;

						m_ListSet.SetItemText(i, 1, (CString)GetDocument()->m_SettingInfo[i].setting_name);

						switch(GetDocument()->m_SettingInfo[i].data_type)
						{
						case 0:
							{
								str.Format("%d %s",GetDocument()->m_SetBuf[i].bValue, GetDocument()->m_SettingInfo[i].setting_unit);
								m_ListCurrent.SetItemText(i, 2, str);

								m_ListCurrent.SetItemText(i, 3, "布爾型");
								break;
							}
						case 1:
							{
								str.Format("%d %s",GetDocument()->m_SetBuf[i].nValue, GetDocument()->m_SettingInfo[i].setting_unit);
								m_ListCurrent.SetItemText(i, 2, str);

								m_ListCurrent.SetItemText(i, 3, "整型");
								break;
							}
						case 2:
							{
								str.Format("%f %s",GetDocument()->m_SetBuf[i].fValue, GetDocument()->m_SettingInfo[i].setting_unit);
								m_ListCurrent.SetItemText(i, 2, str);

								m_ListCurrent.SetItemText(i, 3, "浮點型");
								break;
							}
						}
					}
					UpdateData(FALSE);
					m_bSaved = TRUE;
				}
			}
		}
		else
		{
			if(GetDocument()->ChgSetCmd(this->m_nSetId, 0))
			{
				memcpy(&GetDocument()->m_Pk_value[m_nSetId],&GetDocument()->m_SetBuf,sizeof(GetDocument()->m_SetBuf));
				GetDocument()->m_bSetSaved = TRUE;
				m_bSaved = TRUE;
			}
		}
	}
}

void CSettingView::OnAddsec() 
{
	// TODO: Add your control notification handler code here
	/*
	if(GetDocument()->m_bSetuped)
	{
		CString str;
		UpdateData();
		if(GetDocument()->AddSec(m_nSetId))
		{
			AfxMessageBox("添加成功");
			str.Format("%d", m_CombSecId.GetCount());
			m_CombSecId.AddString(str);
			GetDocument()->m_bSetSaved = TRUE;
		}
		else
		{
			if(m_CombSet.GetCount() > GetDocument()->m_device_info.used_setting_sec_count)
				m_CombSet.DeleteString(m_CombSet.GetCount() - 1);
		}
	}*/
}

void CSettingView::OnSwitchset() 
{
	// TODO: Add your control notification handler code here
	CString str;
	if(GetDocument()->m_bSetuped)
	{
		UpdateData();
		GetDocument()->SwitchSet(this->m_nSetSecId);

		if(GetDocument()->BuildSetFrame(this->m_nSetSecId))
		{
			str.Format("%d", (int)GetDocument()->m_device_info.current_sect + 1);
			this->m_EditId.SetWindowText(str);
			if(GetDocument()->m_bSetuped)
			{
				for(int i = 0; i < GetDocument()->m_device_info.item_in_sect; i++)
				{					
					switch(GetDocument()->m_SettingInfo[i].data_type)
					{
					case 0:
						{
							str.Format("%d %s", GetDocument()->m_Pk_value[GetDocument()->m_device_info.current_sect][i].bValue, GetDocument()->m_SettingInfo[i].setting_unit);
							m_ListCurrent.SetItemText(i, 2, str);
							m_ListSet.SetItemText(i, 2, str);
			
							m_ListCurrent.SetItemText(i, 3, "布爾型");
							m_ListSet.SetItemText(i,3, "布爾型");
							break;
						}
					case 1:
						{
							str.Format("%d %s", GetDocument()->m_Pk_value[GetDocument()->m_device_info.current_sect][i].nValue, GetDocument()->m_SettingInfo[i].setting_unit);
							m_ListCurrent.SetItemText(i, 2, str);
							m_ListSet.SetItemText(i,2, str);

							m_ListCurrent.SetItemText(i, 3, "整型");
							m_ListSet.SetItemText(i, 3, "整型");
							break;
						}
					case 2:
						{
							str.Format("%f %s", GetDocument()->m_Pk_value[GetDocument()->m_device_info.current_sect][i].fValue, GetDocument()->m_SettingInfo[i].setting_unit);
							m_ListCurrent.SetItemText(i, 2, str);
							m_ListSet.SetItemText(i,2, str);

							m_ListCurrent.SetItemText(i, 3, "浮點型");
							m_ListSet.SetItemText(i, 3, "浮點型");
							break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费观看高清完整版在线| 亚洲线精品一区二区三区| 日韩久久一区二区| 奇米综合一区二区三区精品视频 | 午夜精品成人在线视频| 国产在线一区观看| 欧美性色黄大片手机版| 国产欧美日韩精品一区| 久久电影国产免费久久电影| 91丨九色丨国产丨porny| 精品国产露脸精彩对白| 亚洲一级电影视频| 91网址在线看| 国产精品久久福利| 国产激情91久久精品导航| 日韩精品中文字幕在线不卡尤物| 一区二区三区欧美久久| 成人福利视频网站| 国产欧美中文在线| 国产剧情av麻豆香蕉精品| 日韩欧美国产一区在线观看| 午夜视频一区二区三区| 91福利国产成人精品照片| 中文字幕一区二区三区不卡在线| 国产黄色成人av| 久久久久久一级片| 经典三级一区二区| 日韩精品一区二区三区在线播放 | 成人免费观看av| 国产午夜精品福利| 国产福利精品一区二区| 欧美精品一区二区在线播放| 久久精品国产免费看久久精品| 欧美日本在线观看| 同产精品九九九| 在线观看亚洲成人| 午夜精品久久一牛影视| 欧美一区二区精品在线| 美女视频一区二区三区| 日韩一区二区三区高清免费看看| 日韩精品成人一区二区在线| 欧美一区二区视频在线观看2022| 奇米影视一区二区三区| 精品美女一区二区| 国产超碰在线一区| 亚洲女与黑人做爰| 欧美午夜精品理论片a级按摩| 一区二区三区免费| 欧美一二三区在线观看| 国产伦精品一区二区三区视频青涩 | 欧美一区二区二区| 国产一区美女在线| 亚洲丝袜制服诱惑| 欧美日本一道本| 国产一区二区影院| 国产精品国产三级国产aⅴ中文| www.久久精品| 日韩中文字幕区一区有砖一区| 日韩一区二区三区电影| 国产成人在线网站| 亚洲激情五月婷婷| 日韩精品一区二区三区中文不卡 | 日韩精品资源二区在线| 国产91综合一区在线观看| 亚洲视频在线一区| 欧美一级高清片| jlzzjlzz亚洲日本少妇| 日韩精品三区四区| 国产精品久久久久久亚洲毛片| 欧美日韩久久一区| 国产高清不卡一区| 亚洲风情在线资源站| 欧美精品一区二| 日韩电影一区二区三区四区| 亚洲精品一区二区三区影院| 99视频精品免费视频| 日日夜夜免费精品视频| 国产亚洲视频系列| 国产成人免费网站| 一区二区三区av电影| 日韩一卡二卡三卡国产欧美| 大尺度一区二区| 亚洲成人精品在线观看| 亚洲精品在线免费观看视频| 972aa.com艺术欧美| 亚洲大片在线观看| 国产精品久久久久久亚洲毛片| 欧美日韩久久不卡| 成人美女在线观看| 日韩电影网1区2区| 一色屋精品亚洲香蕉网站| 欧美日韩视频第一区| 成人精品gif动图一区| 亚洲综合一区在线| 国产欧美一二三区| 91精品国产欧美一区二区18| 99久久久国产精品免费蜜臀| 久久精品理论片| 亚洲三级在线播放| 久久奇米777| 欧美性猛片aaaaaaa做受| 99国产精品99久久久久久| 黑人巨大精品欧美黑白配亚洲 | 日本精品免费观看高清观看| 韩日av一区二区| 日韩在线一区二区三区| 国产精品理论片| 日韩免费看的电影| 日韩女优av电影| 欧美丰满高潮xxxx喷水动漫| 99久久国产综合精品女不卡| 国内成人免费视频| 七七婷婷婷婷精品国产| 一区二区三区免费看视频| 久久天天做天天爱综合色| 欧美一区二区三区四区高清| 欧美综合视频在线观看| 成人精品高清在线| 成人免费三级在线| 国产99久久久国产精品免费看| 免费看黄色91| 日本美女视频一区二区| 日韩av中文字幕一区二区三区| 夜夜嗨av一区二区三区网页| 亚洲人成在线播放网站岛国| 欧美成人福利视频| 精品少妇一区二区三区视频免付费| 欧美日韩一区中文字幕| 欧美三级日本三级少妇99| 精品视频在线看| 欧美视频精品在线| 欧美日韩亚洲国产综合| 一本色道综合亚洲| 欧美一区永久视频免费观看| 6080国产精品一区二区| 欧美日韩精品免费| 91精品国产综合久久福利 | 亚洲国产视频直播| 亚洲一线二线三线久久久| 亚洲精品视频一区| 一区二区三区欧美激情| 国产精品日产欧美久久久久| 亚洲欧美日本在线| 亚洲一区免费在线观看| 午夜精品久久久| 久久精品理论片| 国产一区二区视频在线播放| 九九国产精品视频| 色哟哟欧美精品| 欧洲另类一二三四区| 91精品欧美综合在线观看最新| 欧美成人aa大片| 久久久久久一二三区| 中文字幕一区二区三区不卡| 亚洲影视在线播放| 久久99日本精品| 成人午夜电影网站| 欧美三级视频在线观看| 日韩欧美国产wwwww| 日韩精品一区二区三区三区免费| 亚洲欧洲成人av每日更新| 亚洲国产综合人成综合网站| 久久精品国产免费看久久精品| 国产91清纯白嫩初高中在线观看| 在线看国产一区| 91在线视频免费91| 亚洲精品一区二区三区99| 成人免费在线播放视频| 首页综合国产亚洲丝袜| 国产99久久久国产精品免费看| 色婷婷av一区二区三区之一色屋| 欧美三级欧美一级| 国产女主播视频一区二区| 亚洲一二三四在线| 国产一区二区三区精品视频| 日本高清视频一区二区| 91精品久久久久久久久99蜜臂 | 日韩欧美电影一区| 依依成人精品视频| 国模大尺度一区二区三区| 色狠狠av一区二区三区| 精品国内片67194| 亚洲图片有声小说| 成人午夜精品在线| 欧美大片日本大片免费观看| 日韩一区中文字幕| 奇米影视一区二区三区小说| 色综合视频一区二区三区高清| 26uuu久久天堂性欧美| 香蕉久久一区二区不卡无毒影院| 国产精品一二二区| 在线成人小视频| 樱桃国产成人精品视频| 国产精品一二三四区| 亚洲精品一区二区三区四区高清 | 国产激情偷乱视频一区二区三区| 欧美电影免费观看完整版| 亚洲不卡一区二区三区| 91丨porny丨国产入口| 中文字幕av一区二区三区|