#if !defined(AFX_SELUSEUNITDLG_H__BAEEFEDE_64B4_474E_89AE_850366C759E7__INCLUDED_) #define AFX_SELUSEUNITDLG_H__BAEEFEDE_64B4_474E_89AE_850366C759E7__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // SelUseUnitDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CSelUseUnitDlg dialog #include "Resource.h" class SUseUnitData { public: SUseUnitData(); SUseUnitData(CString csName, CString csUnit, int iNum, double nStdUse, double nFactor, double nTime){ m_csName = csName; m_csUnit = csUnit; m_nStdUse = nStdUse; m_nFactor = nFactor; m_nTime = nTime; m_iNum = iNum; }; CString m_csName; //用水部位名称 CString m_csUnit; //单位 int m_iNum; double m_nStdUse; //用水标准 double m_nFactor; //变化系数 double m_nTime; //用水时间 double m_nMostByDate; // Qd = 数量×用水标准÷1000 double m_nMostByHour; // Qh = Qd * 变化系数 / 用水时间 double m_nAverage; // = Qd / 用水时间 static int SortByItem(const SUseUnitData *, const SUseUnitData *); }; inline int DoubleCmp(const double *i, const double *j) { if(*i < *j) return -1; else if(*i > *j) return 1; else return 0; } inline int SUseUnitData::SortByItem(const SUseUnitData *p1, const SUseUnitData *p2) { SUseUnitData *pp1 = (SUseUnitData *)p1, *pp2 = (SUseUnitData *)p2; return DoubleCmp(&pp1->m_nStdUse, &pp2->m_nStdUse); } class CSelUseUnitDlg : public CDialog { // Construction public: CSelUseUnitDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CSelUseUnitDlg) enum { IDD = IDD_SEL_USEUNIT }; CListCtrl m_listCtrl; double m_nFactor;//变化系数 int m_iNum; double m_nStdUse;//用水标准 int m_iType; double m_dTime; //}}AFX_DATA CString m_csName; //用水部位名称 CString m_csUnit; //单位 int m_iMode; double m_nTime; //用水时间 // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CSelUseUnitDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CSelUseUnitDlg) virtual BOOL OnInitDialog(); virtual void OnOK(); afx_msg void OnDblclkListUnit(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnItemchangedListUnit(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnRadioType1(); afx_msg void OnRadioType2(); afx_msg void OnRadioType3(); //}}AFX_MSG DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_SELUSEUNITDLG_H__BAEEFEDE_64B4_474E_89AE_850366C759E7__INCLUDED_)