chore: remove 4SERIES compiler directive

This commit is contained in:
Andrew Welker
2025-03-25 10:21:17 -05:00
parent 8316ee22b6
commit f6f731b470
34 changed files with 53 additions and 223 deletions

View File

@@ -12,7 +12,7 @@ using Serilog.Events;
namespace PepperDash.Essentials.Devices.Common.Displays namespace PepperDash.Essentials.Devices.Common.Displays
{ {
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced, IHasInputs<string, string>, IRoutingSinkWithSwitchingWithInputPort, IHasPowerControlWithFeedback public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced, IHasInputs<string>, IRoutingSinkWithSwitchingWithInputPort, IHasPowerControlWithFeedback
{ {
public ISelectableItems<string> Inputs { get; private set; } public ISelectableItems<string> Inputs { get; private set; }

View File

@@ -1,9 +1,7 @@
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.AppServer.Messengers; using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
#if SERIES4
#endif
namespace PepperDash.Essentials.Room.MobileControl namespace PepperDash.Essentials.Room.MobileControl
{ {
public class IChannelMessenger:MessengerBase public class IChannelMessenger:MessengerBase

View File

@@ -1,9 +1,7 @@
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.AppServer.Messengers; using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
#if SERIES4
#endif
namespace PepperDash.Essentials.Room.MobileControl namespace PepperDash.Essentials.Room.MobileControl
{ {
public class IDPadMessenger:MessengerBase public class IDPadMessenger:MessengerBase

View File

@@ -1,9 +1,7 @@
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.AppServer.Messengers; using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
#if SERIES4
#endif
namespace PepperDash.Essentials.Room.MobileControl namespace PepperDash.Essentials.Room.MobileControl
{ {
public class IDvrMessenger: MessengerBase public class IDvrMessenger: MessengerBase

View File

@@ -1,9 +1,7 @@
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.AppServer.Messengers; using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
#if SERIES4
#endif
namespace PepperDash.Essentials.Room.MobileControl namespace PepperDash.Essentials.Room.MobileControl
{ {
public class INumericKeypadMessenger:MessengerBase public class INumericKeypadMessenger:MessengerBase

View File

@@ -1,9 +1,7 @@
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.AppServer.Messengers; using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
#if SERIES4
#endif
namespace PepperDash.Essentials.Room.MobileControl namespace PepperDash.Essentials.Room.MobileControl
{ {
public class ISetTopBoxControlsMessenger:MessengerBase public class ISetTopBoxControlsMessenger:MessengerBase

View File

@@ -1,9 +1,7 @@
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.AppServer.Messengers; using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
#if SERIES4
#endif
namespace PepperDash.Essentials.Room.MobileControl namespace PepperDash.Essentials.Room.MobileControl
{ {
public class ITransportMessenger:MessengerBase public class ITransportMessenger:MessengerBase

View File

@@ -30,11 +30,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
codec.CallStatusChange += Codec_CallStatusChange; codec.CallStatusChange += Codec_CallStatusChange;
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
base.RegisterActions(); base.RegisterActions();

View File

@@ -46,11 +46,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
); );
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
base.RegisterActions(); base.RegisterActions();

View File

@@ -40,11 +40,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
#region Overrides of MessengerBase #region Overrides of MessengerBase
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AddAction("/presets/fullStatus", (id, content) => { AddAction("/presets/fullStatus", (id, content) => {
this.LogInformation("getting full status for client {id}", id); this.LogInformation("getting full status for client {id}", id);

View File

@@ -47,11 +47,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
#region Overrides of MessengerBase #region Overrides of MessengerBase
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AddAction("/fullStatus", (id, content) => SendStatus()); AddAction("/fullStatus", (id, content) => SendStatus());

View File

@@ -10,11 +10,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
{ {
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
base.RegisterActions(); base.RegisterActions();

View File

@@ -20,11 +20,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
ScheduleSource.CodecSchedule.MeetingEventChange += new EventHandler<MeetingEventArgs>(CodecSchedule_MeetingEventChange); ScheduleSource.CodecSchedule.MeetingEventChange += new EventHandler<MeetingEventArgs>(CodecSchedule_MeetingEventChange);
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AddAction("/schedule/fullStatus", (id, content) => SendFullScheduleObject()); AddAction("/schedule/fullStatus", (id, content) => SendFullScheduleObject());
} }

View File

@@ -31,11 +31,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
SendRoutingFullMessageObject(); SendRoutingFullMessageObject();
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AddAction("/fullStatus", (id, content) => SendRoutingFullMessageObject()); AddAction("/fullStatus", (id, content) => SendRoutingFullMessageObject());

View File

@@ -21,11 +21,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
this.device = device; this.device = device;
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
base.RegisterActions(); base.RegisterActions();

View File

@@ -30,11 +30,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
PostStatusMessage(state); PostStatusMessage(state);
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
base.RegisterActions(); base.RegisterActions();

View File

@@ -13,11 +13,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <summary> /// <summary>
/// Provides a messaging bridge /// Provides a messaging bridge
/// </summary> /// </summary>
#if SERIES4
public abstract class MessengerBase : EssentialsDevice, IMobileControlMessenger public abstract class MessengerBase : EssentialsDevice, IMobileControlMessenger
#else
public abstract class MessengerBase: EssentialsDevice
#endif
{ {
protected IKeyName _device; protected IKeyName _device;
@@ -30,11 +26,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
#if SERIES4
public IMobileControl AppServerController { get; private set; } public IMobileControl AppServerController { get; private set; }
#else
public MobileControlSystemController AppServerController { get; private set; }
#endif
public string MessagePath { get; private set; } public string MessagePath { get; private set; }
@@ -76,11 +69,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// Registers this messenger with appserver controller /// Registers this messenger with appserver controller
/// </summary> /// </summary>
/// <param name="appServerController"></param> /// <param name="appServerController"></param>
#if SERIES4
public void RegisterWithAppServer(IMobileControl appServerController) public void RegisterWithAppServer(IMobileControl appServerController)
#else
public void RegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AppServerController = appServerController ?? throw new ArgumentNullException("appServerController"); AppServerController = appServerController ?? throw new ArgumentNullException("appServerController");
@@ -133,11 +122,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// Implemented in extending classes. Wire up API calls and feedback here /// Implemented in extending classes. Wire up API calls and feedback here
/// </summary> /// </summary>
/// <param name="appServerController"></param> /// <param name="appServerController"></param>
#if SERIES4
protected virtual void RegisterActions() protected virtual void RegisterActions()
#else
protected virtual void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
} }
@@ -174,7 +159,6 @@ namespace PepperDash.Essentials.AppServer.Messengers
} }
} }
#if SERIES4
protected void PostStatusMessage(string type, DeviceStateMessageBase deviceState, string clientId = null) protected void PostStatusMessage(string type, DeviceStateMessageBase deviceState, string clientId = null)
{ {
try try
@@ -195,7 +179,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
Debug.LogMessage(ex, "Exception posting status message", this); Debug.LogMessage(ex, "Exception posting status message", this);
} }
} }
#endif
protected void PostStatusMessage(JToken content, string type = "", string clientId = null) protected void PostStatusMessage(JToken content, string type = "", string clientId = null)
{ {
try try

View File

@@ -21,11 +21,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
#region Overrides of MessengerBase #region Overrides of MessengerBase
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AddAction("/saveScheduledEvents", (id, content) => SaveScheduledEvents(content.ToObject<List<ScheduledEventConfig>>())); AddAction("/saveScheduledEvents", (id, content) => SaveScheduledEvents(content.ToObject<List<ScheduledEventConfig>>()));
AddAction("/status", (id, content) => AddAction("/status", (id, content) =>

View File

@@ -57,11 +57,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// ///
/// </summary> /// </summary>
/// <param name="appServerController"></param> /// <param name="appServerController"></param>
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
//EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s })); //EISC.SetStringSigAction(SCurrentDialString, s => PostStatusMessage(new { currentDialString = s }));

View File

@@ -32,11 +32,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AddAction("/fullStatus", (id, content) => SendCameraFullMessageObject()); AddAction("/fullStatus", (id, content) => SendCameraFullMessageObject());
@@ -84,11 +80,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
cameraAction(state.Value.Equals("true", StringComparison.InvariantCultureIgnoreCase)); cameraAction(state.Value.Equals("true", StringComparison.InvariantCultureIgnoreCase));
} }
#if SERIES4 public void CustomUnregisterWithAppServer(IMobileControl appServerController)
public void CustomUnregsiterWithAppServer(IMobileControl appServerController)
#else
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
appServerController.RemoveAction(MessagePath + "/fullStatus"); appServerController.RemoveAction(MessagePath + "/fullStatus");

View File

@@ -26,11 +26,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
#region Overrides of MessengerBase #region Overrides of MessengerBase
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController controller)
#endif
{ {
Debug.Console(2, "********** Direct Route Messenger CustomRegisterWithAppServer **********"); Debug.Console(2, "********** Direct Route Messenger CustomRegisterWithAppServer **********");

View File

@@ -30,11 +30,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
_eisc.SetStringSigAction(_joinStart + StringJoin.CurrentSource, SendRoutingFullMessageObject); _eisc.SetStringSigAction(_joinStart + StringJoin.CurrentSource, SendRoutingFullMessageObject);
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AddAction("/fullStatus", AddAction("/fullStatus",
(id, content) => SendRoutingFullMessageObject(_eisc.GetString(_joinStart + StringJoin.CurrentSource))); (id, content) => SendRoutingFullMessageObject(_eisc.GetString(_joinStart + StringJoin.CurrentSource)));
@@ -47,11 +43,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
}); });
} }
#if SERIES4 public void CustomUnregisterWithAppServer(IMobileControl appServerController)
public void CustomUnregsiterWithAppServer(IMobileControl appServerController)
#else
public void CustomUnregsiterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
appServerController.RemoveAction(MessagePath + "/fullStatus"); appServerController.RemoveAction(MessagePath + "/fullStatus");
appServerController.RemoveAction(MessagePath + "/source"); appServerController.RemoveAction(MessagePath + "/source");

View File

@@ -43,11 +43,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// ///
/// </summary> /// </summary>
/// <param name="appServerController"></param> /// <param name="appServerController"></param>
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
_eisc.SetStringSigAction(JoinMap.HookState.JoinNumber, s => _eisc.SetStringSigAction(JoinMap.HookState.JoinNumber, s =>
{ {

View File

@@ -16,11 +16,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
device = shades; device = shades;
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
base.RegisterActions(); base.RegisterActions();

View File

@@ -83,11 +83,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
)); ));
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
AddAction("/fullStatus", (id, content) => SendFullStatusMessage()); AddAction("/fullStatus", (id, content) => SendFullStatusMessage());
} }

View File

@@ -1,8 +1,7 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces; using PepperDash.Essentials.Devices.Common.Displays;
using TwoWayDisplayBase = PepperDash.Essentials.Devices.Common.Displays.TwoWayDisplayBase;
namespace PepperDash.Essentials.AppServer.Messengers namespace PepperDash.Essentials.AppServer.Messengers
{ {
@@ -33,11 +32,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
PostStatusMessage(messageObj); PostStatusMessage(messageObj);
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
base.RegisterActions(); base.RegisterActions();

View File

@@ -152,11 +152,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// Called from base's RegisterWithAppServer method /// Called from base's RegisterWithAppServer method
/// </summary> /// </summary>
/// <param name="appServerController"></param> /// <param name="appServerController"></param>
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
try try
{ {

View File

@@ -4,12 +4,7 @@ using PepperDash.Essentials.Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials.AppServer.Messengers namespace PepperDash.Essentials.AppServer.Messengers
{ {
#if SERIES4
public class MobileControlMessage : IMobileControlMessage public class MobileControlMessage : IMobileControlMessage
#else
public class MobileControlMessage
#endif
{ {
[JsonProperty("type")] [JsonProperty("type")]
public string Type { get; set; } public string Type { get; set; }

View File

@@ -16,30 +16,14 @@ namespace PepperDash.Essentials
[JsonProperty("clientAppUrl")] [JsonProperty("clientAppUrl")]
public string ClientAppUrl { get; set; } public string ClientAppUrl { get; set; }
#if SERIES4
[JsonProperty("directServer")] [JsonProperty("directServer")]
public MobileControlDirectServerPropertiesConfig DirectServer { get; set; } public MobileControlDirectServerPropertiesConfig DirectServer { get; set; }
[JsonProperty("applicationConfig")] [JsonProperty("applicationConfig")]
public MobileControlApplicationConfig ApplicationConfig { get; set; } public MobileControlApplicationConfig ApplicationConfig { get; set; } = null;
[JsonProperty("enableApiServer")] [JsonProperty("enableApiServer")]
public bool EnableApiServer { get; set; } public bool EnableApiServer { get; set; } = true;
#endif
[JsonProperty("roomBridges")]
[Obsolete("No longer necessary")]
public List<MobileControlRoomBridgePropertiesConfig> RoomBridges { get; set; }
public MobileControlConfig()
{
RoomBridges = new List<MobileControlRoomBridgePropertiesConfig>();
#if SERIES4
EnableApiServer = true; // default to true
ApplicationConfig = null;
#endif
}
} }
public class MobileControlDirectServerPropertiesConfig public class MobileControlDirectServerPropertiesConfig

View File

@@ -28,6 +28,7 @@ using PepperDash.Essentials.Core.Shades;
using PepperDash.Essentials.Core.Web; using PepperDash.Essentials.Core.Web;
using PepperDash.Essentials.Devices.Common.AudioCodec; using PepperDash.Essentials.Devices.Common.AudioCodec;
using PepperDash.Essentials.Devices.Common.Cameras; using PepperDash.Essentials.Devices.Common.Cameras;
using PepperDash.Essentials.Devices.Common.Displays;
using PepperDash.Essentials.Devices.Common.SoftCodec; using PepperDash.Essentials.Devices.Common.SoftCodec;
using PepperDash.Essentials.Devices.Common.VideoCodec; using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Room.MobileControl; using PepperDash.Essentials.Room.MobileControl;
@@ -35,10 +36,6 @@ using PepperDash.Essentials.Services;
using PepperDash.Essentials.WebApiHandlers; using PepperDash.Essentials.WebApiHandlers;
using Serilog.Events; using Serilog.Events;
using WebSocketSharp; using WebSocketSharp;
using DisplayBase = PepperDash.Essentials.Devices.Common.Displays.DisplayBase;
using TwoWayDisplayBase = PepperDash.Essentials.Devices.Common.Displays.TwoWayDisplayBase;
#if SERIES4
#endif
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
@@ -59,16 +56,11 @@ namespace PepperDash.Essentials
private readonly List<MobileControlBridgeBase> _roomBridges = private readonly List<MobileControlBridgeBase> _roomBridges =
new List<MobileControlBridgeBase>(); new List<MobileControlBridgeBase>();
#if SERIES4
private readonly Dictionary<string, IMobileControlMessenger> _messengers = private readonly Dictionary<string, IMobileControlMessenger> _messengers =
new Dictionary<string, IMobileControlMessenger>(); new Dictionary<string, IMobileControlMessenger>();
private readonly Dictionary<string, IMobileControlMessenger> _defaultMessengers = private readonly Dictionary<string, IMobileControlMessenger> _defaultMessengers =
new Dictionary<string, IMobileControlMessenger>(); new Dictionary<string, IMobileControlMessenger>();
#else
private readonly Dictionary<string, MessengerBase> _deviceMessengers =
new Dictionary<string, MessengerBase>();
#endif
private readonly GenericQueue _transmitToServerQueue; private readonly GenericQueue _transmitToServerQueue;
@@ -81,11 +73,10 @@ namespace PepperDash.Essentials
public List<MobileControlBridgeBase> RoomBridges => _roomBridges; public List<MobileControlBridgeBase> RoomBridges => _roomBridges;
#if SERIES4
private readonly MobileControlWebsocketServer _directServer; private readonly MobileControlWebsocketServer _directServer;
public MobileControlWebsocketServer DirectServer => _directServer; public MobileControlWebsocketServer DirectServer => _directServer;
#endif
private readonly CCriticalSection _wsCriticalSection = new CCriticalSection(); private readonly CCriticalSection _wsCriticalSection = new CCriticalSection();
public string SystemUrl; //set only from SIMPL Bridge! public string SystemUrl; //set only from SIMPL Bridge!
@@ -191,7 +182,6 @@ namespace PepperDash.Essentials
25 25
); );
#if SERIES4
if (Config.DirectServer != null && Config.DirectServer.EnableDirectServer) if (Config.DirectServer != null && Config.DirectServer.EnableDirectServer)
{ {
_directServer = new MobileControlWebsocketServer( _directServer = new MobileControlWebsocketServer(
@@ -207,7 +197,6 @@ namespace PepperDash.Essentials
25 25
); );
} }
#endif
Host = config.ServerUrl; Host = config.ServerUrl;
if (!Host.StartsWith("http")) if (!Host.StartsWith("http"))
@@ -514,9 +503,8 @@ namespace PepperDash.Essentials
// messengerAdded = true; // messengerAdded = true;
//} //}
if (device is TwoWayDisplayBase) if (device is TwoWayDisplayBase twoWayDisplay)
{ {
var display = device as TwoWayDisplayBase;
Debug.Console( Debug.Console(
2, 2,
this, this,
@@ -526,7 +514,7 @@ namespace PepperDash.Essentials
var twoWayDisplayMessenger = new TwoWayDisplayBaseMessenger( var twoWayDisplayMessenger = new TwoWayDisplayBaseMessenger(
$"{device.Key}-twoWayDisplay-{Key}", $"{device.Key}-twoWayDisplay-{Key}",
string.Format("/device/{0}", device.Key), string.Format("/device/{0}", device.Key),
display twoWayDisplay
); );
AddDefaultDeviceMessenger(twoWayDisplayMessenger); AddDefaultDeviceMessenger(twoWayDisplayMessenger);
@@ -1281,11 +1269,7 @@ namespace PepperDash.Essentials
return _messengers.ContainsKey(key); return _messengers.ContainsKey(key);
} }
#if SERIES4
public void AddDeviceMessenger(IMobileControlMessenger messenger) public void AddDeviceMessenger(IMobileControlMessenger messenger)
#else
public void AddDeviceMessenger(MessengerBase messenger)
#endif
{ {
if (_messengers.ContainsKey(messenger.Key)) if (_messengers.ContainsKey(messenger.Key))
{ {
@@ -1815,10 +1799,9 @@ namespace PepperDash.Essentials
var conn = _wsClient2 == null ? "No client" : (_wsClient2.IsAlive ? "Yes" : "No"); var conn = _wsClient2 == null ? "No client" : (_wsClient2.IsAlive ? "Yes" : "No");
var secSinceLastAck = DateTime.Now - _lastAckMessage; var secSinceLastAck = DateTime.Now - _lastAckMessage;
#if SERIES4
if (Config.EnableApiServer) if (Config.EnableApiServer)
{ {
#endif
CrestronConsole.ConsoleCommandResponse( CrestronConsole.ConsoleCommandResponse(
@"Mobile Control Edge Server API Information: @"Mobile Control Edge Server API Information:
@@ -1837,7 +1820,6 @@ namespace PepperDash.Essentials
conn, conn,
secSinceLastAck.Seconds secSinceLastAck.Seconds
); );
#if SERIES4
} }
else else
{ {
@@ -1916,7 +1898,6 @@ Mobile Control Direct Server Infromation:
Not Enabled in Config." Not Enabled in Config."
); );
} }
#endif
} }
/// <summary> /// <summary>
@@ -1924,7 +1905,7 @@ Mobile Control Direct Server Infromation:
/// </summary> /// </summary>
public void RegisterSystemToServer() public void RegisterSystemToServer()
{ {
#if SERIES4
if (!Config.EnableApiServer) if (!Config.EnableApiServer)
{ {
Debug.Console( Debug.Console(
@@ -1934,7 +1915,7 @@ Mobile Control Direct Server Infromation:
); );
return; return;
} }
#endif
var result = CreateWebsocket(); var result = CreateWebsocket();
if (!result) if (!result)
@@ -2177,10 +2158,10 @@ Mobile Control Direct Server Infromation:
var essentialsVersion = Global.AssemblyVersion; var essentialsVersion = Global.AssemblyVersion;
confObject.Info.RuntimeInfo.AssemblyVersion = essentialsVersion; confObject.Info.RuntimeInfo.AssemblyVersion = essentialsVersion;
//#if DEBUG
// // Set for local testing // // Set for local testing
// confObject.RuntimeInfo.PluginVersion = "4.0.0-localBuild"; // confObject.RuntimeInfo.PluginVersion = "4.0.0-localBuild";
//#else
// Populate the plugin version // Populate the plugin version
var pluginVersion = Assembly var pluginVersion = Assembly
.GetExecutingAssembly() .GetExecutingAssembly()
@@ -2197,7 +2178,6 @@ Mobile Control Direct Server Infromation:
confObject.RuntimeInfo.PepperDashCoreVersion = PluginLoader.PepperDashCoreAssembly.Version; confObject.RuntimeInfo.PepperDashCoreVersion = PluginLoader.PepperDashCoreAssembly.Version;
confObject.RuntimeInfo.EssentialsPlugins = PluginLoader.EssentialsPluginAssemblies; confObject.RuntimeInfo.EssentialsPlugins = PluginLoader.EssentialsPluginAssemblies;
} }
//#endif
return confObject; return confObject;
} }
@@ -2218,12 +2198,12 @@ Mobile Control Direct Server Infromation:
/// <param name="o"></param> /// <param name="o"></param>
public void SendMessageObject(IMobileControlMessage o) public void SendMessageObject(IMobileControlMessage o)
{ {
#if SERIES4
if (Config.EnableApiServer) if (Config.EnableApiServer)
{ {
#endif
_transmitToServerQueue.Enqueue(new TransmitMessage(o, _wsClient2)); _transmitToServerQueue.Enqueue(new TransmitMessage(o, _wsClient2));
#if SERIES4
} }
if ( if (
@@ -2234,10 +2214,10 @@ Mobile Control Direct Server Infromation:
{ {
_transmitToClientsQueue.Enqueue(new MessageToClients(o, _directServer)); _transmitToClientsQueue.Enqueue(new MessageToClients(o, _directServer));
} }
#endif
} }
#if SERIES4
public void SendMessageObjectToDirectClient(object o) public void SendMessageObjectToDirectClient(object o)
{ {
if ( if (
@@ -2249,7 +2229,7 @@ Mobile Control Direct Server Infromation:
_transmitToClientsQueue.Enqueue(new MessageToClients(o, _directServer)); _transmitToClientsQueue.Enqueue(new MessageToClients(o, _directServer));
} }
} }
#endif
/// <summary> /// <summary>
/// Disconnects the Websocket Client and stops the heartbeat timer /// Disconnects the Websocket Client and stops the heartbeat timer

View File

@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectType>ProgramLibrary</ProjectType>
</PropertyGroup>
<PropertyGroup> <PropertyGroup>
<RootNamespace>PepperDash.Essentials</RootNamespace> <RootNamespace>PepperDash.Essentials</RootNamespace>
<TargetFramework>net472</TargetFramework> <TargetFramework>net472</TargetFramework>

View File

@@ -1,36 +1,27 @@
using System; using Newtonsoft.Json;
using System.Collections.Generic; using Newtonsoft.Json.Converters;
using System.Linq;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Core.Logging;
using PepperDash.Essentials.AppServer;
using PepperDash.Essentials.AppServer.Messengers; using PepperDash.Essentials.AppServer.Messengers;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Essentials.Room.MobileControl;
using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Devices.Common.AudioCodec;
using PepperDash.Essentials.Devices.Common.Cameras;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using PepperDash.Essentials.Devices.Common.Room;
using IShades = PepperDash.Essentials.Core.Shades.IShades;
using ShadeBase = PepperDash.Essentials.Devices.Common.Shades.ShadeBase;
using PepperDash.Essentials.Devices.Common.TouchPanel;
using Crestron.SimplSharp;
using Volume = PepperDash.Essentials.Room.MobileControl.Volume;
using PepperDash.Essentials.Core.CrestronIO; using PepperDash.Essentials.Core.CrestronIO;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Essentials.Core.Lighting; using PepperDash.Essentials.Core.Lighting;
using PepperDash.Essentials.Core.Shades; using PepperDash.Essentials.Core.Shades;
using PepperDash.Core.Logging; using PepperDash.Essentials.Devices.Common.AudioCodec;
using PepperDash.Essentials.Devices.Common.Cameras;
using PepperDash.Essentials.Devices.Common.Room;
using PepperDash.Essentials.Devices.Common.VideoCodec;
#if SERIES4 using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.AppServer; using System;
#endif using System.Collections.Generic;
using System.Linq;
using IShades = PepperDash.Essentials.Core.Shades.IShades;
using ShadeBase = PepperDash.Essentials.Devices.Common.Shades.ShadeBase;
using Volume = PepperDash.Essentials.Room.MobileControl.Volume;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
@@ -66,11 +57,8 @@ namespace PepperDash.Essentials
AddPreActivationAction(GetRoom); AddPreActivationAction(GetRoom);
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
// we add actions to the messaging system with a path, and a related action. Custom action // we add actions to the messaging system with a path, and a related action. Custom action
// content objects can be handled in the controller's LineReceived method - and perhaps other // content objects can be handled in the controller's LineReceived method - and perhaps other

View File

@@ -175,11 +175,8 @@ namespace PepperDash.Essentials.Room.MobileControl
ConfigIsLoaded = true; ConfigIsLoaded = true;
} }
#if SERIES4
protected override void RegisterActions() protected override void RegisterActions()
#else
protected override void CustomRegisterWithAppServer(MobileControlSystemController appServerController)
#endif
{ {
SetupFunctions(); SetupFunctions();
SetupFeedbacks(); SetupFeedbacks();

View File

@@ -71,7 +71,7 @@ namespace PepperDash.Essentials
} }
#if SERIES4
public class MessageToClients : IQueueMessage public class MessageToClients : IQueueMessage
{ {
private readonly MobileControlWebsocketServer _server; private readonly MobileControlWebsocketServer _server;
@@ -146,5 +146,4 @@ namespace PepperDash.Essentials
#endregion #endregion
} }
#endif
} }