/*! RenegotiateAddresses performs a address renegotiation in an attempt to fix connectivity problems */ status_t NetworkSettings::RenegotiateAddresses() { for (int index = 0; index < MAX_PROTOCOLS; index++) { int inet_id = fProtocols[index].inet_id; if (fProtocols[index].present && AutoConfigure(inet_id)) { // If protocol is active, and set to auto fNetworkInterface->AutoConfigure(inet_id); // Perform AutoConfiguration } } return B_OK; }
void tGauge::RemoveSource( int index ) { if( m_Indicators.size() > index ) { m_Indicators.removeAt( index ); //it's safe to assume if they're removing sources, the user wants auto sources off. if( AutoConfigure() ) { SetAutoConfigure( false, true ); } m_Modified = true; InvalidateForeground(); } }
void tGauge::OnDisplaySettingsUpdated() { InvalidateBackground(); if( !tDigitalDataManager::Instance()->GetSourceSelection()->IsLoadedFromUDB() ) { return; // Ignore changed signal before UDB loaded when default ( 1 engine 1 tank ) is put into setting. } if( CanAutoConfigure() && AutoConfigure() ) { if( DoAutoConfigure() ) { //SAVE IMMEDIATELY } } }
void tGauge::ChangeDataType( const tDataId& dataId ) { m_SaveLimits = false; if( dataId == DATA_TYPE_INVALID ) { return; } //clear existing indicators m_Indicators.clear(); m_Indicators << tIndicator( dataId ); //set captions and limits tDigitalData pData( dataId ); AbsoluteLimits = pData.AbsoluteLimitsConverted(); tFloatLimits limits( pData.MinConverted(), pData.MaxConverted() ); tFloatLimits warnings( pData.WarningLowConverted(), pData.WarningHighConverted() ); m_UnitsType = pData.Units(); m_UnitsValue = tUnitsSettings::Instance()->Units( m_UnitsType ); //set update timer and update immediately UpdateValues(); //autoconfigure if applicable if( CanAutoConfigure() && AutoConfigure() ) { DoAutoConfigure(); } SetLimits( limits, warnings ); SetCaptions(); //does any type specific config ReconfigureGauge(); m_BackIsCached = false; m_ForeIsCached = false; update(); m_Modified = true; if( m_UnitsType != UNITS_ECONOMY ) { // m_SaveLimits = true; } }
//------------------------------------------------------------------------------- // //------------------------------------------------------------------------------- void tDataSourcesDialog::CreateActions() { /* Create these in order of importance. As many as possible will be added to the softkey bar in this order */ m_pSelectAct = new tAction( tr( "Select" ), this ); Connect( m_pSelectAct, SIGNAL( triggered() ), this, SLOT( Select() ) ); m_ActionList << m_pSelectAct; m_pConfigureAct = new tAction( tr( "Configure device" ), this ); Connect( m_pConfigureAct, SIGNAL( triggered() ), this, SLOT( ConfigureDevice() ) ); m_ActionList << m_pConfigureAct; QString scopeName = tProductSettings::Instance().FullSimnetAllowed() ? tr( "Group", "The extent or effective range of a selection or setting" ) : tr( "Scope", "The extent or effective range of a selection or setting" ); m_pScopeAct = new tListAction( scopeName, QStringList(), 0, Action::AutoShowPopup, this ); SetScopeList( m_pScopeAct, true, true, true ); Connect( m_pScopeAct, SIGNAL( ValueFinalised( int ) ), this, SLOT( OnScopeChanged( int ) ) ); if (tHAL::Instance()->FeaturePresent(tHAL::ePF_NMEA2000) == true) { m_ActionList << m_pScopeAct; } m_pRenameAct = new tAction( tr( "Rename" ), this ); Connect( m_pRenameAct, SIGNAL( triggered() ), this, SLOT( RenameInst() ) ); m_ActionList << m_pRenameAct; m_pNewInstanceAct = new tAction( tr( "New" ), this ); Connect( m_pNewInstanceAct, SIGNAL( triggered() ), this, SLOT( NewInstance() ) ); m_ActionList << m_pNewInstanceAct; m_pRemoveAct = new tAction( tr( "Remove" ), this ); Connect( m_pRemoveAct, SIGNAL( triggered() ), this, SLOT( RemoveInst() ) ); m_ActionList << m_pRemoveAct; QStringList numEnginesList = NumericStringList( 8 ); m_pEngineNumSetAct = new tListAction( tr("Number of Engines"), numEnginesList, 0, Action::AutoShowPopup, this); Connect( m_pEngineNumSetAct, SIGNAL( ValueFinalised( int ) ), this, SLOT( OnUINumEnginesChanged( int ) ) ); m_ActionList << m_pEngineNumSetAct; m_pTransNumSetAct = new tListAction( tr("Number of Transmissions"), numEnginesList, 0, Action::AutoShowPopup, this); Connect( m_pTransNumSetAct, SIGNAL( ValueFinalised( int ) ), this, SLOT( OnUINumTransChanged( int ) ) ); m_ActionList << m_pTransNumSetAct; QStringList numTanksList = NumericStringList( 5 ); m_pTankNumSetAct = new tListAction( tr("Number of Tanks"), numTanksList, 0, Action::AutoShowPopup, this); Connect( m_pTankNumSetAct, SIGNAL( ValueFinalised( int ) ), this, SLOT( OnUINumTanksChanged( int ) ) ); m_ActionList << m_pTankNumSetAct; QStringList numTrimTabsList = NumericStringList( 3 ); m_pTrimTabsNumSetAct = new tListAction( tr("Number of Trim Tabs"), numTrimTabsList, 0, Action::AutoShowPopup, this); Connect( m_pTrimTabsNumSetAct, SIGNAL( ValueFinalised( int ) ), this, SLOT( OnNumTrimTabsChanged( int ) ) ); m_ActionList << m_pTrimTabsNumSetAct; if( tProductSettings::Instance().FullSimnetAllowed() ) { m_pAutoSelectAct = new tAction( tr( "Auto Select" ), this ); Connect( m_pAutoSelectAct, SIGNAL( triggered() ), this, SLOT( OnAutoSelect() ) ); if (tHAL::Instance()->FeaturePresent(tHAL::ePF_NMEA2000) == true) { m_ActionList << m_pAutoSelectAct; } } else { m_pAutoConfigureAct = new tAction( tr( "Auto Configure" ), this ); Connect( m_pAutoConfigureAct, SIGNAL( triggered() ), this, SLOT( AutoConfigure() ) ); if (tHAL::Instance()->FeaturePresent(tHAL::ePF_NMEA2000) == true) { m_ActionList << m_pAutoConfigureAct; } } m_pGlobalResetAct = new tAction( tr( "Reset Global" ), this ); Connect( m_pGlobalResetAct, SIGNAL( triggered() ), this, SLOT( ResetGlobal() ) ); if (tHAL::Instance()->FeaturePresent(tHAL::ePF_NMEA2000) == true) { m_ActionList << m_pGlobalResetAct; } m_pLocalResetAct = new tAction( tr( "Reset Local" ), this ); Connect( m_pLocalResetAct, SIGNAL( triggered() ), this, SLOT( ResetLocal() ) ); if (tHAL::Instance()->FeaturePresent(tHAL::ePF_NMEA2000) == true) { m_ActionList << m_pLocalResetAct; } // Add as many actions as possible to the softkey bar m_KeyList.clear(); for( int i = 0; (i < m_NumKeys - 1) && (i < m_ActionList.size()); i++ ) { m_KeyList << m_ActionList[i]; } if ( HasTitleCloseButton() == false ) { m_pCloseAct = new tAction( tr( "Close", "Text of the exit dialog button." ), this ); Connect( m_pCloseAct, SIGNAL( triggered() ), this, SIGNAL( CloseRequested() ) ); m_KeyList << m_pCloseAct; } // NSW-10765 // Change what actions are displayed for Cougar // This should be done a better way - this will do for now. // // Configure Device // Scope // Rename // New // Remove // Auto Configure // Reset -> Sub menu // Global // Local if( tProductSettings::Instance().GetProductFamily() == tProductSettings::HDSGen2TouchFamily || tProductSettings::Instance().GetProductFamily() == tProductSettings::HDSGen3TouchFamily ) { m_KeyList.clear(); m_KeyList << m_pConfigureAct; m_KeyList << m_pScopeAct; m_KeyList << m_pRenameAct; m_KeyList << m_pNewInstanceAct; m_KeyList << m_pRemoveAct; m_KeyList << m_pAutoConfigureAct; QList<tAction*> resetSubActions; resetSubActions << m_pGlobalResetAct; resetSubActions << m_pLocalResetAct; m_pResetAct = new tAction( tr("Reset") ); m_pResetAct->SetSubActions(resetSubActions); m_ActionList << m_pSelectAct; m_KeyList << m_pResetAct; } }