mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 05:10:04 +00:00 
			
		
		
		
	Loop delay configuration
This commit is contained in:
		
							parent
							
								
									a5df5a237e
								
							
						
					
					
						commit
						c7a4706f43
					
				
					 6 changed files with 60 additions and 10 deletions
				
			
		|  | @ -672,6 +672,10 @@ void MainWindowImpl::ConnectAnimationSignals() | |||
|            &ui::AnimationDockWidget::LoopSpeedChanged, | ||||
|            timelineManager_.get(), | ||||
|            &manager::TimelineManager::SetLoopSpeed); | ||||
|    connect(animationDockWidget_, | ||||
|            &ui::AnimationDockWidget::LoopDelayChanged, | ||||
|            timelineManager_.get(), | ||||
|            &manager::TimelineManager::SetLoopDelay); | ||||
|    connect(animationDockWidget_, | ||||
|            &ui::AnimationDockWidget::AnimationStepBeginSelected, | ||||
|            timelineManager_.get(), | ||||
|  |  | |||
|  | @ -71,6 +71,7 @@ public: | |||
|    types::MapTime                        viewType_ {types::MapTime::Live}; | ||||
|    std::chrono::minutes                  loopTime_ {30}; | ||||
|    double                                loopSpeed_ {5.0}; | ||||
|    std::chrono::milliseconds             loopDelay_ {2500}; | ||||
| 
 | ||||
|    bool                    radarSweepMonitorActive_ {false}; | ||||
|    std::mutex              radarSweepMonitorMutex_ {}; | ||||
|  | @ -170,6 +171,13 @@ void TimelineManager::SetLoopSpeed(double loopSpeed) | |||
|    p->loopSpeed_ = loopSpeed; | ||||
| } | ||||
| 
 | ||||
| void TimelineManager::SetLoopDelay(std::chrono::milliseconds loopDelay) | ||||
| { | ||||
|    logger_->debug("SetLoopDelay: {}", loopDelay); | ||||
| 
 | ||||
|    p->loopDelay_ = loopDelay; | ||||
| } | ||||
| 
 | ||||
| void TimelineManager::AnimationStepBegin() | ||||
| { | ||||
|    logger_->debug("AnimationStepBegin"); | ||||
|  | @ -417,8 +425,8 @@ void TimelineManager::Impl::Play() | |||
|          } | ||||
|          else | ||||
|          { | ||||
|             // Pause for 2.5 seconds at the end of the loop
 | ||||
|             interval = std::chrono::milliseconds(2500); | ||||
|             // Pause at the end of the loop
 | ||||
|             interval = loopDelay_; | ||||
|          } | ||||
| 
 | ||||
|          animationTimer_.expires_after(interval); | ||||
|  |  | |||
|  | @ -34,6 +34,7 @@ public slots: | |||
| 
 | ||||
|    void SetLoopTime(std::chrono::minutes loopTime); | ||||
|    void SetLoopSpeed(double loopSpeed); | ||||
|    void SetLoopDelay(std::chrono::milliseconds loopDelay); | ||||
| 
 | ||||
|    void AnimationStepBegin(); | ||||
|    void AnimationStepBack(); | ||||
|  |  | |||
|  | @ -88,6 +88,7 @@ AnimationDockWidget::AnimationDockWidget(QWidget* parent) : | |||
|    // Set loop defaults
 | ||||
|    ui->loopTimeSpinBox->setValue(30); | ||||
|    ui->loopSpeedSpinBox->setValue(5.0); | ||||
|    ui->loopDelaySpinBox->setValue(2.5); | ||||
| 
 | ||||
|    // Connect widget signals
 | ||||
|    p->ConnectSignals(); | ||||
|  | @ -161,6 +162,15 @@ void AnimationDockWidgetImpl::ConnectSignals() | |||
|                     &QDoubleSpinBox::valueChanged, | ||||
|                     self_, | ||||
|                     [this](double d) { Q_EMIT self_->LoopSpeedChanged(d); }); | ||||
|    QObject::connect( | ||||
|       self_->ui->loopDelaySpinBox, | ||||
|       &QDoubleSpinBox::valueChanged, | ||||
|       self_, | ||||
|       [this](double d) | ||||
|       { | ||||
|          Q_EMIT self_->LoopDelayChanged(std::chrono::milliseconds( | ||||
|             static_cast<typename std::chrono::milliseconds::rep>(d * 1000.0))); | ||||
|       }); | ||||
| 
 | ||||
|    // Animation controls
 | ||||
|    QObject::connect(self_->ui->beginButton, | ||||
|  |  | |||
|  | @ -38,6 +38,7 @@ signals: | |||
| 
 | ||||
|    void LoopTimeChanged(std::chrono::minutes loopTime); | ||||
|    void LoopSpeedChanged(double loopSpeed); | ||||
|    void LoopDelayChanged(std::chrono::milliseconds loopDelay); | ||||
| 
 | ||||
|    void AnimationStepBeginSelected(); | ||||
|    void AnimationStepBackSelected(); | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ | |||
|     <x>0</x> | ||||
|     <y>0</y> | ||||
|     <width>200</width> | ||||
|     <height>337</height> | ||||
|     <height>348</height> | ||||
|    </rect> | ||||
|   </property> | ||||
|   <property name="windowTitle"> | ||||
|  | @ -130,13 +130,6 @@ | |||
|           <property name="bottomMargin"> | ||||
|            <number>0</number> | ||||
|           </property> | ||||
|           <item row="0" column="0"> | ||||
|            <widget class="QLabel" name="loopTimeLabel"> | ||||
|             <property name="text"> | ||||
|              <string>Loop Time</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="0" column="1"> | ||||
|            <widget class="QSpinBox" name="loopTimeSpinBox"> | ||||
|             <property name="correctionMode"> | ||||
|  | @ -156,6 +149,13 @@ | |||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="0" column="0"> | ||||
|            <widget class="QLabel" name="loopTimeLabel"> | ||||
|             <property name="text"> | ||||
|              <string>Loop Time</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="1" column="0"> | ||||
|            <widget class="QLabel" name="loopSpeedLabel"> | ||||
|             <property name="text"> | ||||
|  | @ -179,6 +179,32 @@ | |||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="2" column="0"> | ||||
|            <widget class="QLabel" name="loopDelayLabel"> | ||||
|             <property name="text"> | ||||
|              <string>Loop Delay</string> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|           <item row="2" column="1"> | ||||
|            <widget class="QDoubleSpinBox" name="loopDelaySpinBox"> | ||||
|             <property name="suffix"> | ||||
|              <string> sec</string> | ||||
|             </property> | ||||
|             <property name="decimals"> | ||||
|              <number>1</number> | ||||
|             </property> | ||||
|             <property name="maximum"> | ||||
|              <double>15.000000000000000</double> | ||||
|             </property> | ||||
|             <property name="singleStep"> | ||||
|              <double>0.100000000000000</double> | ||||
|             </property> | ||||
|             <property name="value"> | ||||
|              <double>2.500000000000000</double> | ||||
|             </property> | ||||
|            </widget> | ||||
|           </item> | ||||
|          </layout> | ||||
|         </widget> | ||||
|        </item> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat