Пример #1
0
/*
    Setup common to all constructors
*/
void QESlider::setup() {
    // Set up data
    // This control used a single data source
    setNumVariables(1);

    // Set up default properties
    updateInProgress = false;
    writeOnChange = true;
    setAllowDrop( false );

    scale = 1.0;
    offset = 0.0;
    currentValue = 0.0;

    // Set the initial state
    isConnected = false;

    ignoreSingleShotRead = false;

    // Use standard context menu
    setupContextMenu();

    // Use slider signals
    QObject::connect( this, SIGNAL( valueChanged( const int &) ), this, SLOT( userValueChanged( const int & ) ) );

    // Set up a connection to recieve variable name property changes
    // The variable name property manager class only delivers an updated variable name after the user has stopped typing
    QObject::connect( &variableNamePropertyManager, SIGNAL( newVariableNameProperty( QString, QString, unsigned int ) ), this, SLOT( useNewVariableNameProperty( QString, QString, unsigned int ) ) );
}
Пример #2
0
/*
    Common construction
*/
void QESpinBox::setup() {
    // Set up data
    // This control used a single data source
    setNumVariables(1);

    // Initialise the flag indicating the value is being changed programatically (not by the user)
    programaticValueChange = false;

    // Set up default properties
    writeOnChange = true;
    setAllowDrop( false );
    addUnitsAsSuffix = false;
    useDbPrecisionForDecimal = true;

    // Set the initial state
    lastValue = 0.0;
    isConnected = false;

    ignoreSingleShotRead = false;

    // Use standard context menu
    setupContextMenu();

    // Use spin box signals
    QObject::connect( this, SIGNAL( valueChanged( double ) ), this, SLOT( userValueChanged( double ) ) );

    // Set up a connection to recieve variable name property changes
    // The variable name property manager class only delivers an updated variable name after the user has stopped typing
    QObject::connect( &variableNamePropertyManager, SIGNAL( newVariableNameProperty( QString, QString, unsigned int ) ), this, SLOT( useNewVariableNameProperty( QString, QString, unsigned int) ) );

}
Пример #3
0
/*
    Setup common to all constructors
*/
void QELabel::setup() {

    // Set up data
    // This control used a single data source
    setNumVariables(1);

    // Set up default properties
    setAllowDrop( false );

    // Set the initial state
    setText( "----" );
    setIndent( 6 );
    isConnected = false;
    updateConnectionStyle( isConnected );
    updateOption = UPDATE_TEXT;

    // Use standard context menu
    setupContextMenu();

//    defaultStyleSheet = styleSheet();
    // Use label signals
    // --Currently none--

    // Set up a connection to recieve variable name property changes
    // The variable name property manager class only delivers an updated variable name after the user has stopped typing
    QObject::connect( &variableNamePropertyManager, SIGNAL( newVariableNameProperty( QString, QString, unsigned int ) ), this, SLOT( useNewVariableNameProperty( QString, QString, unsigned int) ) );

}
/*
    Setup for reading and writing data
*/
void QEGenericButton::dataSetup()
{
    // Set up data
    // This control uses two data sources, the first is written to and (by default) read from. The second is the alternative read back
    setNumVariables(QEGENERICBUTTON_NUM_VARIABLES);

    // Set up default properties
    writeOnPress = false;
    writeOnRelease = false;
    writeOnClick = true;
    setAllowDrop( false );
    confirmRequired = false;
    confirmText = "Do you want to perform this action?";

    // Set text alignment to the default for a push button
    // This will make no visual difference unless the style has been changed from the default
    textAlignment = Qt::AlignHCenter | Qt::AlignVCenter;
    this->setTextAlignment( textAlignment );

    pressText = "1";
    releaseText = "0";
    clickText = "1";
    clickCheckedText = "0";

    // Override default QEWidget properties
    subscribe = false;

    // Set the initial state
    isConnected = false;
    updateOption = getDefaultUpdateOption();
}
Пример #5
0
/*!
    Common construction
*/
void QCaSpinBox::setup() {
    // Set up data
    // This control used a single data source
    setNumVariables(1);

    // Initialise the flag indicating the value is being changed programatically (not by the user)
    programaticValueChange = false;

    // Set up default properties
    localEnabled = true;

    // Set the initial state
    lastSeverity = QCaAlarmInfo::getInvalidSeverity();
    isConnected = false;
    QWidget::setEnabled( false );  // Reflects initial disconnected state

    // Use spin box signals
    QObject::connect( this, SIGNAL( valueChanged( int ) ), this, SLOT( userValueChanged( int ) ) );
}
Пример #6
0
//------------------------------------------------------------------------------
// Setup common to all constructors
//
void QEGenericEdit::setup()
{

    // Set up data
    // This control used a single data source
    setNumVariables( 1 );

    // Set variable index used to select write access cursor style.
    setControlPV( 0 );

    // Set up default properties
    writeOnLoseFocus = false;
    writeOnEnter = true;
    writeOnFinish = true;
    confirmWrite = false;
    isFirstUpdate = false;

    setAllowDrop( false );

    // Set the initial state
    isConnected = false;
    messageDialogPresent = false;
    writeFailMessageDialogPresent = false;

    // Use standard context menu
    setupContextMenu();

    // Use line edit signals
    QObject::connect( this, SIGNAL( returnPressed     () ),
                      this, SLOT  ( userReturnPressed () ) );
    QObject::connect( this, SIGNAL( editingFinished     () ),
                      this, SLOT  ( userEditingFinished () ) );

    // Set up a connection to recieve variable name property changes
    // The variable name property manager class only delivers an updated
    // variable name after the user has stopped typing.
    //
    QObject::connect( &variableNamePropertyManager,
                      SIGNAL( newVariableNameProperty( QString, QString, unsigned int ) ),
                      this, SLOT( useNewVariableNameProperty( QString, QString, unsigned int) ) );

}
Пример #7
0
/*!
    Setup common to all constructors
*/
void QCaLineEdit::setup() {
    // Set up data
    // This control used a single data source
    setNumVariables(1);

    // Set up default properties
    writeOnLoseFocus = false;
    writeOnEnter = true;
    localEnabled = true;
    confirmWrite = false;

    // Set the initial state
    setText( "" );
    lastSeverity = QCaAlarmInfo::getInvalidSeverity();
    isConnected = false;
    QWidget::setEnabled( false );  // Reflects initial disconnected state

    // Use line edit signals
    QObject::connect( this, SIGNAL( returnPressed() ), this, SLOT( userReturnPressed() ) );
    QObject::connect( this, SIGNAL( editingFinished() ), this, SLOT( userEditingFinished() ) );
}
Пример #8
0
/*
    Setup common to all constructors
*/
void QEPeriodic::setup() {

    // Place element selection button to left, and readback label on right
    layout = new QHBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    setLayout(layout);

    // Note the variables associated with the write element button
    writeButtonData.variableIndex1 = 0;
    writeButtonData.variableIndex2 = 1;

    // Note the variables associated with the element readback label
    readbackLabelData.variableIndex1 = 2;
    readbackLabelData.variableIndex2 = 3;

    // Default to just a write element button
    writeButton = NULL;
    readbackLabel = NULL;
    presentationOption = PRESENTATION_BUTTON_ONLY;
    updatePresentationOptions();

    // Set up data
    // This control uses:
    // A pair of values to read and write an 'element' set point
    // A pair of values to read 'element' readback
    setNumVariables(4);

    // Set variable indices used to select write access cursor style.
    ControlVariableIndicesSet controlPvs;
    controlPvs << 0 << 1;
    setControlPVs( controlPvs );


    // Override default QEWidget and QPushButton properties
    subscribe = false;

    // Set up default properties
    localEnabled = true;
    variableTolerance1 = 0.1;
    variableTolerance2 = 0.1;
    setAllowDrop( false );

    // Set the initial state
    isConnected = false;

    variableType1 = VARIABLE_TYPE_USER_VALUE_1;
    variableType2 = VARIABLE_TYPE_USER_VALUE_2;

    // Use standard context menu
    setupContextMenu();

    // !! move this functionality into QEWidget???
    // !! needs one for single variables and one for multiple variables, or just the multiple variable one for all
    // for each variable name property manager, set up an index to identify it when it signals and
    // set up a connection to recieve variable name property changes.
    // The variable name property manager class only delivers an updated variable name after the user has stopped typing
    for( int i = 0; i < QEPERIODIC_NUM_VARIABLES; i++ )
    {
        variableNamePropertyManagers[i].setVariableIndex( i );
        QObject::connect( &variableNamePropertyManagers[i], SIGNAL( newVariableNameProperty( QString, QString, unsigned int ) ), this, SLOT( useNewVariableNameProperty( QString, QString, unsigned int ) ) );
    }
}