void GRIBUIDialog::ComputeBestForecastForNow() { wxTimeSpan span = wxDateTime::Now() - MinTime(); m_sTimeline->SetValue(span.GetMinutes()/60.0*m_OverlaySettings.m_HourDivider); TimelineChanged(); }
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(); } }
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(); } }
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( ); }
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( ); }
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(); }
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(); }
void GRIBUIDialog::OnTimeline( wxScrollEvent& event ) { TimelineChanged(); }