00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "H5DataTypes/LusiDiodeFexConfigV1.h"
00017
00018
00019
00020
00021 #include <algorithm>
00022
00023
00024
00025
00026 #include "hdf5pp/ArrayType.h"
00027 #include "hdf5pp/CompoundType.h"
00028 #include "hdf5pp/TypeTraits.h"
00029 #include "H5DataTypes/H5DataUtils.h"
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 namespace H5DataTypes {
00040
00041 LusiDiodeFexConfigV1::LusiDiodeFexConfigV1 ( const XtcType& data )
00042 {
00043 const ndarray<const float, 1>& ndbase = data.base();
00044 std::copy( ndbase.begin(), ndbase.end(), base);
00045 const ndarray<const float, 1>& ndscale = data.scale();
00046 std::copy( ndscale.begin(), ndscale.end(), scale);
00047 }
00048
00049 hdf5pp::Type
00050 LusiDiodeFexConfigV1::stored_type()
00051 {
00052 return native_type() ;
00053 }
00054
00055 hdf5pp::Type
00056 LusiDiodeFexConfigV1::native_type()
00057 {
00058 hdf5pp::CompoundType confType = hdf5pp::CompoundType::compoundType<LusiDiodeFexConfigV1>() ;
00059 confType.insert_native<float>( "base", offsetof(LusiDiodeFexConfigV1, base), XtcType::NRANGES );
00060 confType.insert_native<float>( "scale", offsetof(LusiDiodeFexConfigV1, scale), XtcType::NRANGES );
00061
00062 return confType ;
00063 }
00064
00065 void
00066 LusiDiodeFexConfigV1::store( const XtcType& config, hdf5pp::Group grp )
00067 {
00068
00069 LusiDiodeFexConfigV1 data ( config ) ;
00070 storeDataObject ( data, "config", grp ) ;
00071 }
00072
00073 }