def StartRaceNow(): global undoResetTimer if undoResetTimer and undoResetTimer.IsRunning(): undoResetTimer.Stop() undoResetTimer = None JChip.reset() undo.clear() undo.pushState() with Model.LockRace() as race: if race is None: return if not getattr(race, 'enableJChipIntegration', False): race.resetStartClockOnFirstTag = False Model.resetCache() race.startRaceNow() OutputStreamer.writeRaceStart() VideoBuffer.ModelStartCamera() # Refresh the main window and switch to the Record pane. mainWin = Utils.getMainWin() if mainWin is not None: mainWin.showPageName( _('Record') ) mainWin.refresh() # For safety, clear the undo stack after 8 seconds. undoResetTimer = wx.CallLater( 8000, undo.clear ) if getattr(race, 'ftpUploadDuringRace', False): realTimeFtpPublish.publishEntry( True )
def StartRaceNow(page=_('Record')): global undoResetTimer if undoResetTimer and undoResetTimer.IsRunning(): undoResetTimer.Stop() undoResetTimer = None ChipReader.chipReaderCur.reset( Model.race.chipReaderType if Model.race else None) undo.clear() undo.pushState() with Model.LockRace() as race: if race is None: return if not race.enableJChipIntegration: race.resetStartClockOnFirstTag = False Model.resetCache() race.startRaceNow() isTimeTrial = race.isTimeTrial OutputStreamer.writeRaceStart() # Refresh the main window and switch to the specified pane. mainWin = Utils.getMainWin() if mainWin is not None: mainWin.showPageName(page) mainWin.updateLapCounter() mainWin.refresh() if isTimeTrial: mainWin.menuPublishHtmlTTStart() # For safety, clear the undo stack after 8 seconds. undoResetTimer = wx.CallLater(8000, undo.clear) if race.ftpUploadDuringRace: realTimeFtpPublish.publishEntry(True)
def StartRaceNow(): global undoResetTimer if undoResetTimer and undoResetTimer.IsRunning(): undoResetTimer.Stop() undoResetTimer = None JChip.reset() undo.clear() undo.pushState() with Model.LockRace() as race: if race is None: return if not race.enableJChipIntegration: race.resetStartClockOnFirstTag = False Model.resetCache() race.startRaceNow() isTimeTrial = race.isTimeTrial OutputStreamer.writeRaceStart() # Refresh the main window and switch to the Record pane. mainWin = Utils.getMainWin() if mainWin is not None: mainWin.showPageName( _('Record') ) mainWin.updateLapCounter() mainWin.refresh() if isTimeTrial and Utils.MessageOKCancel( mainWin, _('Create TTStart HTML Page?'), _('Create TTStart HTML Page?') ): mainWin.menuPublishHtmlTTStart() # For safety, clear the undo stack after 8 seconds. undoResetTimer = wx.CallLater( 8000, undo.clear ) if race.ftpUploadDuringRace: realTimeFtpPublish.publishEntry( True )