Logo Search packages:      
Sourcecode: libgdf version File versions  Download package

void gdf::Channel::addSamplePhys ( const double  value )

Add a physical sample to the channel.

value is scaled from [phys_min..phys_max] to [dig_min..dig_max] and converted to the channel's data type

Definition at line 205 of file Channel.cpp.

References gdf::SignalHeader::phys_to_raw().

Referenced by gdf::RecordBuffer::addSamplePhys(), and blitSamplesPhys().

        using boost::numeric_cast;

        double rawval = m_signalheader->phys_to_raw( value );

        switch( m_signalheader->get_datatype( ) )
        case INT8: m_data->addSample( numeric_cast<int8>(rawval) ); break;
        case UINT8: m_data->addSample( numeric_cast<uint8>(rawval) ); break;
        case INT16: m_data->addSample( numeric_cast<int16>(rawval) ); break;
        case UINT16: m_data->addSample( numeric_cast<uint16>(rawval) ); break;
        case INT32: m_data->addSample( numeric_cast<int32>(rawval) ); break;
        case UINT32: m_data->addSample( numeric_cast<uint32>(rawval) ); break;
        case INT64: m_data->addSample( numeric_cast<int64>(rawval) ); break;
        case UINT64: m_data->addSample( numeric_cast<uint64>(rawval) ); break;
        case FLOAT32: m_data->addSample( numeric_cast<float32>(rawval) ); break;
        case FLOAT64: m_data->addSample( numeric_cast<float64>(rawval) ); break;
        default: throw exception::invalid_type_id( boost::lexical_cast<std::string>(m_signalheader->get_datatype( )) ); break;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index