Exemplo n.º 1
0
/*
    The user has modified the slider position.
    This will occur as the user slides the slider if tracking is enabled,
    or when the user completes sliding if tracking is not enabled.
*/
void QESlider::userValueChanged( const int &value) {

    // If the change is due to an update (and not the user)
    // or not writing on change, then ignore the change
    if( updateInProgress == true || !writeOnChange )
    {
        return;
    }

    // Get the variable to write to
    QEFloating* qca = (QEFloating*)getQcaItem(0);

    /* If a QCa object is present (if there is a variable to write to)
     * then write the value
     */
    if( qca )
    {
        // Attempt to write the data if the destination data type is known.
        // It is not known until a connection is established.
        if( qca->dataTypeKnown() )
        {
            currentValue = (value/scale)+offset;
            qca->writeFloating( currentValue );
        }
        else
        {
            // Inform the user that the write could not be performed.
            // It is normally not possible to get here. If the connection or link has not
            // yet been established (and therefore the data type is unknown) then the user
            // interface object should be unaccessable. This code is here in the event that
            // the user can, by design or omision, still attempt a write.
            sendMessage( "Could not write value as type is not known yet.", "QESlider::userValueChanged()",
                          message_types ( MESSAGE_TYPE_WARNING ) );
        }
    }
}
Exemplo n.º 2
0
 mpi message_types() const {
   detail::type_list<T> token;
   return message_types(token);
 }
Exemplo n.º 3
0
 mpi message_types(const typed_actor<Ts...>&) const {
   detail::type_list<typed_actor<Ts...>> token;
   return message_types(token);
 }