Ejemplo n.º 1
0
// 停止
void CTabSample::OnStop(void)
{
	CButton* iconbutton = NULL;
	CStatic* iconstatic = NULL;
	CButton* pButton = NULL;

	iconstatic =(CStatic*)this->GetDlgItem(IDC_STATIC_LAUX);
	iconstatic->SetIcon(m_iconLAUXDisconnected);
	iconstatic = NULL;

	for (int i=0; i<GraphViewNum; i++)
	{
		ProcessMessages();
		iconbutton = (CButton*)this->GetDlgItem(m_iButtonIDFDU[i]);
		iconbutton->SetIcon(m_iconFDUDisconnected);
		iconbutton = NULL;
		pButton = (CButton*)GetDlgItem(m_iCheckIDInstrumentFDU[i]);
		pButton->SetCheck(0);
		pButton = NULL;
		pButton = (CButton*)GetDlgItem(m_iCheckIDNoiseFDU[i]);
		pButton->SetCheck(0);
		pButton = NULL;
	}
	delete iconstatic;
	delete iconbutton;
	delete pButton;

	GetDlgItem(IDC_EDIT_SENDPORT)->EnableWindow(TRUE);
	GetDlgItem(IDC_CHECK_HEARTBEAT)->EnableWindow(FALSE);
}
// 根据IP地址显示设备断开连接的图标
//************************************
// Method:    OnShowDisconnectedIcon
// FullName:  CInstrumentList::OnShowDisconnectedIcon
// Access:    protected 
// Returns:   void
// Qualifier:
// Parameter: unsigned int uiIPAddress
//************************************
void CInstrumentList::OnShowDisconnectedIcon(unsigned int uiIPAddress)
{
	CButton* iconbutton = NULL;
	CStatic* iconstatic = NULL;
	CButton* pButton = NULL;

	for (int i=0 ;i<= InstrumentNum; i++)
	{
		ProcessMessages();
		if (uiIPAddress == (IPSetAddrStart + i * IPSetAddrInterval))
		{
			if (i == 0)
			{
				iconstatic =(CStatic*)m_pwnd->GetDlgItem(IDC_STATIC_LAUX);
				iconstatic->SetIcon(m_iconLAUXDisconnected);
			}
			else
			{
				iconbutton = (CButton*)m_pwnd->GetDlgItem(m_iButtonIDFDU[i-1]);
				iconbutton->SetIcon(m_iconFDUDisconnected);
				pButton = (CButton*)m_pwnd->GetDlgItem(m_iCheckIDInstrumentFDU[i-1]);
				pButton->SetCheck(0);
			}
			break;
		}
	}
}
Ejemplo n.º 3
0
void CCanvasSizeDlg::SetOrientationPanel(bool m_bWidthEnlargened, bool m_bHeightEnlargened)
{
	UpdateData();
	ClearIcon();
	int left = ((m_Orientation-1)%3 < (m_Orientation)%3)? m_Orientation-1 : -1;
	int right =  ((m_Orientation+1)%3 > m_Orientation%3)? m_Orientation+1 : -1;
	int up =  ( m_Orientation-3 >= 0)? m_Orientation-3 : -1;
	int down =  ( m_Orientation+3 <= 8)? m_Orientation+3 : -1;
		
	if (m_bWidthEnlargened) {
		if (left >= 0) {
			CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0 + left);
			pButton->SetIcon(m_hLeft);
		}
		if (right >= 0) {
			CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0 + right);
			pButton->SetIcon(m_hRight);
		}
	}
	else {
		if (left >= 0) {
			CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0 + left);
			pButton->SetIcon(m_hRight);
		}
		if (right >= 0) {
			CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0 + right);
			pButton->SetIcon(m_hLeft);
		}
	}

	if (m_bHeightEnlargened) {
		if (up >= 0) {
			CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0 + up);
			pButton->SetIcon(m_hUp);
		}
		if (down >= 0) {
			CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0 + down);
			pButton->SetIcon(m_hDown);
		}
	}
	else {
		if (up >= 0) {
			CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0 + up);
			pButton->SetIcon(m_hDown);
		}
		if (down >= 0) {
			CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0 + down);
			pButton->SetIcon(m_hUp);
		}
	}


}
Ejemplo n.º 4
0
void CDLgBarH::OnButtonStartStop() 
{
	KRS_running = !KRS_running;
	if (!KRS_running)
	{
		StartTimeOut(m_MapParamDefault);
		if (KRS_project_flag & KRS_PRJ_FLAG_STAGES)
			StartTimeOut(m_MapParamCM_additional_only);
		KRS_SendTOsToDB();
	}
	CButton* b = (CButton*)GetDlgItem(IDC_BUTTON_START_STOP);
	b->SetIcon(KRS_app.LoadIcon(KRS_running?IDI_ICON_STOP:IDI_ICON_START));
}
Ejemplo n.º 5
0
// 重置设备按键的图标
void CTabSample::OnResetButtonIcon(void)
{
    CButton* iconbutton = NULL;
    CStatic* iconstatic = NULL;
    iconstatic =(CStatic*)this->GetDlgItem(IDC_STATIC_LAUX);
    iconstatic->SetIcon(m_iconLAUXDisconnected);
    iconstatic = NULL;

    for (int i=0; i<InstrumentNum; i++)
    {
        ProcessMessages();
        iconbutton = (CButton*)this->GetDlgItem(m_iButtonIDFDU[i]);
        iconbutton->SetIcon(m_iconFDUDisconnected);
        iconbutton = NULL;
    }
}
Ejemplo n.º 6
0
void CCanvasSizeDlg::ClearIcon(void)
{
	CButton *pButton = (CButton*)GetDlgItem(IDC_BUTTON0);
	pButton->SetIcon(NULL);
	pButton = (CButton*)GetDlgItem(IDC_BUTTON1);
	pButton->SetIcon(NULL);
	pButton = (CButton*)GetDlgItem(IDC_BUTTON2);
	pButton->SetIcon(NULL);
	pButton = (CButton*)GetDlgItem(IDC_BUTTON3);
	pButton->SetIcon(NULL);
	pButton = (CButton*)GetDlgItem(IDC_BUTTON4);
	pButton->SetIcon(NULL);
	pButton = (CButton*)GetDlgItem(IDC_BUTTON5);
	pButton->SetIcon(NULL);
	pButton = (CButton*)GetDlgItem(IDC_BUTTON6);
	pButton->SetIcon(NULL);
	pButton = (CButton*)GetDlgItem(IDC_BUTTON7);
	pButton->SetIcon(NULL);
	pButton = (CButton*)GetDlgItem(IDC_BUTTON8);
	pButton->SetIcon(NULL);
	
}
Ejemplo n.º 7
0
BOOL CServerGUIDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	// TODO: Add extra initialization here
	CButton *pButton = (CButton *)GetDlgItem(BTN_START_SERVER);
	if (pButton && pButton->GetSafeHwnd())
	{
		pButton->SetIcon((HICON)LoadImage(AfxGetApp()->m_hInstance,
			MAKEINTRESOURCE(ID_START),
			IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR));
	}
	serverStatus = false;
	ms = new MessageSocket((CEdit*) GetDlgItem(EC_SERVER_STATUS));
	return TRUE;  // return TRUE  unless you set the focus to a control
}
Ejemplo n.º 8
0
LRESULT CDLgBarH::OnMyInitDialog(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
	CButton *b;
	b = (CButton*)GetDlgItem(IDC_BUTTON_WK__MINUS);
	b->SetIcon(KRS_app.LoadIcon(IDI_ICON_MINUS));
	b = (CButton*)GetDlgItem(IDC_BUTTON_WK__PLUS);
	b->SetIcon(KRS_app.LoadIcon(IDI_ICON_PLUS));
	b = (CButton*)GetDlgItem(IDC_BUTTON_NULL2_MINUS);
	b->SetIcon(KRS_app.LoadIcon(IDI_ICON_MINUS));
	b = (CButton*)GetDlgItem(IDC_BUTTON_NULL2_PLUS);
	b->SetIcon(KRS_app.LoadIcon(IDI_ICON_PLUS));
	b = (CButton*)GetDlgItem(IDC_BUTTON_LBT_MINUS);
	b->SetIcon(KRS_app.LoadIcon(IDI_ICON_MINUS));
	b = (CButton*)GetDlgItem(IDC_BUTTON_LBT_PLUS);
	b->SetIcon(KRS_app.LoadIcon(IDI_ICON_PLUS));


	b = (CButton*)GetDlgItem(IDC_BUTTON_START_STOP);
	b->SetIcon(KRS_app.LoadIcon(KRS_running?IDI_ICON_STOP:IDI_ICON_START));

	return true;
}
Ejemplo n.º 9
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	idTimer = 0;
	picWidth = 4.0;
	picHeight = 3.0;
	picInchOrMM = 0; // inches
	memset(picFileName, 0, sizeof(picFileName));

	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	btnPlay = GetDlgItem(IDC_PLAY);
	btnStop = GetDlgItem(IDC_STOP);
	btnLoop = GetDlgItem(IDC_LOOP);
	RECT btnrc;
	btnPlay.GetClientRect(&btnrc);
	int cxy;
	if ((btnrc.bottom - btnrc.top) < 30)
		cxy = 16;
	else
		cxy = 32;
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_PLAY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnPlay.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStop.SetIcon(hIcon);
	btnStop.EnableWindow(FALSE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_LOOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnLoop.SetIcon(hIcon);

	CButton btnStyle = GetDlgItem(IDC_SAWTOOTH);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SAW), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SQUARE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SQUARE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SIN);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SIN), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_RAMP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_RAMP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_COPYCLIP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_COPY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVEPIC);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_DISK), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVEWAV);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_WVFILE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_HELP2);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	pitchEd = GetDlgItem(IDC_PITCH);
	pitchEd.SetWindowText("48");

	for (int ndx = 0; ndx < WFI_MAXPART; ndx++)
	{
		sliders[ndx] = GetDlgItem(IDC_PART1+ndx);
		sliders[ndx].SetRange(0, 200, FALSE);
		sliders[ndx].SetTicFreq(20);
		sliders[ndx].SetLineSize(1);
		sliders[ndx].SetPageSize(10);
		levels[ndx] = GetDlgItem(IDC_LVL1+ndx);
	}

	SetDlgItemInt(IDC_PERIODS, 1);

	RECT rcPlot;
	CWindow frm = GetDlgItem(IDC_WVFRAME);
	frm.GetClientRect(&rcPlot);
	frm.MapWindowPoints(m_hWnd, &rcPlot);
	InflateRect(&rcPlot, -2, -2);
	wndPlot.Create(m_hWnd, rcPlot, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER, 0/*WS_EX_CLIENTEDGE*/);
	frm.ShowWindow(SW_HIDE);

	gibbs = FALSE;
	BOOL dummy;
	OnSin(0, IDC_SIN, btnStyle, dummy);

	return TRUE;
}
Ejemplo n.º 10
0
BOOL CfsclientwDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	//////////////////////////////////////////////////////////////////////////
	m_dwM = new DwManager("dev5", 18110, 10);
	m_dwWin.setDwManager(m_dwM);

	//m_dwM->setLogWin(pe);
	
	//////////////////////////////////////////////////////////////////////////
	m_font = new CFont;
	m_font->CreateFont(16, 0, 0, 0, FW_BOLD, FALSE, FALSE, 0, ANSI_CHARSET,
		OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,FF_SWISS,(LPCTSTR)"Arial");
	CEdit* pe  = (CEdit *)GetDlgItem(IDC_EDIT_FILE);
	pe->SetFont(m_font, false); 
	pe->SetWindowText("/home");

	//////////////////////////////////////////////////////////////////////////
	CListCtrl * pl = (CListCtrl *)GetDlgItem(IDC_FLIST);
	pl->InsertColumn(IDX_FILENAME, "name", LVCFMT_LEFT,  200);
	pl->InsertColumn(IDX_FILEINFO, "info", LVCFMT_RIGHT, 80);
	pl->InsertColumn(IDX_FILESIZE, "size", LVCFMT_RIGHT, 120);
	pl->InsertColumn(IDX_FILETIME, "time", LVCFMT_RIGHT, 120);
	pl->InsertColumn(IDX_FULLNAME, "path", LVCFMT_LEFT,  200);	

	DWORD dwStyle = pl->GetExtendedStyle();
	dwStyle |= LVS_EX_FULLROWSELECT;
	dwStyle |= LVS_EX_GRIDLINES;
	dwStyle |= LVS_EX_CHECKBOXES;
	pl->SetExtendedStyle(dwStyle);

	//////////////////////////////////////////////////////////////////////////
	CComboBox* pcb = (CComboBox*)GetDlgItem(IDC_COMBOSRV);
	//pcb->AddString("173.230.157.138");
	pcb->AddString("map1");
	pcb->AddString("dev5");
	pcb->AddString("tj-core4");
	pcb->SetCurSel(0);

	//////////////////////////////////////////////////////////////////////////
	CButton* pbut;
	pbut = (CButton*)GetDlgItem(IDC_BUTHELP);
	//m_icoHelp = (HICON)LoadImage(NULL, "d:/material/help.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
	//pbut->SetIcon(m_icoHelp);

	pbut = (CButton*)GetDlgItem(IDC_BUTBROWSE);
	HICON m_icoFolder = (HICON)LoadImage(NULL, "icon/folder.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
	pbut->SetIcon(m_icoFolder);

	pbut = (CButton*)GetDlgItem(IDC_BUTDW);
	HICON m_icoDown = (HICON)LoadImage(NULL, "icon/down.ico", IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
	pbut->SetIcon(m_icoDown);

	//////////////////////////////////////////////////////////////////////////
	//m_logoWin.create(0x101, 610, 2, 56, 56, this);
	//m_logoWin.loadPng("icon/connected.png");
	//m_logoWin.loadPng("icon/connectlock.png");
	//m_logoWin.loadPng("icon/connecting.png");
	//m_logoWin.startTimer();
	//m_logoWin.ShowWindow(false);

	//
	RECT rect;
	GetClientRect(&rect);
	int x = rect.right - 36;

	m_buttonLog.create(0x102, x, 4, 32, 32, this);
	m_buttonLog.loadPng("icon/82.png");

	m_buttonHelp.create(0x103, x - 32, 4, 32, 32, this);
	m_buttonHelp.loadPng("icon/70.png");

	m_gifWin.create(0x101, 10, 2, 56, 56, this);
	m_gifWin.loadGif("icon/earth2.gif");
	m_gifWin.setText("x");
	//////////////////////////////////////////////////////////////////////////
	char buf[256];
	GetCurrentDirectory(sizeof(buf), buf);
	pe  = (CEdit *)GetDlgItem(IDC_EDIT_SAVETO);
	pe->SetFont(m_font, false); 
	pe->SetWindowText(buf);

	//////////////////////////////////////////////////////////////////////////
	enableButton("server",   true);
	enableButton("download", false);
	//m_logoWin.setImage(icon_bad);

	//////////////////////////////////////////////////////////////////////////
	return TRUE;  // return TRUE  unless you set the focus to a control
}
Ejemplo n.º 11
0
// 初始化
void CTabSample::OnInit(void)
{
	// 控件选择
	for (int k=0; k<GraphViewNum; k++)
	{
		ProcessMessages();
		m_iSelectObject[k] = 0;
		m_iSelectObjectNoise[k] = 0;
		m_iButtonIDFDU[k] = IDC_BUTTON_FDU1 + k;
		m_iCheckIDInstrumentFDU[k] = IDC_CHECK_GRAPHVIEW1 + k;
		m_iCheckIDNoiseFDU[k] = IDC_CHECK_NOISE1 + k;
	}

	CString strtmp = _T("");
	for (int i=0; i<GraphViewNum; i++)
	{
		ProcessMessages();
		strtmp.Format(_T("仪器%d"), i+1);
		char* pchar = strtmp.GetBuffer(0); 
		strcpy_s(m_cSelectObjectName[i],pchar);
	}
	
	// 得到当前路径
	char cSaveToFilePath[MAX_PATH];
	GetCurrentDirectory(MAX_PATH, cSaveToFilePath);
	m_csSaveFilePath = cSaveToFilePath;
	
	m_oThreadManage.m_oADCDataRecThread.m_pOScopeCtrl = &m_dlgADCData.m_OScopeCtrl;
	m_dlgADCData.m_ADCDataRecThread = &m_oThreadManage.m_oADCDataRecThread;

	// 得到本机IP地址
	char		name[255]; 
	CString		ip; 
	PHOSTENT	hostinfo; 
	if(   gethostname   (name, sizeof(name)) == 0) 
	{ 
		if((hostinfo = gethostbyname(name)) != NULL) 
		{ 
			ip = inet_ntoa(*(struct in_addr*)*hostinfo-> h_addr_list); 
		} 
	} 
	m_oThreadManage.m_HeadFrameSocket.m_csIPSource = ip;

	m_oThreadManage.m_TailFrameSocket.m_csIPSource = ip;
	m_oThreadManage.m_TailTimeFrameSocket.m_csIPSource = ip;
	m_oThreadManage.m_oSysTimeSocket.m_csIPSource = ip;
	m_oThreadManage.m_oADCDataRecThread.m_csIPSource = ip;

	m_oThreadManage.m_oSysTimeSocket.m_pADCSet = &m_oADCSet;
	m_oThreadManage.m_IPSetSocket.m_pADCSet = &m_oADCSet;


	CString str;
	str.Format("0x%04x", m_uiSendPort);
	GetDlgItem(IDC_EDIT_SENDPORT)->SetWindowText(str);

	str.Format("%d", m_uiADCFileLength);
	GetDlgItem(IDC_EDIT_ADCSAVEFRAMENB)->SetWindowText(str);

	m_iconFDUDisconnected = AfxGetApp()->LoadIcon(IDI_ICON1);
	m_iconFDUConnected = AfxGetApp()->LoadIcon(IDI_ICON2);
	m_iconLAUXDisconnected = AfxGetApp()->LoadIcon(IDI_ICON3);
	m_iconLAUXConnected = AfxGetApp()->LoadIcon(IDI_ICON4);
	
	m_oThreadManage.m_oInstrumentList.m_iconFDUDisconnected = m_iconFDUDisconnected;
	m_oThreadManage.m_oInstrumentList.m_iconLAUXDisconnected = m_iconLAUXDisconnected;
	m_oThreadManage.m_oInstrumentList.m_pwnd = this;
	m_oThreadManage.m_IPSetSocket.m_iconFDUConnected = m_iconFDUConnected;
	m_oThreadManage.m_IPSetSocket.m_iconLAUXConnected= m_iconLAUXConnected;
	m_oThreadManage.m_IPSetSocket.m_pwnd = this;
	m_oThreadManage.m_HeadFrameSocket.m_pwnd = this;

	
	m_oThreadManage.m_oSysTimeSocket.m_pSelectObject = m_iSelectObject;
	m_oThreadManage.m_oADCDataRecThread.m_pSelectObject = m_iSelectObject;
	m_oThreadManage.m_IPSetSocket.m_pSelectObject = m_iSelectObject;
	m_oThreadManage.m_oADCDataRecThread.m_pSelectObjectNoise = m_iSelectObjectNoise;
	for(int i=0; i<GraphViewNum; i++)
	{
		m_oThreadManage.m_oADCDataRecThread.m_cSelectObjectName[i] = m_cSelectObjectName[i];
		m_oThreadManage.m_oInstrumentList.m_iButtonIDFDU[i] = m_iButtonIDFDU[i];
		m_oThreadManage.m_IPSetSocket.m_iButtonIDFDU[i] = m_iButtonIDFDU[i];
		m_oThreadManage.m_oInstrumentList.m_iCheckIDInstrumentFDU[i] = m_iCheckIDInstrumentFDU[i];
		m_oThreadManage.m_IPSetSocket.m_iCheckIDInstrumentFDU[i] = m_iCheckIDInstrumentFDU[i];
	}
	CButton* iconbutton = NULL;
	CStatic* iconstatic = NULL;
	CButton* pButton = NULL;
	
	iconstatic =(CStatic*)this->GetDlgItem(IDC_STATIC_LAUX);
	iconstatic->SetIcon(m_iconLAUXDisconnected);
	iconstatic = NULL;
	
	for (int i=0; i<GraphViewNum; i++)
	{
		ProcessMessages();
		iconbutton = (CButton*)this->GetDlgItem(m_iButtonIDFDU[i]);
		iconbutton->SetIcon(m_iconFDUDisconnected);
		iconbutton = NULL;
		pButton = (CButton*)GetDlgItem(m_iCheckIDInstrumentFDU[i]);
		pButton->SetCheck(0);
		pButton = NULL;
		pButton = (CButton*)GetDlgItem(m_iCheckIDNoiseFDU[i]);
		pButton->SetCheck(0);
		pButton = NULL;
	}
	delete iconstatic;
	delete iconbutton;
	delete pButton;

	m_oThreadManage.OnInit();
	OnOpen();
	// 监测尾包定时器
	SetTimer(4, 1000, NULL);
	OnDisableButtons();
}
Ejemplo n.º 12
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	gen1Frq = GetDlgItem(IDC_CAR_FREQ);
	gen1Atk = GetDlgItem(IDC_CAR_ATTACK);
	gen1Dec = GetDlgItem(IDC_CAR_DECAY);
	gen1Vol = GetDlgItem(IDC_CAR_VOLUME);
	gen1Sus = GetDlgItem(IDC_CAR_SUSTAIN);
	gen1Rel = GetDlgItem(IDC_CAR_RELEASE);
	gen1FrqEd = GetDlgItem(IDC_CFRQ_EDIT);
	gen1AtkEd = GetDlgItem(IDC_CATK_EDIT);
	gen1DecEd = GetDlgItem(IDC_CDEC_EDIT);
	gen1VolEd = GetDlgItem(IDC_CVOL_EDIT);
	gen1SusEd = GetDlgItem(IDC_CSUS_EDIT);
	gen1RelEd = GetDlgItem(IDC_CREL_EDIT);

	InitValue(gen1Frq, gen1FrqEd, 0, 120, 12);
	PutSetting(gen1Frq, gen1FrqEd, 48.0, 1, 120);
	InitValue(gen1Vol, gen1VolEd, 0, 100, 10);
	InitValue(gen1Sus, gen1SusEd, 0, 100, 10);
	InitValue(gen1Atk, gen1AtkEd, 0, 4000, 400);
	InitValue(gen1Dec, gen1DecEd, 0, 4000, 400);
	InitValue(gen1Rel, gen1RelEd, 0, 4000, 400);

	gen2Mul = GetDlgItem(IDC_MOD1_MULT);
	gen2Ndx = GetDlgItem(IDC_MOD1_START);
	gen2Atk = GetDlgItem(IDC_MOD1_ATTACK);
	gen2Pck = GetDlgItem(IDC_MOD1_PEAK);
	gen2Dec = GetDlgItem(IDC_MOD1_DECAY);
	gen2Sus = GetDlgItem(IDC_MOD1_SUSTAIN);
	gen2Rel = GetDlgItem(IDC_MOD1_RELEASE);
	gen2End = GetDlgItem(IDC_MOD1_END);
	gen2MulEd = GetDlgItem(IDC_M1M_EDIT);
	gen2NdxEd = GetDlgItem(IDC_M1I_EDIT);
	gen2AtkEd = GetDlgItem(IDC_M1A_EDIT);
	gen2PckEd = GetDlgItem(IDC_M1P_EDIT);
	gen2DecEd = GetDlgItem(IDC_M1D_EDIT);
	gen2SusEd = GetDlgItem(IDC_M1S_EDIT);
	gen2RelEd = GetDlgItem(IDC_M1R_EDIT);
	gen2EndEd = GetDlgItem(IDC_M1E_EDIT);

	InitValue(gen2Mul, gen2MulEd, 0,  100,  10);
	InitValue(gen2Ndx, gen2NdxEd, 0,  500,  50);
	InitValue(gen2Pck, gen2PckEd, 0,  500,  50);
	InitValue(gen2Sus, gen2SusEd, 0,  500,  50);
	InitValue(gen2End, gen2EndEd, 0,  500,  50);
	InitValue(gen2Atk, gen2AtkEd, 0, 4000, 400);
	InitValue(gen2Dec, gen2DecEd, 0, 4000, 400);
	InitValue(gen2Rel, gen2RelEd, 0, 4000, 400);

	gen3Mul = GetDlgItem(IDC_MOD2_MULT);
	gen3Ndx = GetDlgItem(IDC_MOD2_START);
	gen3Atk = GetDlgItem(IDC_MOD2_ATTACK);
	gen3Pck = GetDlgItem(IDC_MOD2_PEAK);
	gen3Dec = GetDlgItem(IDC_MOD2_DECAY);
	gen3Sus = GetDlgItem(IDC_MOD2_SUSTAIN);
	gen3Rel = GetDlgItem(IDC_MOD2_RELEASE);
	gen3End = GetDlgItem(IDC_MOD2_END);
	gen3MulEd = GetDlgItem(IDC_M2M_EDIT);
	gen3NdxEd = GetDlgItem(IDC_M2I_EDIT);
	gen3AtkEd = GetDlgItem(IDC_M2A_EDIT);
	gen3PckEd = GetDlgItem(IDC_M2P_EDIT);
	gen3DecEd = GetDlgItem(IDC_M2D_EDIT);
	gen3SusEd = GetDlgItem(IDC_M2S_EDIT);
	gen3RelEd = GetDlgItem(IDC_M2R_EDIT);
	gen3EndEd = GetDlgItem(IDC_M2E_EDIT);

	InitValue(gen3Mul, gen3MulEd, 0,  100,  10);
	InitValue(gen3Ndx, gen3NdxEd, 0,  500,  50);
	InitValue(gen3Pck, gen3PckEd, 0,  500,  50);
	InitValue(gen3Sus, gen3SusEd, 0,  500,  50);
	InitValue(gen3End, gen3EndEd, 0,  500,  50);
	InitValue(gen3Atk, gen3AtkEd, 0, 4000, 400);
	InitValue(gen3Dec, gen3DecEd, 0, 4000, 400);
	InitValue(gen3Rel, gen3RelEd, 0, 4000, 400);

	durValEd = GetDlgItem(IDC_DUR_EDIT);
	durValEd.SetWindowText("4.0");
	volValEd = GetDlgItem(IDC_VOL);
	volValEd.SetWindowText("0.707");

	btnPlay = GetDlgItem(IDC_PLAY);
	btnLoop = GetDlgItem(IDC_LOOP);
	btnStop = GetDlgItem(IDC_STOP);
	RECT btnrc;
	btnPlay.GetClientRect(&btnrc);
	int cxy;
	if ((btnrc.bottom - btnrc.top) < 30)
		cxy = 16;
	else
		cxy = 32;
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_PLAY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnPlay.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_LOOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnLoop.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStop.SetIcon(hIcon);
	btnStop.EnableWindow(FALSE);

	CButton btnStyle;
	HBITMAP bm;

	btnStyle = GetDlgItem(IDC_STACK);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_STACK), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle.SetCheck(BST_CHECKED);
	btnStyle = GetDlgItem(IDC_STACK2);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_STACK2), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle = GetDlgItem(IDC_WYE);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_WYE), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle = GetDlgItem(IDC_DELTA);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_DELTA), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);

	btnStyle = GetDlgItem(IDC_COPY_CLIP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_COPY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_WVFILE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_HELP2);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP2), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);

	SetPreset(&resetParams);

	return TRUE;
}