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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? pooling1dlg.cpp

?? 關(guān)于臺(tái)灣研華遠(yuǎn)程以太網(wǎng)模塊上位機(jī)控制源代碼
?? CPP
字號(hào):
// Pooling1Dlg.cpp : implementation file
//

#include "stdafx.h"
#include "Pooling1.h"
#include "Pooling1Dlg.h"

#include <winsock2.h>
#include "..\..\..\include\adamtcp.h"

UINT ThreadProc( LPVOID lpParam );

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

char			szIPAddress[20];
static int		iTotalReceive;
static int		iTotalTimeout;
static int		iThreadIndex;
//----------------------------------------------
struct _StreamData   *pStreamData,StreamData;
static BYTE byLoopFlag=1;
HANDLE    hEvent;
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
	CAboutDlg();

// Dialog Data
	//{{AFX_DATA(CAboutDlg)
	enum { IDD = IDD_ABOUTBOX };
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAboutDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	//{{AFX_MSG(CAboutDlg)
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
	//{{AFX_DATA_INIT(CAboutDlg)
	//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAboutDlg)
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
	//{{AFX_MSG_MAP(CAboutDlg)
		// No message handlers
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPooling1Dlg dialog

CPooling1Dlg::CPooling1Dlg(CWnd* pParent /*=NULL*/)
	: CDialog(CPooling1Dlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CPooling1Dlg)
	m_strIPAddress = _T("");
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CPooling1Dlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CPooling1Dlg)
	DDX_Text(pDX, IDC_EDIT_IPADDRESS, m_strIPAddress);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CPooling1Dlg, CDialog)
	//{{AFX_MSG_MAP(CPooling1Dlg)
	ON_WM_SYSCOMMAND()
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(ID_EXIT, OnExit)
	ON_BN_CLICKED(ID_START, OnStart)
	ON_BN_CLICKED(ID_STOP, OnStop)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPooling1Dlg message handlers

BOOL CPooling1Dlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// Add "About..." menu item to system menu.

	// IDM_ABOUTBOX must be in the system command range.
	ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
	ASSERT(IDM_ABOUTBOX < 0xF000);

	CMenu* pSysMenu = GetSystemMenu(FALSE);
	if (pSysMenu != NULL)
	{
		CString strAboutMenu;
		strAboutMenu.LoadString(IDS_ABOUTBOX);
		if (!strAboutMenu.IsEmpty())
		{
			pSysMenu->AppendMenu(MF_SEPARATOR);
			pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
		}
	}

	// 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
	m_strIPAddress="172.18.1.41";
	SetDlgItemText(IDC_EDIT_IPADDRESS,m_strIPAddress);

	// get the DLL version 
	char   szCh[20];
    int    iVersion;    
 
	iVersion=ADAMTCP_GetDLLVersion();
	_ltoa( iVersion, szCh, 16 );
	SetDlgItemText(IDC_EDIT_DLLVER, szCh);

    (CButton *)GetDlgItem(ID_STOP)->EnableWindow( FALSE );

    //--- To initialize DLL to work ---
    int   iRetVal;

    iRetVal=ADAMTCP_Open();
    if( iRetVal!=0 )
    {
        MessageBox("ADAMTCP_Open() Failure !!!");
    }	
	return TRUE;  // return TRUE  unless you set the focus to a control
}

void CPooling1Dlg::OnSysCommand(UINT nID, LPARAM lParam)
{
	if ((nID & 0xFFF0) == IDM_ABOUTBOX)
	{
		CAboutDlg dlgAbout;
		dlgAbout.DoModal();
	}
	else
	{
		CDialog::OnSysCommand(nID, lParam);
	}
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CPooling1Dlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CPooling1Dlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void CPooling1Dlg::OnExit() 
{
    //--- Finally, calling ADAMTCP_Close() to release all allocated resource  ---
    ADAMTCP_Close();
	
	// TODO: Add your control notification handler code here
	CDialog::OnOK();	
}

void CPooling1Dlg::OnStart() 
{
	// TODO: Add your control notification handler code here
    //char      szDump[80];
	int       iRetVal; 
    CString   strText,strTemp;

	(CButton *)GetDlgItem(ID_START)->EnableWindow( FALSE );
    (CButton *)GetDlgItem(ID_STOP)->EnableWindow( TRUE );
	(CButton *)GetDlgItem(ID_EXIT)->EnableWindow( FALSE );

	m_bStopThread = FALSE;
	m_pThread = NULL;

    m_iTotalReceive=0;
    m_iTotalTimeout=0;
    m_iThreadIndex=0;

    // get the 5000/TCP's IP Address
	GetDlgItemText(IDC_EDIT_IPADDRESS,szIPAddress,20);

    //-----  create a event for synchronization ---------------
    hEvent = CreateEvent(NULL,
			     FALSE,   // auto reset
			     FALSE,  // init state as Non-Signal
			     NULL);

    //--- adding the first 5000/TCP for streaming ----
    iRetVal=ADAMTCP_AddTCPForStream(szIPAddress);
    if( iRetVal<0 )
    {
		MessageBox("ADAMTCP_AddTCPForStream() Failure !!!");
    }

	//sprintf(szDump,"Total Receive:%d   Timeout=%d  index=%d",
	//				m_iTotalReceive,m_iTotalTimeout,m_iThreadIndex);
	//MessageBox( TEXT(szDump) );

	((CListBox*)GetDlgItem(IDC_LIST_STREAM))->ResetContent();
    m_pListBox=(CListBox*)GetDlgItem(IDC_LIST_STREAM);

	if( m_pThread == NULL )
	{
		m_ThreadData.hEvent = &hEvent;
		m_ThreadData.lpStopThread = &m_bStopThread;
		m_ThreadData.TotalReceive=&m_iTotalReceive;
        m_ThreadData.TotalTimeout=&m_iTotalTimeout;
        m_ThreadData.ThreadIndex=&m_iThreadIndex;
		m_ThreadData.pListBox=m_pListBox;
  	    // Start the thread.
		m_pThread =
			AfxBeginThread(ThreadProc, (LPVOID) &m_ThreadData);
	}


    //--- Starting to receive the streaming data come from 5000/TCP ---
    ADAMTCP_StartStream( &hEvent);


}

void CPooling1Dlg::OnStop() 
{
	// TODO: Add your control notification handler code here
	HANDLE hThread = m_pThread->m_hThread;

	(CButton *)GetDlgItem(ID_START)->EnableWindow( TRUE );
    (CButton *)GetDlgItem(ID_STOP)->EnableWindow( FALSE );
	(CButton *)GetDlgItem(ID_EXIT)->EnableWindow( TRUE );

	// Set the flag to kill the thread to TRUE;
    m_bStopThread = TRUE;

	// Wait for the thread to end.
	::WaitForSingleObject( hThread, 1000 );

    //--- Stop receiving the streaming data come from 5000/TCP ---	
	ADAMTCP_StopStream( );
    //--- Close the event handle ---
    CloseHandle(hEvent);

    m_iTotalReceive=0;
    m_iTotalTimeout=0;
    m_iThreadIndex=0;	
}

UINT ThreadProc( LPVOID lpParam )
{
	THREAD_DATA *lpThreadData =
		(THREAD_DATA *) lpParam;
    BOOL   *bStopThread=(BOOL*)lpParam ; 
	int    iRetVal;
    CString   strText; 
	//char   szCh[20];



	while( !(*lpThreadData->lpStopThread) )
	{
		*lpThreadData->ThreadIndex=101;
	    //if(WaitForSingleObject(*lpThreadData->hEvent,2000)==WAIT_OBJECT_0)  // waiting for 5 seconds
	    {
			   if( (*lpThreadData->TotalReceive)%3==2 )
			   {
				   (lpThreadData->pListBox)->ResetContent();
			   }
			   (*lpThreadData->TotalReceive)++;
			   
               //iRetVal=ADAMTCP_ReadStreamData("172.18.1.41",&StreamData);
			   Sleep(1000);
			   iRetVal=ADAMTCP_ReadStreamData(szIPAddress,&StreamData);
               pStreamData=(struct _StreamData *)&StreamData;

		       //strText.Format( "Receive:%d", iTotalReceive++);
		       //((CListBox*)GetDlgItem(IDC_LIST_STREAM))->InsertString( -1, strText );

		       //strText.Format( "Receive:%d", iTotalReceive++);
		       strText.Format( "Receive:%d", *lpThreadData->TotalReceive);
		       (lpThreadData->pListBox)->InsertString( -1, strText );
			  
	           strText.Format ("DI/DO data of Slot0 to Slot 7:\n");
			   (lpThreadData->pListBox)->InsertString( -1, strText );
			   strText.Format("%04x:%04x:%04x:%04x-%04x:%04x:%04x:%04x\n",StreamData.DIO[0],StreamData.DIO[1],
							       StreamData.DIO[2],StreamData.DIO[3],
							       StreamData.DIO[4],StreamData.DIO[5],	
							       StreamData.DIO[6],StreamData.DIO[7]);
			   (lpThreadData->pListBox)->InsertString( -1, strText );
			   strText.Format("AI/Ao data of Slot0:\n");
			   (lpThreadData->pListBox)->InsertString( -1, strText );
               strText.Format("%04x:%04x:%04x:%04x-%04x:%04x:%04x:%04x\n",StreamData.Slot0[0],StreamData.Slot0[1],
							       StreamData.Slot0[2],StreamData.Slot0[3],
							       StreamData.Slot0[4],StreamData.Slot0[5],
							       StreamData.Slot0[6],StreamData.Slot0[7]);	
			   (lpThreadData->pListBox)->InsertString( -1, strText );
			   strText.Format("AI/AO data of Slot1:\n");
			   (lpThreadData->pListBox)->InsertString( -1, strText );
               strText.Format("%04x:%04x:%04x:%04x-%04x:%04x:%04x:%04x\n",StreamData.Slot1[0],StreamData.Slot1[1],
							       StreamData.Slot1[2],StreamData.Slot1[3],
							       StreamData.Slot1[4],StreamData.Slot1[5],
							       StreamData.Slot1[6],StreamData.Slot1[7]);			
			   (lpThreadData->pListBox)->InsertString( -1, strText );
              
		}
	}
	(*lpThreadData->ThreadIndex)=102;
	return 0;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久免费电影网| 亚洲国产成人在线| 99久久精品免费看| 久久精品999| 国产东北露脸精品视频| 亚洲一区二三区| 国产日韩精品一区| 日韩一区二区在线观看视频| 99久久伊人久久99| 国模一区二区三区白浆| 性欧美疯狂xxxxbbbb| 亚洲视频中文字幕| 久久久久久久免费视频了| 4hu四虎永久在线影院成人| 成人国产精品免费| 国产精品一线二线三线| 日韩高清一区在线| 亚洲成av人片| 亚洲国产视频网站| 亚洲同性同志一二三专区| 久久久不卡网国产精品一区| 日韩一本二本av| 欧美精品三级在线观看| 在线免费视频一区二区| 成人激情小说网站| 国产99久久久国产精品免费看| 免费黄网站欧美| 日韩高清不卡一区二区三区| 亚洲曰韩产成在线| 亚洲品质自拍视频| 成人免费在线播放视频| 国产精品第一页第二页第三页| 久久久久久97三级| 久久综合色播五月| 久久久精品国产免费观看同学| 久久亚洲精华国产精华液| 精品日韩在线一区| 精品欧美久久久| 久久嫩草精品久久久精品| 久久婷婷国产综合国色天香 | 国产精品自拍三区| 毛片基地黄久久久久久天堂| 日本视频免费一区| 看片网站欧美日韩| 精品一区二区三区视频在线观看| 麻豆成人久久精品二区三区小说| 毛片av一区二区| 国内欧美视频一区二区| 国产精品亚洲专一区二区三区 | 欧美一级二级在线观看| 欧美一区二区视频在线观看2022| 制服丝袜中文字幕一区| 国产精品久久久久7777按摩| 中文字幕亚洲电影| 伊人色综合久久天天| 欧美网站一区二区| 日韩欧美成人午夜| 久久综合久久综合久久| 精品美女一区二区| 国产日韩欧美亚洲| 亚洲欧洲日韩在线| 亚洲高清免费视频| 美女高潮久久久| 成人免费的视频| 色欧美片视频在线观看| 欧美精品高清视频| 久久久久国色av免费看影院| 国产精品卡一卡二卡三| 天天影视色香欲综合网老头| 国内精品嫩模私拍在线| 成人av网站在线观看免费| 欧美在线一区二区| 欧美刺激脚交jootjob| 国产精品久久久久久久久快鸭| 亚洲资源在线观看| 韩国一区二区视频| 日本精品一区二区三区高清| 欧美一区二区三区日韩| 中文字幕不卡在线| 日韩国产欧美在线视频| 国产福利精品一区| 欧美日韩精品一区二区三区四区| 精品国产一二三| 一区二区三区不卡在线观看| 美国一区二区三区在线播放| 99久久伊人网影院| 日韩欧美国产一区二区三区| 亚洲视频一区二区免费在线观看| 美脚の诱脚舐め脚责91| 91蜜桃在线免费视频| 精品久久国产字幕高潮| 一区二区三区在线观看视频| 国产在线精品一区在线观看麻豆| 色综合色综合色综合| 2欧美一区二区三区在线观看视频| 亚洲人成在线观看一区二区| 精品一区二区三区在线播放 | 国产精品美女久久久久久久| 亚洲愉拍自拍另类高清精品| 加勒比av一区二区| 欧美日韩夫妻久久| 亚洲丝袜制服诱惑| 国产精品18久久久久久久久| 91精品福利在线一区二区三区| 国产精品女同一区二区三区| 蜜臀av性久久久久蜜臀aⅴ流畅| 一本色道综合亚洲| 欧美国产日本韩| 老司机午夜精品| 欧美日韩dvd在线观看| 亚洲色大成网站www久久九九| 国产精品一二三区| 日韩免费电影网站| 日韩精品视频网站| 欧美亚洲一区三区| 亚洲欧美成人一区二区三区| 国产大陆亚洲精品国产| 精品久久五月天| 欧美96一区二区免费视频| 欧美日韩极品在线观看一区| 亚洲免费观看高清| 99国产精品视频免费观看| 日本一二三四高清不卡| 国产乱人伦精品一区二区在线观看 | 色天天综合色天天久久| 中文子幕无线码一区tr| 国产在线精品一区二区三区不卡| 欧美一级理论片| 日韩电影在线一区| 欧美日本乱大交xxxxx| 亚洲午夜视频在线| 精品视频资源站| 亚洲成av人综合在线观看| 欧美午夜精品电影| 亚洲一区二区三区三| 91国偷自产一区二区三区观看 | 中文字幕一区二区不卡| 成人午夜免费av| 国产精品水嫩水嫩| 99精品热视频| 亚洲精品v日韩精品| 在线观看欧美黄色| 午夜精品久久久久久久久久久| 欧洲另类一二三四区| 亚洲一区二区在线视频| 欧美精品久久久久久久多人混战| 婷婷久久综合九色综合绿巨人| 51精品国自产在线| 久草这里只有精品视频| 国产午夜精品久久久久久免费视 | 国产精品996| 国产精品欧美一区喷水| 91丨porny丨国产入口| 亚洲国产一区二区三区| 91麻豆精品91久久久久久清纯 | 久久精品一二三| 成年人网站91| 亚洲一区二区三区四区在线免费观看| 欧美乱妇23p| 国产一区二区三区日韩| 亚洲国产精品精华液ab| 色88888久久久久久影院野外| 亚洲大尺度视频在线观看| 日韩欧美区一区二| 国产91精品欧美| 亚洲精品第1页| 日韩精品一区二区三区老鸭窝| 国产乱码字幕精品高清av| 亚洲三级小视频| 欧美一区二区视频在线观看2020| 国产一区视频在线看| 亚洲欧美另类久久久精品2019| 91.成人天堂一区| 国产成人免费高清| 亚洲成年人网站在线观看| 久久综合国产精品| 在线观看免费视频综合| 久久精品99国产精品日本| 亚洲欧美视频一区| 精品99999| 日本丰满少妇一区二区三区| 久久精品二区亚洲w码| 亚洲欧美电影院| 国产亚洲精品超碰| 欧美日韩精品欧美日韩精品一综合| 国产在线不卡一区| 亚洲愉拍自拍另类高清精品| 精品国产乱码久久久久久图片| 色播五月激情综合网| 国产乱淫av一区二区三区 | 亚洲最大的成人av| 久久久久久久久久久电影| 欧美性猛交xxxx黑人交| 国产盗摄一区二区三区| 日韩av电影免费观看高清完整版 | 色久综合一二码| 国产九色sp调教91| 日本欧美一区二区三区乱码| 中文字幕中文字幕一区| 精品国产一区二区三区四区四|