19#include "tinymatwriter.h"
22#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64) || defined(__WIN64__)
26#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNUC__) || defined(__GNUG__) || defined(unix) || defined(__unix) || defined(__unix__)
31#error OS not supported
35#define sprintf_s(buf, len, ...) snprintf((buf), (len), __VA_ARGS__)
130 int connect(
bool logdata =
false, std::string log_path =
"");
152 int save(
int id, std::string name, std::string path);
A class for file reading and writing.
Definition: File.h:30
A class for host communication via TCP/IP protocol.
Definition: HostPortTCP.h:20
A class for host communication via UDP protocol using the broadcast IP.
Definition: HostPortUDP.h:20
A class for host communication via serial port.
Definition: HostPort.h:18
A templated-class for managing logged-data.
Definition: LogData.h:20
A templated-class for managing data packet.
Definition: Packet.h:17
A class for the application setting parameters.
Definition: Params.h:16
A class for the core of the SBB Host application.
Definition: SBBHostCore.h:46
bool save_mat_private(std::string filename, LogData< float > *p_logData)
Private routine to save *.mat file.
size_t save_dat_private(File *p_file, LogData< float > *p_logData)
Private routine to save *.csv format.
Packet< float, PACKET_SIZE > rx_packet
Rx Packet object.
Definition: SBBHostCore.h:80
void set_path_logs(std::string folder)
Set the default path of all logs.
~SBBHostCore()
Desctructor.
SBBHostCore()
Constructor.
unsigned int numOfMissingPackets
Number of current missing packets.
Definition: SBBHostCore.h:69
int connect(bool logdata=false, std::string log_path="")
Connect the host port.
int stream(bool writeFlag)
Perform a stream step.
bool dolog
true if do data logging.
Definition: SBBHostCore.h:73
bool delete_log(int id)
Delete a log.
HostPort hostPort
HostPort object.
Definition: SBBHostCore.h:77
std::string tmp_name
Temporary name for the logged-data.
Definition: SBBHostCore.h:74
HostPortUDP hostPortUDP
HostPortUDP object.
Definition: SBBHostCore.h:79
int open(std::string str)
Open a log from a *.sbb file.
int save(int id, std::string name, std::string path)
Save a log as a *.sbb file.
void beginlog(std::string path)
Begin the data logging.
Params * p_params
Pointer to the parameters structure created in SBBHostApp.
Definition: SBBHostCore.h:66
int save_dat(int id, std::string str)
Save a log as *.dat file.
std::vector< LogData< float > * > logData
Vector of pointers to LogData with base type float.
Definition: SBBHostCore.h:85
int save_mat(int id, std::string str)
Save a log as *.csv file.
File * p_file
Pointer to File object.
Definition: SBBHostCore.h:86
bool check_allSaved()
Check if all log are saved.
void set_params(Params *params)
Set the parameters.
int save(int id)
Save a log as a *.sbb file.
Time time
Time object.
Definition: SBBHostCore.h:82
int find(int id)
Find a log using the ID.
Packet< float, PACKET_SIZE > tx_packet
Tx Packet object.
Definition: SBBHostCore.h:81
int get_lastUnsaved(int *id)
Get the ID of the last unsaved log.
void disconnect()
Disconnect the host port.
HostPortTCP hostPortTCP
HostPortTCP object.
Definition: SBBHostCore.h:78
int id_count
Counter of logged-data ID.
Definition: SBBHostCore.h:70
long long samples
Number of current logged sample.
Definition: SBBHostCore.h:71
void reset_stream()
Reset the data streaming.
A class to get system time.
Definition: Timepp.h:37
A configuration file for the source code.