// ------------------------------------------------------------------------- // /* for reference of the tdm data model, see https://zone.ni.com/reference/de-XX/help/370858P-0113/tdmdatamodel/tdmdatamodel/tdm_headerfile/ https://zone.ni.com/reference/de-XX/help/370858P-0113/tdmdatamodel/tdmdatamodel/tdm_datamodel/ */ #ifndef TDM_DATAMODEL #define TDM_DATAMODEL #include #include #include #include #include // -------------------------------------------------------------------------- // // block of data struct block { std::string id_; unsigned long int byte_offset_; unsigned long int length_; unsigned long int block_offset_, block_size_; std::string value_type_; block () { id_ = std::string(""); byte_offset_ = 0; length_ = 0; block_offset_ = 0; block_size_ = 0; value_type_ = std::string(""); } const std::string get_info(int width = 20) { std::stringstream ss; ss< tdm_datatypes = { {"eInt16Usi",{"eInt16Usi","DT_SHORT",2,"short_sequence",2,"signed 16 bit integer"}}, {"eInt32Usi",{"eInt32Usi","DT_LONG",6,"long_sequence",4,"signed 32 bit integer"}}, {"eUInt8Usi",{"eUInt8Usi","DT_BYTE",5,"byte_sequence",1,"unsigned 8 bit integer"}}, {"eUInt16Usi",{"eUInt16Usi","DT_SHORT",2,"short_sequence",2,"unsigned 16 bit integer"}}, {"eUInt32Usi",{"eUInt32Usi","DT_LONG",6,"long_sequence",4,"unsigned 32 bit integer"}}, {"eFloat32Usi",{"eFloat32Usi","DT_FLOAT",3,"float_sequence",4,"32 bit float"}}, {"eFloat64Usi",{"eFloat64Usi","DT_DOUBLE",7,"double_sequence",8,"64 bit double"}}, {"eStringUsi",{"eStringUsi","DT_STRING",1,"string_sequence",0,"text"}} }; // -------------------------------------------------------------------------- // // tdm_root struct tdm_root { std::string id_; std::string name_; std::string description_; std::string title_; std::string author_; std::string timestamp_; // std::chrono::time_point timepoint_; // from string 2008-05-06T17:20:12.65074539184570313 // std::stringstream ss; // ss<<"2008-05-06T17:20:12.65074539184570313"; // std::cout< channelgroups_; const std::string get_info(int width = 20) { std::stringstream ss; ss< channels_; // referenced by id std::vector submatrices_; const std::string get_info(int width = 20) { std::stringstream ss; ss< of ) // https://zone.ni.com/reference/de-XX/help/370858P-0113/tdmdatamodel/tdmdatamodel/tdm_tdxdata_waveform/ struct waveform_channel { std::string wf_xname_; std::string wf_xunit_string_; std::string wf_start_time_; double wf_start_offset_; double wf_increment_; unsigned long wf_samples_; wf_time_pref_type wf_time_pref; }; struct tdm_channel { std::string id_; std::string name_; std::string description_; std::string unit_string_; std::string datatype_; double minimum_, maximum_; std::string group_; std::vector local_columns_; // TODO waveform_channel wf_channel_; const std::string get_info(int width = 20) { std::stringstream ss; ss< tdm_channelgroup id std::vector local_columns_; // -> list of type "localcolumn" unsigned long int number_of_rows_; // -> number of values in channels const std::string get_info(int width = 20) { std::stringstream ss; ss< for implicit_linear_!! raw_linear_ // datatype is always DT_DOUBLE }; // https://zone.ni.com/reference/de-XX/help/370858P-0113/tdmdatamodel/tdmdatamodel/tdm_tdxdata_localcolumn/ struct localcolumn { std::string id_; std::string name_; std::string description_; std::string measurement_quantity_; // -> tdm_channel std::string submatrix_; unsigned long int global_flag_; unsigned long int independent_; double minimum_, maximum_; // representation sequence_representation_; std::string sequence_representation_; std::vector generation_parameters_; // { offset, factor } std::string values_; // -> refers to usi:data -> _sequence const std::string get_info(int width = 25) { std::stringstream ss; ss<