-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAI3Doc.cpp
105 lines (87 loc) · 2.14 KB
/
AI3Doc.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// AI3Doc.cpp : implementation of the CAI3Doc class
//
#include "stdafx.h"
#include "AI3.h"
#include "AI3Doc.h"
#include "InputAdvDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAI3Doc
IMPLEMENT_DYNCREATE(CAI3Doc, CDocument)
BEGIN_MESSAGE_MAP(CAI3Doc, CDocument)
ON_COMMAND(IDM_Custom,OnFileNew2)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAI3Doc construction/destruction
CAI3Doc::CAI3Doc()
{
}
CAI3Doc::~CAI3Doc()
{
}
BOOL CAI3Doc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
static BOOL Ready = FALSE;
if(!Ready) return Ready = TRUE;
CMain MainProcess;
if(MainProcess.LoadData())
{
List *pList = MainProcess.GetResultListPoint();
this->GenerateDispList(pList);//生成显示链表
}
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAI3Doc serialization
void CAI3Doc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
}
else
{
}
}
/////////////////////////////////////////////////////////////////////////////
// CAI3Doc diagnostics
#ifdef _DEBUG
void CAI3Doc::AssertValid() const
{
CDocument::AssertValid();
}
void CAI3Doc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CAI3Doc commands
///////////////////////////////////////////////
// 产生结果显示链表
///////////////////////////////////////////////
void CAI3Doc::GenerateDispList(List *pScrList)
{
if(m_DispList.GetCount() > 0) m_DispList.RemoveAll();
POSITION pos = pScrList->GetHeadPosition();
while(pos)
{
CDisplay * SrcItem = (CDisplay *)pScrList->GetNext(pos);
this->m_DispList.AddTail(SrcItem);
}
}
void CAI3Doc::OnFileNew2()
{
CMain MainProcess;
if(MainProcess.LoadData(true))
{
List *pList = MainProcess.GetResultListPoint();
this->GenerateDispList(pList);//生成显示链表
}
this->UpdateAllViews(NULL);
}