H5DataTypes/src/OceanOpticsConfigV2.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: OceanOpticsConfigV2.cpp 7759 2014-03-05 01:15:23Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class OceanOpticsConfigV2...
00007 //
00008 // Author List:
00009 //      Andrei Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "H5DataTypes/OceanOpticsConfigV2.h"
00017 
00018 //-----------------
00019 // C/C++ Headers --
00020 //-----------------
00021 #include <algorithm>
00022 
00023 //-------------------------------
00024 // Collaborating Class Headers --
00025 //-------------------------------
00026 #include "H5DataTypes/H5DataUtils.h"
00027 #include "hdf5pp/CompoundType.h"
00028 #include "hdf5pp/EnumType.h"
00029 
00030 //-----------------------------------------------------------------------
00031 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00032 //-----------------------------------------------------------------------
00033 
00034 //              ----------------------------------------
00035 //              -- Public Function Member Definitions --
00036 //              ----------------------------------------
00037 
00038 namespace H5DataTypes {
00039 
00040 //----------------
00041 // Constructors --
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   // make scalar data set for main object
00082   OceanOpticsConfigV2 data ( config ) ;
00083   storeDataObject ( data, "config", grp ) ;
00084 }
00085 
00086 
00087 } // namespace H5DataTypes

Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7