void ClearChannelDelta(int channel) { if (_log.IsDebugEnabled) { _log.DebugFormat("Starting {0}", MethodBase.GetCurrentMethod().ToString()); } if (ChangingChannels.ContainsKey(channel)) { lock (lockObject1) { ChangingChannels.Remove(channel); if (ChangingChannels.Count == 0) { TimerIsTicking = false; ProcessTimer.Stop(); } } } if (_log.IsDebugEnabled) { _log.DebugFormat("Ending {0}", MethodBase.GetCurrentMethod().ToString()); } }
void SetChannelDelta(int channel, byte startValue, decimal delta, int milliseconds) { if (_log.IsDebugEnabled) { _log.DebugFormat("Starting {0}", MethodBase.GetCurrentMethod().ToString()); } if (!ChangingChannels.ContainsKey(channel)) { ChangingChannels.Add(channel, new ChangingChannelDefinition(startValue, delta, milliseconds)); } else { ChangingChannels[channel] = new ChangingChannelDefinition(startValue, delta, milliseconds); } if (!TimerIsTicking) { ProcessTimer.Start(); TimerIsTicking = true; } if (_log.IsDebugEnabled) { _log.DebugFormat("Ending {0}", MethodBase.GetCurrentMethod().ToString()); } }