mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-15 04:34:56 +00:00
Merge pull request #6 in PEC/essentials from feature/ecs-711 to development
* commit 'c20036cfe95f0940d378dfa6db402cd61a48b54e': 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>
|
/// </summary>
|
||||||
public override void InitializeSystem()
|
public override void InitializeSystem()
|
||||||
{
|
{
|
||||||
|
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
||||||
|
ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
CrestronConsole.AddNewConsoleCommand(s =>
|
CrestronConsole.AddNewConsoleCommand(s =>
|
||||||
{
|
{
|
||||||
foreach (var tl in TieLineCollection.Default)
|
foreach (var tl in TieLineCollection.Default)
|
||||||
@@ -54,7 +57,7 @@ namespace PepperDash.Essentials
|
|||||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||||
|
|
||||||
GoWithLoad();
|
//GoWithLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1005,6 +1005,10 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
void SetUpCommunitcationMonitors()
|
void SetUpCommunitcationMonitors()
|
||||||
{
|
{
|
||||||
|
uint displayNum = 0;
|
||||||
|
uint touchpanelNum = 0;
|
||||||
|
uint xpanelNum = 0;
|
||||||
|
|
||||||
// Attach to all room's devices with monitors.
|
// Attach to all room's devices with monitors.
|
||||||
//foreach (var dev in DeviceManager.Devices)
|
//foreach (var dev in DeviceManager.Devices)
|
||||||
foreach (var dev in DeviceManager.GetDevices())
|
foreach (var dev in DeviceManager.GetDevices())
|
||||||
@@ -1012,41 +1016,56 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
if (!(dev is ICommunicationMonitor))
|
if (!(dev is ICommunicationMonitor))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var keyNum = ExtractNumberFromKey(dev.Key);
|
string attrName = null;
|
||||||
if (keyNum == -1)
|
uint attrNum = 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);
|
|
||||||
|
|
||||||
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 (uiDev.Panel is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
|
||||||
{
|
|
||||||
if (attrNum > 10)
|
|
||||||
continue;
|
|
||||||
attrName = "Online - Touch Panel " + attrNum;
|
|
||||||
attrNum += 150;
|
|
||||||
}
|
|
||||||
else if ((dev as EssentialsTouchpanelController).Panel is Crestron.SimplSharpPro.UI.XpanelForSmartGraphics)
|
|
||||||
{
|
{
|
||||||
|
attrNum = attrNum + touchpanelNum;
|
||||||
|
|
||||||
if (attrNum > 10)
|
if (attrNum > 10)
|
||||||
continue;
|
continue;
|
||||||
attrName = "Online - XPanel " + attrNum;
|
attrName = "Online - XPanel " + attrNum;
|
||||||
attrNum += 160;
|
attrNum += 160;
|
||||||
|
|
||||||
|
touchpanelNum++;
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
attrNum = attrNum + xpanelNum;
|
||||||
|
|
||||||
|
if (attrNum > 10)
|
||||||
|
continue;
|
||||||
|
attrName = "Online - Touch Panel " + attrNum;
|
||||||
|
attrNum += 150;
|
||||||
|
|
||||||
|
xpanelNum++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//else
|
//else
|
||||||
if (dev is DisplayBase)
|
if (dev is DisplayBase)
|
||||||
{
|
{
|
||||||
|
attrNum = attrNum + displayNum;
|
||||||
if (attrNum > 10)
|
if (attrNum > 10)
|
||||||
continue;
|
continue;
|
||||||
attrName = "Online - Display " + attrNum;
|
attrName = "Online - Display " + attrNum;
|
||||||
attrNum += 170;
|
attrNum += 170;
|
||||||
|
|
||||||
|
displayNum++;
|
||||||
}
|
}
|
||||||
//else if (dev is DvdDeviceBase)
|
//else if (dev is DvdDeviceBase)
|
||||||
//{
|
//{
|
||||||
@@ -1265,7 +1284,7 @@ namespace PepperDash.Essentials.Fusion
|
|||||||
/// <returns>-1 if no number matched</returns>
|
/// <returns>-1 if no number matched</returns>
|
||||||
int ExtractNumberFromKey(string key)
|
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)
|
if (!capture.Success)
|
||||||
return -1;
|
return -1;
|
||||||
else return Convert.ToInt32(capture.Groups[1].Value);
|
else return Convert.ToInt32(capture.Groups[1].Value);
|
||||||
|
|||||||
@@ -12,7 +12,9 @@
|
|||||||
public bool ShowDate { get; set; }
|
public bool ShowDate { get; set; }
|
||||||
public bool ShowTime { get; set; }
|
public bool ShowTime { get; set; }
|
||||||
public UiSetupPropertiesConfig Setup { get; set; }
|
public UiSetupPropertiesConfig Setup { get; set; }
|
||||||
public string HeaderStyle { get; set; }
|
public string HeaderStyle { get; set; }
|
||||||
|
public bool IncludeInFusionRoomHealth { get; set; }
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The count of sources that will trigger the "additional" arrows to show on the SRL.
|
/// 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
|
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; }
|
public PanelDriverBase PanelDriver { get; private set; }
|
||||||
|
|
||||||
@@ -35,48 +39,97 @@ namespace PepperDash.Essentials
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public EssentialsTouchpanelController(string key, string name, string type, CrestronTouchpanelPropertiesConfig props, uint id)
|
public EssentialsTouchpanelController(string key, string name, string type, CrestronTouchpanelPropertiesConfig props, uint id)
|
||||||
: base(key, name)
|
: 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(() =>
|
AddPostActivationAction(() =>
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Creating hardware...");
|
//Debug.Console(0, this, "Creating hardware...");
|
||||||
type = type.ToLower();
|
//type = type.ToLower();
|
||||||
try
|
//try
|
||||||
{
|
//{
|
||||||
if (type == "crestronapp")
|
// if (type == "crestronapp")
|
||||||
{
|
// {
|
||||||
var app = new CrestronApp(id, Global.ControlSystem);
|
// var app = new CrestronApp(id, Global.ControlSystem);
|
||||||
app.ParameterProjectName.Value = props.ProjectName;
|
// app.ParameterProjectName.Value = props.ProjectName;
|
||||||
Panel = app;
|
// Panel = app;
|
||||||
}
|
// }
|
||||||
else if (type == "tsw550")
|
// else if (type == "tsw550")
|
||||||
Panel = new Tsw550(id, Global.ControlSystem);
|
// Panel = new Tsw550(id, Global.ControlSystem);
|
||||||
else if (type == "tsw552")
|
// else if (type == "tsw552")
|
||||||
Panel = new Tsw552(id, Global.ControlSystem);
|
// Panel = new Tsw552(id, Global.ControlSystem);
|
||||||
else if (type == "tsw560")
|
// else if (type == "tsw560")
|
||||||
Panel = new Tsw560(id, Global.ControlSystem);
|
// Panel = new Tsw560(id, Global.ControlSystem);
|
||||||
else if (type == "tsw750")
|
// else if (type == "tsw750")
|
||||||
Panel = new Tsw750(id, Global.ControlSystem);
|
// Panel = new Tsw750(id, Global.ControlSystem);
|
||||||
else if (type == "tsw752")
|
// else if (type == "tsw752")
|
||||||
Panel = new Tsw752(id, Global.ControlSystem);
|
// Panel = new Tsw752(id, Global.ControlSystem);
|
||||||
else if (type == "tsw760")
|
// else if (type == "tsw760")
|
||||||
Panel = new Tsw760(id, Global.ControlSystem);
|
// Panel = new Tsw760(id, Global.ControlSystem);
|
||||||
else if (type == "tsw1050")
|
// else if (type == "tsw1050")
|
||||||
Panel = new Tsw1050(id, Global.ControlSystem);
|
// Panel = new Tsw1050(id, Global.ControlSystem);
|
||||||
else if (type == "tsw1052")
|
// else if (type == "tsw1052")
|
||||||
Panel = new Tsw1052(id, Global.ControlSystem);
|
// Panel = new Tsw1052(id, Global.ControlSystem);
|
||||||
else if (type == "tsw1060")
|
// else if (type == "tsw1060")
|
||||||
Panel = new Tsw1060(id, Global.ControlSystem);
|
// Panel = new Tsw1060(id, Global.ControlSystem);
|
||||||
else
|
// else if (type == "xpanel")
|
||||||
{
|
// Panel = new XpanelForSmartGraphics(id, Global.ControlSystem);
|
||||||
Debug.Console(0, this, "WARNING: Cannot create TSW controller with type '{0}'", type);
|
// else
|
||||||
return;
|
// {
|
||||||
}
|
// 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);
|
//catch (Exception e)
|
||||||
return;
|
//{
|
||||||
}
|
// Debug.Console(0, this, "WARNING: Cannot create TSW base class. Panel will not function: {0}", e.Message);
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
// Reserved sigs
|
// Reserved sigs
|
||||||
if (Panel is TswFt5ButtonSystem)
|
if (Panel is TswFt5ButtonSystem)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user