📄 mainfrm.h
字号:
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__BE7BA14C_BDA7_4D5B_BDA4_8D258ABC2FBB__INCLUDED_)
#define AFX_MAINFRM_H__BE7BA14C_BDA7_4D5B_BDA4_8D258ABC2FBB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "SetDlg.h"
#include "SimulateView.h"
#include "SimulateDoc.h"
#include "WorkSpaceBar.h"
#include "OutputBar.h"
#include "Rand.h"
#include "AnalyseDlg.h"
#include "HelpDlg.h"
#include "SortListCtrl.h"
#include "afxmt.h"
#include "ProgressStatusBar.h"
//定义指向随机模拟视图的链表
typedef struct SimulateViewList
{
CSimulateView* pSimulateView;
int nIndex; //该视图在视图链表中的ID号
Record rMaxRecord; //最好的记录
struct SimulateViewList* pNext; //指向下一个视图的指针
struct SimulateViewList* pTail; //指向尾节点的指针
}SimulateViewList;
#define CFrameWnd CCJFrameWnd
class CMainFrame : public CFrameWnd
{
protected: // create from serialization only
CMainFrame();
DECLARE_DYNCREATE(CMainFrame)
// Attributes
public:
CToolBar m_wndToolBar;
CProgressStatusBar m_wndStatusBar;
CSplitterWnd m_wndSplitter;
CWorkSpaceBar m_wndWorkSpaceBar; //工作空间栏
COutputBar m_wndOutputBar; //信息输出栏
CSimulateDoc *m_pSimulateDoc; //文档类
SimulateViewList* m_pSimulateViewList; //随机模拟视图链表
SimulateViewList* m_pSimulateViewListHead;
//随机模拟视图链表头指针,头节点为数据分析视图
CSimulateView* m_pAnalyseView; //数据分析视图
CSimulateView* m_pCurView; //当前视图
CSimulateView* m_pSimulatingView; //当前正在模拟的视图
int m_nCurOutputViewID; //当前输出视图ID
int m_nCurViewID; //当前视图ID,为-1时表示当前视图为数据分析
int m_nRandomSimulateNum; //随机模拟次数
int m_nSimulateNum; //已模拟次数
CString m_strResultData; //输出显示
bool m_bIsUseFirst; //随机模拟1是否已用
bool m_bIsPressOutlookItem; //是否按了Outlook上的按钮
CCriticalSection m_CriticalSection;
//线程同步对象
int m_nCurThreadNum; //当前线程数
int m_nMaxThreadNum; //最大线程数
CRand m_Rand;
bool m_bShow; //本系统的可见性
CMainFrame* m_pMainFrame;
int m_nIndex;
SetParam m_SetParam;
CSetDlg m_dlgSet; //设置对话框
float m_fCurLAxis; //当前长半轴
float m_fCurSAxis; //当前短半轴
float m_fFocus; //焦距
float m_fLAxisAdd; //长半轴增量
float m_fLAxisFrom; //长半轴初值
float m_fSAxisAdd; //短半轴增量
float m_fSAxisFrom; //短半轴初值
float m_fObjRadius; //物体半径
int m_nObjSort; //物体类别:0为球面,1为球体
int m_nGoodPhotonCount; //好光子数
int m_nBadPhotonCount; //坏光子数
int m_nDeadPhotonCount; //死光子数
Record m_MaxRecord; //接收光子最多数的那条记录
int m_nAllPhoton; //总光子数
int m_nReflectCount; //反射次数
float m_fShineIntensity; //光子发光强度
float m_fGoodRate; //光子吸收率
float m_fBadRate; //坏光子率
float m_fDeadRate; //死光子率
CString m_strIndex; //序号
CString m_strLAxis; //长半轴
CString m_strSAxis; //短半轴
CString m_strGoodPhotonCount;
//好光子数
CString m_strBadPhotonCount;
//坏光子数
CString m_strDeadPhotonCount;
//死光子数
CString m_strGoodRate; //光子吸收率
CString m_strBadRate; //坏光子率
CString m_strDeadRate; //死光子率
Record m_Record; //一条记录
float m_fError; //允许误差
// CWinThread* m_hThread;
HANDLE m_hThread;
bool m_bStop;
// Operations
public:
void ChangeView(int nFolder,int nIndex); //切换视图
DWORD WINAPI SimulateProc(); //模拟线程函数
DWORD WINAPI SingleSimulateProc(); //单个模拟线程函数
int IsCutWithPipe(Line l0); //反射直线是否与光电倍增管相交
bool IsCutWithObj(Line l0,int nObjSort); //反射直线是否与物体相交
bool IsEven(Point p1,Point p2); //p1和p2是否相同
float GetFocus(float fLAxis); //得到焦距
float GetSAxis(float fLAxis); //得到短半轴
Line GetReflectLine(Line l0); //得到已知直线的反射直线,nID为点号
Point GetCutPoint(Line l0,int nID); //得到已知直线与椭球的交点
CSimulateView* SearchViewByIndex(int nIndex,bool bIsSimulate);
//定位视图指针
void SingleSimulate();
void ChangeOutputView(int nID);
float Max(float a,float b);
float Min(float a,float b);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//}}AFX_VIRTUAL
// Implementation
public:
void AnalyseData();
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnTimeChange();
afx_msg void OnSimulate();
afx_msg void OnPause();
afx_msg void OnStop();
afx_msg void OnSet();
afx_msg void OnHideoutbar();
afx_msg void OnClearedit();
afx_msg void OnOutputbar();
afx_msg void OnWorkspacebar();
afx_msg void OnClose();
afx_msg void OnMain();
afx_msg void OnHide();
afx_msg void OnAppExit();
//}}AFX_MSG
afx_msg LRESULT OnTrayNotification(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnHotKey(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_MAINFRM_H__BE7BA14C_BDA7_4D5B_BDA4_8D258ABC2FBB__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -