📄 mainfrm.cpp
字号:
if(pDoc->m_nShow!=SHOWALLSPACE)
{
pDoc->m_nShow=SHOWALLSPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnSpaceDiversity()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\nBox序号\t\t多样性指数\r\n";
UINT boxnum=pDoc->m_nAllBoxNum;
for(UINT index=0;index<boxnum;index++)
{
tmpstring.Format("\r\n%ld\t\t%.2f",index+1,
pDoc->m_AllVarySpace[index].Diversity);
ResultString+=tmpstring;
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLSPACE)
{
pDoc->m_nShow=SHOWALLSPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnSpaceJamming()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\nBox序号\t\t人为干扰指数\r\n";
UINT boxnum=pDoc->m_nAllBoxNum;
for(UINT index=0;index<boxnum;index++)
{
tmpstring.Format("\r\n%ld\t\t%.2f",index+1,
pDoc->m_AllVarySpace[index].Jamming);
ResultString+=tmpstring;
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLSPACE)
{
pDoc->m_nShow=SHOWALLSPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnSpacePlant()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\nBox序号\t\t植被指数\r\n";
UINT boxnum=pDoc->m_nAllBoxNum;
for(UINT index=0;index<boxnum;index++)
{
tmpstring.Format("\r\n%ld\t\t%.2f",index+1,
pDoc->m_AllVarySpace[index].Plant);
ResultString+=tmpstring;
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLSPACE)
{
pDoc->m_nShow=SHOWALLSPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnSpaceRisk()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\nBox序号\t\t生态风险指数\r\n";
UINT boxnum=pDoc->m_nAllBoxNum;
for(UINT index=0;index<boxnum;index++)
{
tmpstring.Format("\r\n%ld\t\t%.2f",index+1,
pDoc->m_AllVarySpace[index].Risk);
ResultString+=tmpstring;
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLSPACE)
{
pDoc->m_nShow=SHOWALLSPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnSpaceVantage()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\nBox序号\t\t优势度指数\r\n";
UINT boxnum=pDoc->m_nAllBoxNum;
for(UINT index=0;index<boxnum;index++)
{
tmpstring.Format("\r\n%ld\t\t%.2f",index+1,
pDoc->m_AllVarySpace[index].Vantage);
ResultString+=tmpstring;
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLSPACE)
{
pDoc->m_nShow=SHOWALLSPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnTypespaceArea()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\nBox序号\t景观名\t颜色值\t平均斑块面积\r\n";
BYTE tpnum=pDoc->m_BlockTypes.GetSize();
UINT boxnum=pDoc->m_nAllBoxNum;
for(UINT index=0;index<boxnum;index++)
{
for(BYTE tpid=0;tpid<tpnum;tpid++)
{
if(pDoc->m_TypeVarySpace[index*tpnum+tpid].IsData)
{
tmpstring.Format("\r\n%ld\t%s\t%d\t%.2f",index+1,
pDoc->m_BlockTypes[tpid].Name,
pDoc->m_BlockTypes[tpid].Val,
pDoc->m_TypeVarySpace[index*tpnum+tpid].AverArea);
ResultString+=tmpstring;
}
}
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWTYPESPACE)
{
pDoc->m_nShow=SHOWTYPESPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnTypespaceBlocknum()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\nBox序号\t景观名\t颜色值\t斑块数量\r\n";
BYTE tpnum=pDoc->m_BlockTypes.GetSize();
UINT boxnum=pDoc->m_nAllBoxNum;
for(UINT index=0;index<boxnum;index++)
{
for(BYTE tpid=0;tpid<tpnum;tpid++)
{
if(pDoc->m_TypeVarySpace[index*tpnum+tpid].IsData)
{
tmpstring.Format("\r\n%ld\t%s\t%d\t%ld",index+1,
pDoc->m_BlockTypes[tpid].Name,
pDoc->m_BlockTypes[tpid].Val,
(ULONG)pDoc->m_TypeVarySpace[index*tpnum+tpid].BlockNum);
ResultString+=tmpstring;
}
}
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWTYPESPACE)
{
pDoc->m_nShow=SHOWTYPESPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnTypespaceChip()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\nBox序号\t景观名\t颜色值\t碎裂化指数\r\n";
BYTE tpnum=pDoc->m_BlockTypes.GetSize();
UINT boxnum=pDoc->m_nAllBoxNum;
for(UINT index=0;index<boxnum;index++)
{
for(BYTE tpid=0;tpid<tpnum;tpid++)
{
if(pDoc->m_TypeVarySpace[index*tpnum+tpid].IsData)
{
tmpstring.Format("\r\n%ld\t%s\t%d\t%.2f",index+1,
pDoc->m_BlockTypes[tpid].Name,
pDoc->m_BlockTypes[tpid].Val,
pDoc->m_TypeVarySpace[index*tpnum+tpid].Chip);
ResultString+=tmpstring;
}
}
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWTYPESPACE)
{
pDoc->m_nShow=SHOWTYPESPACE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnShowbox()
{
CLSDoc *pDoc=GetDocument();
pDoc->m_bShowBox=!(pDoc->m_bShowBox);
CMenu * Menu=GetMenu();
Menu->CheckMenuItem(IDC_SHOWBOX,
(pDoc->m_bShowBox)?(MF_BYCOMMAND|MF_CHECKED):(MF_BYCOMMAND|MF_UNCHECKED));
if(pDoc->m_bShowBox)
{
pDoc->m_bShowLine=FALSE;
pDoc->m_bShowPoint=FALSE;
Menu->CheckMenuItem(IDC_SHOWLINE,MF_BYCOMMAND|MF_UNCHECKED);
Menu->CheckMenuItem(IDM_SHOWPOINT,MF_BYCOMMAND|MF_UNCHECKED);
}
pDoc->UpdateAllViews(NULL,PICVIEW,NULL);
}
void CMainFrame::OnAutoCorrelation()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\n空间化变量\t\tMoran I\t\tMoran z\r\n";
tmpstring.Format("\r\n斑块数量\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_BlockNum,
pDoc->m_AllofZValues.Z_BlockNum);
ResultString+=tmpstring;
tmpstring.Format("\r\n斑块平均面积\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_AverArea,
pDoc->m_AllofZValues.Z_AverArea);
ResultString+=tmpstring;
tmpstring.Format("\r\n碎裂化指数\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_Chip,
pDoc->m_AllofZValues.Z_Chip);
ResultString+=tmpstring;
tmpstring.Format("\r\n多样性指数\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_Diversity,
pDoc->m_AllofZValues.Z_Diversity);
ResultString+=tmpstring;
tmpstring.Format("\r\n均匀度指数\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_Blance,
pDoc->m_AllofZValues.Z_Blance);
ResultString+=tmpstring;
tmpstring.Format("\r\n优势度指数\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_Vantage,
pDoc->m_AllofZValues.Z_Vantage);
ResultString+=tmpstring;
tmpstring.Format("\r\n植被指数\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_Plant,
pDoc->m_AllofZValues.Z_Plant);
ResultString+=tmpstring;
tmpstring.Format("\r\n城市化指数\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_City,
pDoc->m_AllofZValues.Z_City);
ResultString+=tmpstring;
tmpstring.Format("\r\n人为干扰指数\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_Jamming,
pDoc->m_AllofZValues.Z_Jamming);
ResultString+=tmpstring;
tmpstring.Format("\r\n生态风险指数\t\t%.4f\t\t%.4f",
pDoc->m_AllofIValues.Z_Risk,
pDoc->m_AllofZValues.Z_Risk);
ResultString+=tmpstring;
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLAUTOCORRE)
{
pDoc->m_nShow=SHOWALLAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnTypeAutocorre()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\n景观名\t颜色值\t空间化变量\tMoran I\tMoran z\r\n";
for(int tt=0;tt<pDoc->m_BlockTypes.GetSize();tt++)
{
tmpstring.Format("\r\n%s\t%d\t斑块数量\t%.4f\t%.4f",
pDoc->m_BlockTypes[tt].Name,
pDoc->m_BlockTypes[tt].Val,
pDoc->m_TypeofIValues[tt].BlockNum,
pDoc->m_TypeofZValues[tt].BlockNum);
ResultString+=tmpstring;
tmpstring.Format("\r\n%s\t%d\t斑块平均面积\t%.4f\t%.4f",
pDoc->m_BlockTypes[tt].Name,
pDoc->m_BlockTypes[tt].Val,
pDoc->m_TypeofIValues[tt].AverArea,
pDoc->m_TypeofZValues[tt].AverArea);
ResultString+=tmpstring;
tmpstring.Format("\r\n%s\t%d\t碎裂化指数\t%.4f\t%.4f",
pDoc->m_BlockTypes[tt].Name,
pDoc->m_BlockTypes[tt].Val,
pDoc->m_TypeofIValues[tt].Chip,
pDoc->m_TypeofZValues[tt].Chip);
ResultString+=tmpstring;
ResultString+="\r\n";
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWTYPEAUTOCORRE)
{
pDoc->m_nShow=SHOWTYPEAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnEwCorre()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
CString ResultString;
CString tmpstring;
ResultString="\r\n空间化变量\t\tMoran I\t\tMoran z\r\n";
tmpstring.Format("\r\n斑块数量\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_BlockNum,
pDoc->m_EWofAllZValues.Z_BlockNum);
ResultString+=tmpstring;
tmpstring.Format("\r\n斑块平均面积\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_AverArea,
pDoc->m_EWofAllZValues.Z_AverArea);
ResultString+=tmpstring;
tmpstring.Format("\r\n碎裂化指数\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_Chip,
pDoc->m_EWofAllZValues.Z_Chip);
ResultString+=tmpstring;
tmpstring.Format("\r\n多样性指数\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_Diversity,
pDoc->m_EWofAllZValues.Z_Diversity);
ResultString+=tmpstring;
tmpstring.Format("\r\n均匀度指数\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_Blance,
pDoc->m_EWofAllZValues.Z_Blance);
ResultString+=tmpstring;
tmpstring.Format("\r\n优势度指数\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_Vantage,
pDoc->m_EWofAllZValues.Z_Vantage);
ResultString+=tmpstring;
tmpstring.Format("\r\n植被指数\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_Plant,
pDoc->m_EWofAllZValues.Z_Plant);
ResultString+=tmpstring;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -