WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
Hdf5Logger.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX INC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX INC.
15******************************************************************************/
16/*
17HDF5 Logger header file
18
19Author: Alex Reynolds
20*/
21#ifndef HDF5_LOGGER_H
22#define HDF5_LOGGER_H
23
24#include <vector>
25
26#include "highfive/highfive.hpp"
27#include "logging/SimLogger.h"
29
30namespace warptwin {
31
36 class Hdf5Logger : public clockwerk::SimLogger {
37 public:
39 Hdf5Logger(warpos::FlightExecutive &exec, const std::string &filename="output.h5", unsigned int buffer_size=1000);
40 virtual ~Hdf5Logger();
41
44 int close();
45
51 void logLevel(log_level_e log_level) {_local_log_level = log_level;}
52
55 const HighFive::File* h5File() {return _file;}
56 protected:
58 int _createSetupFile();
59
61 int _writeToFile();
62
65
67 HighFive::File* _file;
68 HighFive::DataSpace* _dataspace;
69 HighFive::DataSetCreateProps _props;
70 std::vector<HighFive::DataSet> _datasets;
71
73 unsigned long long _l_start_idx;
74 unsigned long long _l_end_idx;
75
78 };
79
80}
81
82#endif
Executive derivation specifically to run flight systems.
Definition FlightExecutive.h:46
virtual ~Hdf5Logger()
Definition Hdf5Logger.cpp:55
log_level_e _local_log_level
The log level for this particular app.
Definition Hdf5Logger.h:77
HighFive::DataSpace * _dataspace
Definition Hdf5Logger.h:68
HighFive::File * _file
High Five variables for writing HDF5 to file.
Definition Hdf5Logger.h:67
std::vector< HighFive::DataSet > _datasets
Definition Hdf5Logger.h:70
log_level_e logLevel()
Get the log level set for the executive.
Definition Hdf5Logger.h:48
int _writeToFile()
Function to write buffered data to HDF5 file.
Definition Hdf5Logger.cpp:147
Hdf5Logger(warpos::FlightExecutive &exec, const std::string &filename="output.h5", unsigned int buffer_size=1000)
Constructor for CSV logger – wraps around logger constructor.
Definition Hdf5Logger.cpp:27
void logLevel(log_level_e log_level)
Set the executive log level.
Definition Hdf5Logger.h:51
unsigned long long _l_end_idx
Definition Hdf5Logger.h:74
unsigned long long _l_start_idx
Index to track where we're writing to our dataset.
Definition Hdf5Logger.h:73
warpos::FlightExecutive & exc
Handle to executive for logging.
Definition Hdf5Logger.h:64
int _createSetupFile()
Function to create an HDF5 file for logging.
Definition Hdf5Logger.cpp:68
const HighFive::File * h5File()
Get handle to HDF5 file in Hdf5 logger.
Definition Hdf5Logger.h:55
int close()
Function to close down the file – logs remaining buffered data and closes.
Definition Hdf5Logger.cpp:227
HighFive::DataSetCreateProps _props
Definition Hdf5Logger.h:69
log_level_e
Log level enumerations.
Definition flighterrors.h:159
@ LOG_WARNING
Output in almost all cases.
Definition flighterrors.h:162
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22