mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-06-04 11:09:33 +00:00
Server: Fix playing music after 0 seconds time
This commit is contained in:
@@ -310,16 +310,17 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
@confirmation_required("This operation will takeoff selected copters with delay and start animation. Proceed?")
|
||||
def send_start_time_selected(self):
|
||||
time_now = server.time_now()
|
||||
time_lag = 0.1
|
||||
dt = self.ui.start_delay_spin.value()
|
||||
logging.info('Wait {} seconds to start animation'.format(dt))
|
||||
if self.ui.music_checkbox.isChecked():
|
||||
music_dt = self.ui.music_delay_spin.value()
|
||||
asyncio.ensure_future(self.play_music_at_time(music_dt + time_now), loop=loop)
|
||||
asyncio.ensure_future(self.play_music_at_time(music_dt + time_now + time_lag), loop=loop)
|
||||
logging.info('Wait {} seconds to play music'.format(music_dt))
|
||||
# This filter constraints takeoff in real world, when copter state was normal and then some checks were failed for a while
|
||||
# for copter in filter(lambda copter: copter.states.all_checks, self.model.user_selected()):
|
||||
for copter in self.model.user_selected():
|
||||
server.send_starttime(copter.client, dt + time_now)
|
||||
server.send_starttime(copter.client, dt + time_now + time_lag)
|
||||
|
||||
@pyqtSlot()
|
||||
def pause_resume_selected(self):
|
||||
|
||||
Reference in New Issue
Block a user