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

📄 posview.h

📁 可以根据停车场的具体情况定义停车点的位置
💻 H
字号:
#if !defined(AFX_POSVIEW_H__6A83D629_1771_44CD_8D42_35DD5D4BC206__INCLUDED_)
#define AFX_POSVIEW_H__6A83D629_1771_44CD_8D42_35DD5D4BC206__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PosView.h : header file
//
#include "Serial.h"
#include "Position.h"
#include "MyLog.h"
//常量定义
#define MAXSCM	50			//最多多少个下位机

//消息定义
#define MSG_READ	0
#define MSG_WRITE	1
#define WM_COM_MSG WM_USER+100
#define WM_COM_READ WM_USER+101
#define WM_INITPROBOK WM_USER+102
/////////////////////////////////////////////////////////////////////////////
// CPosView form view

#ifndef __AFXEXT_H__
#include <afxext.h>
#endif

class CPosView : public CFormView
{
public:
	CPosView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CPosView)

// Form Data
public:
	int m_nCom;
	//{{AFX_DATA(CPosView)
	enum { IDD = IDD_POSVIEW };
	CString	m_msg;
	//}}AFX_DATA

// Attributes
private:
	int m_nGride;
	bool isGrideOn;
	CMyLog m_ComLog,m_PosLog;
	DCB dcbConfig;
	CBitmap m_bmp;
	int m_nLength,m_nWidth;
	int m_nPosTotal,m_nPosRemain;
	int m_nTopX,m_nTopY;
	int m_nCurPos;
public:
	bool m_bParamFixed;
	bool m_bAllLocked;
	bool m_bSetOver;
	bool m_bProbInit;
	int m_bComOpened;
	bool m_bComBlocked;
	CPosition* pos[2000];
	CSerial serial;
	COMMSG m_ComMsg[MAXSCM];

// Operations
private:
	void GrideOn(int);
	void AttachProb();
	void MsgAnalysis(int scm);
	void InitProb(BYTE szData[],DWORD len);
	BOOL DetectDataEnd(BYTE szData[],DWORD len);

public:
	void InitPosParam();	
	void CreatePos(int,int,int,int);
	void DisplayAll();
	void LockAll()
	{	
		for(int nI=0;nI<m_nPosTotal;nI++){pos[nI]->Lock();}
		m_bAllLocked=true;
	}
	void UnlockAll()
	{	
		for(int nI=0;nI<m_nPosTotal;nI++){pos[nI]->Unlock();}
		m_bAllLocked=false;
	}

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPosView)
	public:
	virtual void OnInitialUpdate();
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
public:
	bool InitSerial();
	bool LoadPosition();
	virtual ~CPosView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
	//{{AFX_MSG(CPosView)
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnFixParam();
	afx_msg void OnFinish();
	afx_msg void OnResetAll();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnAddPos();
	afx_msg void OnScm();
	afx_msg void OnGride();
	//}}AFX_MSG
	afx_msg	void OnComMsg(WPARAM wParam,LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_POSVIEW_H__6A83D629_1771_44CD_8D42_35DD5D4BC206__INCLUDED_)

⌨️ 快捷键说明

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