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

📄 powerdc.h

📁 MDF监控源码2
💻 H
字号:
#pragma once

// CPowerDC 对话框
#include "..\..\cmserial\cmserial\serialport.h"
#include "led.h"
#include "afxwin.h"
#include "protocol.h"
#include "afxcmn.h"
const int CST_SUBCOUNT = 72;

typedef struct {
	unsigned int m_Addr;
	int m_subAlarm;
	int m_Alarm;
	long  m_majorPower;			//主种电压
	long  m_minorPower;			//备路电压
	long  m_majorCarrent;			//主种电流
	long  m_minorCarrent;			//备路电流
	int   m_sub[CST_SUBCOUNT];
	CTime  m_time;	
} tyPowerDC;



class CPowerDC : public CDialog
{
	DECLARE_DYNAMIC(CPowerDC)

public:
	CPowerDC(CWnd* pParent = NULL);   // 标准构造函数
	virtual ~CPowerDC();
	CSerialPort m_Port;
// 对话框数据
	enum { IDD = IDD_DCPOWER };
	CWinThread *m_pThread;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持
	bool blOpen;
	DECLARE_MESSAGE_MAP()
	BOOL bAsking,blMonitor ;
	int iInterval;
	int m_inCount,m_outCount;
	//{{AFX_MSG_MAP(CSerialTestDlg)
	afx_msg LRESULT onCOMM_RXCHAR(WPARAM wParam, LPARAM lParam);
	//}}AFX_MSG_MAP
	int iPt;
	
public:
	
	afx_msg void OnBnClickedBtnopen();
	CComboBox m_listCom;
	void IniControl(void);
	virtual BOOL OnInitDialog();
	afx_msg void OnBnClickedBtnclose();
	CString m_rate;
	afx_msg void OnBnClickedChkauto();
	static UINT Asking(LPVOID lpWnd);	
	int AskData();
	int Analyse(LPVOID * rscStatus);
	int DataAnalyse(char * lpBuf, int iLen);
	CString ToHexString(char * cBuf, int iLen);
	CButton m_chkAutoSend;
	CListBox m_listInfo;
private:
	int m_DeviceCode;
	CImageList m_imgList;
	CImageList m_imgList32;
	CArray<tyPowerDC,tyPowerDC> m_arrayDevice;

public:
	CProtocol m_fun;
	CLED m_Power1;
	CLED m_Power2;
	CLED m_Power3;
	CLED m_Power4;
	int m_subStatus[CST_SUBCOUNT];

	// 绘制支路状态图
	void DrawSubstatus(int iSub);
	afx_msg void OnPaint();
	// 设备地址列表
	CListBox m_lstAddress;
	afx_msg void OnBnClickedBtnadd();
	afx_msg void OnBnClickedBtndelete();
	afx_msg void OnBnClickedBtnsend();
	afx_msg void OnClose();
	void CloseMonitor(void);
	// 设备当前值
	CListCtrl m_lstInfo;
	void UpdateList(const tyPowerDC m_curStatus);
	int SetDeviceStatus(const tyPowerDC m_Status);
	afx_msg void OnNMDblclkListalarm(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnHdnItemclickListalarm(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnItemchangedListalarm(NMHDR *pNMHDR, LRESULT *pResult);
};

⌨️ 快捷键说明

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