Refator: Refactor timer implementation across multiple classes to use System.Timers.Timer instead of CTimer for improved consistency and performance.

- Updated RelayControlledShade to utilize Timer for output pulsing.
- Refactored MockVC to replace CTimer with Timer for call status simulation.
- Modified VideoCodecBase to enhance documentation and improve feedback handling.
- Removed obsolete IHasCamerasMessenger and updated related classes to use IHasCamerasWithControls.
- Adjusted PressAndHoldHandler to implement Timer for button hold actions.
- Enhanced logging throughout MobileControl and RoomBridges for better debugging and information tracking.
- Cleaned up unnecessary comments and improved exception handling in various classes.
This commit is contained in:
Neil Dorin 2026-03-30 11:44:15 -06:00
parent b4d53dbe0e
commit 7076eafc21
56 changed files with 1343 additions and 2197 deletions

View file

@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using System.Timers;
using PepperDash.Core;
using Serilog.Events;
@ -56,16 +56,14 @@ namespace PepperDash.Essentials.Devices.Common.Codec
}
}
private readonly CTimer _scheduleChecker;
private Timer _scheduleChecker;
/// <summary>
/// Initializes a new instance of the CodecScheduleAwareness class with default poll time
/// </summary>
public CodecScheduleAwareness()
{
Meetings = new List<Meeting>();
_scheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
Init(1000);
}
/// <summary>
@ -73,10 +71,17 @@ namespace PepperDash.Essentials.Devices.Common.Codec
/// </summary>
/// <param name="pollTime">The poll time in milliseconds for checking schedule changes</param>
public CodecScheduleAwareness(long pollTime)
{
Init(pollTime);
}
private void Init(long pollTime)
{
Meetings = new List<Meeting>();
_scheduleChecker = new CTimer(CheckSchedule, null, pollTime, pollTime);
_scheduleChecker = new Timer(pollTime) { AutoReset = true };
_scheduleChecker.Elapsed += (s, e) => CheckSchedule(null);
_scheduleChecker.Start();
}
/// <summary>