mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-28 20:04:56 +00:00
Updates to add IncludeInFusionRoomHealth config property for UI devices to allow them to be excluded from the Fusion error rollup. Implement ICommunicationMonitor on EssentialsTouchpanelControler class. Updated Fusion class to better handle mapping digital online joins to ICommunicationMonitor classes.
This commit is contained in:
@@ -32,6 +32,9 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public override void InitializeSystem()
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
{
|
||||
foreach (var tl in TieLineCollection.Default)
|
||||
@@ -54,7 +57,7 @@ namespace PepperDash.Essentials
|
||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
GoWithLoad();
|
||||
//GoWithLoad();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1005,6 +1005,10 @@ namespace PepperDash.Essentials.Fusion
|
||||
/// </summary>
|
||||
void SetUpCommunitcationMonitors()
|
||||
{
|
||||
uint displayNum = 0;
|
||||
uint touchpanelNum = 0;
|
||||
uint xpanelNum = 0;
|
||||
|
||||
// Attach to all room's devices with monitors.
|
||||
//foreach (var dev in DeviceManager.Devices)
|
||||
foreach (var dev in DeviceManager.GetDevices())
|
||||
@@ -1012,41 +1016,56 @@ namespace PepperDash.Essentials.Fusion
|
||||
if (!(dev is ICommunicationMonitor))
|
||||
continue;
|
||||
|
||||
var keyNum = ExtractNumberFromKey(dev.Key);
|
||||
if (keyNum == -1)
|
||||
{
|
||||
Debug.Console(1, this, "WARNING: Cannot link device '{0}' to numbered Fusion monitoring attributes",
|
||||
dev.Key);
|
||||
continue;
|
||||
}
|
||||
string attrName = null;
|
||||
uint attrNum = Convert.ToUInt32(keyNum);
|
||||
string attrName = null;
|
||||
uint attrNum = 1;
|
||||
|
||||
if (dev is EssentialsTouchpanelController)
|
||||
//var keyNum = ExtractNumberFromKey(dev.Key);
|
||||
//if (keyNum == -1)
|
||||
//{
|
||||
// Debug.Console(1, this, "WARNING: Cannot link device '{0}' to numbered Fusion monitoring attributes",
|
||||
// dev.Key);
|
||||
// continue;
|
||||
//}
|
||||
//uint attrNum = Convert.ToUInt32(keyNum);
|
||||
|
||||
// Check for UI devices
|
||||
var uiDev = dev as EssentialsTouchpanelController;
|
||||
if (uiDev != null)
|
||||
{
|
||||
if ((dev as EssentialsTouchpanelController).Panel is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button)
|
||||
{
|
||||
if (attrNum > 10)
|
||||
continue;
|
||||
attrName = "Online - Touch Panel " + attrNum;
|
||||
attrNum += 150;
|
||||
}
|
||||
else if ((dev as EssentialsTouchpanelController).Panel is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
|
||||
if (uiDev.Panel is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
|
||||
{
|
||||
attrNum = attrNum + touchpanelNum;
|
||||
|
||||
if (attrNum > 10)
|
||||
continue;
|
||||
attrName = "Online - XPanel " + attrNum;
|
||||
attrNum += 160;
|
||||
|
||||
touchpanelNum++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
attrNum = attrNum + xpanelNum;
|
||||
|
||||
if (attrNum > 10)
|
||||
continue;
|
||||
attrName = "Online - Touch Panel " + attrNum;
|
||||
attrNum += 150;
|
||||
|
||||
xpanelNum++;
|
||||
}
|
||||
}
|
||||
|
||||
//else
|
||||
if (dev is DisplayBase)
|
||||
{
|
||||
attrNum = attrNum + displayNum;
|
||||
if (attrNum > 10)
|
||||
continue;
|
||||
attrName = "Online - Display " + attrNum;
|
||||
attrNum += 170;
|
||||
|
||||
displayNum++;
|
||||
}
|
||||
//else if (dev is DvdDeviceBase)
|
||||
//{
|
||||
@@ -1265,7 +1284,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
/// <returns>-1 if no number matched</returns>
|
||||
int ExtractNumberFromKey(string key)
|
||||
{
|
||||
var capture = System.Text.RegularExpressions.Regex.Match(key, @"\D+(\d+)");
|
||||
var capture = System.Text.RegularExpressions.Regex.Match(key, @"\b(\d+)");
|
||||
if (!capture.Success)
|
||||
return -1;
|
||||
else return Convert.ToInt32(capture.Groups[1].Value);
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
public bool ShowDate { get; set; }
|
||||
public bool ShowTime { get; set; }
|
||||
public UiSetupPropertiesConfig Setup { get; set; }
|
||||
public string HeaderStyle { get; set; }
|
||||
public string HeaderStyle { get; set; }
|
||||
public bool IncludeInFusionRoomHealth { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The count of sources that will trigger the "additional" arrows to show on the SRL.
|
||||
|
||||
@@ -13,9 +13,13 @@ using PepperDash.Essentials.Core.PageManagers;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsTouchpanelController : Device
|
||||
public class EssentialsTouchpanelController : Device, ICommunicationMonitor
|
||||
{
|
||||
public BasicTriListWithSmartObject Panel { get; private set; }
|
||||
public BasicTriListWithSmartObject Panel { get; private set; }
|
||||
|
||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||
|
||||
public bool IncludeInFusionRoomHealth { get; private set; }
|
||||
|
||||
public PanelDriverBase PanelDriver { get; private set; }
|
||||
|
||||
@@ -35,48 +39,97 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public EssentialsTouchpanelController(string key, string name, string type, CrestronTouchpanelPropertiesConfig props, uint id)
|
||||
: base(key, name)
|
||||
{
|
||||
{
|
||||
IncludeInFusionRoomHealth = props.IncludeInFusionRoomHealth;
|
||||
|
||||
Debug.Console(0, this, "Creating hardware...");
|
||||
type = type.ToLower();
|
||||
try
|
||||
{
|
||||
if (type == "crestronapp")
|
||||
{
|
||||
var app = new CrestronApp(id, Global.ControlSystem);
|
||||
app.ParameterProjectName.Value = props.ProjectName;
|
||||
Panel = app;
|
||||
}
|
||||
else if (type == "tsw550")
|
||||
Panel = new Tsw550(id, Global.ControlSystem);
|
||||
else if (type == "tsw552")
|
||||
Panel = new Tsw552(id, Global.ControlSystem);
|
||||
else if (type == "tsw560")
|
||||
Panel = new Tsw560(id, Global.ControlSystem);
|
||||
else if (type == "tsw750")
|
||||
Panel = new Tsw750(id, Global.ControlSystem);
|
||||
else if (type == "tsw752")
|
||||
Panel = new Tsw752(id, Global.ControlSystem);
|
||||
else if (type == "tsw760")
|
||||
Panel = new Tsw760(id, Global.ControlSystem);
|
||||
else if (type == "tsw1050")
|
||||
Panel = new Tsw1050(id, Global.ControlSystem);
|
||||
else if (type == "tsw1052")
|
||||
Panel = new Tsw1052(id, Global.ControlSystem);
|
||||
else if (type == "tsw1060")
|
||||
Panel = new Tsw1060(id, Global.ControlSystem);
|
||||
else if (type == "xpanel")
|
||||
Panel = new XpanelForSmartGraphics(id, Global.ControlSystem);
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "WARNING: Cannot create TSW controller with type '{0}'", type);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, this, "WARNING: Cannot create TSW base class. Panel will not function: {0}", e.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, Panel, 30000, 120000);
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
Debug.Console(0, this, "Creating hardware...");
|
||||
type = type.ToLower();
|
||||
try
|
||||
{
|
||||
if (type == "crestronapp")
|
||||
{
|
||||
var app = new CrestronApp(id, Global.ControlSystem);
|
||||
app.ParameterProjectName.Value = props.ProjectName;
|
||||
Panel = app;
|
||||
}
|
||||
else if (type == "tsw550")
|
||||
Panel = new Tsw550(id, Global.ControlSystem);
|
||||
else if (type == "tsw552")
|
||||
Panel = new Tsw552(id, Global.ControlSystem);
|
||||
else if (type == "tsw560")
|
||||
Panel = new Tsw560(id, Global.ControlSystem);
|
||||
else if (type == "tsw750")
|
||||
Panel = new Tsw750(id, Global.ControlSystem);
|
||||
else if (type == "tsw752")
|
||||
Panel = new Tsw752(id, Global.ControlSystem);
|
||||
else if (type == "tsw760")
|
||||
Panel = new Tsw760(id, Global.ControlSystem);
|
||||
else if (type == "tsw1050")
|
||||
Panel = new Tsw1050(id, Global.ControlSystem);
|
||||
else if (type == "tsw1052")
|
||||
Panel = new Tsw1052(id, Global.ControlSystem);
|
||||
else if (type == "tsw1060")
|
||||
Panel = new Tsw1060(id, Global.ControlSystem);
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "WARNING: Cannot create TSW controller with type '{0}'", type);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, this, "WARNING: Cannot create TSW base class. Panel will not function: {0}", e.Message);
|
||||
return;
|
||||
}
|
||||
//Debug.Console(0, this, "Creating hardware...");
|
||||
//type = type.ToLower();
|
||||
//try
|
||||
//{
|
||||
// if (type == "crestronapp")
|
||||
// {
|
||||
// var app = new CrestronApp(id, Global.ControlSystem);
|
||||
// app.ParameterProjectName.Value = props.ProjectName;
|
||||
// Panel = app;
|
||||
// }
|
||||
// else if (type == "tsw550")
|
||||
// Panel = new Tsw550(id, Global.ControlSystem);
|
||||
// else if (type == "tsw552")
|
||||
// Panel = new Tsw552(id, Global.ControlSystem);
|
||||
// else if (type == "tsw560")
|
||||
// Panel = new Tsw560(id, Global.ControlSystem);
|
||||
// else if (type == "tsw750")
|
||||
// Panel = new Tsw750(id, Global.ControlSystem);
|
||||
// else if (type == "tsw752")
|
||||
// Panel = new Tsw752(id, Global.ControlSystem);
|
||||
// else if (type == "tsw760")
|
||||
// Panel = new Tsw760(id, Global.ControlSystem);
|
||||
// else if (type == "tsw1050")
|
||||
// Panel = new Tsw1050(id, Global.ControlSystem);
|
||||
// else if (type == "tsw1052")
|
||||
// Panel = new Tsw1052(id, Global.ControlSystem);
|
||||
// else if (type == "tsw1060")
|
||||
// Panel = new Tsw1060(id, Global.ControlSystem);
|
||||
// else if (type == "xpanel")
|
||||
// Panel = new XpanelForSmartGraphics(id, Global.ControlSystem);
|
||||
// else
|
||||
// {
|
||||
// Debug.Console(0, this, "WARNING: Cannot create TSW controller with type '{0}'", type);
|
||||
// return;
|
||||
// }
|
||||
//}
|
||||
//catch (Exception e)
|
||||
//{
|
||||
// Debug.Console(0, this, "WARNING: Cannot create TSW base class. Panel will not function: {0}", e.Message);
|
||||
// return;
|
||||
//}
|
||||
|
||||
|
||||
// Reserved sigs
|
||||
if (Panel is TswFt5ButtonSystem)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user