📄 eqd.h
字号:
/*
Module : EQD.H
Purpose: Implementation for a MFC class to retrieve earthquake data from the US
Geological Survey Web site.
Created: PJN / 18-10-1999
Copyright (c) 1999 by PJ Naughter.
All rights reserved.
*/
/////////////////////////////// Defines ///////////////////////////////////////
#ifndef __EQD_H__
#define __EQD_H__
#ifndef __AFXTEMPL_H__
#pragma message("EQD classes require afxtempl.h in your PCH")
#endif
/////////////////////////////// Classes ///////////////////////////////////////
//Data pertaining to 1 single earthquake
class CQuakeData
{
public:
//Constructors / Destructors
CQuakeData();
//Methods
BOOL Parse(const CString& sLine); //Converts a line as returned into the member variable
//Enums
enum MagnitudeType
{
Ml, //
Lg, //Local or regional magnitude
Md, //Duration wave
Mb, //Body wave
Ms, //Surface wave
Mw, //Moment wave
};
enum LocationQuality
{
A, //Quake location is "Good"
B, //Quake location is "Fair"
C, //Quake location is "Poor"
D, //Quake Location is "Bad"
U, //Quake Location quality has not been determined
};
//Member variables
SYSTEMTIME m_Time; //The UTC date and time when the quake took place.
float m_Latitude; //The latitude where the quake took place
float m_Longitude; //The longitude where the quake took place
float m_Depth; //The depth in Km below sea level of the epicenter
MagnitudeType m_MagType; //the type of magnitude quoted
float m_Magnitude; //The actual magnitude of the earthquake (Richter Scale).
LocationQuality m_Quality; //The quality of the location fix
CString m_sComments; //Textual Description, Normally the location of the quake
};
//The main class which encapsulates the data retrieval
class CEQD
{
public:
//Methods
BOOL GetQuakeData(CArray<CQuakeData, CQuakeData&>& data, DWORD dwTimeout=500);
protected:
LPTSTR GetNextLine(LPTSTR pszData, CString& sLine);
};
#endif //__EQD_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -