start full revision

This commit is contained in:
2021-01-18 15:29:49 +01:00
parent 16a73d2d9f
commit b519756aeb
10 changed files with 122 additions and 84 deletions

View File

@@ -1,14 +0,0 @@
CC = gcc -std=c++11 -stdlib=libc++
CPPFLAGS = -O3 -Wall -Werror
LIB = ../pugixml/
libtdmripper.a : tdm_ripper.o
ar rcs $@ $^
tdm_ripper.o : tdm_ripper.cpp tdm_ripper.hpp
$(CC) -c $(CPPFLAGS) -I $(LIB) $< -o $@
clean :
rm -f *.o *.a

29
lib/tdm_reaper.cpp Normal file
View File

@@ -0,0 +1,29 @@
// -------------------------------------------------------------------------- //
#include "tdm_reaper.hpp"
// -------------------------------------------------------------------------- //
tdm_ripper::tdm_ripper(std::string tdmfile, std::string tdxfile,
bool suppress_status, bool neglect_empty_groups)
{
}
void tdm_ripper::print_channel(int idx, char const* name, int width)
{
}
void tdm_ripper::list_groups(std::ostream& out, int g, int c)
{
}
void tdm_ripper::list_channels(std::ostream& out, int g, int c)
{
}
// -------------------------------------------------------------------------- //

View File

@@ -1,3 +1,4 @@
// ------------------------------------------------------------------------- //
#ifndef TDM_RIPPER
#define TDM_RIPPER
@@ -13,22 +14,39 @@
#include <numeric>
#include <algorithm>
#include "../pugixml/pugixml.hpp"
#include "pugixml.hpp"
// -------------------------------------------------------------------------- //
// define datatypes
struct datatype {
std::string name_;
std::string channel_datatype_;
int numeric_;
std::string value_sequence_;
int size_;
std::string description;
};
const std::map<std::string,datatype> tdm_datatypes = {
{"eInt16Usi",{"eInt16Usi","DT_SHORT",2,"short_sequence",2,"signed 16 bit integer"}}
};
// -------------------------------------------------------------------------- //
class tdm_ripper
{
// .tdm and .tdx filenames
// .tdm and .tdx paths/filenames
std::string tdmfile_;
std::string tdxfile_;
bool suppress_status_;
// set of .csv files
std::vector<std::string> csvfile_;
// endianness (true = little, false = big)
bool endianness_, machine_endianness_;
// evtl. neglect groups with no actual channels
bool neglect_empty_groups_;
int num_empty_groups_;
// number/names/ids of channels, channelgroups and channels's assignment to groups
int num_channels_, num_groups_;
std::vector<std::string> channel_id_, inc_id_, units_, channel_name_;
@@ -38,6 +56,10 @@ class tdm_ripper
std::vector<int> channels_group_;
std::vector<int> channel_ext_;
// neglect empty groups
bool neglect_empty_groups_;
int num_empty_groups_;
// minimum/maximum value in particular channel (is provided in .tdm file as float)
std::vector<std::pair<double,double>> minmax_;
@@ -50,7 +72,7 @@ class tdm_ripper
std::vector<std::string> type_;
std::vector<std::string> external_id_;
// mapping of NI datatype to size (in bytes) of type
// NI datatypes ( )
std::map<std::string, int> datatypes_;
// xml parser