Compare commits

...

2 Commits

Author SHA1 Message Date
Nick Genovese
bf3af3b611 feat: major refactor to namespaces to make everything a bit easier to follow 2024-11-06 19:01:09 -05:00
Nick Genovese
37c1a6c7dd feat: implemented logging by key with Core
- updated log methods in a few places
2024-11-05 13:30:01 -05:00
339 changed files with 971 additions and 2619 deletions

12
.editorconfig Normal file
View File

@@ -0,0 +1,12 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false

View File

@@ -15,11 +15,15 @@
<MakeDir Directories="$(PackageOutputPath)\$(AssemblyName)" Condition="!Exists('$(PackageOutputPath)\$(AssemblyName)')" />
<ZipDirectory SourceDirectory="$(TargetDir)" DestinationFile="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cplz" Overwrite="true"/>
</Target>
<Target Name="Copy CPZ NET6" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net6.0' ) Or ( '$(TargetFramework)' == 'net8.0' ))">
<Target Name="Copy CPZ NET6" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net6.0' ))">
<Message Text="Copying CPZ"></Message>
<Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" />
</Target>
<Target Name="Copy CPZ NET47" AfterTargets="SimplSharpPostProcess47" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' != 'net6.0' ) And ( '$(TargetFramework)' != 'net8.0' ))">
<Target Name="Copy CPZ NET8" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net8.0' ))">
<Message Text="Copying CPZ"></Message>
<Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" />
</Target>
<Target Name="Copy CPZ NET47" AfterTargets="SimplSharpPostProcess" Condition="($(ProjectType) == 'Program' And ( '$(TargetFramework)' == 'net472' ))">
<Message Text="Copying CPZ"></Message>
<Move SourceFiles="$(TargetDir)$(TargetName).cpz" DestinationFiles="$(PackageOutputPath)\$(AssemblyName)\$(TargetName).$(Version).$(TargetFramework).cpz" />
</Target>

View File

@@ -11,7 +11,11 @@ using Crestron.SimplSharpPro.EthernetCommunication;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Communications;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.JoinMaps;
using PepperDash.Essentials.Core.Monitoring;
using Serilog.Events;
//using PepperDash.Essentials.Devices.Common.Cameras;

View File

@@ -1,4 +1,5 @@
using PepperDash.Core;
using PepperDash.Essentials.Core.Devices;
using Serilog.Events;
//using PepperDash.Essentials.Devices.Common.Cameras;

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class AirMediaControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class AppleTvJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class C2nRthsControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
/// <summary>
/// Join map for CameraBase devices

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class CenOdtOccupancySensorBaseJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class DisplayControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges {
namespace PepperDash.Essentials.Core.Bridges.JoinMaps {
public class DmBladeChassisControllerJoinMap : JoinMapBaseAdvanced {
[JoinName("IsOnline")]

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class DmChassisControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class DmRmcControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class DmTxControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class DmpsAudioOutputControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class DmpsMicrophoneControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,4 +1,5 @@
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{

View File

@@ -1,7 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class GenericLightingJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class GenericRelayControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class GlsOccupancySensorBaseJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,5 +1,6 @@
using System;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class HdMdNxM4kEControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class HdMdxxxCEControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,7 +1,7 @@
using System;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class HdPsXxxControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class Hrxxx0WirelessRemoteControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class IAnalogInputJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class IBasicCommunicationJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class IDigitalInputJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class IDigitalOutputJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
/// <summary>
/// Join map for IRBlurayBase devices

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class PduJoinMapBase : JoinMapBaseAdvanced
{

View File

@@ -1,7 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class SetTopBoxControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class StatusSignControllerJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,6 +1,7 @@
using System;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class SystemMonitorJoinMap : JoinMapBaseAdvanced
{

View File

@@ -1,5 +1,7 @@
using System;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.JoinMaps;
namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class VideoCodecControllerJoinMap : JoinMapBaseAdvanced

View File

@@ -1,25 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public interface IComPortsDevice
{
IComPorts Device { get; }
}
}

View File

@@ -1,16 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using PepperDash.Core;
using Serilog.Events;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Communications
{
public class CecPortController : Device, IBasicCommunicationWithStreamDebugging
{

View File

@@ -1,16 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
using Serilog.Events;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Communications
{
public class ComPortController : Device, IBasicCommunicationWithStreamDebugging
{

View File

@@ -1,19 +1,8 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using System;
using Crestron.SimplSharpPro;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Communications
{
/// <summary>
/// This converter creates a proper ComPort.ComPortSpec struct from more-friendly JSON values. It uses

View File

@@ -1,16 +1,14 @@

using System;
using Crestron.SimplSharp;
using System;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Routing;
using Serilog.Events;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Communications
{
/// <summary>
///

View File

@@ -0,0 +1,12 @@
using Crestron.SimplSharpPro;
namespace PepperDash.Essentials.Core.Communications
{
/// <summary>
///
/// </summary>
public interface IComPortsDevice
{
IComPorts Device { get; }
}
}

View File

@@ -1,15 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Monitoring;
using Serilog.Events;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Communications
{
public class ConsoleCommMockDevice : EssentialsDevice, ICommunicationMonitor
{

View File

@@ -1,19 +1,19 @@

using System;
using System;
using System.Collections.Generic;
using Crestron.SimplSharp.CrestronSockets;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Bridges.JoinMaps;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Config.Essentials;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.JoinMaps;
using PepperDash.Essentials.Core.Touchpanels;
using Serilog.Events;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Communications
{
/// <summary>
/// Serves as a generic wrapper class for all styles of IBasicCommuncation ports

View File

@@ -1,8 +1,8 @@
using Crestron.SimplSharp.Net.Http;
using System;
using Crestron.SimplSharp.Net.Http;
using PepperDash.Core;
using System;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Communications
{
[Obsolete("Please use the builtin HttpClient class instead: https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/http/httpclient-guidelines")]
public class GenericHttpClient : Device, IBasicCommunication

View File

@@ -1,18 +1,13 @@

using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using System;
using Crestron.SimplSharpPro;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices;
using Serilog.Events;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Communications
{
/// <summary>
///

View File

@@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PepperDash.Essentials.Core.Devices;
namespace PepperDash.Essentials.Core.Config
{

View File

@@ -6,6 +6,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Core.Config
{

View File

@@ -1,6 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

View File

@@ -1,17 +1,14 @@
using System;
using System;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Core.Config;
using Serilog.Events;
namespace PepperDash.Essentials.Core.Config
namespace PepperDash.Essentials.Core.Config.Essentials
{
/// <summary>
/// Loads the ConfigObject from the file

View File

@@ -1,20 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Crestron.SimplSharp.Net.Http;
using Crestron.SimplSharpPro.Diagnostics;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using Serilog.Events;
namespace PepperDash.Essentials.Core.Config
namespace PepperDash.Essentials.Core.Config.Essentials
{
public static class ConfigUpdater
{
@@ -160,7 +152,7 @@ namespace PepperDash.Essentials.Core.Config
// Moves the file and appends the .bak extension
var fileDest = archiveDirectoryPath + "/" + file.Name + ".bak";
if(!File.Exists(fileDest))
if(!global::Crestron.SimplSharp.CrestronIO.File.Exists(fileDest))
{
file.MoveTo(fileDest);
}

View File

@@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json;
@@ -11,7 +7,7 @@ using Newtonsoft.Json.Linq;
using PepperDash.Core;
using Serilog.Events;
namespace PepperDash.Essentials.Core.Config
namespace PepperDash.Essentials.Core.Config.Essentials
{
/// <summary>
/// Responsible for updating config at runtime, and writing the updates out to a local file

View File

@@ -1,15 +1,8 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.Config
namespace PepperDash.Essentials.Core.Config.Essentials
{
/// <summary>
/// Loads the ConfigObject from the file

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Config
{
public interface ILoadConfig
{

View File

@@ -4,6 +4,7 @@ using Crestron.SimplSharp;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using PepperDash.Essentials.Core.Ethernet;
namespace PepperDash.Essentials.Core.Config
{

View File

@@ -1,13 +1,15 @@
using System;
using System.Linq;
using System.Linq;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Core.JsonStandardObjects;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Feedbacks;
using PepperDash.Essentials.Core.Monitoring;
using Serilog.Events;
using Feedback = PepperDash.Essentials.Core.Feedbacks.Feedback;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Crestron
{
public abstract class CrestronGenericBaseDevice : EssentialsDevice, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
{

View File

@@ -1,128 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// A bridge class to cover the basic features of GenericBase hardware
/// </summary>
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
{
public virtual GenericBase Hardware { get; protected set; }
public BoolFeedback IsOnline { get; private set; }
public BoolFeedback IsRegistered { get; private set; }
public StringFeedback IpConnectionsText { get; private set; }
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name)
{
Hardware = hardware;
IsOnline = new BoolFeedback(CommonBoolCue.IsOnlineFeedback, () => Hardware.IsOnline);
IsRegistered = new BoolFeedback(new Cue("IsRegistered", 0, eCueType.Bool), () => Hardware.Registered);
IpConnectionsText = new StringFeedback(CommonStringCue.IpConnectionsText, () =>
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
}
/// <summary>
/// Make sure that overriding classes call this!
/// Registers the Crestron device, connects up to the base events, starts communication monitor
/// </summary>
public override bool CustomActivate()
{
Debug.LogMessage(LogEventLevel.Information, this, "Activating");
var response = Hardware.RegisterWithLogging(Key);
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
{
<<<<<<< HEAD
Debug.LogMessage(LogEventLevel.Information, this, "ERROR: Cannot register Crestron device: {0}", response);
return false;
}
=======
Debug.LogMessage(LogEventLevel.Information, this, "ERROR: Cannot register Crestron device: {0}", response);
return false;
}
>>>>>>> origin/feature/ecs-342-neil
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
CommunicationMonitor.Start();
return true;
}
/// <summary>
/// This disconnects events and unregisters the base hardware device.
/// </summary>
/// <returns></returns>
public override bool Deactivate()
{
CommunicationMonitor.Stop();
Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange;
return Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
}
/// <summary>
/// Returns a list containing the Outputs that we want to expose.
/// </summary>
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
IsOnline,
IsRegistered,
IpConnectionsText
};
}
}
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
IsOnline.FireUpdate();
}
#region IStatusMonitor Members
public StatusMonitorBase CommunicationMonitor { get; private set; }
#endregion
#region IUsageTracking Members
public UsageTracking UsageTracker { get; set; }
#endregion
}
//***********************************************************************************
public class CrestronGenericBaseDeviceEventIds
{
public const uint IsOnline = 1;
public const uint IpConnectionsText =2;
}
/// <summary>
/// Adds logging to Register() failure
/// </summary>
public static class GenericBaseExtensions
{
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
{
var result = device.Register();
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.LogMessage(LogEventLevel.Information, "Cannot register device '{0}': {1}", key, result);
}
return result;
}
}
}

View File

@@ -10,7 +10,11 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Bridges.JoinMaps;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Feedbacks;
using PepperDash.Essentials.Core.JoinMaps;
using Serilog.Events;

View File

@@ -10,7 +10,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Bridges.JoinMaps;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Feedbacks;
using PepperDash.Essentials.Core.JoinMaps;
using PepperDash.Essentials.Core.Touchpanels;
using Serilog.Events;
namespace PepperDash.Essentials.Core.CrestronIO

View File

@@ -14,6 +14,11 @@ using PepperDash.Essentials.Core.Bridges;
using Newtonsoft.Json;
using PepperDash.Essentials.Core.Bridges.JoinMaps;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Feedbacks;
using PepperDash.Essentials.Core.JoinMaps;
using PepperDash.Essentials.Core.Touchpanels;
using Serilog.Events;
namespace PepperDash.Essentials.Core.CrestronIO

View File

@@ -14,6 +14,10 @@ using PepperDash.Essentials.Core.Bridges;
using Newtonsoft.Json;
using PepperDash.Essentials.Core.Bridges.JoinMaps;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Feedbacks;
using PepperDash.Essentials.Core.JoinMaps;
using Serilog.Events;
namespace PepperDash.Essentials.Core.CrestronIO

View File

@@ -14,6 +14,11 @@ using PepperDash.Essentials.Core.Bridges;
using Newtonsoft.Json;
using PepperDash.Essentials.Core.Bridges.JoinMaps;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Feedbacks;
using PepperDash.Essentials.Core.JoinMaps;
using PepperDash.Essentials.Core.Touchpanels;
using Serilog.Events;
namespace PepperDash.Essentials.Core.CrestronIO

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.CrestronIO
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.CrestronIO
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.CrestronIO
{

View File

@@ -1,12 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.CrestronIO
{
public interface IHasCresnetBranches
{

View File

@@ -5,6 +5,7 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.CrestronIO
{

View File

@@ -1,19 +0,0 @@
//using System;
//using System.Collections.Generic;
//using Crestron.SimplSharpPro;
//using Crestron.SimplSharpPro.DeviceSupport;
//using PepperDash.Core;
//namespace PepperDash.Essentials.Core
//{
// public interface IPresentationSource : IKeyed
// {
// string Name { get; }
// PresentationSourceType Type { get; }
// string IconName { get; set; }
// BoolFeedback HasPowerOnFeedback { get; }
// }
//}

View File

@@ -1,10 +1,7 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core.Touchpanels;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
///

View File

@@ -1,10 +1,7 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core.Touchpanels;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
///

View File

@@ -1,10 +1,8 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.Touchpanels;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
///

View File

@@ -1,9 +1,4 @@
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IDiscPlayerControls : IColor, IDPad, INumericKeypad, IHasPowerControl, ITransport, IUiDisplayInfo

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Devices.DeviceTypeInterfaces
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IDisplayBasic
{

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IDumbSource
{

View File

@@ -1,15 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core.Touchpanels;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
///

View File

@@ -1,4 +1,6 @@
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IHasFarEndContentStatus
{

View File

@@ -1,5 +1,6 @@
using System;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PepperDash.Essentials.Core.Devices;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{

View File

@@ -2,6 +2,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{

View File

@@ -1,9 +1,8 @@
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.Touchpanels;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
///

View File

@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
/// Describes the functionality required to prompt a user to enter a password

View File

@@ -1,17 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.Fusion;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core.Feedbacks;
using PepperDash.Essentials.Core.Touchpanels;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>

View File

@@ -2,6 +2,7 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{

View File

@@ -1,9 +1,7 @@
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core.Touchpanels;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
///

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{

View File

@@ -1,6 +1,7 @@
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core.Touchpanels;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
///

View File

@@ -1,6 +1,6 @@
using PepperDash.Core;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
/// Describes things needed to show on UI

View File

@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
/// Defines a class that has warm up and cool down

View File

@@ -1,9 +1,4 @@
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
}

View File

@@ -1,11 +1,6 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Devices
{
public abstract class AudioControlListItemBase
{

View File

@@ -1,12 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Devices
{
public enum AudioChangeType

View File

@@ -1,7 +1,7 @@
using Newtonsoft.Json;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Devices
{
public class CameraListItem
{

View File

@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Devices
{
/// <summary>
/// Adds control of codec receive volume

View File

@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
using PepperDash.Essentials.Core.CrestronIO;
using Serilog.Events;
@@ -17,7 +14,7 @@ namespace PepperDash.Essentials.Core.Devices
{
public Dictionary<uint, ISwitchedOutput> SwitchedOutputs { get; private set; }
public Crestron.SimplSharpPro.CrestronControlSystem Processor { get; private set; }
public CrestronControlSystem Processor { get; private set; }
public CrestronProcessor(string key)
: base(key)

View File

@@ -1,9 +1,7 @@
using Newtonsoft.Json;
using PepperDash.Essentials.Core.Routing;
using Newtonsoft.Json;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Devices
{
public class DestinationListItem
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core.Feedbacks;
namespace PepperDash.Essentials.Core.Devices
{

View File

@@ -1,12 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.Feedbacks;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
namespace PepperDash.Essentials.Core.Devices
{
public static class DeviceFeedbackExtensions
{

View File

@@ -1,4 +1,4 @@
namespace PepperDash.Essentials.Core.DeviceInfo
namespace PepperDash.Essentials.Core.Device_Info
{
public class DeviceInfo
{

View File

@@ -1,6 +1,6 @@
using System;
namespace PepperDash.Essentials.Core.DeviceInfo
namespace PepperDash.Essentials.Core.Device_Info
{
public class DeviceInfoEventArgs:EventArgs
{

Some files were not shown because too many files have changed in this diff Show More