Updates from testing System Monitor messaging with AppServer

This commit is contained in:
Neil Dorin
2018-12-14 16:56:17 -07:00
parent f6136a8c77
commit 821f2a6d60
7 changed files with 40 additions and 13 deletions

View File

@@ -68,11 +68,14 @@ namespace PepperDash.Essentials.AppServer.Messengers
/// <param name="contentObject">The contents of the content object</param>
protected void PostStatusMessage(object contentObject)
{
AppServerController.SendMessageToServer(JObject.FromObject(new
{
type = MessagePath,
content = contentObject
}));
if (AppServerController != null)
{
AppServerController.SendMessageToServer(JObject.FromObject(new
{
type = MessagePath,
content = contentObject
}));
}
}
}
}

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Monitoring;
namespace PepperDash.Essentials.AppServer.Messengers
@@ -45,6 +46,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
{
var programInfo = JsonConvert.DeserializeObject<ProgramInfo>(serializedProgramInfo);
Debug.Console(2, "Posting Status Message: {0}", programInfo.ToString());
PostStatusMessage(programInfo);
}
@@ -70,6 +73,8 @@ namespace PepperDash.Essentials.AppServer.Messengers
void SendSystemMonitorStatusMessage()
{
Debug.Console(2, "Posting System Monitor Status Message.");
// This takes a while, launch a new thread
CrestronInvoke.BeginInvoke((o) =>
{