using System; using System.Collections.Generic; using System.Linq; using Crestron.SimplSharpPro; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Routing; using PepperDash.Core; using Serilog.Events; namespace PepperDash.Essentials.Core.Devices { [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")] public class InRoomPc : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking { public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } } public string IconName { get; set; } public BoolFeedback HasPowerOnFeedback { get; private set; } public RoutingOutputPort AnyVideoOut { get; private set; } #region IRoutingOutputs Members /// /// Options: hdmi /// public RoutingPortCollection OutputPorts { get; private set; } #endregion public InRoomPc(string key, string name) : base(key, name) { IconName = "PC"; HasPowerOnFeedback = new BoolFeedback("HasPowerFeedback", () => this.GetVideoStatuses() != VideoStatusOutputs.NoStatus); OutputPorts = new RoutingPortCollection(); OutputPorts.Add(AnyVideoOut = new RoutingOutputPort(RoutingPortNames.AnyVideoOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this)); } #region IHasFeedback Members /// /// Passes through the VideoStatuses list /// public FeedbackCollection Feedbacks { get { var newList = new FeedbackCollection(); newList.AddRange(this.GetVideoStatuses().ToList()); return newList; } } #endregion #region IUsageTracking Members public UsageTracking UsageTracker { get; set; } #endregion } [Obsolete("Please use PepperDash.Essentials.Devices.Common, this will be removed in 2.1")] public class InRoomPcFactory : EssentialsDeviceFactory { public InRoomPcFactory() { TypeNames = new List() { "inroompc" }; } public override EssentialsDevice BuildDevice(DeviceConfig dc) { Debug.LogMessage(LogEventLevel.Debug, "Factory Attempting to create new InRoomPc Device"); return new InRoomPc(dc.Key, dc.Name); } } }