📄 mainfrm.cpp
字号:
tmpstring.Format("\r\n城市化指数\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_City,
pDoc->m_EWofAllZValues.Z_City);
ResultString+=tmpstring;
tmpstring.Format("\r\n人为干扰指数\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_Jamming,
pDoc->m_EWofAllZValues.Z_Jamming);
ResultString+=tmpstring;
tmpstring.Format("\r\n生态风险指数\t\t%.4f\t\t%.4f",
pDoc->m_EWofAllIValues.Z_Risk,
pDoc->m_EWofAllZValues.Z_Risk);
ResultString+=tmpstring;
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLEWAUTOCORRE)
{
pDoc->m_nShow=SHOWALLEWAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnSnCorre()
{
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_SNofAllIValues.Z_BlockNum,
pDoc->m_SNofAllZValues.Z_BlockNum);
ResultString+=tmpstring;
tmpstring.Format("\r\n斑块平均面积\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_AverArea,
pDoc->m_SNofAllZValues.Z_AverArea);
ResultString+=tmpstring;
tmpstring.Format("\r\n碎裂化指数\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_Chip,
pDoc->m_SNofAllZValues.Z_Chip);
ResultString+=tmpstring;
tmpstring.Format("\r\n多样性指数\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_Diversity,
pDoc->m_SNofAllZValues.Z_Diversity);
ResultString+=tmpstring;
tmpstring.Format("\r\n均匀度指数\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_Blance,
pDoc->m_SNofAllZValues.Z_Blance);
ResultString+=tmpstring;
tmpstring.Format("\r\n优势度指数\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_Vantage,
pDoc->m_SNofAllZValues.Z_Vantage);
ResultString+=tmpstring;
tmpstring.Format("\r\n植被指数\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_Plant,
pDoc->m_SNofAllZValues.Z_Plant);
ResultString+=tmpstring;
tmpstring.Format("\r\n城市化指数\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_City,
pDoc->m_SNofAllZValues.Z_City);
ResultString+=tmpstring;
tmpstring.Format("\r\n人为干扰指数\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_Jamming,
pDoc->m_SNofAllZValues.Z_Jamming);
ResultString+=tmpstring;
tmpstring.Format("\r\n生态风险指数\t\t%.4f\t\t%.4f",
pDoc->m_SNofAllIValues.Z_Risk,
pDoc->m_SNofAllZValues.Z_Risk);
ResultString+=tmpstring;
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLSNAUTOCORRE)
{
pDoc->m_nShow=SHOWALLSNAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnSeCorre()
{
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_SEofAllIValues.Z_BlockNum,
pDoc->m_SEofAllZValues.Z_BlockNum);
ResultString+=tmpstring;
tmpstring.Format("\r\n斑块平均面积\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_AverArea,
pDoc->m_SEofAllZValues.Z_AverArea);
ResultString+=tmpstring;
tmpstring.Format("\r\n碎裂化指数\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_Chip,
pDoc->m_SEofAllZValues.Z_Chip);
ResultString+=tmpstring;
tmpstring.Format("\r\n多样性指数\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_Diversity,
pDoc->m_SEofAllZValues.Z_Diversity);
ResultString+=tmpstring;
tmpstring.Format("\r\n均匀度指数\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_Blance,
pDoc->m_SEofAllZValues.Z_Blance);
ResultString+=tmpstring;
tmpstring.Format("\r\n优势度指数\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_Vantage,
pDoc->m_SEofAllZValues.Z_Vantage);
ResultString+=tmpstring;
tmpstring.Format("\r\n植被指数\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_Plant,
pDoc->m_SEofAllZValues.Z_Plant);
ResultString+=tmpstring;
tmpstring.Format("\r\n城市化指数\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_City,
pDoc->m_SEofAllZValues.Z_City);
ResultString+=tmpstring;
tmpstring.Format("\r\n人为干扰指数\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_Jamming,
pDoc->m_SEofAllZValues.Z_Jamming);
ResultString+=tmpstring;
tmpstring.Format("\r\n生态风险指数\t\t%.4f\t\t%.4f",
pDoc->m_SEofAllIValues.Z_Risk,
pDoc->m_SEofAllZValues.Z_Risk);
ResultString+=tmpstring;
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLSEAUTOCORRE)
{
pDoc->m_nShow=SHOWALLSEAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnSwCorre()
{
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_SWofAllIValues.Z_BlockNum,
pDoc->m_SWofAllZValues.Z_BlockNum);
ResultString+=tmpstring;
tmpstring.Format("\r\n斑块平均面积\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_AverArea,
pDoc->m_SWofAllZValues.Z_AverArea);
ResultString+=tmpstring;
tmpstring.Format("\r\n碎裂化指数\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_Chip,
pDoc->m_SWofAllZValues.Z_Chip);
ResultString+=tmpstring;
tmpstring.Format("\r\n多样性指数\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_Diversity,
pDoc->m_SWofAllZValues.Z_Diversity);
ResultString+=tmpstring;
tmpstring.Format("\r\n均匀度指数\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_Blance,
pDoc->m_SWofAllZValues.Z_Blance);
ResultString+=tmpstring;
tmpstring.Format("\r\n优势度指数\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_Vantage,
pDoc->m_SWofAllZValues.Z_Vantage);
ResultString+=tmpstring;
tmpstring.Format("\r\n植被指数\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_Plant,
pDoc->m_SWofAllZValues.Z_Plant);
ResultString+=tmpstring;
tmpstring.Format("\r\n城市化指数\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_City,
pDoc->m_SWofAllZValues.Z_City);
ResultString+=tmpstring;
tmpstring.Format("\r\n人为干扰指数\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_Jamming,
pDoc->m_SWofAllZValues.Z_Jamming);
ResultString+=tmpstring;
tmpstring.Format("\r\n生态风险指数\t\t%.4f\t\t%.4f",
pDoc->m_SWofAllIValues.Z_Risk,
pDoc->m_SWofAllZValues.Z_Risk);
ResultString+=tmpstring;
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWALLSWAUTOCORRE)
{
pDoc->m_nShow=SHOWALLSWAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnTypeEwCorre()
{
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_EWTypeofIValues[tt].BlockNum,
pDoc->m_EWTypeofZValues[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_EWTypeofIValues[tt].AverArea,
pDoc->m_EWTypeofZValues[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_EWTypeofIValues[tt].Chip,
pDoc->m_EWTypeofZValues[tt].Chip);
ResultString+=tmpstring;
ResultString+="\r\n";
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWTYPEEWAUTOCORRE)
{
pDoc->m_nShow=SHOWTYPEEWAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnTypeSnCorre()
{
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_SNTypeofIValues[tt].BlockNum,
pDoc->m_SNTypeofZValues[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_SNTypeofIValues[tt].AverArea,
pDoc->m_SNTypeofZValues[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_SNTypeofIValues[tt].Chip,
pDoc->m_SNTypeofZValues[tt].Chip);
ResultString+=tmpstring;
ResultString+="\r\n";
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWTYPESNAUTOCORRE)
{
pDoc->m_nShow=SHOWTYPESNAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnTypeSeCorre()
{
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_SETypeofIValues[tt].BlockNum,
pDoc->m_SETypeofZValues[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_SETypeofIValues[tt].AverArea,
pDoc->m_SETypeofZValues[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_SETypeofIValues[tt].Chip,
pDoc->m_SETypeofZValues[tt].Chip);
ResultString+=tmpstring;
ResultString+="\r\n";
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWTYPESEAUTOCORRE)
{
pDoc->m_nShow=SHOWTYPESEAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnTypeSwCorre()
{
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_SWTypeofIValues[tt].BlockNum,
pDoc->m_SWTypeofZValues[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_SWTypeofIValues[tt].AverArea,
pDoc->m_SWTypeofZValues[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_SWTypeofIValues[tt].Chip,
pDoc->m_SWTypeofZValues[tt].Chip);
ResultString+=tmpstring;
ResultString+="\r\n";
}
CResultDlg resultdlg(NULL,ResultString);
resultdlg.DoModal();
if(pDoc->m_nShow!=SHOWTYPESWAUTOCORRE)
{
pDoc->m_nShow=SHOWTYPESWAUTOCORRE;
pDoc->UpdateAllViews(NULL,TXTVIEW,NULL);
}
SwitchToView(theApp.m_pTextTemplate,RUNTIME_CLASS(CTXTView));
}
void CMainFrame::OnAllDiffQuadAverarea()
{
CLSDoc * pDoc=GetDocument();
if(!pDoc->m_bEverAllSpace)
{
if(!OnBoxdefine())
return;
}
UINT boxlong=pDoc->m_nBoxlong;
UINT xlong=pDoc->m_nWidth-boxlong;
UINT ylong=pDoc->m_nHeight-boxlong;
UINT maxlong=sqrt(xlong*xlong+ylong*ylong);
CMultiDiffQuadDistDlg DiffDlg(NULL,maxlong,boxlong,pDoc->oldDiffString,pDoc->oldDiffRange);
if(DiffDlg.DoModal()!=IDOK)
{
return;
}
pDoc->oldDiffString=DiffDlg.m_Boxleng;
pDoc->oldDiffRange=DiffDlg.m_nRange;
int distnum=DiffDlg.m_Lengs.GetSize();
double * zValues;
double * getvalue;
zValues=pDoc->MakeZValues(0,INDEX_AVERAREA);
CString ResultString="\r\n\t整体平均斑块面积地统计学分析结果\r\n";
ResultString+="\r\n距离\t变异矩[g(h)]\t标准变异矩\t相关矩[r(h)]";
ResultString+="\t东西向变异矩\t东西标准变异矩\t东西向相关矩";
ResultString+="\t南北向变异矩\t南北标准变异矩\t南北向相关矩";
ResultString+="\t东南向变异矩\t东南标准变异矩\t东南向相关矩";
ResultString+="\t西南向变异矩\t西南标准变异矩\t西南向相关矩\r\n";
CString tmpstr;
CWaitDlg waitdlg;
waitdlg.Create(IDD_WAIT,NULL);
waitdlg.m_ProgWait.SetRange(0,distnum+1);
waitdlg.m_ProgWait.SetStep(1);
waitdlg.m_ProgWait.StepIt();
double stand=pDoc->m_AverAllIndex.Z_AverArea*pDoc->m_AverAllIndex.Z_AverArea;
for(int i=0;i<distnum;i++)
{
getvalue=pDoc->CalcDiffQuad(zValues,pDoc->m_AverAllIndex.Z_AverArea,
pDoc->m_AllC0.Z_AverArea,DiffDlg.m_Lengs[i],DiffDlg.m_nRange);
tmpstr.Format("\r\n%d\t%14.4f\t%14.4f\t%14.4f\t%14.4f\t%14.4f\t%14.4f\t%14.4f\t%14
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -