コード例 #1
0
ファイル: QELabel.cpp プロジェクト: rorydog1/epics
/*
    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) ) );

}
コード例 #2
0
ファイル: QELabel.cpp プロジェクト: rorydog1/epics
/*
    Act on a connection change.
    Change how the label looks and change the tool tip
    This is the slot used to recieve connection updates from a QCaObject based class.
 */
void QELabel::connectionChanged( QCaConnectionInfo& connectionInfo, const unsigned int& )
{
    // Note the connected state
    isConnected = connectionInfo.isChannelConnected();

    // Display the connected state
    updateToolTipConnection( isConnected );
    updateConnectionStyle( isConnected );

    // Signal channel connection change to any Link widgets,
    // using signal dbConnectionChanged.
    emitDbConnectionChanged( 0 );
}
コード例 #3
0
/*
    Act on a connection change.
    Change how the label looks and change the tool tip
    This is the slot used to recieve connection updates from a QCaObject based class.
 */
void QEGenericButton::connectionChanged( QCaConnectionInfo& connectionInfo, const unsigned int& variableIndex )
{
    // Do nothing if no variable name, but there is a program to run or a new gui to open.
    // Most widgets will be dissabled at this point if there is no good connection to a PV,
    // but this widget may be doing other stuff (running a program of starting a GUI)
    if( getSubstitutedVariableName( variableIndex ).isEmpty() )
        return;

    // Note the connected state
    isConnected = connectionInfo.isChannelConnected();

    // Display the connected state
    updateToolTipConnection( isConnected, variableIndex );
    updateConnectionStyle( isConnected );
}
コード例 #4
0
ファイル: QEGenericEdit.cpp プロジェクト: rorydog1/epics
//------------------------------------------------------------------------------
// Act on a connection change.
// Change how the label looks and change the tool tip
// This is the slot used to recieve connection updates from a QCaObject based class.
//
void QEGenericEdit::connectionChanged( QCaConnectionInfo& connectionInfo )
{
    // Note the connected state
    isConnected = connectionInfo.isChannelConnected();

    // Note if first update has arrived (ok to set repeatedly)
    if( isConnected )
    {
        isFirstUpdate = true;
    }

    // Display the connected state
    updateToolTipConnection( isConnected );
    updateConnectionStyle( isConnected );

    // Set cursor to indicate access mode.
    setAccessCursorStyle();

    // Signal channel connection change to any (Link) widgets.
    // using signal dbConnectionChanged.
    //
    emitDbConnectionChanged( 0 );
}
コード例 #5
0
/*
    Act on a connection change.
    Change how the label looks and change the tool tip
    This is the slot used to recieve connection updates from a QCaObject based class.
 */
void QESpinBox::connectionChanged( QCaConnectionInfo& connectionInfo )
{
    // Note the connected state
    isConnected = connectionInfo.isChannelConnected();

    // Display the connected state
    updateToolTipConnection( isConnected );
    updateConnectionStyle( isConnected );

    // !!! ??? not sure if this is right. Added as the record type was comming back as GENERIC::UNKNOWN deep in the write
    // Start a single shot read if the channel is up (ignore channel down),
    // This will allow initialisation of the widget using info from the database.
    // If subscribing, then an update will occur without having to initiated one here.
    // Note, channel up implies link up
    // Note, even though there is nothing to do to initialise the spin box if not subscribing, an
    // initial sing shot read is still performed to ensure we have valid information about the
    // variable when it is time to do a write.
    if( isConnected && !subscribe )
    {
        QEFloating* qca = (QEFloating*)getQcaItem(0);
        qca->singleShotRead();
        ignoreSingleShotRead = true;
    }
}