Skip to content

Commit

Permalink
Merge tag 'v1.0.4' into develop
Browse files Browse the repository at this point in the history
updated debug messages
  • Loading branch information
ngenovese11 committed Jul 9, 2020
2 parents 90d6772 + 495294a commit 17275dc
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/countdown_timer/CountdownTimerEpi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public static void LoadPlugin()
var timer = new SecondsCountdownTimer(string.Format("{0}-timer", config.Key));
timer.SecondsToCount = props.CountdownTime;

return new CountdownTimerEpi(config.Key, timer, props);
return
new CountdownTimerEpi(config.Key, timer, props);
});
}

Expand All @@ -63,7 +64,8 @@ public CountdownTimerEpi(string key, SecondsCountdownTimer timer, CountdowmTimer

CrestronEnvironment.ProgramStatusEventHandler += eventType =>
{
if (eventType != eProgramStatusEventType.Stopping) return;
if (eventType != eProgramStatusEventType.Stopping)
return;

_countdownTimer.Cancel();
};
Expand All @@ -76,22 +78,22 @@ public override bool CustomActivate()
_countdownTimer.HasStarted += (sender, args) =>
{
var timer = sender as SecondsCountdownTimer;
Debug.Console(2, timer, "Countdown started and will expire at {0}", timer.FinishTime.ToShortTimeString());
Debug.Console(1, timer, "Countdown started and will expire at {0}", timer.FinishTime.ToShortTimeString());
};

_countdownTimer.HasFinished += (sender, args) =>
{
var timer = sender as SecondsCountdownTimer;
TimerExpiredFb.Start();

Debug.Console(2, timer, "Countdown has completed");
Debug.Console(1, timer, "Countdown has completed");
_countdownTimer.SecondsToCount = SecondsToCount;
};

_countdownTimer.WasCancelled += (sender, args) =>
{
var timer = sender as SecondsCountdownTimer;
Debug.Console(2, timer, "Countdown cancelled");
Debug.Console(1, timer, "Countdown cancelled");
_countdownTimer.SecondsToCount = SecondsToCount;
};

Expand All @@ -102,7 +104,7 @@ public override bool CustomActivate()

var timeRemainingString = _countdownTimer.FinishTime.Subtract(DateTime.Now).ToString();
double timeRemaining = _countdownTimer.FinishTime.Subtract(DateTime.Now).TotalSeconds;
Debug.Console(2, this, "Checking Time remaining for warning:{0}|{1}", timeRemainingString, timeRemaining);
Debug.Console(1, this, "Time remaining for warning:{0}|{1}", timeRemainingString, timeRemaining);

if (timeRemaining == (int)_warningTime)
TimerWarningFb.Start();
Expand All @@ -129,7 +131,7 @@ public void Extend()
if (_extendTime != null)
timeToExtend = (int)_extendTime;

Debug.Console(2, _countdownTimer, "Countdown extended {0}", timeToExtend);
Debug.Console(1, _countdownTimer, "Countdown extended {0}", timeToExtend);
_countdownTimer.SecondsToCount = timeToExtend;
_countdownTimer.Reset();
}
Expand Down

0 comments on commit 17275dc

Please sign in to comment.