📄 gpssimdoc.h
字号:
// GPSSimDoc.h : interface of the CGPSSimDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_GPSSIMDOC_H__63CEC1BA_E32F_4EEB_B1FD_F4ED58D70CC3__INCLUDED_)
#define AFX_GPSSIMDOC_H__63CEC1BA_E32F_4EEB_B1FD_F4ED58D70CC3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Parse.h"
#include "serialport.h"
#include <vector>
using namespace std;
struct KNPosition
{
char data[12]; // 日期
char time[16]; // 时间
long latitude; // 纬度
long longitude; // 经度
float height; // 高度
float speed; // 速度
float direction; // 方向
};
class CGPSSimDoc : public CDocument
{
public:
friend class CGPSSimView;
// 当前显示的是原始信号还是变换后的信号
static bool m_bDisplayFlag;
protected: // create from serialization only
CGPSSimDoc();
DECLARE_DYNCREATE(CGPSSimDoc)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGPSSimDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
bool Validate();
void Begin();
int Next();
void SetSerialPort(CString &port, DWORD dwBand)
{
m_strPort = port;
m_dwBand = dwBand;
}
const vector<KNPosition>& GetAllTrnPos(){return m_posRawAll;}
const vector<KNPosition>& GetAllRawPos(){return m_posRawAll;}
const vector<char*>& GetAllRawText(){return m_textRawAll;}
const vector<char*>& GetCurRawText(){return m_textRawCur;}
const vector<char*>& GetAllTrnText(){return m_textRawAll;}
const vector<char*>& GetCurTrnText(){return m_textRawCur;}
void GetSetting(char &abnormal, char &nosignal, char &acel)
{
abnormal = m_cAbnormal;
nosignal = m_cNosignal;
acel = m_cAccelerate;
}
void SetSetting(char &abnormal, char &nosignal, char &acel)
{
m_cAbnormal = abnormal;
m_cNosignal = nosignal;
m_cAccelerate = acel;
}
protected:
int NextSegmant(vector<char*> &str);
int GetPos(const vector<char*> &str, KNPosition &pos);
virtual ~CGPSSimDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
ofstream m_streamTrace;
#endif
protected:
vector<char*> m_textRawCur;
//vector<char*> m_textTrnCur;
vector<char*> m_textRawAll;
//vector<char*> m_textTrnAll;
vector<KNPosition> m_posRawAll;
//vector<KNPosition> m_posTrnAll;
char m_cAbnormal; // 异常点出现频率
char m_cNosignal; // 无信号点出现频率
char m_cAccelerate; // 加速比例
CParse m_parse;
CSerialPort m_serialPort;
long m_lStatus; // 串口状态
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGPSSimDoc)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
CString m_strPort;
DWORD m_dwBand;
protected:
public:
afx_msg void OnSignalConnect();
int Prior(void);
int GetCount(void);
int GetCurIndex(void);
void Reset(void);
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GPSSIMDOC_H__63CEC1BA_E32F_4EEB_B1FD_F4ED58D70CC3__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -