H5DataTypes/src/OceanOpticsConfigV1.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //      $Id: OceanOpticsConfigV1.cpp 6826 2013-09-24 21:08:01Z salnikov@SLAC.STANFORD.EDU $
00004 //
00005 // Description:
00006 //      Class OceanOpticsConfigV1...
00007 //
00008 // Author List:
00009 //      Andrei Salnikov
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "H5DataTypes/OceanOpticsConfigV1.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 OceanOpticsConfigV1::OceanOpticsConfigV1 ( const Pds::OceanOptics::ConfigV1& data )
00044   : exposureTime(data.exposureTime())
00045   , strayLightConstant(data.strayLightConstant())
00046 {
00047   const ndarray<const double, 1>& waveLenCalib = data.waveLenCalib();
00048   std::copy(waveLenCalib.begin(), waveLenCalib.end(), this->waveLenCalib);
00049   const ndarray<const double, 1>& nonlinCorrect = data.nonlinCorrect();
00050   std::copy(nonlinCorrect.begin(), nonlinCorrect.end(), this->nonlinCorrect);
00051 }
00052 
00053 OceanOpticsConfigV1::~OceanOpticsConfigV1()
00054 {
00055 }
00056 
00057 
00058 hdf5pp::Type
00059 OceanOpticsConfigV1::stored_type()
00060 {
00061   return native_type() ;
00062 }
00063 
00064 hdf5pp::Type
00065 OceanOpticsConfigV1::native_type()
00066 {
00067   hdf5pp::CompoundType confType = hdf5pp::CompoundType::compoundType<OceanOpticsConfigV1>() ;
00068   confType.insert_native<float>("exposureTime", offsetof(OceanOpticsConfigV1, exposureTime));
00069   confType.insert_native<double>("waveLenCalib", offsetof(OceanOpticsConfigV1, waveLenCalib), 4);
00070   confType.insert_native<double>("nonlinCorrect", offsetof(OceanOpticsConfigV1, nonlinCorrect), 8);
00071   confType.insert_native<double>("strayLightConstant", offsetof(OceanOpticsConfigV1, strayLightConstant));
00072 
00073   return confType ;
00074 }
00075 
00076 void
00077 OceanOpticsConfigV1::store( const Pds::OceanOptics::ConfigV1& config, hdf5pp::Group grp )
00078 {
00079   // make scalar data set for main object
00080   OceanOpticsConfigV1 data ( config ) ;
00081   storeDataObject ( data, "config", grp ) ;
00082 }
00083 
00084 
00085 } // namespace H5DataTypes

Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7