private void RestTimer_Tick(object sender, object e) { TimerLogic.RestMinuteChanger(); TimerLogic.IsItLessThenTenRestMinute(restMinuteBlock); TimerLogic.RestSecondDecrementer(restSecondBlock); TimerSequenceRepeater(); }
private void WorkTimer_Tick(object sender, object e) { TimerLogic.WorkMinuteChanger(); TimerLogic.IsItLessThenTenWorkMinute(workMinuteBlock); TimerLogic.WorkSecondDecrementer(workSecondBlock); WorkEndChecker(); }
public override ulong Update(ulong currentCycleCount) { ExpirationTime = ulong.MaxValue; // Only enabled and not-done timers should predict expiration time if (AudioControl.EnableCount && (AudioControl.EnableReload || !DynamicControlBits.TimerDone) && VolumeControl != 0 && BackupValue != 0) { // Assume timer has not expired and is not updated DynamicControlBits.BorrowOut = false; DynamicControlBits.BorrowIn = false; // TODO: Find out why and when borrow-in is set // Calculate new current value and update if necessary bool expired = TimerLogic.UpdateCurrentValue(currentCycleCount); // When timer value has expired it will attempt to borrow out if (expired) { Expire(); } ExpirationTime = TimerLogic.PredictExpirationTime(currentCycleCount); } // Audio channels never trigger interrupts, so never spend CPU time in IRQ handling code return(0); }
/// <summary> /// /// </summary> /// <returns>Number of system cycles used by work in timer interrupt</returns> public override ulong Update(ulong currentCycleCount) { ulong cyclesInterrupt = 0; ExpirationTime = ulong.MaxValue; // "The Timer Done bit requires clearing in order to count." // Only enabled and not-done timers should predict expiration time if (StaticControlBits.EnableCount && (StaticControlBits.EnableReload || !DynamicControlBits.TimerDone)) { // Assume timer has not expired and is not updated DynamicControlBits.BorrowOut = false; DynamicControlBits.BorrowIn = false; // TODO: Find out why and when borrow-in is set // Calculate new current value and update if necessary bool expired = TimerLogic.UpdateCurrentValue(currentCycleCount); // When timer value has expired it will attempt to borrow out if (expired) { cyclesInterrupt = Expire(); } ExpirationTime = TimerLogic.PredictExpirationTime(currentCycleCount); } return(cyclesInterrupt); }
public void RBAppearer() { TimerLogic.TextBlockAppearer(restMinuteBlock, restSecondBlock, workMinuteBlock, workSecondBlock); TimerLogic.BtnAppearer(btnStartWork, btnStartRest); TimerLogic.StarterStopper(mediaElement); workTimer.Stop(); restTimer.Start(); }
public HiddenWindow() { TimerLogic = new TimerLogic(this); StartWindow = new StartWindow(this); StopWindow = new StopWindow(this); OptionsWindow = new Options(); InitializeComponent(); }
public override void OnInspectorGUI() { NGUIEditorTools.BeginContents(); NGUIEditorTools.DrawProperty("Text Label", serializedObject, "TextLabel"); NGUIEditorTools.DrawProperty("Is Add", serializedObject, "IsAdd"); NGUIEditorTools.DrawProperty("Is Start", serializedObject, "IsStart"); NGUIEditorTools.EndContents(); TimerLogic button = target as TimerLogic; NGUIEditorTools.DrawEvents("Update Delegate", button, button.UpdateDelegate, false); serializedObject.ApplyModifiedProperties(); }
private void GameScreen_Loaded(object sender, RoutedEventArgs e) { MainWindow win = (MainWindow)Window.GetWindow(this); if (win.IsNewGame) { this.GameModel = new GameModel(win.PlayerName); this.ballLogic = new BallLogic(this.GameModel.Ball); this.characterLogic = new CharacterLogic(this.GameModel.Ball, this.GameModel.Character, this.GameModel.Score, this.GameModel.Timer); this.scoreLogic = new ScoreLogic(this.GameModel.Score, this.GameModel.Ball); this.timerLogic = new TimerLogic(this.GameModel.Timer, this.GameModel); } else { this.GameModel = win.GameModel; this.GameModel.Character.Blocked = false; this.ballLogic = new BallLogic(this.GameModel.Ball); this.characterLogic = new CharacterLogic(this.GameModel.Ball, this.GameModel.Character, this.GameModel.Score, this.GameModel.Timer); this.scoreLogic = new ScoreLogic(this.GameModel.Score, this.GameModel.Ball); this.timerLogic = new TimerLogic(this.GameModel.Timer, this.GameModel); } this.render = new GameRenderer(this.GameModel); if (win != null) { this.tickTimer = new DispatcherTimer(); this.tickTimerSeconds = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(1000), }; this.tickTimer.Interval = TimeSpan.FromMilliseconds(20); this.tickTimer.Tick += this.Timer_Tick; this.tickTimerSeconds.Tick += this.Timer_Tick_Seconds; this.tickTimerSeconds.Start(); this.tickTimer.Start(); win.KeyDown += this.Win_KeyDown; win.KeyUp += this.Win_KeyUp; } this.ballLogic.RefreshScreen += (obj, args) => this.InvalidateVisual(); this.InvalidateVisual(); }
public TimersController() { this._timerLogic = new TimerLogic(); }
public TimerProPage() { InitializeComponent(); // takes class and instantiates it into an object otimerLogic = new TimerLogic(); }