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

void gdf::Channel::fillPhys ( const double  value,
size_t  num 

Fill a number of samples with the same physical value.

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

Definition at line 239 of file Channel.cpp.

References gdf::SignalHeader::phys_to_raw().

        using boost::numeric_cast;
        double rawval = value * m_signalheader->phys_to_raw( value );

        switch( m_signalheader->get_datatype( ) )
        case INT8: m_data->fill( numeric_cast<int8>(rawval), num ); break;
        case UINT8: m_data->fill( numeric_cast<uint8>(rawval), num ); break;
        case INT16: m_data->fill( numeric_cast<int16>(rawval), num ); break;
        case UINT16: m_data->fill( numeric_cast<uint16>(rawval), num ); break;
        case INT32: m_data->fill( numeric_cast<int32>(rawval), num ); break;
        case UINT32: m_data->fill( numeric_cast<uint32>(rawval), num ); break;
        case INT64: m_data->fill( numeric_cast<int64>(rawval), num ); break;
        case UINT64: m_data->fill( numeric_cast<uint64>(rawval), num ); break;
        case FLOAT32: m_data->fill( numeric_cast<float32>(rawval), num ); break;
        case FLOAT64: m_data->fill( numeric_cast<float64>(rawval), num ); 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:

Generated by  Doxygen 1.6.0   Back to index