Exemplo n.º 1
0
void JokerWindow::on_actionPlay_pause_triggered()
{
	if(currentRate() == 0.0) {
		setCurrentRate(1.0);
	}
	else {
		setCurrentRate(0.0);
	}
}
Exemplo n.º 2
0
//-----------------------------------------------------------------------------
//! 
//-----------------------------------------------------------------------------
void tStartLineTacticalWidget::UpdateTideArrow()
{
    float setR = 0;
    float lineBearingR = 0;
    float currentRateKn = 0;

    // tide set
    tDigitalData currentSet( DATA_TYPE_CURRENT_SET );
    bool setOk = currentSet.DampedValidValue(setR);

    // tide rate
    tDigitalData currentRate( DATA_TYPE_CURRENT_DRIFT );
    bool rateOk = currentRate.DampedValidValue(currentRateKn);

    // line bearing
    tDigitalData lineBearing( DATA_TYPE_START_LINE_BEARING );
    bool lineOk = lineBearing.DampedValidValue( lineBearingR );
    
    bool showTideArrow = false;

    if ( setOk && rateOk && lineOk )
    {
        float angleR = setR - ( lineBearingR + PI_2f );
        NormaliseRadiansF( angleR );
        m_pTideArrow->SetAngle( qRound( RadiansToDegreesf( angleR ) ) );
        showTideArrow = true;

        if( currentRateKn < 0.05f )
        {
            showTideArrow = false;
        }
        else if( currentRateKn < 1.0f )
        {
            m_pTideArrow->SetScale( currentRateKn );
            showTideArrow = true;
        }
        else
        {
            m_pTideArrow->SetScale( 1.0f );
            showTideArrow = true;
        }
    }
    else
    {
        showTideArrow = false;
    }

    m_pTideArrow->setVisible( showTideArrow );
}
Exemplo n.º 3
0
void JokerWindow::timeCounter(PhTime elapsedTime)
{
	if(currentRate() == 1 && (PhSynchronizer::SyncType)_settings->synchroProtocol() != PhSynchronizer::NoSync) {
		_settings->setTimePlayed(_settings->timePlayed() + elapsedTime);
	}
}