Esempio n. 1
0
void GRIBUIDialog::ComputeBestForecastForNow()
{
    wxTimeSpan span = wxDateTime::Now() - MinTime();
    m_sTimeline->SetValue(span.GetMinutes()/60.0*m_OverlaySettings.m_HourDivider);

    TimelineChanged();
}
Esempio n. 2
0
void GRIBUIDialog::OnPlayStopTimer( wxTimerEvent & )
{
    if(!m_tbPlayStop->GetValue())
        m_tPlayStop.Stop();
    else if(m_sTimeline->GetValue() >= m_sTimeline->GetMax()) {
        if(m_OverlaySettings.m_bLoopMode) {
            m_sTimeline->SetValue(0);
            TimelineChanged();
        } else {
            m_tbPlayStop->SetValue(0);
            m_tbPlayStop->SetLabel(_("Play"));
            m_tPlayStop.Stop();
        }
    } else {
        m_sTimeline->SetValue(m_sTimeline->GetValue() + m_OverlaySettings.m_SlicesPerUpdate);
        TimelineChanged();
    }
}
Esempio n. 3
0
void GRIBUIDialog::OnPlayStopTimer( wxTimerEvent & )
{
    if( m_bPlay->IsSameAs( m_bpPlay->GetBitmapLabel()) )  
        m_tPlayStop.Stop();
    else if(m_sTimeline->GetValue() >= m_sTimeline->GetMax()) {
        if(m_OverlaySettings.m_bLoopMode) {
            m_sTimeline->SetValue(0);
            TimelineChanged();
        } else {
            m_bpPlay->SetBitmap(*m_bPlay );
            m_bpPlay->SetToolTip( _("Play") );
            m_tPlayStop.Stop();
        }
    } else {
        m_sTimeline->SetValue(m_sTimeline->GetValue() + m_OverlaySettings.m_SlicesPerUpdate);
        TimelineChanged();
    }
}
Esempio n. 4
0
void GRIBUIDialog::OnNext( wxCommandEvent& event )
{
    if(m_cRecordForecast->GetCurrentSelection() == -1) /* set to interpolated entry */
        TimelineChanged(true);

    if( m_cRecordForecast->GetCurrentSelection() == (int)m_cRecordForecast->GetCount() - 1 ) return; //end of list

//    m_pGribForecastTimer.Stop();
    m_cRecordForecast->SetSelection( m_cRecordForecast->GetCurrentSelection() + 1 );
    DisplayDataGRS( );
}
Esempio n. 5
0
void GRIBUIDialog::OnPrev( wxCommandEvent& event )
{
    if(m_cRecordForecast->GetCurrentSelection() == -1) /* set to interpolated entry */
        TimelineChanged(true);

//    m_pGribForecastTimer.Stop();
    int selection = m_cRecordForecast->GetCurrentSelection() - 1;
    if(selection < 0)
        selection = 0;
    m_cRecordForecast->SetSelection( selection );
    DisplayDataGRS( );
}
Esempio n. 6
0
void GRIBUIDialog::SelectGribRecordSet( GribRecordSet *pGribRecordSet )
{
    if(!pGribRecordSet) {
        pPlugIn->GetGRIBOverlayFactory()->SetGribTimelineRecordSet(NULL);
        return;
    }

    wxDateTime mintime = MinTime(), curtime = pGribRecordSet->m_Reference_Time;
    double hour = (curtime - mintime).GetMinutes()/60.0;

    m_sTimeline->SetValue(hour*m_OverlaySettings.m_HourDivider);
    TimelineChanged();
}
Esempio n. 7
0
void GRIBUIDialog::OnSettings( wxCommandEvent& event )
{
    GribOverlaySettings initSettings = m_OverlaySettings;
    GribSettingsDialog *dialog = new GribSettingsDialog( *this, m_OverlaySettings,  m_lastdatatype);
    if(dialog->ShowModal() == wxID_OK)
    {
        dialog->WriteSettings();
        m_OverlaySettings.Write();
        TimelineChanged(true);
    } else
        m_OverlaySettings = initSettings;

    SetFactoryOptions();
}
Esempio n. 8
0
void GRIBUIDialog::OnTimeline( wxScrollEvent& event )
{
    TimelineChanged();
}