FasTensor  1.0.0
Transform Supercomputing for AI
ft_endpoint_tdms.h
Go to the documentation of this file.
1 
2 
3 /*
4 ****************************
5 
6 FasTensor (FT) Copyright (c) 2021, The Regents of the University of
7 California, through Lawrence Berkeley National Laboratory (subject to
8 receipt of any required approvals from the U.S. Dept. of Energy).
9 All rights reserved.
10 
11 If you have questions about your rights to use or distribute this software,
12 please contact Berkeley Lab's Intellectual Property Office at
14 
15 NOTICE. This Software was developed under funding from the U.S. Department
16 of Energy and the U.S. Government consequently retains certain rights. As
17 such, the U.S. Government has been granted for itself and others acting on
18 its behalf a paid-up, nonexclusive, irrevocable, worldwide license in the
19 Software to reproduce, distribute copies to the public, prepare derivative
20 works, and perform publicly and display publicly, and to permit others to do so.
21 
22 
23 ****************************
24 
25 
26 *** License Agreement ***
27 
28 FasTensor (FT) Copyright (c) 2021, The Regents of the University of
29 California, through Lawrence Berkeley National Laboratory (subject to
30 receipt of any required approvals from the U.S. Dept. of Energy).
31 All rights reserved.
32 
33 Redistribution and use in source and binary forms, with or without
34 modification, are permitted provided that the following conditions are met:
35 
36 (1) Redistributions of source code must retain the above copyright notice,
37 this list of conditions and the following disclaimer.
38 
39 (2) Redistributions in binary form must reproduce the above copyright
40 notice, this list of conditions and the following disclaimer in the
41 documentation and/or other materials provided with the distribution.
42 
43 (3) Neither the name of the University of California, Lawrence Berkeley
44 National Laboratory, U.S. Dept. of Energy nor the names of its contributors
45 may be used to endorse or promote products derived from this software
46 without specific prior written permission.
47 
48 
49 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
50 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
53 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
54 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
55 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
56 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
57 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
58 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
59 POSSIBILITY OF SUCH DAMAGE.
60 
61 You are under no obligation whatsoever to provide any bug fixes, patches,
62 or upgrades to the features, functionality or performance of the source
63 code ("Enhancements") to anyone; however, if you choose to make your
64 Enhancements available either publicly, or directly to Lawrence Berkeley
65 National Laboratory, without imposing a separate written license agreement
66 for such Enhancements, then you hereby grant the following license: a
67 non-exclusive, royalty-free perpetual license to install, use, modify,
68 prepare derivative works, incorporate into other computer software,
69 distribute, and sublicense such enhancements or derivative works thereof,
70 in binary and source code form.
71 */
72 
82 #ifndef END_POINT_TDMS_H
83 #define END_POINT_TDMS_H
84 
85 #include "ft_type.h"
86 #include "ft_endpoint.h"
87 #include "ft_endpoint_binary.h"
88 #include <string>
89 #include <iostream>
90 #include <vector>
91 #include <math.h>
92 
93 #define NBYTE_LEADIN 28
94 #define NBYTE_PER_DATUM 2
95 #define EPOCH_DIFF 2082844800 //seconds from epoch(1904, Mac HFS+ ) to epoch (1970, Unix)
96 
97 #define TDMS_MLS "MeasureLength[m]"
98 #define TDMS_SRS "SpatialResolution[m]"
99 //#define OUTPUT_META_TO_SCREEN 1
100 
101 typedef enum
102 {
124  tdsTypeDAQmxRawData = 0xFFFFFFFF
126 
127 //
128 //I/O layer
130 {
131 public:
132  EndpointTDMS(std::string endpoint_info_p) : EndpointBinary(endpoint_info_p)
133  {
134  }
140  {
141  }
142 
143  virtual ~EndpointTDMS()
144  {
145  }
146 
151  void UpdateSeekOffset() override;
152 
158  int ExtractMeta() override;
159 
167  int FindMlSr(unsigned int &MeasureLength, double &SpatialResolution);
168 };
169 #endif
Definition: ft_endpoint_binary.h:105
Definition: ft_endpoint_tdms.h:130
int FindMlSr(unsigned int &MeasureLength, double &SpatialResolution)
find MeasureLength and SpatialResolution
Definition: ft_endpoint_tdms.cpp:152
virtual ~EndpointTDMS()
Definition: ft_endpoint_tdms.h:143
EndpointTDMS()
Construct a new Endpoint in Binary Nothing to do there, can be used as sub-endpoint of directory.
Definition: ft_endpoint_tdms.h:139
int ExtractMeta() override
extracts metadata, possbile endpoint_ranks/endpoint_dim_size/data_element_type
Definition: ft_endpoint_tdms.cpp:101
void UpdateSeekOffset() override
update the seek_offset
Definition: ft_endpoint_tdms.cpp:82
EndpointTDMS(std::string endpoint_info_p)
Definition: ft_endpoint_tdms.h:132
tdsDataType
Definition: ft_endpoint_tdms.h:102
@ tdsTypeI32
Definition: ft_endpoint_tdms.h:106
@ tdsTypeExtendedFloat
Definition: ft_endpoint_tdms.h:114
@ tdsTypeString
Definition: ft_endpoint_tdms.h:118
@ tdsTypeDAQmxRawData
Definition: ft_endpoint_tdms.h:124
@ tdsTypeBoolean
Definition: ft_endpoint_tdms.h:119
@ tdsTypeU8
Definition: ft_endpoint_tdms.h:108
@ tdsTypeVoid
Definition: ft_endpoint_tdms.h:103
@ tdsTypeU64
Definition: ft_endpoint_tdms.h:111
@ tdsTypeExtendedFloatWithUnit
Definition: ft_endpoint_tdms.h:117
@ tdsTypeDoubleFloat
Definition: ft_endpoint_tdms.h:113
@ tdsTypeSingleFloat
Definition: ft_endpoint_tdms.h:112
@ tdsTypeTimeStamp
Definition: ft_endpoint_tdms.h:120
@ tdsTypeDoubleFloatWithUnit
Definition: ft_endpoint_tdms.h:116
@ tdsTypeU16
Definition: ft_endpoint_tdms.h:109
@ tdsTypeI16
Definition: ft_endpoint_tdms.h:105
@ tdsTypeI8
Definition: ft_endpoint_tdms.h:104
@ tdsTypeSingleFloatWithUnit
Definition: ft_endpoint_tdms.h:115
@ tdsTypeI64
Definition: ft_endpoint_tdms.h:107
@ tdsTypeComplexSingleFloat
Definition: ft_endpoint_tdms.h:122
@ tdsTypeU32
Definition: ft_endpoint_tdms.h:110
@ tdsTypeComplexDoubleFloat
Definition: ft_endpoint_tdms.h:123
@ tdsTypeFixedPoint
Definition: ft_endpoint_tdms.h:121