home *** CD-ROM | disk | FTP | other *** search
- // gpsrcDoc.cpp : implementation of the CGpsrcDoc class
- //
-
- #include "stdafx.h"
- #include "gpsrc.h"
-
- #include "gpsrcDoc.h"
- #include "MainFrm.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CGpsrcDoc
-
- IMPLEMENT_DYNCREATE(CGpsrcDoc, CDocument)
-
- BEGIN_MESSAGE_MAP(CGpsrcDoc, CDocument)
- //{{AFX_MSG_MAP(CGpsrcDoc)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CGpsrcDoc construction/destruction
-
- CGpsrcDoc::CGpsrcDoc()
- {
- // TODO: add one-time construction code here
-
- m_pSock= NULL;
- }
-
- CGpsrcDoc::~CGpsrcDoc()
- {
- }
-
-
- BOOL CGpsrcDoc::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
-
- // TODO: add reinitialization code here
- // (SDI documents will reuse this document)
-
-
- // Create some Longitude/Latitude test points.
- m_LonLat.Add("122W:08:35 47N:52:36");
- m_LonLat.Add("122W:15:18 47N:55:34");
- m_LonLat.Add("122W:23:39 47N:54:22");
- m_LonLat.Add("122W:27:05 47N:50:44");
- m_LonLat.Add("122W:22:10 47N:45:47");
- m_LonLat.Add("122W:17:45 47N:44:21");
- m_LonLat.Add("122W:10:33 47N:42:48");
- m_LonLat.Add("122W:06:57 47N:38:11");
- m_LonLat.Add("122W:12:41 47N:36:39");
- m_LonLat.Add("122W:22:10 47N:37:05");
- m_LonLat.Add("122W:27:34 47N:42:22");
- m_LonLat.Add("122W:30:50 47N:46:00");
- m_LonLat.Add("122W:31:10 47N:48:32");
- m_LonLat.Add("122W:27:14 47N:54:55");
- m_LonLat.Add("122W:19:33 47N:54:08");
- m_LonLat.Add("122W:19:04 47N:48:51");
- m_LonLat.Add("122W:19:23 47N:42:29");
- m_LonLat.Add("122W:19:23 47N:39:43");
- m_LonLat.Add("122W:19:13 47N:35:26");
- m_LonLat.Add("122W:19:39 47N:35:00");
- m_LonLat.Add("122W:15:18 47N:41:09");
- m_LonLat.Add("122W:15:18 47N:43:41");
- m_LonLat.Add("122W:15:28 47N:51:17");
- m_LonLat.Add("122W:14:09 47N:57:00");
- m_LonLat.Add("122W:08:45 47N:56:39");
-
- // Initialize the lon,lat array index.
- m_curLonLat= 0;
-
-
- return TRUE;
- }
- void CGpsrcDoc::DeleteContents()
- {
- m_strings.RemoveAll();
- UpdateAllViews(NULL); // refresh our screen.
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CGpsrcDoc serialization
-
- void CGpsrcDoc::Serialize(CArchive& ar)
- {
- if (ar.IsStoring())
- {
- // TODO: add storing code here
- }
- else
- {
- // TODO: add loading code here
- }
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CGpsrcDoc diagnostics
-
- #ifdef _DEBUG
- void CGpsrcDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
-
- void CGpsrcDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CGpsrcDoc commands
-
- void CGpsrcDoc::SendPosition()
- {
- if (m_pSock)
- {
- CString lonlat= m_LonLat.GetAt(m_curLonLat);
- m_strings.Add(lonlat);
- UpdateAllViews(NULL); // refresh our screen.
-
- // Recycle points if we need to.
- if (++m_curLonLat>= m_LonLat.GetSize())
- m_curLonLat= 0;
-
-
- }
- }
-
-