00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "H5DataTypes/OceanOpticsConfigV2.h"
00017
00018
00019
00020
00021 #include <algorithm>
00022
00023
00024
00025
00026 #include "H5DataTypes/H5DataUtils.h"
00027 #include "hdf5pp/CompoundType.h"
00028 #include "hdf5pp/EnumType.h"
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 namespace H5DataTypes {
00039
00040
00041
00042
00043 OceanOpticsConfigV2::OceanOpticsConfigV2 ( const Pds::OceanOptics::ConfigV2& data )
00044 : exposureTime(data.exposureTime())
00045 , deviceType(data.deviceType())
00046 , strayLightConstant(data.strayLightConstant())
00047 {
00048 const ndarray<const double, 1>& waveLenCalib = data.waveLenCalib();
00049 std::copy(waveLenCalib.begin(), waveLenCalib.end(), this->waveLenCalib);
00050 const ndarray<const double, 1>& nonlinCorrect = data.nonlinCorrect();
00051 std::copy(nonlinCorrect.begin(), nonlinCorrect.end(), this->nonlinCorrect);
00052 }
00053
00054 OceanOpticsConfigV2::~OceanOpticsConfigV2()
00055 {
00056 }
00057
00058
00059 hdf5pp::Type
00060 OceanOpticsConfigV2::stored_type()
00061 {
00062 return native_type() ;
00063 }
00064
00065 hdf5pp::Type
00066 OceanOpticsConfigV2::native_type()
00067 {
00068 hdf5pp::CompoundType confType = hdf5pp::CompoundType::compoundType<OceanOpticsConfigV2>() ;
00069 confType.insert_native<float>("exposureTime", offsetof(OceanOpticsConfigV2, exposureTime));
00070 confType.insert_native<int32_t>("deviceType", offsetof(OceanOpticsConfigV2, deviceType));
00071 confType.insert_native<double>("waveLenCalib", offsetof(OceanOpticsConfigV2, waveLenCalib), 4);
00072 confType.insert_native<double>("nonlinCorrect", offsetof(OceanOpticsConfigV2, nonlinCorrect), 8);
00073 confType.insert_native<double>("strayLightConstant", offsetof(OceanOpticsConfigV2, strayLightConstant));
00074
00075 return confType ;
00076 }
00077
00078 void
00079 OceanOpticsConfigV2::store( const Pds::OceanOptics::ConfigV2& config, hdf5pp::Group grp )
00080 {
00081
00082 OceanOpticsConfigV2 data ( config ) ;
00083 storeDataObject ( data, "config", grp ) ;
00084 }
00085
00086
00087 }