64 lines
1.9 KiB
C++
Executable File
64 lines
1.9 KiB
C++
Executable File
/************************************************************/
|
|
/* NAME: Xiaobin Zeng */
|
|
/* ORGN: MIT */
|
|
/* FILE: DataManagement.h */
|
|
/* DATE: */
|
|
/************************************************************/
|
|
|
|
#ifndef DataManagement_HEADER
|
|
#define DataManagement_HEADER
|
|
|
|
#include "MOOS/libMOOS/Thirdparty/AppCasting/AppCastingMOOSApp.h"
|
|
#include "MOOS/libMOOS/MOOSLib.h"
|
|
|
|
|
|
struct MotionControlInfo
|
|
{
|
|
double desiredHeading;
|
|
double desiredSpeed;
|
|
double desiredDepth;
|
|
};
|
|
|
|
class DataManagement : public AppCastingMOOSApp
|
|
//class DataManagement : public CMOOSApp
|
|
{
|
|
public:
|
|
DataManagement();
|
|
~DataManagement();
|
|
|
|
protected: // Standard MOOSApp functions to overload
|
|
bool OnNewMail(MOOSMSG_LIST &NewMail);
|
|
bool Iterate();
|
|
bool OnConnectToServer();
|
|
bool OnStartUp();
|
|
bool DoAsyncLog(MOOSMSG_LIST & NewMail);
|
|
|
|
protected:
|
|
enum MissionStatus{FAULT=0, UNRUN=1, MANUAL=2 ,RUN=3, CONFIG=5};
|
|
void RegisterVariables();
|
|
bool buildReport();
|
|
bool OpenFile(std::ofstream & of,const std::string & sName);
|
|
void DoAuvDataLogBanner(std::ofstream &os);
|
|
void DoMissionHistoryBanner(std::ofstream &os);
|
|
void DoFaultHandleBanner(std::ofstream &os);
|
|
void DoMotionControlBanner(std::ofstream &os);
|
|
|
|
void GenerateFileName(std::string &fileDir, std::string &fileName);
|
|
bool OpenOutputStream();
|
|
void CloseOutputStream();
|
|
double getTimeStamp();
|
|
int nDoublePrecision;
|
|
std::ofstream auvDataStream;
|
|
std::ofstream missionHistoryStream;
|
|
std::ofstream clientCommandStream;
|
|
std::ofstream faultLogStream;
|
|
std::ofstream motionControlStream;
|
|
std::map<std::string, int> logVarList;
|
|
std::string contentFromStream;
|
|
struct MotionControlInfo motionControlInfo;
|
|
bool logEnable;
|
|
std::string saveLogDir;
|
|
};
|
|
|
|
#endif
|