Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
cISLogger Class Reference

#include <ISLogger.h>

Public Types

enum  eLogType {
  LOGTYPE_DAT = 0, LOGTYPE_SDAT, LOGTYPE_CSV, LOGTYPE_KML,
  LOGTYPE_JSON
}
 

Public Member Functions

 cISLogger ()
 
void CloseAllFiles ()
 
bool CopyLog (cISLogger &log, const string &timestamp=g_emptyString, const string &outputDir=g_emptyString, eLogType logType=LOGTYPE_DAT, float maxDiskSpacePercent=0.5f, uint32_t maxFileSize=1024 *1024 *5, bool useSubFolderTimestamp=true)
 
bool Enabled ()
 
void EnableLogging (bool enabled)
 
uint32_t FileCount (unsigned int device=0)
 
float FileSizeMB (unsigned int device=0)
 
uint32_t GetDeviceCount ()
 
const dev_info_tGetDeviceInfo (unsigned int device=0)
 
const cLogStatsGetStats ()
 
time_t GetTimeoutFlushSeconds ()
 
eLogType GetType ()
 
bool InitSave (eLogType logType=LOGTYPE_DAT, const string &directory=g_emptyString, int numDevices=1, float maxDiskSpacePercent=0.5f, uint32_t maxFileSize=1024 *1024 *5, bool useSubFolderTimestamp=true)
 
bool InitSaveTimestamp (const string &timeStamp, const string &directory=g_emptyString, const string &subDirectory=g_emptyString, int numDevices=1, eLogType logType=LOGTYPE_DAT, float maxDiskSpacePercent=0.5f, uint32_t maxFileSize=1024 *1024 *5, bool useSubFolderTimestamp=true)
 
bool LoadFromDirectory (const string &directory, eLogType logType=LOGTYPE_DAT, vector< string > serials={})
 
bool LogData (unsigned int device, p_data_hdr_t *dataHdr, const uint8_t *dataBuf)
 
string LogDirectory ()
 
uint64_t LogSize (unsigned int device=0)
 
uint64_t LogSizeAll ()
 
float LogSizeAllMB ()
 
float LogSizeMB (unsigned int device=0)
 
void OpenWithSystemApp ()
 
p_data_tReadData (unsigned int device=0)
 
p_data_tReadNextData (unsigned int &device)
 
bool SetDeviceInfo (const dev_info_t *info, unsigned int device=0)
 
void SetKmlConfig (bool showPath=true, bool showSample=false, bool showTimeStamp=true, double updatePeriodSec=1.0, bool altClampToGround=true)
 
void SetTimeoutFlushSeconds (time_t timeoutFlushSeconds)
 
string TimeStamp ()
 
void Update ()
 
virtual ~cISLogger ()
 

Static Public Member Functions

static string CreateCurrentTimestamp ()
 
static bool LogDataIsCorrupt (const p_data_t *data)
 
static bool LogHeaderIsCorrupt (const p_data_hdr_t *hdr)
 
static eLogType ParseLogType (const string &logTypeString)
 
static bool ReadAllLogDataIntoMemory (const string &directory, map< uint32_t, vector< vector< uint8_t >>> &data)
 

Static Public Attributes

static const string g_emptyString
 

Private Member Functions

 cISLogger (const cISLogger &copy)
 
void Cleanup ()
 
bool InitDevicesForWriting (int numDevices=1)
 
bool InitSaveCommon (eLogType logType, const string &directory, const string &subDirectory, int numDevices, float maxDiskSpacePercent, uint32_t maxFileSize, bool useSubFolderTimestamp)
 

Static Private Member Functions

static time_t GetTime ()
 

Private Attributes

bool m_altClampToGround
 
vector< cDeviceLog * > m_devices
 
string m_directory
 
bool m_enabled
 
cISLogFileBasem_errorFile
 
double m_iconUpdatePeriodSec
 
time_t m_lastCommTime
 
cLogStatsm_logStats
 
eLogType m_logType
 
uint64_t m_maxDiskSpace
 
uint32_t m_maxFileSize
 
bool m_showPath
 
bool m_showSample
 
bool m_showTimeStamp
 
time_t m_timeoutFlushSeconds
 
string m_timeStamp
 

Detailed Description

Definition at line 47 of file ISLogger.h.

Member Enumeration Documentation

◆ eLogType

Enumerator
LOGTYPE_DAT 
LOGTYPE_SDAT 
LOGTYPE_CSV 
LOGTYPE_KML 
LOGTYPE_JSON 

Definition at line 50 of file ISLogger.h.

Constructor & Destructor Documentation

◆ cISLogger() [1/2]

cISLogger::cISLogger ( )

Definition at line 73 of file ISLogger.cpp.

◆ ~cISLogger()

cISLogger::~cISLogger ( )
virtual

Definition at line 84 of file ISLogger.cpp.

◆ cISLogger() [2/2]

cISLogger::cISLogger ( const cISLogger copy)
private

Member Function Documentation

◆ Cleanup()

void cISLogger::Cleanup ( )
private

Definition at line 92 of file ISLogger.cpp.

◆ CloseAllFiles()

void cISLogger::CloseAllFiles ( )

Definition at line 439 of file ISLogger.cpp.

◆ CopyLog()

bool cISLogger::CopyLog ( cISLogger log,
const string &  timestamp = g_emptyString,
const string &  outputDir = g_emptyString,
eLogType  logType = LOGTYPE_DAT,
float  maxDiskSpacePercent = 0.5f,
uint32_t  maxFileSize = 1024 * 1024 * 5,
bool  useSubFolderTimestamp = true 
)

Definition at line 541 of file ISLogger.cpp.

◆ CreateCurrentTimestamp()

string cISLogger::CreateCurrentTimestamp ( )
static

Definition at line 180 of file ISLogger.cpp.

◆ Enabled()

bool cISLogger::Enabled ( )
inline

Definition at line 77 of file ISLogger.h.

◆ EnableLogging()

void cISLogger::EnableLogging ( bool  enabled)
inline

Definition at line 76 of file ISLogger.h.

◆ FileCount()

uint32_t cISLogger::FileCount ( unsigned int  device = 0)

Definition at line 510 of file ISLogger.cpp.

◆ FileSizeMB()

float cISLogger::FileSizeMB ( unsigned int  device = 0)

Definition at line 499 of file ISLogger.cpp.

◆ GetDeviceCount()

uint32_t cISLogger::GetDeviceCount ( )
inline

Definition at line 88 of file ISLogger.h.

◆ GetDeviceInfo()

const dev_info_t * cISLogger::GetDeviceInfo ( unsigned int  device = 0)

Definition at line 531 of file ISLogger.cpp.

◆ GetStats()

const cLogStats& cISLogger::GetStats ( )
inline

Definition at line 92 of file ISLogger.h.

◆ GetTime()

static time_t cISLogger::GetTime ( )
inlinestaticprivate

Definition at line 166 of file ISLogger.h.

◆ GetTimeoutFlushSeconds()

time_t cISLogger::GetTimeoutFlushSeconds ( )
inline

Get the timeout flush parameter in seconds

Returns
the timeout flush parameter in seconds

Definition at line 99 of file ISLogger.h.

◆ GetType()

eLogType cISLogger::GetType ( )
inline

Definition at line 93 of file ISLogger.h.

◆ InitDevicesForWriting()

bool cISLogger::InitDevicesForWriting ( int  numDevices = 1)
private

Definition at line 229 of file ISLogger.cpp.

◆ InitSave()

bool cISLogger::InitSave ( eLogType  logType = LOGTYPE_DAT,
const string &  directory = g_emptyString,
int  numDevices = 1,
float  maxDiskSpacePercent = 0.5f,
uint32_t  maxFileSize = 1024 * 1024 * 5,
bool  useSubFolderTimestamp = true 
)

Definition at line 206 of file ISLogger.cpp.

◆ InitSaveCommon()

bool cISLogger::InitSaveCommon ( eLogType  logType,
const string &  directory,
const string &  subDirectory,
int  numDevices,
float  maxDiskSpacePercent,
uint32_t  maxFileSize,
bool  useSubFolderTimestamp 
)
private

Definition at line 125 of file ISLogger.cpp.

◆ InitSaveTimestamp()

bool cISLogger::InitSaveTimestamp ( const string &  timeStamp,
const string &  directory = g_emptyString,
const string &  subDirectory = g_emptyString,
int  numDevices = 1,
eLogType  logType = LOGTYPE_DAT,
float  maxDiskSpacePercent = 0.5f,
uint32_t  maxFileSize = 1024 * 1024 * 5,
bool  useSubFolderTimestamp = true 
)

Definition at line 213 of file ISLogger.cpp.

◆ LoadFromDirectory()

bool cISLogger::LoadFromDirectory ( const string &  directory,
eLogType  logType = LOGTYPE_DAT,
vector< string >  serials = {} 
)

Definition at line 259 of file ISLogger.cpp.

◆ LogData()

bool cISLogger::LogData ( unsigned int  device,
p_data_hdr_t dataHdr,
const uint8_t *  dataBuf 
)

Definition at line 348 of file ISLogger.cpp.

◆ LogDataIsCorrupt()

bool cISLogger::LogDataIsCorrupt ( const p_data_t data)
static

Definition at line 68 of file ISLogger.cpp.

◆ LogDirectory()

string cISLogger::LogDirectory ( )
inline

Definition at line 81 of file ISLogger.h.

◆ LogHeaderIsCorrupt()

bool cISLogger::LogHeaderIsCorrupt ( const p_data_hdr_t hdr)
static

Definition at line 51 of file ISLogger.cpp.

◆ LogSize()

uint64_t cISLogger::LogSize ( unsigned int  device = 0)

Definition at line 471 of file ISLogger.cpp.

◆ LogSizeAll()

uint64_t cISLogger::LogSizeAll ( )

Definition at line 460 of file ISLogger.cpp.

◆ LogSizeAllMB()

float cISLogger::LogSizeAllMB ( )

Definition at line 482 of file ISLogger.cpp.

◆ LogSizeMB()

float cISLogger::LogSizeMB ( unsigned int  device = 0)

Definition at line 488 of file ISLogger.cpp.

◆ OpenWithSystemApp()

void cISLogger::OpenWithSystemApp ( void  )

Definition at line 451 of file ISLogger.cpp.

◆ ParseLogType()

static eLogType cISLogger::ParseLogType ( const string &  logTypeString)
inlinestatic

Definition at line 134 of file ISLogger.h.

◆ ReadAllLogDataIntoMemory()

bool cISLogger::ReadAllLogDataIntoMemory ( const string &  directory,
map< uint32_t, vector< vector< uint8_t >>> &  data 
)
static

Definition at line 589 of file ISLogger.cpp.

◆ ReadData()

p_data_t * cISLogger::ReadData ( unsigned int  device = 0)

Definition at line 402 of file ISLogger.cpp.

◆ ReadNextData()

p_data_t * cISLogger::ReadNextData ( unsigned int &  device)

Definition at line 425 of file ISLogger.cpp.

◆ SetDeviceInfo()

bool cISLogger::SetDeviceInfo ( const dev_info_t info,
unsigned int  device = 0 
)

Definition at line 520 of file ISLogger.cpp.

◆ SetKmlConfig()

void cISLogger::SetKmlConfig ( bool  showPath = true,
bool  showSample = false,
bool  showTimeStamp = true,
double  updatePeriodSec = 1.0,
bool  altClampToGround = true 
)
inline

Definition at line 120 of file ISLogger.h.

◆ SetTimeoutFlushSeconds()

void cISLogger::SetTimeoutFlushSeconds ( time_t  timeoutFlushSeconds)
inline

Set the timeout flush logger parameter in seconds

Parameters
timeoutFlushSecondsthe timeout flush logger parameter in seconds

Definition at line 105 of file ISLogger.h.

◆ TimeStamp()

string cISLogger::TimeStamp ( )
inline

Definition at line 80 of file ISLogger.h.

◆ Update()

void cISLogger::Update ( )

Definition at line 107 of file ISLogger.cpp.

Member Data Documentation

◆ g_emptyString

const string cISLogger::g_emptyString
static

Definition at line 59 of file ISLogger.h.

◆ m_altClampToGround

bool cISLogger::m_altClampToGround
private

Definition at line 185 of file ISLogger.h.

◆ m_devices

vector<cDeviceLog*> cISLogger::m_devices
private

Definition at line 179 of file ISLogger.h.

◆ m_directory

string cISLogger::m_directory
private

Definition at line 177 of file ISLogger.h.

◆ m_enabled

bool cISLogger::m_enabled
private

Definition at line 176 of file ISLogger.h.

◆ m_errorFile

cISLogFileBase* cISLogger::m_errorFile
private

Definition at line 183 of file ISLogger.h.

◆ m_iconUpdatePeriodSec

double cISLogger::m_iconUpdatePeriodSec
private

Definition at line 189 of file ISLogger.h.

◆ m_lastCommTime

time_t cISLogger::m_lastCommTime
private

Definition at line 190 of file ISLogger.h.

◆ m_logStats

cLogStats* cISLogger::m_logStats
private

Definition at line 182 of file ISLogger.h.

◆ m_logType

eLogType cISLogger::m_logType
private

Definition at line 175 of file ISLogger.h.

◆ m_maxDiskSpace

uint64_t cISLogger::m_maxDiskSpace
private

Definition at line 180 of file ISLogger.h.

◆ m_maxFileSize

uint32_t cISLogger::m_maxFileSize
private

Definition at line 181 of file ISLogger.h.

◆ m_showPath

bool cISLogger::m_showPath
private

Definition at line 187 of file ISLogger.h.

◆ m_showSample

bool cISLogger::m_showSample
private

Definition at line 186 of file ISLogger.h.

◆ m_showTimeStamp

bool cISLogger::m_showTimeStamp
private

Definition at line 188 of file ISLogger.h.

◆ m_timeoutFlushSeconds

time_t cISLogger::m_timeoutFlushSeconds
private

Definition at line 191 of file ISLogger.h.

◆ m_timeStamp

string cISLogger::m_timeStamp
private

Definition at line 178 of file ISLogger.h.


The documentation for this class was generated from the following files:


inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:02