00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "H5DataTypes/UsdUsbConfigV1.h"
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "H5DataTypes/H5DataUtils.h"
00026 #include "hdf5pp/EnumType.h"
00027 #include "hdf5pp/CompoundType.h"
00028 #include "hdf5pp/TypeTraits.h"
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 namespace H5DataTypes {
00039
00040
00041
00042
00043 UsdUsbConfigV1::UsdUsbConfigV1 ( const XtcType& data )
00044 {
00045 const ndarray<const uint32_t, 1>& in_counting_mode = data.counting_mode();
00046 std::copy(in_counting_mode.begin(), in_counting_mode.end(), counting_mode);
00047
00048 const ndarray<const uint32_t, 1>& in_quadrature_mode = data.quadrature_mode();
00049 std::copy(in_quadrature_mode.begin(), in_quadrature_mode.end(), quadrature_mode);
00050 }
00051
00052 hdf5pp::Type
00053 UsdUsbConfigV1::stored_type()
00054 {
00055 return native_type() ;
00056 }
00057
00058 hdf5pp::Type
00059 UsdUsbConfigV1::native_type()
00060 {
00061 hdf5pp::EnumType<uint32_t> countModeEnumType = hdf5pp::EnumType<uint32_t>::enumType() ;
00062 countModeEnumType.insert ( "WRAP_FULL", Pds::UsdUsb::ConfigV1::WRAP_FULL ) ;
00063 countModeEnumType.insert ( "LIMIT", Pds::UsdUsb::ConfigV1::LIMIT ) ;
00064 countModeEnumType.insert ( "HALT", Pds::UsdUsb::ConfigV1::HALT ) ;
00065 countModeEnumType.insert ( "WRAP_PRESET", Pds::UsdUsb::ConfigV1::WRAP_PRESET ) ;
00066
00067 hdf5pp::EnumType<uint32_t> quadModeEnumType = hdf5pp::EnumType<uint32_t>::enumType() ;
00068 quadModeEnumType.insert ( "CLOCK_DIR", Pds::UsdUsb::ConfigV1::CLOCK_DIR ) ;
00069 quadModeEnumType.insert ( "X1", Pds::UsdUsb::ConfigV1::X1 ) ;
00070 quadModeEnumType.insert ( "X2", Pds::UsdUsb::ConfigV1::X2 ) ;
00071 quadModeEnumType.insert ( "X4", Pds::UsdUsb::ConfigV1::X4 ) ;
00072
00073 hdf5pp::CompoundType type = hdf5pp::CompoundType::compoundType<UsdUsbConfigV1>() ;
00074 type.insert( "counting_mode", offsetof(UsdUsbConfigV1, counting_mode), countModeEnumType, NCHANNELS ) ;
00075 type.insert( "quadrature_mode", offsetof(UsdUsbConfigV1, quadrature_mode), quadModeEnumType, NCHANNELS ) ;
00076
00077 return type;
00078 }
00079
00080 void
00081 UsdUsbConfigV1::store( const XtcType& config, hdf5pp::Group grp )
00082 {
00083
00084 UsdUsbConfigV1 data ( config ) ;
00085 storeDataObject ( data, "config", grp ) ;
00086 }
00087
00088 }