diff --git a/PepperDashEssentials.3Series.sln b/PepperDashEssentials.3Series.sln
index 337d06ea..b52c4c1a 100644
--- a/PepperDashEssentials.3Series.sln
+++ b/PepperDashEssentials.3Series.sln
@@ -1,21 +1,21 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", "PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDashEssentials", "src\PepperDashEssentials\PepperDashEssentials.csproj", "{1BED5BA9-88C4-4365-9362-6F4B128071D3}"
ProjectSection(ProjectDependencies) = postProject
{892B761C-E479-44CE-BD74-243E9214AF13} = {892B761C-E479-44CE-BD74-243E9214AF13}
{9199CE8A-0C9F-4952-8672-3EED798B284F} = {9199CE8A-0C9F-4952-8672-3EED798B284F}
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", "essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_Core", "src\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj", "{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", "essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Essentials Devices Common", "src\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj", "{892B761C-E479-44CE-BD74-243E9214AF13}"
ProjectSection(ProjectDependencies) = postProject
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
EndProjectSection
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_DM", "essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PepperDash_Essentials_DM", "src\essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj", "{9199CE8A-0C9F-4952-8672-3EED798B284F}"
ProjectSection(ProjectDependencies) = postProject
{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5} = {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
EndProjectSection
diff --git a/PepperDashEssentials/Audio/EssentialsVolumeLevelConfig.cs b/src/PepperDashEssentials/Audio/EssentialsVolumeLevelConfig.cs
similarity index 100%
rename from PepperDashEssentials/Audio/EssentialsVolumeLevelConfig.cs
rename to src/PepperDashEssentials/Audio/EssentialsVolumeLevelConfig.cs
diff --git a/PepperDashEssentials/Bridges/._EssentialsLightsBridge.cs b/src/PepperDashEssentials/Bridges/._EssentialsLightsBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/._EssentialsLightsBridge.cs
rename to src/PepperDashEssentials/Bridges/._EssentialsLightsBridge.cs
diff --git a/PepperDashEssentials/Bridges/AirMediaControllerBridge.cs b/src/PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/AirMediaControllerBridge.cs
diff --git a/PepperDashEssentials/Bridges/AppleTvBridge.cs b/src/PepperDashEssentials/Bridges/AppleTvBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/AppleTvBridge.cs
rename to src/PepperDashEssentials/Bridges/AppleTvBridge.cs
diff --git a/PepperDashEssentials/Bridges/BridgeFactory.cs b/src/PepperDashEssentials/Bridges/BridgeFactory.cs
similarity index 97%
rename from PepperDashEssentials/Bridges/BridgeFactory.cs
rename to src/PepperDashEssentials/Bridges/BridgeFactory.cs
index c17d4642..f6649eec 100644
--- a/PepperDashEssentials/Bridges/BridgeFactory.cs
+++ b/src/PepperDashEssentials/Bridges/BridgeFactory.cs
@@ -1,129 +1,129 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Bridges;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Routing;
-using PepperDash.Essentials.Bridges;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.EthernetCommunication;
-
-namespace PepperDash.Essentials
-{
- ///
- /// Responsible for loading all of the device types for this library
- ///
- public class BridgeFactory
- {
- public BridgeFactory()
- {
- var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
- eiscApiAdvancedFactory.LoadTypeFactories();
-
- var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
- eiscApiFactory.LoadTypeFactories();
- }
-
- }
-
- public class CommBridge : Device
- {
- public CommBridgeProperties Properties { get; private set; }
-
- public List CommDevices { get; private set; }
-
- public CommBridge(string key, string name, JToken properties)
- : base(key, name)
- {
- Properties = JsonConvert.DeserializeObject(properties.ToString());
- }
-
- public override bool CustomActivate()
- {
- // Create EiscApis
- if (Properties.Eiscs != null)
- {
- foreach (var eisc in Properties.Eiscs)
- {
- var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
- }
- }
-
- foreach (var deviceKey in Properties.CommDevices)
- {
- var device = DeviceManager.GetDeviceForKey(deviceKey);
-
- if (device != null)
- {
- Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
- CommDevices.Add(device as IBasicCommunication);
- }
- else
- {
- Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
- }
- }
-
- // Iterate through all the CommDevices and link up their Actions and Feedbacks
-
- Debug.Console(0, "Bridge {0} Activated", this.Name);
-
- return true;
- }
- }
-
-
- public class EiscBridgeProperties
- {
- public string ParentDeviceKey { get; set; }
- public eApiType ApiType { get; set; }
- public List Eiscs { get; set; }
- public string ApiOverrideFilePath { get; set; }
-
- public class EiscProperties
- {
- public string IpId { get; set; }
- public string Hostname { get; set; }
- }
- }
-
- public class CommBridgeProperties : EiscBridgeProperties
- {
- public List CommDevices { get; set; }
- }
-
- public enum eApiType { Eisc = 0 }
-
- public class BridgeApiEisc
- {
- public uint Ipid { get; private set; }
- public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
-
- public BridgeApiEisc(string ipid, string hostname)
- {
- Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
- Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
- Eisc.Register();
- Eisc.SigChange += Eisc_SigChange;
- Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
- }
- void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
- {
- if (Debug.Level >= 1)
- Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
- var uo = args.Sig.UserObject;
- if (uo is Action)
- (uo as Action)(args.Sig.BoolValue);
- else if (uo is Action)
- (uo as Action)(args.Sig.UShortValue);
- else if (uo is Action)
- (uo as Action)(args.Sig.StringValue);
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Routing;
+using PepperDash.Essentials.Bridges;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.EthernetCommunication;
+
+namespace PepperDash.Essentials
+{
+ ///
+ /// Responsible for loading all of the device types for this library
+ ///
+ public class BridgeFactory
+ {
+ public BridgeFactory()
+ {
+ var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
+ eiscApiAdvancedFactory.LoadTypeFactories();
+
+ var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
+ eiscApiFactory.LoadTypeFactories();
+ }
+
+ }
+
+ public class CommBridge : Device
+ {
+ public CommBridgeProperties Properties { get; private set; }
+
+ public List CommDevices { get; private set; }
+
+ public CommBridge(string key, string name, JToken properties)
+ : base(key, name)
+ {
+ Properties = JsonConvert.DeserializeObject(properties.ToString());
+ }
+
+ public override bool CustomActivate()
+ {
+ // Create EiscApis
+ if (Properties.Eiscs != null)
+ {
+ foreach (var eisc in Properties.Eiscs)
+ {
+ var ApiEisc = new BridgeApiEisc(eisc.IpId, eisc.Hostname);
+ }
+ }
+
+ foreach (var deviceKey in Properties.CommDevices)
+ {
+ var device = DeviceManager.GetDeviceForKey(deviceKey);
+
+ if (device != null)
+ {
+ Debug.Console(0, "deviceKey {0} Found in Device Manager", device.Key);
+ CommDevices.Add(device as IBasicCommunication);
+ }
+ else
+ {
+ Debug.Console(0, "deviceKey {0} Not Found in Device Manager", deviceKey);
+ }
+ }
+
+ // Iterate through all the CommDevices and link up their Actions and Feedbacks
+
+ Debug.Console(0, "Bridge {0} Activated", this.Name);
+
+ return true;
+ }
+ }
+
+
+ public class EiscBridgeProperties
+ {
+ public string ParentDeviceKey { get; set; }
+ public eApiType ApiType { get; set; }
+ public List Eiscs { get; set; }
+ public string ApiOverrideFilePath { get; set; }
+
+ public class EiscProperties
+ {
+ public string IpId { get; set; }
+ public string Hostname { get; set; }
+ }
+ }
+
+ public class CommBridgeProperties : EiscBridgeProperties
+ {
+ public List CommDevices { get; set; }
+ }
+
+ public enum eApiType { Eisc = 0 }
+
+ public class BridgeApiEisc
+ {
+ public uint Ipid { get; private set; }
+ public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
+
+ public BridgeApiEisc(string ipid, string hostname)
+ {
+ Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
+ Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, hostname, Global.ControlSystem);
+ Eisc.Register();
+ Eisc.SigChange += Eisc_SigChange;
+ Debug.Console(0, "BridgeApiEisc Created at Ipid {0}", ipid);
+ }
+ void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
+ {
+ if (Debug.Level >= 1)
+ Debug.Console(1, "BridgeApiEisc change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
+ var uo = args.Sig.UserObject;
+ if (uo is Action)
+ (uo as Action)(args.Sig.BoolValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.UShortValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.StringValue);
+ }
+ }
+}
diff --git a/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs b/src/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs
similarity index 96%
rename from PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs
rename to src/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs
index 18dd0c71..d99c25ef 100644
--- a/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs
+++ b/src/PepperDashEssentials/Bridges/Bridges.BridgeFactory.cs
@@ -1,90 +1,90 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Routing;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.EthernetCommunication;
-using PepperDash.Essentials.Bridges;
-
-namespace PepperDash.Essentials {
- public class BridgeFactory {
- public static IKeyed GetDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc) {
- // ? why is this static JTA 2018-06-13?
-
- var key = dc.Key;
- var name = dc.Name;
- var type = dc.Type;
- var properties = dc.Properties;
- var propAnon = new { };
- JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon);
-
- var typeName = dc.Type.ToLower();
- var groupName = dc.Group.ToLower();
-
- Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
- if (typeName == "essentialdm")
- {
- return new EssentialDM(key, name, properties);
- }
- else if (typeName == "essentialcomm")
- {
- Debug.Console(2, "Launch Essential Comm");
- return new EssentialComm(key, name, properties);
- }
- else if (typeName == "essentialdsp")
- {
- Debug.Console(2, "Launch EssentialDsp");
- return new EssentialDsp(key, name, properties);
- }
- else if (typeName == "essentialstvone")
- {
- Debug.Console(2, "Launch essentialstvone");
- return new EssentialsTVOne(key, name, properties);
- }
- else if (typeName == "essentialslighting")
- {
- Debug.Console(2, "Launch essentialslighting");
- return new EssentialsLightsBridge(key, name, properties);
- }
- else if (typeName == "eiscapi")
- {
- return new EiscApi(dc);
- }
- return null;
- }
- }
- public class BridgeApiEisc {
- public uint Ipid;
- public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc;
- public BridgeApiEisc(string ipid) {
- Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
- Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, "127.0.0.2", Global.ControlSystem);
- Eisc.Register();
- Eisc.SigChange += Eisc_SigChange;
- Debug.Console(2, "BridgeApiEisc Created at Ipid {0}", ipid);
- }
- void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args) {
- if (Debug.Level >= 1)
- Debug.Console(2, "DDVC EISC change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
- var uo = args.Sig.UserObject;
- if (uo is Action)
- (uo as Action)(args.Sig.BoolValue);
- else if (uo is Action)
- (uo as Action)(args.Sig.UShortValue);
- else if (uo is Action)
- (uo as Action)(args.Sig.StringValue);
- }
- }
-
- }
-
-
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Routing;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.EthernetCommunication;
+using PepperDash.Essentials.Bridges;
+
+namespace PepperDash.Essentials {
+ public class BridgeFactory {
+ public static IKeyed GetDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc) {
+ // ? why is this static JTA 2018-06-13?
+
+ var key = dc.Key;
+ var name = dc.Name;
+ var type = dc.Type;
+ var properties = dc.Properties;
+ var propAnon = new { };
+ JsonConvert.DeserializeAnonymousType(dc.Properties.ToString(), propAnon);
+
+ var typeName = dc.Type.ToLower();
+ var groupName = dc.Group.ToLower();
+
+ Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
+ if (typeName == "essentialdm")
+ {
+ return new EssentialDM(key, name, properties);
+ }
+ else if (typeName == "essentialcomm")
+ {
+ Debug.Console(2, "Launch Essential Comm");
+ return new EssentialComm(key, name, properties);
+ }
+ else if (typeName == "essentialdsp")
+ {
+ Debug.Console(2, "Launch EssentialDsp");
+ return new EssentialDsp(key, name, properties);
+ }
+ else if (typeName == "essentialstvone")
+ {
+ Debug.Console(2, "Launch essentialstvone");
+ return new EssentialsTVOne(key, name, properties);
+ }
+ else if (typeName == "essentialslighting")
+ {
+ Debug.Console(2, "Launch essentialslighting");
+ return new EssentialsLightsBridge(key, name, properties);
+ }
+ else if (typeName == "eiscapi")
+ {
+ return new EiscApi(dc);
+ }
+ return null;
+ }
+ }
+ public class BridgeApiEisc {
+ public uint Ipid;
+ public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc;
+ public BridgeApiEisc(string ipid) {
+ Ipid = (UInt32)int.Parse(ipid, System.Globalization.NumberStyles.HexNumber);
+ Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(Ipid, "127.0.0.2", Global.ControlSystem);
+ Eisc.Register();
+ Eisc.SigChange += Eisc_SigChange;
+ Debug.Console(2, "BridgeApiEisc Created at Ipid {0}", ipid);
+ }
+ void Eisc_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args) {
+ if (Debug.Level >= 1)
+ Debug.Console(2, "DDVC EISC change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
+ var uo = args.Sig.UserObject;
+ if (uo is Action)
+ (uo as Action)(args.Sig.BoolValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.UShortValue);
+ else if (uo is Action)
+ (uo as Action)(args.Sig.StringValue);
+ }
+ }
+
+ }
+
+
+
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs b/src/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
similarity index 97%
rename from PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
index 931ee231..ea67b6ba 100644
--- a/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
+++ b/src/PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
@@ -1,38 +1,38 @@
-using Crestron.SimplSharpPro.DeviceSupport;
-using Newtonsoft.Json;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.CrestronIO;
-
-namespace PepperDash.Essentials.Core.Bridges
-{
- public static class C2nRthsControllerApiExtensions
- {
- public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
- string joinMapKey)
- {
- var joinMap = new C2nRthsControllerJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
-
-
- triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
-
- device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
- device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
- device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Humidity]);
-
- triList.StringInput[joinMap.Name].StringValue = device.Name;
-
-
- }
-
- }
+using Crestron.SimplSharpPro.DeviceSupport;
+using Newtonsoft.Json;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.CrestronIO;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public static class C2nRthsControllerApiExtensions
+ {
+ public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
+ string joinMapKey)
+ {
+ var joinMap = new C2nRthsControllerJoinMap();
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ joinMap.OffsetJoinNumbers(joinStart);
+
+ Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
+
+
+ triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
+
+ device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
+ device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
+ device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Humidity]);
+
+ triList.StringInput[joinMap.Name].StringValue = device.Name;
+
+
+ }
+
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/CameraControllerBridge.cs b/src/PepperDashEssentials/Bridges/CameraControllerBridge.cs
similarity index 97%
rename from PepperDashEssentials/Bridges/CameraControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/CameraControllerBridge.cs
index 6a3771d3..b97618c6 100644
--- a/PepperDashEssentials/Bridges/CameraControllerBridge.cs
+++ b/src/PepperDashEssentials/Bridges/CameraControllerBridge.cs
@@ -1,169 +1,169 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Devices.Common;
-using PepperDash.Essentials.Devices.Common.Cameras;
-
-using Newtonsoft.Json;
-
-namespace PepperDash.Essentials.Core.Bridges
-{
- public static class CameraControllerApiExtensions
- {
- public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge)
- {
- CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart);
-
- // Adds the join map to the bridge
- bridge.AddJoinMap(cameraDevice.Key, joinMap);
-
- var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
-
- if (customJoins != null)
- {
- joinMap.SetCustomJoinData(customJoins);
- }
-
- Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
- Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
-
- var commMonitor = cameraDevice as ICommunicationMonitor;
- commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
-
- var ptzCamera = cameraDevice as IHasCameraPtzControl;
-
- if (ptzCamera != null)
- {
- trilist.SetBoolSigAction(joinMap.PanLeft.JoinNumber, (b) =>
- {
- if (b)
- {
- ptzCamera.PanLeft();
- }
- else
- {
- ptzCamera.PanStop();
- }
- });
- trilist.SetBoolSigAction(joinMap.PanRight.JoinNumber, (b) =>
- {
- if (b)
- {
- ptzCamera.PanRight();
- }
- else
- {
- ptzCamera.PanStop();
- }
- });
-
- trilist.SetBoolSigAction(joinMap.TiltUp.JoinNumber, (b) =>
- {
- if (b)
- {
- ptzCamera.TiltUp();
- }
- else
- {
- ptzCamera.TiltStop();
- }
- });
- trilist.SetBoolSigAction(joinMap.TiltDown.JoinNumber, (b) =>
- {
- if (b)
- {
- ptzCamera.TiltDown();
- }
- else
- {
- ptzCamera.TiltStop();
- }
- });
-
- trilist.SetBoolSigAction(joinMap.ZoomIn.JoinNumber, (b) =>
- {
- if (b)
- {
- ptzCamera.ZoomIn();
- }
- else
- {
- ptzCamera.ZoomStop();
- }
- });
-
- trilist.SetBoolSigAction(joinMap.ZoomOut.JoinNumber, (b) =>
- {
- if (b)
- {
- ptzCamera.ZoomOut();
- }
- else
- {
- ptzCamera.ZoomStop();
- }
- });
- }
-
- if (cameraDevice is IPower)
- {
- var powerCamera = cameraDevice as IPower;
- trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
- trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
-
- powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
- powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
- }
-
- if (cameraDevice is ICommunicationMonitor)
- {
- var monitoredCamera = cameraDevice as ICommunicationMonitor;
- monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
- }
-
- if (cameraDevice is IHasCameraPresets)
- {
- // Set the preset lables when they change
- var presetsCamera = cameraDevice as IHasCameraPresets;
- presetsCamera.PresetsListHasChanged += new EventHandler((o, a) =>
- {
- for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
- {
- int tempNum = i - 1;
-
- string label = "" ;
-
- var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
-
- if (preset != null)
- label = preset.Description;
-
- trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
- }
- });
-
- for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
- {
- int tempNum = i;
-
- trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallStart.JoinNumber + tempNum), () =>
- {
- presetsCamera.PresetSelect(tempNum);
- });
- trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveStart.JoinNumber + tempNum), () =>
- {
- var label = trilist.GetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum));
-
- presetsCamera.PresetStore(tempNum, label);
- });
- }
- }
- }
- }
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Devices.Common;
+using PepperDash.Essentials.Devices.Common.Cameras;
+
+using Newtonsoft.Json;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public static class CameraControllerApiExtensions
+ {
+ public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApi bridge)
+ {
+ CameraControllerJoinMap joinMap = new CameraControllerJoinMap(joinStart);
+
+ // Adds the join map to the bridge
+ bridge.AddJoinMap(cameraDevice.Key, joinMap);
+
+ var customJoins = JoinMapHelper.TryGetJoinMapAdvancedForDevice(joinMapKey);
+
+ if (customJoins != null)
+ {
+ joinMap.SetCustomJoinData(customJoins);
+ }
+
+ Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+ Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString());
+
+ var commMonitor = cameraDevice as ICommunicationMonitor;
+ commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+
+ var ptzCamera = cameraDevice as IHasCameraPtzControl;
+
+ if (ptzCamera != null)
+ {
+ trilist.SetBoolSigAction(joinMap.PanLeft.JoinNumber, (b) =>
+ {
+ if (b)
+ {
+ ptzCamera.PanLeft();
+ }
+ else
+ {
+ ptzCamera.PanStop();
+ }
+ });
+ trilist.SetBoolSigAction(joinMap.PanRight.JoinNumber, (b) =>
+ {
+ if (b)
+ {
+ ptzCamera.PanRight();
+ }
+ else
+ {
+ ptzCamera.PanStop();
+ }
+ });
+
+ trilist.SetBoolSigAction(joinMap.TiltUp.JoinNumber, (b) =>
+ {
+ if (b)
+ {
+ ptzCamera.TiltUp();
+ }
+ else
+ {
+ ptzCamera.TiltStop();
+ }
+ });
+ trilist.SetBoolSigAction(joinMap.TiltDown.JoinNumber, (b) =>
+ {
+ if (b)
+ {
+ ptzCamera.TiltDown();
+ }
+ else
+ {
+ ptzCamera.TiltStop();
+ }
+ });
+
+ trilist.SetBoolSigAction(joinMap.ZoomIn.JoinNumber, (b) =>
+ {
+ if (b)
+ {
+ ptzCamera.ZoomIn();
+ }
+ else
+ {
+ ptzCamera.ZoomStop();
+ }
+ });
+
+ trilist.SetBoolSigAction(joinMap.ZoomOut.JoinNumber, (b) =>
+ {
+ if (b)
+ {
+ ptzCamera.ZoomOut();
+ }
+ else
+ {
+ ptzCamera.ZoomStop();
+ }
+ });
+ }
+
+ if (cameraDevice is IPower)
+ {
+ var powerCamera = cameraDevice as IPower;
+ trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () => powerCamera.PowerOn());
+ trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () => powerCamera.PowerOff());
+
+ powerCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
+ powerCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
+ }
+
+ if (cameraDevice is ICommunicationMonitor)
+ {
+ var monitoredCamera = cameraDevice as ICommunicationMonitor;
+ monitoredCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ }
+
+ if (cameraDevice is IHasCameraPresets)
+ {
+ // Set the preset lables when they change
+ var presetsCamera = cameraDevice as IHasCameraPresets;
+ presetsCamera.PresetsListHasChanged += new EventHandler((o, a) =>
+ {
+ for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
+ {
+ int tempNum = i - 1;
+
+ string label = "" ;
+
+ var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
+
+ if (preset != null)
+ label = preset.Description;
+
+ trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
+ }
+ });
+
+ for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
+ {
+ int tempNum = i;
+
+ trilist.SetSigTrueAction((ushort)(joinMap.PresetRecallStart.JoinNumber + tempNum), () =>
+ {
+ presetsCamera.PresetSelect(tempNum);
+ });
+ trilist.SetSigTrueAction((ushort)(joinMap.PresetSaveStart.JoinNumber + tempNum), () =>
+ {
+ var label = trilist.GetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum));
+
+ presetsCamera.PresetStore(tempNum, label);
+ });
+ }
+ }
+ }
+ }
+
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs b/src/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/DmChassisControllerBridge.cs
diff --git a/PepperDashEssentials/Bridges/DmRmcControllerBridge.cs b/src/PepperDashEssentials/Bridges/DmRmcControllerBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/DmRmcControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/DmRmcControllerBridge.cs
diff --git a/PepperDashEssentials/Bridges/DmTxControllerBridge.cs b/src/PepperDashEssentials/Bridges/DmTxControllerBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/DmTxControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/DmTxControllerBridge.cs
diff --git a/PepperDashEssentials/Bridges/DmpsAudioOutputControllerBridge.cs b/src/PepperDashEssentials/Bridges/DmpsAudioOutputControllerBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/DmpsAudioOutputControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/DmpsAudioOutputControllerBridge.cs
diff --git a/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs b/src/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/DmpsRoutingControllerBridge.cs
diff --git a/PepperDashEssentials/Bridges/DspControllerBridge.cs b/src/PepperDashEssentials/Bridges/DspControllerBridge.cs
similarity index 97%
rename from PepperDashEssentials/Bridges/DspControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/DspControllerBridge.cs
index 9dd018fb..f31828e8 100644
--- a/PepperDashEssentials/Bridges/DspControllerBridge.cs
+++ b/src/PepperDashEssentials/Bridges/DspControllerBridge.cs
@@ -1,120 +1,120 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Devices.Common;
-
-namespace PepperDash.Essentials.Bridges
-{
- public static class SamsungDisplayControllerApiExtensions
- {
- public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
- {
- var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
-
- if (joinMap == null)
- {
- joinMap = new DisplayControllerJoinMap();
- }
-
- joinMap.OffsetJoinNumbers(joinStart);
- Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
- Debug.Console(0, "Linking to lighting Type {0}", displayDevice.GetType().Name.ToString());
-
- var commMonitor = displayDevice as ICommunicationMonitor;
- commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
-
-
- // Poewer Off
- trilist.SetSigTrueAction(joinMap.PowerOff, () => displayDevice.PowerOff());
- displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
-
- // Poewer On
- trilist.SetSigTrueAction(joinMap.PowerOn, () => displayDevice.PowerOn());
- displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
-
- // GenericLighitng Actions & FeedBack
-
- // int sceneIndex = 1;
- /*
- foreach (var scene in displayDevice.LightingScenes)
- {
- var tempIndex = sceneIndex - 1;
- //trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => displayDevice.SelectScene(displayDevice.LightingScenes[tempIndex]));
- scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
- trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
- trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
- sceneIndex++;
- }
-
- if (displayDevice.GetType().Name.ToString() == "LutronQuantumArea")
- {
- var lutronDevice = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
- lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
- }
- */
- //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
-
-
- /*
- var lutronLights = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
-
-
- for (uint i = 1; i <= lightingBase.CircuitCount; i++)
- {
- var circuit = i;
- lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
- lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
- lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
- trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
- trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
- trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
-
- }
- */
- }
- }
- public class DisplayControllerJoinMap : JoinMapBase
- {
- public uint IsOnline { get; set; }
- public uint PowerOff { get; set; }
- public uint PowerOn { get; set; }
- public uint SelectScene { get; set; }
- public uint LightingSceneOffset { get; set; }
- public uint ButtonVisibilityOffset { get; set; }
- public uint IntegrationIdSet { get; set; }
-
- public DisplayControllerJoinMap()
- {
- // Digital
- IsOnline = 1;
- PowerOff = 1;
- PowerOn = 2;
- SelectScene = 1;
- IntegrationIdSet = 1;
- LightingSceneOffset = 10;
- ButtonVisibilityOffset = 40;
- // Analog
- }
-
- public override void OffsetJoinNumbers(uint joinStart)
- {
- var joinOffset = joinStart - 1;
-
- IsOnline = IsOnline + joinOffset;
- PowerOff = PowerOff + joinOffset;
- PowerOn = PowerOn + joinOffset;
- SelectScene = SelectScene + joinOffset;
- LightingSceneOffset = LightingSceneOffset + joinOffset;
- ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
-
-
-
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Devices.Common;
+
+namespace PepperDash.Essentials.Bridges
+{
+ public static class SamsungDisplayControllerApiExtensions
+ {
+ public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
+ {
+ var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
+
+ if (joinMap == null)
+ {
+ joinMap = new DisplayControllerJoinMap();
+ }
+
+ joinMap.OffsetJoinNumbers(joinStart);
+ Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+ Debug.Console(0, "Linking to lighting Type {0}", displayDevice.GetType().Name.ToString());
+
+ var commMonitor = displayDevice as ICommunicationMonitor;
+ commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
+
+
+ // Poewer Off
+ trilist.SetSigTrueAction(joinMap.PowerOff, () => displayDevice.PowerOff());
+ displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
+
+ // Poewer On
+ trilist.SetSigTrueAction(joinMap.PowerOn, () => displayDevice.PowerOn());
+ displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
+
+ // GenericLighitng Actions & FeedBack
+
+ // int sceneIndex = 1;
+ /*
+ foreach (var scene in displayDevice.LightingScenes)
+ {
+ var tempIndex = sceneIndex - 1;
+ //trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => displayDevice.SelectScene(displayDevice.LightingScenes[tempIndex]));
+ scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
+ trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
+ trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
+ sceneIndex++;
+ }
+
+ if (displayDevice.GetType().Name.ToString() == "LutronQuantumArea")
+ {
+ var lutronDevice = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
+ lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
+ trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
+ }
+ */
+ //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
+
+
+ /*
+ var lutronLights = displayDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
+
+
+ for (uint i = 1; i <= lightingBase.CircuitCount; i++)
+ {
+ var circuit = i;
+ lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
+ lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
+ lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
+ trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
+ trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
+ trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
+
+ }
+ */
+ }
+ }
+ public class DisplayControllerJoinMap : JoinMapBase
+ {
+ public uint IsOnline { get; set; }
+ public uint PowerOff { get; set; }
+ public uint PowerOn { get; set; }
+ public uint SelectScene { get; set; }
+ public uint LightingSceneOffset { get; set; }
+ public uint ButtonVisibilityOffset { get; set; }
+ public uint IntegrationIdSet { get; set; }
+
+ public DisplayControllerJoinMap()
+ {
+ // Digital
+ IsOnline = 1;
+ PowerOff = 1;
+ PowerOn = 2;
+ SelectScene = 1;
+ IntegrationIdSet = 1;
+ LightingSceneOffset = 10;
+ ButtonVisibilityOffset = 40;
+ // Analog
+ }
+
+ public override void OffsetJoinNumbers(uint joinStart)
+ {
+ var joinOffset = joinStart - 1;
+
+ IsOnline = IsOnline + joinOffset;
+ PowerOff = PowerOff + joinOffset;
+ PowerOn = PowerOn + joinOffset;
+ SelectScene = SelectScene + joinOffset;
+ LightingSceneOffset = LightingSceneOffset + joinOffset;
+ ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
+
+
+
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/EiscBridge.cs b/src/PepperDashEssentials/Bridges/EiscBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/EiscBridge.cs
rename to src/PepperDashEssentials/Bridges/EiscBridge.cs
diff --git a/PepperDashEssentials/Bridges/EssentialComms.cs b/src/PepperDashEssentials/Bridges/EssentialComms.cs
similarity index 97%
rename from PepperDashEssentials/Bridges/EssentialComms.cs
rename to src/PepperDashEssentials/Bridges/EssentialComms.cs
index 461715fc..6d038dff 100644
--- a/PepperDashEssentials/Bridges/EssentialComms.cs
+++ b/src/PepperDashEssentials/Bridges/EssentialComms.cs
@@ -1,144 +1,144 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Routing;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.EthernetCommunication;
-using Crestron.SimplSharpPro.CrestronThread;
-
-namespace PepperDash.Essentials {
- public class EssentialCommConfig {
- public string[] EiscApiIpids;
- public EssentialCommCommConnectionConfigs[] CommConnections;
- }
- public class EssentialCommCommConnectionConfigs {
- public uint joinNumber {get; set; }
- public EssentialsControlPropertiesConfig control { get; set; }
- }
-
- public class EssentialCommsPort {
- public IBasicCommunication Comm;
- public IntFeedback StatusFeedback;
- public BoolFeedback ConnectedFeedback;
- public List Outputs = new List();
- public String RxBuffer;
- public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix) {
- Comm = CommFactory.CreateCommForConfig(config, keyPrefix);
- // var PortGather = new CommunicationGather(Comm, config.EndOfLineChar);
- Comm.TextReceived += new EventHandler(Communication_TextReceived);
-
- var socket = Comm as ISocketStatus;
- StatusFeedback = new IntFeedback(() => { return (int)socket.ClientStatus; });
- ConnectedFeedback = new BoolFeedback(() => { return Comm.IsConnected; });
-
- if (socket != null) {
- socket.ConnectionChange += new EventHandler(socket_ConnectionChange);
- } else {
- }
-
- }
- void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) {
- StatusFeedback.FireUpdate();
- ConnectedFeedback.FireUpdate();
- if (e.Client.IsConnected) {
- // Tasks on connect
- } else {
- // Cleanup items from this session
- }
- }
- void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) {
- try {
- foreach (var Output in Outputs) {
- Output.Api.Eisc.StringInput[Output.Join].StringValue = args.Text;
- }
-
- }
- catch (Exception) {
- throw new FormatException(string.Format("ERROR:{0}"));
- }
- }
- }
-
- public class EssentialComm : Device {
- public EssentialCommConfig Properties;
-
- public CommunicationGather PortGather { get; private set; }
- public List Apis {get; set;}
- public Dictionary CommFeedbacks {get; private set; }
- public StatusMonitorBase CommunicationMonitor { get; private set; }
- public Dictionary CommDictionary { get; private set; }
-
- public EssentialComm(string key, string name, JToken properties) : base(key, name) {
- Properties = JsonConvert.DeserializeObject(properties.ToString());
- CommFeedbacks = new Dictionary();
- CommDictionary = new Dictionary();
- Apis = new List();
- int commNumber = 1;
- foreach (var commConfig in Properties.CommConnections) {
- var commPort = new EssentialCommsPort(commConfig.control, string.Format("{0}-{1}", this.Key, commConfig.joinNumber));
- CommDictionary.Add(commConfig.joinNumber, commPort);
-
- commNumber++;
- }
-
- foreach (var Ipid in Properties.EiscApiIpids) {
- var ApiEisc = new BridgeApiEisc(Ipid);
- Apis.Add(ApiEisc);
- foreach (var commConnection in CommDictionary) {
- Debug.Console(2, "Joining Api{0} to comm {1}", Ipid, commConnection.Key);
- var tempComm = commConnection.Value;
- var tempJoin = (uint)commConnection.Key;
- EssentialComApiMap ApiMap = new EssentialComApiMap(ApiEisc, (uint)tempJoin);
-
- tempComm.Outputs.Add(ApiMap);
- // Check for ApiMap Overide Values here
-
- ApiEisc.Eisc.SetBoolSigAction(tempJoin, b => {if (b) { tempComm.Comm.Connect(); } else { tempComm.Comm.Disconnect(); }});
- ApiEisc.Eisc.SetStringSigAction(tempJoin, s => tempComm.Comm.SendText(s));
-
- tempComm.StatusFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[tempJoin]);
- tempComm.ConnectedFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[tempJoin]);
-
-
-
- }
- ApiEisc.Eisc.Register();
- }
- }
-
-
-
- public override bool CustomActivate()
- {
- try {
-
-
-
- Debug.Console(2, "Name {0} Activated", this.Name);
- return true;
- }
- catch (Exception e) {
- Debug.Console(0, "Bridge {0}", e);
- return false;
- }
- }
-
-
- }
- public class EssentialComApiMap {
- public uint Join;
- public BridgeApiEisc Api;
- public uint connectJoin;
- public EssentialComApiMap(BridgeApiEisc api, uint join) {
- Join = join;
- Api = api;
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Routing;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.EthernetCommunication;
+using Crestron.SimplSharpPro.CrestronThread;
+
+namespace PepperDash.Essentials {
+ public class EssentialCommConfig {
+ public string[] EiscApiIpids;
+ public EssentialCommCommConnectionConfigs[] CommConnections;
+ }
+ public class EssentialCommCommConnectionConfigs {
+ public uint joinNumber {get; set; }
+ public EssentialsControlPropertiesConfig control { get; set; }
+ }
+
+ public class EssentialCommsPort {
+ public IBasicCommunication Comm;
+ public IntFeedback StatusFeedback;
+ public BoolFeedback ConnectedFeedback;
+ public List Outputs = new List();
+ public String RxBuffer;
+ public EssentialCommsPort(EssentialsControlPropertiesConfig config, string keyPrefix) {
+ Comm = CommFactory.CreateCommForConfig(config, keyPrefix);
+ // var PortGather = new CommunicationGather(Comm, config.EndOfLineChar);
+ Comm.TextReceived += new EventHandler(Communication_TextReceived);
+
+ var socket = Comm as ISocketStatus;
+ StatusFeedback = new IntFeedback(() => { return (int)socket.ClientStatus; });
+ ConnectedFeedback = new BoolFeedback(() => { return Comm.IsConnected; });
+
+ if (socket != null) {
+ socket.ConnectionChange += new EventHandler(socket_ConnectionChange);
+ } else {
+ }
+
+ }
+ void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) {
+ StatusFeedback.FireUpdate();
+ ConnectedFeedback.FireUpdate();
+ if (e.Client.IsConnected) {
+ // Tasks on connect
+ } else {
+ // Cleanup items from this session
+ }
+ }
+ void Communication_TextReceived(object sender, GenericCommMethodReceiveTextArgs args) {
+ try {
+ foreach (var Output in Outputs) {
+ Output.Api.Eisc.StringInput[Output.Join].StringValue = args.Text;
+ }
+
+ }
+ catch (Exception) {
+ throw new FormatException(string.Format("ERROR:{0}"));
+ }
+ }
+ }
+
+ public class EssentialComm : Device {
+ public EssentialCommConfig Properties;
+
+ public CommunicationGather PortGather { get; private set; }
+ public List Apis {get; set;}
+ public Dictionary CommFeedbacks {get; private set; }
+ public StatusMonitorBase CommunicationMonitor { get; private set; }
+ public Dictionary CommDictionary { get; private set; }
+
+ public EssentialComm(string key, string name, JToken properties) : base(key, name) {
+ Properties = JsonConvert.DeserializeObject(properties.ToString());
+ CommFeedbacks = new Dictionary();
+ CommDictionary = new Dictionary();
+ Apis = new List();
+ int commNumber = 1;
+ foreach (var commConfig in Properties.CommConnections) {
+ var commPort = new EssentialCommsPort(commConfig.control, string.Format("{0}-{1}", this.Key, commConfig.joinNumber));
+ CommDictionary.Add(commConfig.joinNumber, commPort);
+
+ commNumber++;
+ }
+
+ foreach (var Ipid in Properties.EiscApiIpids) {
+ var ApiEisc = new BridgeApiEisc(Ipid);
+ Apis.Add(ApiEisc);
+ foreach (var commConnection in CommDictionary) {
+ Debug.Console(2, "Joining Api{0} to comm {1}", Ipid, commConnection.Key);
+ var tempComm = commConnection.Value;
+ var tempJoin = (uint)commConnection.Key;
+ EssentialComApiMap ApiMap = new EssentialComApiMap(ApiEisc, (uint)tempJoin);
+
+ tempComm.Outputs.Add(ApiMap);
+ // Check for ApiMap Overide Values here
+
+ ApiEisc.Eisc.SetBoolSigAction(tempJoin, b => {if (b) { tempComm.Comm.Connect(); } else { tempComm.Comm.Disconnect(); }});
+ ApiEisc.Eisc.SetStringSigAction(tempJoin, s => tempComm.Comm.SendText(s));
+
+ tempComm.StatusFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[tempJoin]);
+ tempComm.ConnectedFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[tempJoin]);
+
+
+
+ }
+ ApiEisc.Eisc.Register();
+ }
+ }
+
+
+
+ public override bool CustomActivate()
+ {
+ try {
+
+
+
+ Debug.Console(2, "Name {0} Activated", this.Name);
+ return true;
+ }
+ catch (Exception e) {
+ Debug.Console(0, "Bridge {0}", e);
+ return false;
+ }
+ }
+
+
+ }
+ public class EssentialComApiMap {
+ public uint Join;
+ public BridgeApiEisc Api;
+ public uint connectJoin;
+ public EssentialComApiMap(BridgeApiEisc api, uint join) {
+ Join = join;
+ Api = api;
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/EssentialDM.cs b/src/PepperDashEssentials/Bridges/EssentialDM.cs
similarity index 97%
rename from PepperDashEssentials/Bridges/EssentialDM.cs
rename to src/PepperDashEssentials/Bridges/EssentialDM.cs
index f03f174b..ff753ca6 100644
--- a/PepperDashEssentials/Bridges/EssentialDM.cs
+++ b/src/PepperDashEssentials/Bridges/EssentialDM.cs
@@ -1,150 +1,150 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.DM;
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Routing;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.EthernetCommunication;
-using Crestron.SimplSharpPro.DM;
-
-namespace PepperDash.Essentials {
- public class EssentialDM : PepperDash.Core.Device {
- public EssentialDMProperties Properties;
- public List BridgeApiEiscs;
- private PepperDash.Essentials.DM.DmChassisController DmSwitch;
- private EssentialDMApiMap ApiMap = new EssentialDMApiMap();
- public EssentialDM(string key, string name, JToken properties)
- : base(key, name) {
- Properties = JsonConvert.DeserializeObject(properties.ToString());
-
-
- }
- public override bool CustomActivate() {
- // Create EiscApis
- try {
- foreach (var device in DeviceManager.AllDevices) {
- if (device.Key == this.Properties.connectionDeviceKey) {
- Debug.Console(2, "deviceKey {0} Matches", device.Key);
- DmSwitch = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.DM.DmChassisController;
-
- }
-
-
- else {
- Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
- }
- }
- if (Properties.EiscApiIpids != null) {
-
-
- foreach (string Ipid in Properties.EiscApiIpids) {
- var ApiEisc = new BridgeApiEisc(Ipid);
- for (uint x = 1; x <= DmSwitch.Chassis.NumberOfInputs;x++ ) {
- uint tempX = x;
- Debug.Console(2, "Creating EiscActions {0}", tempX);
-
-
- ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputVideoRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Video));
- ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputAudioRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Audio));
-
-
- if (DmSwitch.TxDictionary.ContainsKey(tempX)) {
- Debug.Console(2, "Creating Tx Feedbacks {0}", tempX);
- var TxKey = DmSwitch.TxDictionary[tempX];
- var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
- TxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxOnlineStatus[tempX]]);
- TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
- ApiEisc.Eisc.SetUShortSigAction((ApiMap.HdcpSupport[tempX]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
- TxDevice.HdcpSupportAllFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupport[tempX]]);
- ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupportCapability[tempX]].UShortValue = TxDevice.HdcpSupportCapability;
- }
- else {
- DmSwitch.VideoInputSyncFeedbacks[tempX].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
- }
- if (DmSwitch.RxDictionary.ContainsKey(tempX)) {
- Debug.Console(2, "Creating Rx Feedbacks {0}", tempX);
- var RxKey = DmSwitch.RxDictionary[tempX];
- var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
- RxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.RxOnlineStatus[tempX]]);
- }
- // DmSwitch.InputEndpointOnlineFeedbacks[(ushort)tempOutputNum].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.OutputVideoRoutes[tempOutputNum]]);
- DmSwitch.VideoOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputVideoRoutes[tempX]]);
- DmSwitch.AudioOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputAudioRoutes[tempX]]);
- DmSwitch.InputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.InputNames[tempX]]);
- DmSwitch.OutputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputNames[tempX]]);
- DmSwitch.OutputRouteNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputRouteNames[tempX]]);
- }
- DmSwitch.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.ChassisOnline]);
- ApiEisc.Eisc.Register();
- }
- }
-
-
-
- Debug.Console(2, "Name {0} Activated", this.Name);
- return true;
- }
- catch (Exception e) {
- Debug.Console(2, "BRidge {0}", e);
- return false;
- }
- }
- }
- public class EssentialDMProperties {
- public string connectionDeviceKey;
- public string[] EiscApiIpids;
-
-
- }
-
-
- public class EssentialDMApiMap {
- public ushort ChassisOnline = 11;
- public Dictionary OutputVideoRoutes;
- public Dictionary OutputAudioRoutes;
- public Dictionary TxOnlineStatus;
- public Dictionary RxOnlineStatus;
- public Dictionary TxVideoSyncStatus;
- public Dictionary InputNames;
- public Dictionary OutputNames;
- public Dictionary OutputRouteNames;
- public Dictionary HdcpSupport;
- public Dictionary HdcpSupportCapability;
-
- public EssentialDMApiMap() {
- OutputVideoRoutes = new Dictionary();
- OutputAudioRoutes = new Dictionary();
- TxOnlineStatus = new Dictionary();
- RxOnlineStatus = new Dictionary();
- TxVideoSyncStatus = new Dictionary();
- InputNames = new Dictionary();
- OutputNames = new Dictionary();
- OutputRouteNames = new Dictionary();
- HdcpSupport = new Dictionary();
- HdcpSupportCapability = new Dictionary();
-
- for (uint x = 1; x <= 200; x++) {
- // Debug.Console(0, "Init Value {0}", x);
- uint tempNum = x;
- HdcpSupportCapability[tempNum] = (ushort)(tempNum + 1200);
- HdcpSupport[tempNum] = (ushort)(tempNum + 1000);
- OutputVideoRoutes[tempNum] = (ushort)(tempNum + 100);
- OutputAudioRoutes[tempNum] = (ushort)(tempNum + 300);
- TxOnlineStatus[tempNum] = (ushort)(tempNum + 500);
- RxOnlineStatus[tempNum] = (ushort)(tempNum + 700);
- TxVideoSyncStatus[tempNum] = (ushort)(tempNum + 100);
- InputNames[tempNum] = (ushort)(tempNum + 100);
- OutputNames[tempNum] = (ushort)(tempNum + 300);
- OutputRouteNames[tempNum] = (ushort)(tempNum + 2000);
- }
- }
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.DM;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Routing;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.EthernetCommunication;
+using Crestron.SimplSharpPro.DM;
+
+namespace PepperDash.Essentials {
+ public class EssentialDM : PepperDash.Core.Device {
+ public EssentialDMProperties Properties;
+ public List BridgeApiEiscs;
+ private PepperDash.Essentials.DM.DmChassisController DmSwitch;
+ private EssentialDMApiMap ApiMap = new EssentialDMApiMap();
+ public EssentialDM(string key, string name, JToken properties)
+ : base(key, name) {
+ Properties = JsonConvert.DeserializeObject(properties.ToString());
+
+
+ }
+ public override bool CustomActivate() {
+ // Create EiscApis
+ try {
+ foreach (var device in DeviceManager.AllDevices) {
+ if (device.Key == this.Properties.connectionDeviceKey) {
+ Debug.Console(2, "deviceKey {0} Matches", device.Key);
+ DmSwitch = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.DM.DmChassisController;
+
+ }
+
+
+ else {
+ Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
+ }
+ }
+ if (Properties.EiscApiIpids != null) {
+
+
+ foreach (string Ipid in Properties.EiscApiIpids) {
+ var ApiEisc = new BridgeApiEisc(Ipid);
+ for (uint x = 1; x <= DmSwitch.Chassis.NumberOfInputs;x++ ) {
+ uint tempX = x;
+ Debug.Console(2, "Creating EiscActions {0}", tempX);
+
+
+ ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputVideoRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Video));
+ ApiEisc.Eisc.SetUShortSigAction(ApiMap.OutputAudioRoutes[tempX], u => DmSwitch.ExecuteSwitch(u, tempX, eRoutingSignalType.Audio));
+
+
+ if (DmSwitch.TxDictionary.ContainsKey(tempX)) {
+ Debug.Console(2, "Creating Tx Feedbacks {0}", tempX);
+ var TxKey = DmSwitch.TxDictionary[tempX];
+ var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
+ TxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxOnlineStatus[tempX]]);
+ TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
+ ApiEisc.Eisc.SetUShortSigAction((ApiMap.HdcpSupport[tempX]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
+ TxDevice.HdcpSupportAllFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupport[tempX]]);
+ ApiEisc.Eisc.UShortInput[ApiMap.HdcpSupportCapability[tempX]].UShortValue = TxDevice.HdcpSupportCapability;
+ }
+ else {
+ DmSwitch.VideoInputSyncFeedbacks[tempX].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.TxVideoSyncStatus[tempX]]);
+ }
+ if (DmSwitch.RxDictionary.ContainsKey(tempX)) {
+ Debug.Console(2, "Creating Rx Feedbacks {0}", tempX);
+ var RxKey = DmSwitch.RxDictionary[tempX];
+ var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
+ RxDevice.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.RxOnlineStatus[tempX]]);
+ }
+ // DmSwitch.InputEndpointOnlineFeedbacks[(ushort)tempOutputNum].LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.OutputVideoRoutes[tempOutputNum]]);
+ DmSwitch.VideoOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputVideoRoutes[tempX]]);
+ DmSwitch.AudioOutputFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.OutputAudioRoutes[tempX]]);
+ DmSwitch.InputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.InputNames[tempX]]);
+ DmSwitch.OutputNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputNames[tempX]]);
+ DmSwitch.OutputRouteNameFeedbacks[(ushort)tempX].LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.OutputRouteNames[tempX]]);
+ }
+ DmSwitch.IsOnline.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.ChassisOnline]);
+ ApiEisc.Eisc.Register();
+ }
+ }
+
+
+
+ Debug.Console(2, "Name {0} Activated", this.Name);
+ return true;
+ }
+ catch (Exception e) {
+ Debug.Console(2, "BRidge {0}", e);
+ return false;
+ }
+ }
+ }
+ public class EssentialDMProperties {
+ public string connectionDeviceKey;
+ public string[] EiscApiIpids;
+
+
+ }
+
+
+ public class EssentialDMApiMap {
+ public ushort ChassisOnline = 11;
+ public Dictionary OutputVideoRoutes;
+ public Dictionary OutputAudioRoutes;
+ public Dictionary TxOnlineStatus;
+ public Dictionary RxOnlineStatus;
+ public Dictionary TxVideoSyncStatus;
+ public Dictionary InputNames;
+ public Dictionary OutputNames;
+ public Dictionary OutputRouteNames;
+ public Dictionary HdcpSupport;
+ public Dictionary HdcpSupportCapability;
+
+ public EssentialDMApiMap() {
+ OutputVideoRoutes = new Dictionary();
+ OutputAudioRoutes = new Dictionary();
+ TxOnlineStatus = new Dictionary();
+ RxOnlineStatus = new Dictionary();
+ TxVideoSyncStatus = new Dictionary();
+ InputNames = new Dictionary();
+ OutputNames = new Dictionary();
+ OutputRouteNames = new Dictionary();
+ HdcpSupport = new Dictionary();
+ HdcpSupportCapability = new Dictionary();
+
+ for (uint x = 1; x <= 200; x++) {
+ // Debug.Console(0, "Init Value {0}", x);
+ uint tempNum = x;
+ HdcpSupportCapability[tempNum] = (ushort)(tempNum + 1200);
+ HdcpSupport[tempNum] = (ushort)(tempNum + 1000);
+ OutputVideoRoutes[tempNum] = (ushort)(tempNum + 100);
+ OutputAudioRoutes[tempNum] = (ushort)(tempNum + 300);
+ TxOnlineStatus[tempNum] = (ushort)(tempNum + 500);
+ RxOnlineStatus[tempNum] = (ushort)(tempNum + 700);
+ TxVideoSyncStatus[tempNum] = (ushort)(tempNum + 100);
+ InputNames[tempNum] = (ushort)(tempNum + 100);
+ OutputNames[tempNum] = (ushort)(tempNum + 300);
+ OutputRouteNames[tempNum] = (ushort)(tempNum + 2000);
+ }
+ }
+ }
+ }
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/EssentialDsp.cs b/src/PepperDashEssentials/Bridges/EssentialDsp.cs
similarity index 97%
rename from PepperDashEssentials/Bridges/EssentialDsp.cs
rename to src/PepperDashEssentials/Bridges/EssentialDsp.cs
index d8aed442..223aa34c 100644
--- a/PepperDashEssentials/Bridges/EssentialDsp.cs
+++ b/src/PepperDashEssentials/Bridges/EssentialDsp.cs
@@ -1,217 +1,217 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.DM;
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Routing;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.EthernetCommunication;
-using Crestron.SimplSharpPro.DM;
-
-namespace PepperDash.Essentials {
- public class EssentialDsp : PepperDash.Core.Device {
- public EssentialDspProperties Properties;
- public List BridgeApiEiscs;
- private PepperDash.Essentials.Devices.Common.DSP.QscDsp Dsp;
- private EssentialDspApiMap ApiMap = new EssentialDspApiMap();
- public EssentialDsp(string key, string name, JToken properties)
- : base(key, name) {
- Properties = JsonConvert.DeserializeObject(properties.ToString());
-
-
- }
- public override bool CustomActivate() {
- // Create EiscApis
-
- try
- {
- ICommunicationMonitor comm = null;
- foreach (var device in DeviceManager.AllDevices)
- {
- if (device.Key == this.Properties.connectionDeviceKey)
- {
- if (!(device is ICommunicationMonitor))
- {
- comm = device as ICommunicationMonitor;
- }
- Debug.Console(2, "deviceKey {0} Matches", device.Key);
- Dsp = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.DSP.QscDsp;
- break;
- }
- else
- {
- Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
-
- }
- }
- if (Properties.EiscApiIpids != null && Dsp != null)
- {
- foreach (string Ipid in Properties.EiscApiIpids)
- {
- var ApiEisc = new BridgeApiEisc(Ipid);
- Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, Dsp.Name);
- ushort x = 1;
- if (comm != null)
- {
- comm.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
- }
- foreach (var channel in Dsp.LevelControlPoints)
- {
- //var QscChannel = channel.Value as PepperDash.Essentials.Devices.Common.DSP.QscDspLevelControl;
- Debug.Console(2, "QscChannel {0} connect", x);
-
- var genericChannel = channel.Value as IBasicVolumeWithFeedback;
- if (channel.Value.Enabled)
- {
- ApiEisc.Eisc.StringInput[ApiMap.channelName[x]].StringValue = channel.Value.LevelCustomName;
- ApiEisc.Eisc.UShortInput[ApiMap.channelType[x]].UShortValue = (ushort)channel.Value.Type;
-
- genericChannel.MuteFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.channelMuteToggle[x]]);
- genericChannel.VolumeLevelFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.channelVolume[x]]);
-
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteToggle[x], () => genericChannel.MuteToggle());
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOn[x], () => genericChannel.MuteOn());
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOff[x], () => genericChannel.MuteOff());
-
- ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeUp[x], b => genericChannel.VolumeUp(b));
- ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeDown[x], b => genericChannel.VolumeDown(b));
-
- ApiEisc.Eisc.SetUShortSigAction(ApiMap.channelVolume[x], u => genericChannel.SetVolume(u));
- ApiEisc.Eisc.SetStringSigAction(ApiMap.presetString, s => Dsp.RunPreset(s));
- }
- x++;
-
- }
- x = 1;
- foreach (var preset in Dsp.PresetList)
- {
- ApiEisc.Eisc.StringInput[ApiMap.presets[x]].StringValue = preset.label;
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.presets[x], () => Dsp.RunPresetNumber(x));
- x++;
- }
- foreach (var dialer in Dsp.Dialers)
- {
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad0, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num0));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad1, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num1));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad2, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num2));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad3, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num3));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad4, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num4));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad5, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num5));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad6, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num6));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad7, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num7));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad8, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num8));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad9, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num9));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadStar, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Star));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadPound, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Pound));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadClear, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Clear));
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadBackspace, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Backspace));
-
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.Dial, () => dialer.Value.Dial());
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbToggle, () => dialer.Value.DoNotDisturbToggle());
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOn, () => dialer.Value.DoNotDisturbOn());
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOff, () => dialer.Value.DoNotDisturbOff());
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerToggle, () => dialer.Value.AutoAnswerToggle());
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOn, () => dialer.Value.AutoAnswerOn());
- ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOff, () => dialer.Value.AutoAnswerOff());
-
- dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbToggle]);
- dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOn]);
- dialer.Value.DoNotDisturbFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOff]);
-
- dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerToggle]);
- dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOn]);
- dialer.Value.AutoAnswerFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOff]);
-
- dialer.Value.OffHookFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Dial]);
- dialer.Value.DialStringFeedback.LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.DialString]);
- }
- }
- }
-
-
-
-
- Debug.Console(2, "Name {0} Activated", this.Name);
- return true;
- }
- catch (Exception e) {
- Debug.Console(0, "Bridge {0}", e);
- return false;
- }
- }
- }
- public class EssentialDspProperties {
- public string connectionDeviceKey;
- public string[] EiscApiIpids;
-
-
- }
-
-
- public class EssentialDspApiMap {
- public ushort Online = 1;
- public ushort presetString = 2000;
- public Dictionary channelMuteToggle;
- public Dictionary channelMuteOn;
- public Dictionary channelMuteOff;
- public Dictionary channelVolume;
- public Dictionary channelType;
- public Dictionary channelName;
- public Dictionary channelVolumeUp;
- public Dictionary channelVolumeDown;
- public Dictionary presets;
- public ushort DialString = 3100;
- public ushort Keypad0 = 3110;
- public ushort Keypad1 = 3111;
- public ushort Keypad2 = 3112;
- public ushort Keypad3 = 3113;
- public ushort Keypad4 = 3114;
- public ushort Keypad5 = 3115;
- public ushort Keypad6 = 3116;
- public ushort Keypad7 = 3117;
- public ushort Keypad8 = 3118;
- public ushort Keypad9 = 3119;
- public ushort KeypadStar = 3120;
- public ushort KeypadPound = 3121;
- public ushort KeypadClear = 3122;
- public ushort KeypadBackspace = 3123;
- public ushort Dial = 3124;
- public ushort DoNotDisturbToggle = 3132;
- public ushort DoNotDisturbOn = 3133;
- public ushort DoNotDisturbOff = 3134;
- public ushort AutoAnswerToggle = 3127;
- public ushort AutoAnswerOn = 3125;
- public ushort AutoAnswerOff = 3126;
-
- public EssentialDspApiMap() {
- channelMuteToggle = new Dictionary();
- channelMuteOn = new Dictionary();
- channelMuteOff = new Dictionary();
- channelVolume = new Dictionary();
- channelName = new Dictionary();
- channelType = new Dictionary();
- presets = new Dictionary();
- channelVolumeUp = new Dictionary();
- channelVolumeDown = new Dictionary();
- for (uint x = 1; x <= 100; x++) {
- uint tempNum = x;
- presets[tempNum] = (ushort)(tempNum + 100);
- channelMuteToggle[tempNum] = (ushort)(tempNum + 400);
- channelMuteOn[tempNum] = (ushort)(tempNum + 600);
- channelMuteOff[tempNum] = (ushort)(tempNum + 800);
- channelVolume[tempNum] = (ushort)(tempNum + 200);
- channelName[tempNum] = (ushort)(tempNum + 200);
- channelType[tempNum] = (ushort)(tempNum + 400);
- channelVolumeUp[tempNum] = (ushort)(tempNum + 1000);
- channelVolumeDown[tempNum] = (ushort)(tempNum + 1200);
- }
- }
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.DM;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Routing;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.EthernetCommunication;
+using Crestron.SimplSharpPro.DM;
+
+namespace PepperDash.Essentials {
+ public class EssentialDsp : PepperDash.Core.Device {
+ public EssentialDspProperties Properties;
+ public List BridgeApiEiscs;
+ private PepperDash.Essentials.Devices.Common.DSP.QscDsp Dsp;
+ private EssentialDspApiMap ApiMap = new EssentialDspApiMap();
+ public EssentialDsp(string key, string name, JToken properties)
+ : base(key, name) {
+ Properties = JsonConvert.DeserializeObject(properties.ToString());
+
+
+ }
+ public override bool CustomActivate() {
+ // Create EiscApis
+
+ try
+ {
+ ICommunicationMonitor comm = null;
+ foreach (var device in DeviceManager.AllDevices)
+ {
+ if (device.Key == this.Properties.connectionDeviceKey)
+ {
+ if (!(device is ICommunicationMonitor))
+ {
+ comm = device as ICommunicationMonitor;
+ }
+ Debug.Console(2, "deviceKey {0} Matches", device.Key);
+ Dsp = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.DSP.QscDsp;
+ break;
+ }
+ else
+ {
+ Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
+
+ }
+ }
+ if (Properties.EiscApiIpids != null && Dsp != null)
+ {
+ foreach (string Ipid in Properties.EiscApiIpids)
+ {
+ var ApiEisc = new BridgeApiEisc(Ipid);
+ Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, Dsp.Name);
+ ushort x = 1;
+ if (comm != null)
+ {
+ comm.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
+ }
+ foreach (var channel in Dsp.LevelControlPoints)
+ {
+ //var QscChannel = channel.Value as PepperDash.Essentials.Devices.Common.DSP.QscDspLevelControl;
+ Debug.Console(2, "QscChannel {0} connect", x);
+
+ var genericChannel = channel.Value as IBasicVolumeWithFeedback;
+ if (channel.Value.Enabled)
+ {
+ ApiEisc.Eisc.StringInput[ApiMap.channelName[x]].StringValue = channel.Value.LevelCustomName;
+ ApiEisc.Eisc.UShortInput[ApiMap.channelType[x]].UShortValue = (ushort)channel.Value.Type;
+
+ genericChannel.MuteFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.channelMuteToggle[x]]);
+ genericChannel.VolumeLevelFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.channelVolume[x]]);
+
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteToggle[x], () => genericChannel.MuteToggle());
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOn[x], () => genericChannel.MuteOn());
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.channelMuteOff[x], () => genericChannel.MuteOff());
+
+ ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeUp[x], b => genericChannel.VolumeUp(b));
+ ApiEisc.Eisc.SetBoolSigAction(ApiMap.channelVolumeDown[x], b => genericChannel.VolumeDown(b));
+
+ ApiEisc.Eisc.SetUShortSigAction(ApiMap.channelVolume[x], u => genericChannel.SetVolume(u));
+ ApiEisc.Eisc.SetStringSigAction(ApiMap.presetString, s => Dsp.RunPreset(s));
+ }
+ x++;
+
+ }
+ x = 1;
+ foreach (var preset in Dsp.PresetList)
+ {
+ ApiEisc.Eisc.StringInput[ApiMap.presets[x]].StringValue = preset.label;
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.presets[x], () => Dsp.RunPresetNumber(x));
+ x++;
+ }
+ foreach (var dialer in Dsp.Dialers)
+ {
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad0, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num0));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad1, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num1));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad2, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num2));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad3, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num3));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad4, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num4));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad5, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num5));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad6, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num6));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad7, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num7));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad8, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num8));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Keypad9, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num9));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadStar, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Star));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadPound, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Pound));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadClear, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Clear));
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.KeypadBackspace, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Backspace));
+
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.Dial, () => dialer.Value.Dial());
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbToggle, () => dialer.Value.DoNotDisturbToggle());
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOn, () => dialer.Value.DoNotDisturbOn());
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.DoNotDisturbOff, () => dialer.Value.DoNotDisturbOff());
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerToggle, () => dialer.Value.AutoAnswerToggle());
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOn, () => dialer.Value.AutoAnswerOn());
+ ApiEisc.Eisc.SetSigTrueAction(ApiMap.AutoAnswerOff, () => dialer.Value.AutoAnswerOff());
+
+ dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbToggle]);
+ dialer.Value.DoNotDisturbFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOn]);
+ dialer.Value.DoNotDisturbFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.DoNotDisturbOff]);
+
+ dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerToggle]);
+ dialer.Value.AutoAnswerFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOn]);
+ dialer.Value.AutoAnswerFeedback.LinkComplementInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.AutoAnswerOff]);
+
+ dialer.Value.OffHookFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Dial]);
+ dialer.Value.DialStringFeedback.LinkInputSig(ApiEisc.Eisc.StringInput[ApiMap.DialString]);
+ }
+ }
+ }
+
+
+
+
+ Debug.Console(2, "Name {0} Activated", this.Name);
+ return true;
+ }
+ catch (Exception e) {
+ Debug.Console(0, "Bridge {0}", e);
+ return false;
+ }
+ }
+ }
+ public class EssentialDspProperties {
+ public string connectionDeviceKey;
+ public string[] EiscApiIpids;
+
+
+ }
+
+
+ public class EssentialDspApiMap {
+ public ushort Online = 1;
+ public ushort presetString = 2000;
+ public Dictionary channelMuteToggle;
+ public Dictionary channelMuteOn;
+ public Dictionary channelMuteOff;
+ public Dictionary channelVolume;
+ public Dictionary channelType;
+ public Dictionary channelName;
+ public Dictionary channelVolumeUp;
+ public Dictionary channelVolumeDown;
+ public Dictionary presets;
+ public ushort DialString = 3100;
+ public ushort Keypad0 = 3110;
+ public ushort Keypad1 = 3111;
+ public ushort Keypad2 = 3112;
+ public ushort Keypad3 = 3113;
+ public ushort Keypad4 = 3114;
+ public ushort Keypad5 = 3115;
+ public ushort Keypad6 = 3116;
+ public ushort Keypad7 = 3117;
+ public ushort Keypad8 = 3118;
+ public ushort Keypad9 = 3119;
+ public ushort KeypadStar = 3120;
+ public ushort KeypadPound = 3121;
+ public ushort KeypadClear = 3122;
+ public ushort KeypadBackspace = 3123;
+ public ushort Dial = 3124;
+ public ushort DoNotDisturbToggle = 3132;
+ public ushort DoNotDisturbOn = 3133;
+ public ushort DoNotDisturbOff = 3134;
+ public ushort AutoAnswerToggle = 3127;
+ public ushort AutoAnswerOn = 3125;
+ public ushort AutoAnswerOff = 3126;
+
+ public EssentialDspApiMap() {
+ channelMuteToggle = new Dictionary();
+ channelMuteOn = new Dictionary();
+ channelMuteOff = new Dictionary();
+ channelVolume = new Dictionary();
+ channelName = new Dictionary();
+ channelType = new Dictionary();
+ presets = new Dictionary();
+ channelVolumeUp = new Dictionary();
+ channelVolumeDown = new Dictionary();
+ for (uint x = 1; x <= 100; x++) {
+ uint tempNum = x;
+ presets[tempNum] = (ushort)(tempNum + 100);
+ channelMuteToggle[tempNum] = (ushort)(tempNum + 400);
+ channelMuteOn[tempNum] = (ushort)(tempNum + 600);
+ channelMuteOff[tempNum] = (ushort)(tempNum + 800);
+ channelVolume[tempNum] = (ushort)(tempNum + 200);
+ channelName[tempNum] = (ushort)(tempNum + 200);
+ channelType[tempNum] = (ushort)(tempNum + 400);
+ channelVolumeUp[tempNum] = (ushort)(tempNum + 1000);
+ channelVolumeDown[tempNum] = (ushort)(tempNum + 1200);
+ }
+ }
+ }
+ }
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/EssentialTVOne.cs b/src/PepperDashEssentials/Bridges/EssentialTVOne.cs
similarity index 96%
rename from PepperDashEssentials/Bridges/EssentialTVOne.cs
rename to src/PepperDashEssentials/Bridges/EssentialTVOne.cs
index 12fb0c49..494e145d 100644
--- a/PepperDashEssentials/Bridges/EssentialTVOne.cs
+++ b/src/PepperDashEssentials/Bridges/EssentialTVOne.cs
@@ -1,98 +1,98 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.DM;
-using PepperDash.Core;
-using PepperDash.Essentials.Core.Routing;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.EthernetCommunication;
-using Crestron.SimplSharpPro.DM;
-
-namespace PepperDash.Essentials
-{
- public class EssentialsTVOne : PepperDash.Core.Device
- {
- public EssentialTVOneProperties Properties;
- public List BridgeApiEiscs;
- private PepperDash.Essentials.Devices.Common.TVOneCorio TVOneCorio;
- private EssentialsTVOneApiMap ApiMap = new EssentialsTVOneApiMap();
- public EssentialsTVOne(string key, string name, JToken properties)
- : base(key, name)
- {
- Properties = JsonConvert.DeserializeObject(properties.ToString());
-
-
- }
- public override bool CustomActivate() {
- // Create EiscApis
- try
- {
- foreach (var device in DeviceManager.AllDevices)
- {
- if (device.Key == this.Properties.connectionDeviceKey)
- {
- Debug.Console(2, "deviceKey {0} Matches", device.Key);
- TVOneCorio = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.TVOneCorio;
- break;
- }
- else
- {
- Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
-
- }
- }
- if (Properties.EiscApiIpids != null && TVOneCorio != null)
- {
- foreach (string Ipid in Properties.EiscApiIpids)
- {
- var ApiEisc = new BridgeApiEisc(Ipid);
- Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, TVOneCorio.Name);
- ushort x = 1;
- TVOneCorio.OnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
- ApiEisc.Eisc.SetUShortSigAction(ApiMap.CallPreset, u => TVOneCorio.CallPreset(u));
- TVOneCorio.PresetFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.PresetFeedback]);
-
- }
- }
-
-
-
-
- Debug.Console(2, "Name {0} Activated", this.Name);
- return true;
- }
- catch (Exception e) {
- Debug.Console(0, "Bridge {0}", e);
- return false;
- }
- }
- }
- public class EssentialTVOneProperties
- {
- public string connectionDeviceKey;
- public string[] EiscApiIpids;
-
-
- }
-
-
- public class EssentialsTVOneApiMap
- {
- public ushort CallPreset = 1;
- public ushort PresetFeedback = 1;
- public ushort Online = 1;
-
- public EssentialsTVOneApiMap()
- {
-
-
- }
-
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.DM;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Routing;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.EthernetCommunication;
+using Crestron.SimplSharpPro.DM;
+
+namespace PepperDash.Essentials
+{
+ public class EssentialsTVOne : PepperDash.Core.Device
+ {
+ public EssentialTVOneProperties Properties;
+ public List BridgeApiEiscs;
+ private PepperDash.Essentials.Devices.Common.TVOneCorio TVOneCorio;
+ private EssentialsTVOneApiMap ApiMap = new EssentialsTVOneApiMap();
+ public EssentialsTVOne(string key, string name, JToken properties)
+ : base(key, name)
+ {
+ Properties = JsonConvert.DeserializeObject(properties.ToString());
+
+
+ }
+ public override bool CustomActivate() {
+ // Create EiscApis
+ try
+ {
+ foreach (var device in DeviceManager.AllDevices)
+ {
+ if (device.Key == this.Properties.connectionDeviceKey)
+ {
+ Debug.Console(2, "deviceKey {0} Matches", device.Key);
+ TVOneCorio = DeviceManager.GetDeviceForKey(device.Key) as PepperDash.Essentials.Devices.Common.TVOneCorio;
+ break;
+ }
+ else
+ {
+ Debug.Console(2, "deviceKey {0} doesn't match", device.Key);
+
+ }
+ }
+ if (Properties.EiscApiIpids != null && TVOneCorio != null)
+ {
+ foreach (string Ipid in Properties.EiscApiIpids)
+ {
+ var ApiEisc = new BridgeApiEisc(Ipid);
+ Debug.Console(2, "Connecting EiscApi {0} to {1}", ApiEisc.Ipid, TVOneCorio.Name);
+ ushort x = 1;
+ TVOneCorio.OnlineFeedback.LinkInputSig(ApiEisc.Eisc.BooleanInput[ApiMap.Online]);
+ ApiEisc.Eisc.SetUShortSigAction(ApiMap.CallPreset, u => TVOneCorio.CallPreset(u));
+ TVOneCorio.PresetFeedback.LinkInputSig(ApiEisc.Eisc.UShortInput[ApiMap.PresetFeedback]);
+
+ }
+ }
+
+
+
+
+ Debug.Console(2, "Name {0} Activated", this.Name);
+ return true;
+ }
+ catch (Exception e) {
+ Debug.Console(0, "Bridge {0}", e);
+ return false;
+ }
+ }
+ }
+ public class EssentialTVOneProperties
+ {
+ public string connectionDeviceKey;
+ public string[] EiscApiIpids;
+
+
+ }
+
+
+ public class EssentialsTVOneApiMap
+ {
+ public ushort CallPreset = 1;
+ public ushort PresetFeedback = 1;
+ public ushort Online = 1;
+
+ public EssentialsTVOneApiMap()
+ {
+
+
+ }
+
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/GenericLightingBridge.cs b/src/PepperDashEssentials/Bridges/GenericLightingBridge.cs
similarity index 98%
rename from PepperDashEssentials/Bridges/GenericLightingBridge.cs
rename to src/PepperDashEssentials/Bridges/GenericLightingBridge.cs
index 5365b813..65331a65 100644
--- a/PepperDashEssentials/Bridges/GenericLightingBridge.cs
+++ b/src/PepperDashEssentials/Bridges/GenericLightingBridge.cs
@@ -1,74 +1,74 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Devices.Common;
-
-using Newtonsoft.Json;
-
-namespace PepperDash.Essentials.Core.Bridges
-{
- public static class GenericLightingApiExtensions
- {
- public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
- {
- GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
-
- // GenericLighitng Actions & FeedBack
- trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
-
- int sceneIndex = 1;
- foreach (var scene in lightingDevice.LightingScenes)
- {
- var tempIndex = sceneIndex - 1;
- trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
- scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
- trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
- trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
- sceneIndex++;
- }
-
- if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
- {
- var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
- lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
- }
-
- //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
-
-
- /*
- var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
-
-
- for (uint i = 1; i <= lightingBase.CircuitCount; i++)
- {
- var circuit = i;
- lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
- lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
- lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
- trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
- trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
- trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
-
- }
- */
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Devices.Common;
+
+using Newtonsoft.Json;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public static class GenericLightingApiExtensions
+ {
+ public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
+ {
+ GenericLightingJoinMap joinMap = new GenericLightingJoinMap();
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ joinMap.OffsetJoinNumbers(joinStart);
+
+ Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
+
+ // GenericLighitng Actions & FeedBack
+ trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
+
+ int sceneIndex = 1;
+ foreach (var scene in lightingDevice.LightingScenes)
+ {
+ var tempIndex = sceneIndex - 1;
+ trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
+ scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
+ trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
+ trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
+ sceneIndex++;
+ }
+
+ if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
+ {
+ var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
+ lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
+ trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
+ }
+
+ //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
+
+
+ /*
+ var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
+
+
+ for (uint i = 1; i <= lightingBase.CircuitCount; i++)
+ {
+ var circuit = i;
+ lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
+ lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
+ lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
+ trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
+ trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
+ trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
+
+ }
+ */
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/GenericRelayDeviceBridge.cs b/src/PepperDashEssentials/Bridges/GenericRelayDeviceBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/GenericRelayDeviceBridge.cs
rename to src/PepperDashEssentials/Bridges/GenericRelayDeviceBridge.cs
diff --git a/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs b/src/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs
similarity index 98%
rename from PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs
index b073750c..052fe669 100644
--- a/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs
+++ b/src/PepperDashEssentials/Bridges/GlsOccupancySensorBaseControllerBridge.cs
@@ -1,125 +1,125 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-
-using PepperDash.Essentials.Devices.Common.Occupancy;
-
-using PepperDash.Essentials.Core;
-using PepperDash.Core;
-
-using Newtonsoft.Json;
-
-namespace PepperDash.Essentials.Core.Bridges
-{
- public static class GlsOccupancySensorBaseControllerApiExtensions
- {
- public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey)
- {
- GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- #region Single and Dual Sensor Stuff
- occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- trilist.StringInput[joinMap.Name].StringValue = occController.Name;
-
- trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
- {
- if (args.DeviceOnLine)
- {
- trilist.StringInput[joinMap.Name].StringValue = occController.Name;
- }
- }
- );
-
- // Occupied status
- trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
- trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
- occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
- occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
- occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
- trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action((b) => occController.EnableRawStates(b)));
-
- // Timouts
- trilist.SetUShortSigAction(joinMap.Timeout, new Action((u) => occController.SetRemoteTimeout(u)));
- occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
- occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
-
- // LED Flash
- trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
- trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
- occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
-
- // Short Timeout
- trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
- trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
- occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
-
- // PIR Sensor
- trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
- trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
- occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
-
- // PIR Sensitivity in Occupied State
- trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
- trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
- occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
-
- // PIR Sensitivity in Vacant State
- trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action((b) => occController.IncrementPirSensitivityInVacantState(b)));
- trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action((b) => occController.DecrementPirSensitivityInVacantState(b)));
- occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
- #endregion
-
- #region Dual Technology Sensor Stuff
- var odtOccController = occController as GlsOdtOccupancySensorController;
-
- if (odtOccController != null)
- {
- // OR When Vacated
- trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action((b) => odtOccController.SetOrWhenVacatedState(b)));
- odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
-
- // AND When Vacated
- trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action((b) => odtOccController.SetAndWhenVacatedState(b)));
- odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
-
- // Ultrasonic A Sensor
- trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
- trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
- odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
-
- // Ultrasonic B Sensor
- trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
- trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
- odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
-
- // US Sensitivity in Occupied State
- trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
- trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
- odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
-
- // US Sensitivity in Vacant State
- trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
- trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
- odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
-
- //Sensor Raw States
- odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
- odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
-
- }
- #endregion
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+
+using PepperDash.Essentials.Devices.Common.Occupancy;
+
+using PepperDash.Essentials.Core;
+using PepperDash.Core;
+
+using Newtonsoft.Json;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public static class GlsOccupancySensorBaseControllerApiExtensions
+ {
+ public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey)
+ {
+ GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap();
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ joinMap.OffsetJoinNumbers(joinStart);
+
+ Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ #region Single and Dual Sensor Stuff
+ occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
+ trilist.StringInput[joinMap.Name].StringValue = occController.Name;
+
+ trilist.OnlineStatusChange += new Crestron.SimplSharpPro.OnlineStatusChangeEventHandler((d, args) =>
+ {
+ if (args.DeviceOnLine)
+ {
+ trilist.StringInput[joinMap.Name].StringValue = occController.Name;
+ }
+ }
+ );
+
+ // Occupied status
+ trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
+ trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
+ occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
+ occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
+ occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
+ trilist.SetBoolSigAction(joinMap.EnableRawStates, new Action((b) => occController.EnableRawStates(b)));
+
+ // Timouts
+ trilist.SetUShortSigAction(joinMap.Timeout, new Action((u) => occController.SetRemoteTimeout(u)));
+ occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
+ occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
+
+ // LED Flash
+ trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
+ occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
+
+ // Short Timeout
+ trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
+ trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
+ occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
+
+ // PIR Sensor
+ trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
+ occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
+
+ // PIR Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
+ occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
+
+ // PIR Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action((b) => occController.IncrementPirSensitivityInVacantState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action((b) => occController.DecrementPirSensitivityInVacantState(b)));
+ occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
+ #endregion
+
+ #region Dual Technology Sensor Stuff
+ var odtOccController = occController as GlsOdtOccupancySensorController;
+
+ if (odtOccController != null)
+ {
+ // OR When Vacated
+ trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action((b) => odtOccController.SetOrWhenVacatedState(b)));
+ odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
+
+ // AND When Vacated
+ trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action((b) => odtOccController.SetAndWhenVacatedState(b)));
+ odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
+
+ // Ultrasonic A Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
+ odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
+
+ // Ultrasonic B Sensor
+ trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
+ trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
+ odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
+
+ // US Sensitivity in Occupied State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
+ odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
+
+ // US Sensitivity in Vacant State
+ trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
+ trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
+ odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
+
+ //Sensor Raw States
+ odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
+ odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
+
+ }
+ #endregion
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs b/src/PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/HdMdxxxCEControllerBridge.cs
diff --git a/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs b/src/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs
rename to src/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs
diff --git a/PepperDashEssentials/Bridges/IBridge.cs b/src/PepperDashEssentials/Bridges/IBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/IBridge.cs
rename to src/PepperDashEssentials/Bridges/IBridge.cs
diff --git a/PepperDashEssentials/Bridges/IDigitalInputBridge.cs b/src/PepperDashEssentials/Bridges/IDigitalInputBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/IDigitalInputBridge.cs
rename to src/PepperDashEssentials/Bridges/IDigitalInputBridge.cs
diff --git a/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs b/src/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
similarity index 98%
rename from PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
rename to src/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
index 76e5b5ee..68455e57 100644
--- a/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
+++ b/src/PepperDashEssentials/Bridges/IRSetTopBoxBaseBridge.cs
@@ -1,128 +1,128 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Devices.Common;
-
-using Newtonsoft.Json;
-
-namespace PepperDash.Essentials.Core.Bridges
-{
- public static class IRSetTopBoxBaseApiExtensions
- {
- public static void LinkToApi(this PepperDash.Essentials.Devices.Common.IRSetTopBoxBase stbDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
- {
- SetTopBoxControllerJoinMap joinMap = new SetTopBoxControllerJoinMap();
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
- Debug.Console(0, "Linking to Display: {0}", stbDevice.Name);
-
- trilist.StringInput[joinMap.Name].StringValue = stbDevice.Name;
-
- var stbBase = stbDevice as ISetTopBoxControls;
- if (stbBase != null)
- {
- trilist.BooleanInput[joinMap.HasDpad].BoolValue = stbBase.HasDpad;
- trilist.BooleanInput[joinMap.HasNumeric].BoolValue = stbBase.HasNumeric;
- trilist.BooleanInput[joinMap.HasDvr].BoolValue = stbBase.HasDvr;
- trilist.BooleanInput[joinMap.HasPresets].BoolValue = stbBase.HasPresets;
-
- trilist.SetBoolSigAction(joinMap.DvrList, (b) => stbBase.DvrList(b));
- trilist.SetBoolSigAction(joinMap.Replay, (b) => stbBase.Replay(b));
-
- trilist.SetStringSigAction(joinMap.LoadPresets, (s) => stbBase.LoadPresets(s));
- }
-
- var stbPower = stbDevice as IPower;
- if (stbPower != null)
- {
- trilist.SetSigTrueAction(joinMap.PowerOn, () => stbPower.PowerOn());
- trilist.SetSigTrueAction(joinMap.PowerOff, () => stbPower.PowerOff());
- trilist.SetSigTrueAction(joinMap.PowerToggle, () => stbPower.PowerToggle());
-
- }
-
- var stbDPad = stbDevice as IDPad;
- if (stbDPad != null)
- {
- trilist.SetBoolSigAction(joinMap.Up, (b) => stbDPad.Up(b));
- trilist.SetBoolSigAction(joinMap.Down, (b) => stbDPad.Down(b));
- trilist.SetBoolSigAction(joinMap.Left, (b) => stbDPad.Left(b));
- trilist.SetBoolSigAction(joinMap.Right, (b) => stbDPad.Right(b));
- trilist.SetBoolSigAction(joinMap.Select, (b) => stbDPad.Select(b));
- trilist.SetBoolSigAction(joinMap.Menu, (b) => stbDPad.Menu(b));
- trilist.SetBoolSigAction(joinMap.Exit, (b) => stbDPad.Exit(b));
- }
-
- var stbChannel = stbDevice as IChannel;
- if (stbChannel != null)
- {
- trilist.SetBoolSigAction(joinMap.ChannelUp, (b) => stbChannel.ChannelUp(b));
- trilist.SetBoolSigAction(joinMap.ChannelDown, (b) => stbChannel.ChannelDown(b));
- trilist.SetBoolSigAction(joinMap.LastChannel, (b) => stbChannel.LastChannel(b));
- trilist.SetBoolSigAction(joinMap.Guide, (b) => stbChannel.Guide(b));
- trilist.SetBoolSigAction(joinMap.Info, (b) => stbChannel.Info(b));
- trilist.SetBoolSigAction(joinMap.Exit, (b) => stbChannel.Exit(b));
- }
-
- var stbColor = stbDevice as IColor;
- if (stbColor != null)
- {
- trilist.SetBoolSigAction(joinMap.Red, (b) => stbColor.Red(b));
- trilist.SetBoolSigAction(joinMap.Green, (b) => stbColor.Green(b));
- trilist.SetBoolSigAction(joinMap.Yellow, (b) => stbColor.Yellow(b));
- trilist.SetBoolSigAction(joinMap.Blue, (b) => stbColor.Blue(b));
- }
-
- var stbKeypad = stbDevice as ISetTopBoxNumericKeypad;
- if (stbKeypad != null)
- {
- trilist.StringInput[joinMap.KeypadAccessoryButton1Label].StringValue = stbKeypad.KeypadAccessoryButton1Label;
- trilist.StringInput[joinMap.KeypadAccessoryButton2Label].StringValue = stbKeypad.KeypadAccessoryButton2Label;
-
- trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1].BoolValue = stbKeypad.HasKeypadAccessoryButton1;
- trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2].BoolValue = stbKeypad.HasKeypadAccessoryButton2;
-
- trilist.SetBoolSigAction(joinMap.Digit0, (b) => stbKeypad.Digit0(b));
- trilist.SetBoolSigAction(joinMap.Digit1, (b) => stbKeypad.Digit1(b));
- trilist.SetBoolSigAction(joinMap.Digit2, (b) => stbKeypad.Digit2(b));
- trilist.SetBoolSigAction(joinMap.Digit3, (b) => stbKeypad.Digit3(b));
- trilist.SetBoolSigAction(joinMap.Digit4, (b) => stbKeypad.Digit4(b));
- trilist.SetBoolSigAction(joinMap.Digit5, (b) => stbKeypad.Digit5(b));
- trilist.SetBoolSigAction(joinMap.Digit6, (b) => stbKeypad.Digit6(b));
- trilist.SetBoolSigAction(joinMap.Digit7, (b) => stbKeypad.Digit7(b));
- trilist.SetBoolSigAction(joinMap.Digit8, (b) => stbKeypad.Digit8(b));
- trilist.SetBoolSigAction(joinMap.Digit9, (b) => stbKeypad.Digit9(b));
- trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
- trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
- trilist.SetBoolSigAction(joinMap.Dash, (b) => stbKeypad.Dash(b));
- trilist.SetBoolSigAction(joinMap.KeypadEnter, (b) => stbKeypad.KeypadEnter(b));
- }
-
- var stbTransport = stbDevice as ITransport;
- if (stbTransport != null)
- {
- trilist.SetBoolSigAction(joinMap.Play, (b) => stbTransport.Play(b));
- trilist.SetBoolSigAction(joinMap.Pause, (b) => stbTransport.Pause(b));
- trilist.SetBoolSigAction(joinMap.Rewind, (b) => stbTransport.Rewind(b));
- trilist.SetBoolSigAction(joinMap.FFwd, (b) => stbTransport.FFwd(b));
- trilist.SetBoolSigAction(joinMap.ChapMinus, (b) => stbTransport.ChapMinus(b));
- trilist.SetBoolSigAction(joinMap.ChapPlus, (b) => stbTransport.ChapPlus(b));
- trilist.SetBoolSigAction(joinMap.Stop, (b) => stbTransport.Stop(b));
- trilist.SetBoolSigAction(joinMap.Record, (b) => stbTransport.Record(b));
-
- }
-
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Devices.Common;
+
+using Newtonsoft.Json;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public static class IRSetTopBoxBaseApiExtensions
+ {
+ public static void LinkToApi(this PepperDash.Essentials.Devices.Common.IRSetTopBoxBase stbDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
+ {
+ SetTopBoxControllerJoinMap joinMap = new SetTopBoxControllerJoinMap();
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ joinMap.OffsetJoinNumbers(joinStart);
+
+ Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+ Debug.Console(0, "Linking to Display: {0}", stbDevice.Name);
+
+ trilist.StringInput[joinMap.Name].StringValue = stbDevice.Name;
+
+ var stbBase = stbDevice as ISetTopBoxControls;
+ if (stbBase != null)
+ {
+ trilist.BooleanInput[joinMap.HasDpad].BoolValue = stbBase.HasDpad;
+ trilist.BooleanInput[joinMap.HasNumeric].BoolValue = stbBase.HasNumeric;
+ trilist.BooleanInput[joinMap.HasDvr].BoolValue = stbBase.HasDvr;
+ trilist.BooleanInput[joinMap.HasPresets].BoolValue = stbBase.HasPresets;
+
+ trilist.SetBoolSigAction(joinMap.DvrList, (b) => stbBase.DvrList(b));
+ trilist.SetBoolSigAction(joinMap.Replay, (b) => stbBase.Replay(b));
+
+ trilist.SetStringSigAction(joinMap.LoadPresets, (s) => stbBase.LoadPresets(s));
+ }
+
+ var stbPower = stbDevice as IPower;
+ if (stbPower != null)
+ {
+ trilist.SetSigTrueAction(joinMap.PowerOn, () => stbPower.PowerOn());
+ trilist.SetSigTrueAction(joinMap.PowerOff, () => stbPower.PowerOff());
+ trilist.SetSigTrueAction(joinMap.PowerToggle, () => stbPower.PowerToggle());
+
+ }
+
+ var stbDPad = stbDevice as IDPad;
+ if (stbDPad != null)
+ {
+ trilist.SetBoolSigAction(joinMap.Up, (b) => stbDPad.Up(b));
+ trilist.SetBoolSigAction(joinMap.Down, (b) => stbDPad.Down(b));
+ trilist.SetBoolSigAction(joinMap.Left, (b) => stbDPad.Left(b));
+ trilist.SetBoolSigAction(joinMap.Right, (b) => stbDPad.Right(b));
+ trilist.SetBoolSigAction(joinMap.Select, (b) => stbDPad.Select(b));
+ trilist.SetBoolSigAction(joinMap.Menu, (b) => stbDPad.Menu(b));
+ trilist.SetBoolSigAction(joinMap.Exit, (b) => stbDPad.Exit(b));
+ }
+
+ var stbChannel = stbDevice as IChannel;
+ if (stbChannel != null)
+ {
+ trilist.SetBoolSigAction(joinMap.ChannelUp, (b) => stbChannel.ChannelUp(b));
+ trilist.SetBoolSigAction(joinMap.ChannelDown, (b) => stbChannel.ChannelDown(b));
+ trilist.SetBoolSigAction(joinMap.LastChannel, (b) => stbChannel.LastChannel(b));
+ trilist.SetBoolSigAction(joinMap.Guide, (b) => stbChannel.Guide(b));
+ trilist.SetBoolSigAction(joinMap.Info, (b) => stbChannel.Info(b));
+ trilist.SetBoolSigAction(joinMap.Exit, (b) => stbChannel.Exit(b));
+ }
+
+ var stbColor = stbDevice as IColor;
+ if (stbColor != null)
+ {
+ trilist.SetBoolSigAction(joinMap.Red, (b) => stbColor.Red(b));
+ trilist.SetBoolSigAction(joinMap.Green, (b) => stbColor.Green(b));
+ trilist.SetBoolSigAction(joinMap.Yellow, (b) => stbColor.Yellow(b));
+ trilist.SetBoolSigAction(joinMap.Blue, (b) => stbColor.Blue(b));
+ }
+
+ var stbKeypad = stbDevice as ISetTopBoxNumericKeypad;
+ if (stbKeypad != null)
+ {
+ trilist.StringInput[joinMap.KeypadAccessoryButton1Label].StringValue = stbKeypad.KeypadAccessoryButton1Label;
+ trilist.StringInput[joinMap.KeypadAccessoryButton2Label].StringValue = stbKeypad.KeypadAccessoryButton2Label;
+
+ trilist.BooleanInput[joinMap.HasKeypadAccessoryButton1].BoolValue = stbKeypad.HasKeypadAccessoryButton1;
+ trilist.BooleanInput[joinMap.HasKeypadAccessoryButton2].BoolValue = stbKeypad.HasKeypadAccessoryButton2;
+
+ trilist.SetBoolSigAction(joinMap.Digit0, (b) => stbKeypad.Digit0(b));
+ trilist.SetBoolSigAction(joinMap.Digit1, (b) => stbKeypad.Digit1(b));
+ trilist.SetBoolSigAction(joinMap.Digit2, (b) => stbKeypad.Digit2(b));
+ trilist.SetBoolSigAction(joinMap.Digit3, (b) => stbKeypad.Digit3(b));
+ trilist.SetBoolSigAction(joinMap.Digit4, (b) => stbKeypad.Digit4(b));
+ trilist.SetBoolSigAction(joinMap.Digit5, (b) => stbKeypad.Digit5(b));
+ trilist.SetBoolSigAction(joinMap.Digit6, (b) => stbKeypad.Digit6(b));
+ trilist.SetBoolSigAction(joinMap.Digit7, (b) => stbKeypad.Digit7(b));
+ trilist.SetBoolSigAction(joinMap.Digit8, (b) => stbKeypad.Digit8(b));
+ trilist.SetBoolSigAction(joinMap.Digit9, (b) => stbKeypad.Digit9(b));
+ trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton1Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
+ trilist.SetBoolSigAction(joinMap.KeypadAccessoryButton2Press, (b) => stbKeypad.KeypadAccessoryButton1(b));
+ trilist.SetBoolSigAction(joinMap.Dash, (b) => stbKeypad.Dash(b));
+ trilist.SetBoolSigAction(joinMap.KeypadEnter, (b) => stbKeypad.KeypadEnter(b));
+ }
+
+ var stbTransport = stbDevice as ITransport;
+ if (stbTransport != null)
+ {
+ trilist.SetBoolSigAction(joinMap.Play, (b) => stbTransport.Play(b));
+ trilist.SetBoolSigAction(joinMap.Pause, (b) => stbTransport.Pause(b));
+ trilist.SetBoolSigAction(joinMap.Rewind, (b) => stbTransport.Rewind(b));
+ trilist.SetBoolSigAction(joinMap.FFwd, (b) => stbTransport.FFwd(b));
+ trilist.SetBoolSigAction(joinMap.ChapMinus, (b) => stbTransport.ChapMinus(b));
+ trilist.SetBoolSigAction(joinMap.ChapPlus, (b) => stbTransport.ChapPlus(b));
+ trilist.SetBoolSigAction(joinMap.Stop, (b) => stbTransport.Stop(b));
+ trilist.SetBoolSigAction(joinMap.Record, (b) => stbTransport.Record(b));
+
+ }
+
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/JoinMaps/AirMediaControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/AirMediaControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/AppleTvJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/C2nRthsControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/CameraControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/CameraControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/CameraControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/CameraControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DigitalLoggerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/DigitalLoggerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DisplayControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/DisplayControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/DisplayControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/DisplayControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/DmBladeChassisControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/DmChassisControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
similarity index 99%
rename from PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
index 3d7cec8d..ae9592ec 100644
--- a/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
+++ b/src/PepperDashEssentials/Bridges/JoinMaps/DmRmcControllerJoinMap.cs
@@ -38,12 +38,12 @@ namespace PepperDash.Essentials.Bridges
/// Reports the EDID serial number value
///
public uint EdidSerialNumber { get; set; }
- #endregion
-
- #region Analogs
- public uint AudioVideoSource { get; set; }
- #endregion
-
+ #endregion
+
+ #region Analogs
+ public uint AudioVideoSource { get; set; }
+ #endregion
+
public DmRmcControllerJoinMap()
{
// Digital
@@ -56,7 +56,7 @@ namespace PepperDash.Essentials.Bridges
EdidPrefferedTiming = 4;
EdidSerialNumber = 5;
- //Analog
+ //Analog
AudioVideoSource = 1;
}
@@ -69,7 +69,7 @@ namespace PepperDash.Essentials.Bridges
EdidManufacturer = EdidManufacturer + joinOffset;
EdidName = EdidName + joinOffset;
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
- EdidSerialNumber = EdidSerialNumber + joinOffset;
+ EdidSerialNumber = EdidSerialNumber + joinOffset;
AudioVideoSource = AudioVideoSource + joinOffset;
}
}
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/DmTxControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/DmpsAudioOutputControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/DmpsRoutingControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/GenericLightingJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/GenericLightingJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/GenericLightingJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/GenericLightingJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/GenericRelayControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/GlsOccupancySensorBaseJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/HdMdxxxCEControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/IBasicCommunicationJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/IDigitalInputJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/IDigitalInputJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/IDigitalInputJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/IDigitalInputJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/SetTopBoxControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/StatusSignControllerJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/StatusSignControllerJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs b/src/PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
rename to src/PepperDashEssentials/Bridges/JoinMaps/SystemMonitorJoinMap.cs
diff --git a/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs b/src/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
similarity index 98%
rename from PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
rename to src/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
index 0b35677d..4c7c3d29 100644
--- a/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
+++ b/src/PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
@@ -1,65 +1,65 @@
-using Crestron.SimplSharpPro.DeviceSupport;
-using Newtonsoft.Json;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.CrestronIO;
-
-namespace PepperDash.Essentials.Core.Bridges
-{
- public static class StatusSignDeviceApiExtensions
- {
- public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
- string joinMapKey)
- {
- var joinMap = new StatusSignControllerJoinMap();
-
- var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
-
- if (!string.IsNullOrEmpty(joinMapSerialized))
- joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
-
- joinMap.OffsetJoinNumbers(joinStart);
-
- Debug.Console(1, ssDevice, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
-
- trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, ssDevice));
- trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, ssDevice));
- trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, ssDevice));
-
- trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, ssDevice));
- trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, ssDevice));
- trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, ssDevice));
-
- trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
-
- ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
- ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
- ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
- ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
-
- ssDevice.RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
- ssDevice.BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
- ssDevice.GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
-
- }
-
- private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
- StatusSignController device)
- {
- var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
- var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
- var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
- device.EnableLedControl(redEnable, greenEnable, blueEnable);
- }
-
- private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
- StatusSignController device)
- {
- var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
- var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
- var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
-
- device.SetColor(redBrightness, greenBrightness, blueBrightness);
- }
- }
+using Crestron.SimplSharpPro.DeviceSupport;
+using Newtonsoft.Json;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.CrestronIO;
+
+namespace PepperDash.Essentials.Core.Bridges
+{
+ public static class StatusSignDeviceApiExtensions
+ {
+ public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
+ string joinMapKey)
+ {
+ var joinMap = new StatusSignControllerJoinMap();
+
+ var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
+
+ if (!string.IsNullOrEmpty(joinMapSerialized))
+ joinMap = JsonConvert.DeserializeObject(joinMapSerialized);
+
+ joinMap.OffsetJoinNumbers(joinStart);
+
+ Debug.Console(1, ssDevice, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
+
+ trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, ssDevice));
+ trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, ssDevice));
+ trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, ssDevice));
+
+ trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, ssDevice));
+ trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, ssDevice));
+ trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, ssDevice));
+
+ trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
+
+ ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
+ ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
+ ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
+ ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
+
+ ssDevice.RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
+ ssDevice.BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
+ ssDevice.GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
+
+ }
+
+ private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
+ StatusSignController device)
+ {
+ var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
+ var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
+ var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
+ device.EnableLedControl(redEnable, greenEnable, blueEnable);
+ }
+
+ private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
+ StatusSignController device)
+ {
+ var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
+ var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
+ var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
+
+ device.SetColor(redBrightness, greenBrightness, blueBrightness);
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Bridges/SystemMonitorBridge.cs b/src/PepperDashEssentials/Bridges/SystemMonitorBridge.cs
similarity index 100%
rename from PepperDashEssentials/Bridges/SystemMonitorBridge.cs
rename to src/PepperDashEssentials/Bridges/SystemMonitorBridge.cs
diff --git a/PepperDashEssentials/ClassDiagram1.cd b/src/PepperDashEssentials/ClassDiagram1.cd
similarity index 100%
rename from PepperDashEssentials/ClassDiagram1.cd
rename to src/PepperDashEssentials/ClassDiagram1.cd
diff --git a/PepperDashEssentials/ControlSystem.cs b/src/PepperDashEssentials/ControlSystem.cs
similarity index 97%
rename from PepperDashEssentials/ControlSystem.cs
rename to src/PepperDashEssentials/ControlSystem.cs
index 1bafbbac..43b10fee 100644
--- a/PepperDashEssentials/ControlSystem.cs
+++ b/src/PepperDashEssentials/ControlSystem.cs
@@ -1,663 +1,663 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.CrestronIO;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.CrestronThread;
-using Crestron.SimplSharpPro.Diagnostics;
-using Crestron.SimplSharp.Reflection;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Bridges;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.Fusion;
-using PepperDash.Essentials.Core.Web;
-using PepperDash.Essentials.Devices.Common;
-using PepperDash.Essentials.DM;
-using PepperDash.Essentials.Fusion;
-using PepperDash.Essentials.Room.Config;
-
-using Newtonsoft.Json;
-using PepperDash.Essentials.Core.DeviceTypeInterfaces;
-
-namespace PepperDash.Essentials
-{
- public class ControlSystem : CrestronControlSystem
- {
- HttpLogoServer LogoServer;
-
- private CTimer _startTimer;
- private CEvent _initializeEvent;
- private const long StartupTime = 500;
-
- public ControlSystem()
- : base()
- {
- Thread.MaxNumberOfUserThreads = 400;
- Global.ControlSystem = this;
- DeviceManager.Initialize(this);
- SecretsManager.Initialize();
- SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
- }
-
- ///
- /// Entry point for the program
- ///
- public override void InitializeSystem()
- {
- // If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
- // to allow any HD-BaseT DM endpoints to register first.
- bool preventInitializationComplete = Global.ControlSystemIsDmpsType;
- if (preventInitializationComplete)
- {
- Debug.Console(1, "******************* InitializeSystem() Entering **********************");
- _startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
- _initializeEvent = new CEvent(true, false);
- DeviceManager.AllDevicesRegistered += (o, a) =>
- {
- _initializeEvent.Set();
- };
- _initializeEvent.Wait(30000);
- Debug.Console(1, "******************* InitializeSystem() Exiting **********************");
- SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
- }
- else
- {
- _startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
- }
- }
-
- private void StartSystem(object preventInitialization)
- {
- DeterminePlatform();
-
- if (Debug.DoNotLoadOnNextBoot)
- {
- CrestronConsole.AddNewConsoleCommand(s => CrestronInvoke.BeginInvoke((o) => GoWithLoad()), "go", "Loads configuration file",
- ConsoleAccessLevelEnum.AccessOperator);
- }
-
- CrestronConsole.AddNewConsoleCommand(PluginLoader.ReportAssemblyVersions, "reportversions", "Reports the versions of the loaded assemblies", ConsoleAccessLevelEnum.AccessOperator);
-
- CrestronConsole.AddNewConsoleCommand(Core.DeviceFactory.GetDeviceFactoryTypes, "gettypes", "Gets the device types that can be built. Accepts a filter string.", ConsoleAccessLevelEnum.AccessOperator);
-
- CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
-
- CrestronConsole.AddNewConsoleCommand(BridgeHelper.JoinmapMarkdown, "getjoinmapmarkdown"
- , "generate markdown of map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
-
- CrestronConsole.AddNewConsoleCommand(s => Debug.Console(0, Debug.ErrorLogLevel.Notice, "CONSOLE MESSAGE: {0}", s), "appdebugmessage", "Writes message to log", ConsoleAccessLevelEnum.AccessOperator);
-
- CrestronConsole.AddNewConsoleCommand(s =>
- {
- foreach (var tl in TieLineCollection.Default)
- CrestronConsole.ConsoleCommandResponse(" {0}{1}", tl, CrestronEnvironment.NewLine);
- },
- "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
-
- CrestronConsole.AddNewConsoleCommand(s =>
- {
- CrestronConsole.ConsoleCommandResponse
- ("Current running configuration. This is the merged system and template configuration" + CrestronEnvironment.NewLine);
- CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
- (ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
- }, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
-
- CrestronConsole.AddNewConsoleCommand(s =>
- CrestronConsole.ConsoleCommandResponse(
- "This system can be found at the following URLs:{2}" +
- "System URL: {0}{2}" +
- "Template URL: {1}{2}",
- ConfigReader.ConfigObject.SystemUrl,
- ConfigReader.ConfigObject.TemplateUrl,
- CrestronEnvironment.NewLine),
- "portalinfo",
- "Shows portal URLS from configuration",
- ConsoleAccessLevelEnum.AccessOperator);
-
-
- CrestronConsole.AddNewConsoleCommand(DeviceManager.GetRoutingPorts,
- "getroutingports", "Reports all routing ports, if any. Requires a device key", ConsoleAccessLevelEnum.AccessOperator);
-
- if (!Debug.DoNotLoadOnNextBoot)
- {
- GoWithLoad();
- return;
- }
-
- if (!(bool)preventInitialization)
- {
- SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
- }
- }
-
- ///
- /// Determines if the program is running on a processor (appliance) or server (VC-4).
- ///
- /// Sets Global.FilePathPrefix and Global.ApplicationDirectoryPathPrefix based on platform
- ///
- public void DeterminePlatform()
- {
- try
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform....");
-
- string filePathPrefix;
-
- var dirSeparator = Global.DirectorySeparator;
-
- string directoryPrefix;
-
- directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
-
- var fullVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
-
- AssemblyInformationalVersionAttribute fullVersionAtt = fullVersion[0] as AssemblyInformationalVersionAttribute;
-
- Global.SetAssemblyVersion(fullVersionAtt.InformationalVersion);
-
- if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS
- {
- string userFolder;
- string nvramFolder;
- bool is4series = false;
-
- if (eCrestronSeries.Series4 == (Global.ProcessorSeries & eCrestronSeries.Series4)) // Handle 4-series
- {
- is4series = true;
- // Set path to user/
- userFolder = "user";
- nvramFolder = "nvram";
- }
- else
- {
- userFolder = "User";
- nvramFolder = "Nvram";
- }
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on {1} Appliance", Global.AssemblyVersion, is4series ? "4-series" : "3-series");
-
- // Check if User/ProgramX exists
- if (Directory.Exists(Global.ApplicationDirectoryPathPrefix + dirSeparator + userFolder
- + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
- {
- Debug.Console(0, @"{0}/program{1} directory found", userFolder, InitialParametersClass.ApplicationNumber);
- filePathPrefix = directoryPrefix + dirSeparator + userFolder
- + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
- }
- // Check if Nvram/Programx exists
- else if (Directory.Exists(directoryPrefix + dirSeparator + nvramFolder
- + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
- {
- Debug.Console(0, @"{0}/program{1} directory found", nvramFolder, InitialParametersClass.ApplicationNumber);
- filePathPrefix = directoryPrefix + dirSeparator + nvramFolder
- + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
- }
- // If neither exists, set path to User/ProgramX
- else
- {
- Debug.Console(0, @"No previous directory found. Using {0}/program{1}", userFolder, InitialParametersClass.ApplicationNumber);
- filePathPrefix = directoryPrefix + dirSeparator + userFolder
- + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
- }
- }
- else // Handles Linux OS (Virtual Control)
- {
- Debug.SetDebugLevel(2);
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", Global.AssemblyVersion);
-
- // Set path to User/
- filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator;
- }
-
- Global.SetFilePathPrefix(filePathPrefix);
- }
- catch (Exception e)
- {
- Debug.Console(0, "Unable to Determine Platform due to Exception: {0}", e.Message);
- }
- }
-
- ///
- /// Begins the process of loading resources including plugins and configuration data
- ///
- public void GoWithLoad()
- {
- try
- {
- Debug.SetDoNotLoadOnNextBoot(false);
-
- PluginLoader.AddProgramAssemblies();
-
- new Core.DeviceFactory();
- new Devices.Common.DeviceFactory();
- new DM.DeviceFactory();
- new DeviceFactory();
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
-
- var filesReady = SetupFilesystem();
- if (filesReady)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Checking for plugins");
- PluginLoader.LoadPlugins();
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
- if (!ConfigReader.LoadConfig2())
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Essentials Load complete with errors");
- return;
- }
-
- Load();
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Essentials load complete\r\n" +
- "-------------------------------------------------------------");
- }
- else
- {
- Debug.Console(0,
- @"----------------------------------------------
- ------------------------------------------------
- ------------------------------------------------
- Essentials file structure setup completed.
- Please load config, sgd and ir files and
- restart program.
- ------------------------------------------------
- ------------------------------------------------
- ------------------------------------------------");
- }
-
- }
- catch (Exception e)
- {
- Debug.Console(0, "FATAL INITIALIZE ERROR. System is in an inconsistent state:\r\n{0}", e);
- }
- finally
- {
- // Notify the OS that the program intitialization has completed
- SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
- }
-
- }
-
-
-
- ///
- /// Verifies filesystem is set up. IR, SGD, and programX folders
- ///
- bool SetupFilesystem()
- {
- Debug.Console(0, "Verifying and/or creating folder structure");
- var configDir = Global.FilePathPrefix;
- var configExists = Directory.Exists(configDir);
- if (!configExists)
- Directory.Create(configDir);
-
- var irDir = Global.FilePathPrefix + "ir";
- if (!Directory.Exists(irDir))
- Directory.Create(irDir);
-
- var sgdDir = Global.FilePathPrefix + "sgd";
- if (!Directory.Exists(sgdDir))
- Directory.Create(sgdDir);
-
- var pluginDir = Global.FilePathPrefix + "plugins";
- if (!Directory.Exists(pluginDir))
- Directory.Create(pluginDir);
-
- var joinmapDir = Global.FilePathPrefix + "joinmaps";
- if(!Directory.Exists(joinmapDir))
- Directory.Create(joinmapDir);
-
- return configExists;
- }
-
- ///
- ///
- ///
- public void TearDown()
- {
- Debug.Console(0, "Tearing down existing system");
- DeviceManager.DeactivateAll();
-
- TieLineCollection.Default.Clear();
-
- foreach (var key in DeviceManager.GetDevices())
- DeviceManager.RemoveDevice(key);
-
- Debug.Console(0, "Tear down COMPLETE");
- }
-
- ///
- ///
- ///
- void Load()
- {
- LoadDevices();
- LoadTieLines();
- LoadRooms();
- LoadLogoServer();
-
- DeviceManager.ActivateAll();
-
- var mobileControl = GetMobileControlDevice();
-
- if (mobileControl == null) return;
-
- mobileControl.LinkSystemMonitorToAppServer();
-
- }
-
- ///
- /// Reads all devices from config and adds them to DeviceManager
- ///
- public void LoadDevices()
- {
-
- // Build the processor wrapper class
- DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
- DeviceManager.AddDevice(new EssemtialsWebApi("essentialsWebApi","Essentials Web API"));
-
- // Add global System Monitor device
- if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
- {
- DeviceManager.AddDevice(
- new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
- }
-
- foreach (var devConf in ConfigReader.ConfigObject.Devices)
- {
-
- try
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}', type '{1}'", devConf.Key, devConf.Type);
- // Skip this to prevent unnecessary warnings
- if (devConf.Key == "processor")
- {
- var prompt = Global.ControlSystem.ControllerPrompt;
-
- var typeMatch = String.Equals(devConf.Type, prompt, StringComparison.OrdinalIgnoreCase) ||
- String.Equals(devConf.Type, prompt.Replace("-", ""), StringComparison.OrdinalIgnoreCase);
-
- if (!typeMatch)
- Debug.Console(0,
- "WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
- devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
-
- // Check if the processor is a DMPS model
- if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
- {
- Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
-
- var propertiesConfig = JsonConvert.DeserializeObject(devConf.Properties.ToString());
-
- if(propertiesConfig == null)
- propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
-
- DeviceManager.AddDevice(DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig));
- }
- else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
- {
- Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController.");
-
- var butToken = devConf.Properties["buttons"];
- if (butToken == null)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error,
- "Error: Unable to deserialize buttons collection for device: {0}", devConf.Key);
- continue;
- }
-
- var buttons = butToken.ToObject>();
- var tpController = new Core.Touchpanels.Mpc3TouchpanelController(
- string.Format("{0}-keypadButtons", devConf.Key), devConf.Name, Global.ControlSystem, buttons);
-
- DeviceManager.AddDevice(tpController);
- }
- else
- {
- Debug.Console(2, "************Processor is not DMPS type***************");
- }
-
-
-
- continue;
- }
-
- // Try local factories first
- IKeyed newDev = null;
-
- if (newDev == null)
- newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
-
- if (newDev != null)
- DeviceManager.AddDevice(newDev);
- else
- Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
- }
- catch (Exception e)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
- }
- }
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Devices Loaded.");
-
- }
-
-
- ///
- /// Helper method to load tie lines. This should run after devices have loaded
- ///
- public void LoadTieLines()
- {
- // In the future, we can't necessarily just clear here because devices
- // might be making their own internal sources/tie lines
-
- var tlc = TieLineCollection.Default;
- //tlc.Clear();
- if (ConfigReader.ConfigObject.TieLines == null)
- {
- return;
- }
-
- foreach (var tieLineConfig in ConfigReader.ConfigObject.TieLines)
- {
- var newTL = tieLineConfig.GetTieLine();
- if (newTL != null)
- tlc.Add(newTL);
- }
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Tie Lines Loaded.");
-
- }
-
- ///
- /// Reads all rooms from config and adds them to DeviceManager
- ///
- public void LoadRooms()
- {
- if (ConfigReader.ConfigObject.Rooms == null)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Configuration contains no rooms - Is this intentional? This may be a valid configuration.");
- return;
- }
-
- uint fusionIpId = 0xf1;
-
- foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
- {
- var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as IEssentialsRoom;
- if (room != null)
- {
- // default to no join map key
- string fusionJoinMapKey = string.Empty;
-
- if (room.Config.Properties["fusion"] != null)
- {
- Debug.Console(2, "Custom Fusion config found. Using custom values");
-
- var fusionConfig = room.Config.Properties["fusion"].ToObject();
-
- if (fusionConfig != null)
- {
- fusionIpId = fusionConfig.IpIdInt;
- fusionJoinMapKey = fusionConfig.JoinMapKey;
- }
- }
-
- AddRoomAndBuildMC(room);
-
- if (room is IEssentialsHuddleSpaceRoom)
- {
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
- DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey));
-
- }
- else if (room is IEssentialsHuddleVtc1Room)
- {
-
- if (!(room is EssentialsCombinedHuddleVtc1Room))
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
- DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((IEssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey));
- }
-
- }
- else if (room is EssentialsTechRoom)
- {
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice,
- "Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
- DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)room, fusionIpId, fusionJoinMapKey));
-
- }
- fusionIpId += 1;
- }
- else
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
-
- }
- }
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
-
- }
-
- private static void AddRoomAndBuildMC(IEssentialsRoom room)
- {
- DeviceManager.AddDevice(room);
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge");
-
- CreateMobileControlBridge(room);
- }
-
- private static void CreateMobileControlBridge(object room)
- {
- var mobileControl = GetMobileControlDevice();
-
- if (mobileControl == null) return;
-
- var mobileControl3 = mobileControl as IMobileControl3;
-
- if (mobileControl3 != null)
- {
- mobileControl3.CreateMobileControlRoomBridge(room as IEssentialsRoom, mobileControl);
- }
- else
- {
- mobileControl.CreateMobileControlRoomBridge(room as EssentialsRoomBase, mobileControl);
- }
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added...");
- }
-
- private static IMobileControl GetMobileControlDevice()
- {
- var mobileControlList = DeviceManager.AllDevices.OfType().ToList();
-
- if (mobileControlList.Count > 1)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Warning,
- "Multiple instances of Mobile Control Server found.");
-
- return null;
- }
-
- if (mobileControlList.Count > 0)
- {
- return mobileControlList[0];
- }
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control not enabled for this system");
- return null;
- }
-
- ///
- /// Fires up a logo server if not already running
- ///
- void LoadLogoServer()
- {
- if (ConfigReader.ConfigObject.Rooms == null)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "No rooms configured. Bypassing Logo server startup.");
- return;
- }
-
- if (
- !ConfigReader.ConfigObject.Rooms.Any(
- CheckRoomConfig))
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "No rooms configured to use system Logo server. Bypassing Logo server startup");
- return;
- }
-
- try
- {
- LogoServer = new HttpLogoServer(8080, Global.DirectorySeparator + "html" + Global.DirectorySeparator + "logo");
- }
- catch (Exception)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program");
- }
- }
-
- private bool CheckRoomConfig(DeviceConfig c)
- {
- string logoDark = null;
- string logoLight = null;
- string logo = null;
-
- try
- {
- if (c.Properties["logoDark"] != null)
- {
- logoDark = c.Properties["logoDark"].Value("type");
- }
-
- if (c.Properties["logoLight"] != null)
- {
- logoLight = c.Properties["logoLight"].Value("type");
- }
-
- if (c.Properties["logo"] != null)
- {
- logo = c.Properties["logo"].Value("type");
- }
-
- return ((logoDark != null && logoDark == "system") ||
- (logoLight != null && logoLight == "system") || (logo != null && logo == "system"));
- }
- catch
- {
- Debug.Console(1, Debug.ErrorLogLevel.Notice, "Unable to find logo information in any room config");
- return false;
- }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.CrestronIO;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.CrestronThread;
+using Crestron.SimplSharpPro.Diagnostics;
+using Crestron.SimplSharp.Reflection;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Fusion;
+using PepperDash.Essentials.Core.Web;
+using PepperDash.Essentials.Devices.Common;
+using PepperDash.Essentials.DM;
+using PepperDash.Essentials.Fusion;
+using PepperDash.Essentials.Room.Config;
+
+using Newtonsoft.Json;
+using PepperDash.Essentials.Core.DeviceTypeInterfaces;
+
+namespace PepperDash.Essentials
+{
+ public class ControlSystem : CrestronControlSystem
+ {
+ HttpLogoServer LogoServer;
+
+ private CTimer _startTimer;
+ private CEvent _initializeEvent;
+ private const long StartupTime = 500;
+
+ public ControlSystem()
+ : base()
+ {
+ Thread.MaxNumberOfUserThreads = 400;
+ Global.ControlSystem = this;
+ DeviceManager.Initialize(this);
+ SecretsManager.Initialize();
+ SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
+ }
+
+ ///
+ /// Entry point for the program
+ ///
+ public override void InitializeSystem()
+ {
+ // If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
+ // to allow any HD-BaseT DM endpoints to register first.
+ bool preventInitializationComplete = Global.ControlSystemIsDmpsType;
+ if (preventInitializationComplete)
+ {
+ Debug.Console(1, "******************* InitializeSystem() Entering **********************");
+ _startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
+ _initializeEvent = new CEvent(true, false);
+ DeviceManager.AllDevicesRegistered += (o, a) =>
+ {
+ _initializeEvent.Set();
+ };
+ _initializeEvent.Wait(30000);
+ Debug.Console(1, "******************* InitializeSystem() Exiting **********************");
+ SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
+ }
+ else
+ {
+ _startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
+ }
+ }
+
+ private void StartSystem(object preventInitialization)
+ {
+ DeterminePlatform();
+
+ if (Debug.DoNotLoadOnNextBoot)
+ {
+ CrestronConsole.AddNewConsoleCommand(s => CrestronInvoke.BeginInvoke((o) => GoWithLoad()), "go", "Loads configuration file",
+ ConsoleAccessLevelEnum.AccessOperator);
+ }
+
+ CrestronConsole.AddNewConsoleCommand(PluginLoader.ReportAssemblyVersions, "reportversions", "Reports the versions of the loaded assemblies", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(Core.DeviceFactory.GetDeviceFactoryTypes, "gettypes", "Gets the device types that can be built. Accepts a filter string.", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(BridgeHelper.JoinmapMarkdown, "getjoinmapmarkdown"
+ , "generate markdown of map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(s => Debug.Console(0, Debug.ErrorLogLevel.Notice, "CONSOLE MESSAGE: {0}", s), "appdebugmessage", "Writes message to log", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(s =>
+ {
+ foreach (var tl in TieLineCollection.Default)
+ CrestronConsole.ConsoleCommandResponse(" {0}{1}", tl, CrestronEnvironment.NewLine);
+ },
+ "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(s =>
+ {
+ CrestronConsole.ConsoleCommandResponse
+ ("Current running configuration. This is the merged system and template configuration" + CrestronEnvironment.NewLine);
+ CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
+ (ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
+ }, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(s =>
+ CrestronConsole.ConsoleCommandResponse(
+ "This system can be found at the following URLs:{2}" +
+ "System URL: {0}{2}" +
+ "Template URL: {1}{2}",
+ ConfigReader.ConfigObject.SystemUrl,
+ ConfigReader.ConfigObject.TemplateUrl,
+ CrestronEnvironment.NewLine),
+ "portalinfo",
+ "Shows portal URLS from configuration",
+ ConsoleAccessLevelEnum.AccessOperator);
+
+
+ CrestronConsole.AddNewConsoleCommand(DeviceManager.GetRoutingPorts,
+ "getroutingports", "Reports all routing ports, if any. Requires a device key", ConsoleAccessLevelEnum.AccessOperator);
+
+ if (!Debug.DoNotLoadOnNextBoot)
+ {
+ GoWithLoad();
+ return;
+ }
+
+ if (!(bool)preventInitialization)
+ {
+ SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
+ }
+ }
+
+ ///
+ /// Determines if the program is running on a processor (appliance) or server (VC-4).
+ ///
+ /// Sets Global.FilePathPrefix and Global.ApplicationDirectoryPathPrefix based on platform
+ ///
+ public void DeterminePlatform()
+ {
+ try
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform....");
+
+ string filePathPrefix;
+
+ var dirSeparator = Global.DirectorySeparator;
+
+ string directoryPrefix;
+
+ directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
+
+ var fullVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
+
+ AssemblyInformationalVersionAttribute fullVersionAtt = fullVersion[0] as AssemblyInformationalVersionAttribute;
+
+ Global.SetAssemblyVersion(fullVersionAtt.InformationalVersion);
+
+ if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS
+ {
+ string userFolder;
+ string nvramFolder;
+ bool is4series = false;
+
+ if (eCrestronSeries.Series4 == (Global.ProcessorSeries & eCrestronSeries.Series4)) // Handle 4-series
+ {
+ is4series = true;
+ // Set path to user/
+ userFolder = "user";
+ nvramFolder = "nvram";
+ }
+ else
+ {
+ userFolder = "User";
+ nvramFolder = "Nvram";
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on {1} Appliance", Global.AssemblyVersion, is4series ? "4-series" : "3-series");
+
+ // Check if User/ProgramX exists
+ if (Directory.Exists(Global.ApplicationDirectoryPathPrefix + dirSeparator + userFolder
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
+ {
+ Debug.Console(0, @"{0}/program{1} directory found", userFolder, InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + userFolder
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
+ }
+ // Check if Nvram/Programx exists
+ else if (Directory.Exists(directoryPrefix + dirSeparator + nvramFolder
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
+ {
+ Debug.Console(0, @"{0}/program{1} directory found", nvramFolder, InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + nvramFolder
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
+ }
+ // If neither exists, set path to User/ProgramX
+ else
+ {
+ Debug.Console(0, @"No previous directory found. Using {0}/program{1}", userFolder, InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + userFolder
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
+ }
+ }
+ else // Handles Linux OS (Virtual Control)
+ {
+ Debug.SetDebugLevel(2);
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", Global.AssemblyVersion);
+
+ // Set path to User/
+ filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator;
+ }
+
+ Global.SetFilePathPrefix(filePathPrefix);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, "Unable to Determine Platform due to Exception: {0}", e.Message);
+ }
+ }
+
+ ///
+ /// Begins the process of loading resources including plugins and configuration data
+ ///
+ public void GoWithLoad()
+ {
+ try
+ {
+ Debug.SetDoNotLoadOnNextBoot(false);
+
+ PluginLoader.AddProgramAssemblies();
+
+ new Core.DeviceFactory();
+ new Devices.Common.DeviceFactory();
+ new DM.DeviceFactory();
+ new DeviceFactory();
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
+
+ var filesReady = SetupFilesystem();
+ if (filesReady)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Checking for plugins");
+ PluginLoader.LoadPlugins();
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
+ if (!ConfigReader.LoadConfig2())
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Essentials Load complete with errors");
+ return;
+ }
+
+ Load();
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Essentials load complete\r\n" +
+ "-------------------------------------------------------------");
+ }
+ else
+ {
+ Debug.Console(0,
+ @"----------------------------------------------
+ ------------------------------------------------
+ ------------------------------------------------
+ Essentials file structure setup completed.
+ Please load config, sgd and ir files and
+ restart program.
+ ------------------------------------------------
+ ------------------------------------------------
+ ------------------------------------------------");
+ }
+
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, "FATAL INITIALIZE ERROR. System is in an inconsistent state:\r\n{0}", e);
+ }
+ finally
+ {
+ // Notify the OS that the program intitialization has completed
+ SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
+ }
+
+ }
+
+
+
+ ///
+ /// Verifies filesystem is set up. IR, SGD, and programX folders
+ ///
+ bool SetupFilesystem()
+ {
+ Debug.Console(0, "Verifying and/or creating folder structure");
+ var configDir = Global.FilePathPrefix;
+ var configExists = Directory.Exists(configDir);
+ if (!configExists)
+ Directory.Create(configDir);
+
+ var irDir = Global.FilePathPrefix + "ir";
+ if (!Directory.Exists(irDir))
+ Directory.Create(irDir);
+
+ var sgdDir = Global.FilePathPrefix + "sgd";
+ if (!Directory.Exists(sgdDir))
+ Directory.Create(sgdDir);
+
+ var pluginDir = Global.FilePathPrefix + "plugins";
+ if (!Directory.Exists(pluginDir))
+ Directory.Create(pluginDir);
+
+ var joinmapDir = Global.FilePathPrefix + "joinmaps";
+ if(!Directory.Exists(joinmapDir))
+ Directory.Create(joinmapDir);
+
+ return configExists;
+ }
+
+ ///
+ ///
+ ///
+ public void TearDown()
+ {
+ Debug.Console(0, "Tearing down existing system");
+ DeviceManager.DeactivateAll();
+
+ TieLineCollection.Default.Clear();
+
+ foreach (var key in DeviceManager.GetDevices())
+ DeviceManager.RemoveDevice(key);
+
+ Debug.Console(0, "Tear down COMPLETE");
+ }
+
+ ///
+ ///
+ ///
+ void Load()
+ {
+ LoadDevices();
+ LoadTieLines();
+ LoadRooms();
+ LoadLogoServer();
+
+ DeviceManager.ActivateAll();
+
+ var mobileControl = GetMobileControlDevice();
+
+ if (mobileControl == null) return;
+
+ mobileControl.LinkSystemMonitorToAppServer();
+
+ }
+
+ ///
+ /// Reads all devices from config and adds them to DeviceManager
+ ///
+ public void LoadDevices()
+ {
+
+ // Build the processor wrapper class
+ DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
+ DeviceManager.AddDevice(new EssemtialsWebApi("essentialsWebApi","Essentials Web API"));
+
+ // Add global System Monitor device
+ if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
+ {
+ DeviceManager.AddDevice(
+ new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
+ }
+
+ foreach (var devConf in ConfigReader.ConfigObject.Devices)
+ {
+
+ try
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}', type '{1}'", devConf.Key, devConf.Type);
+ // Skip this to prevent unnecessary warnings
+ if (devConf.Key == "processor")
+ {
+ var prompt = Global.ControlSystem.ControllerPrompt;
+
+ var typeMatch = String.Equals(devConf.Type, prompt, StringComparison.OrdinalIgnoreCase) ||
+ String.Equals(devConf.Type, prompt.Replace("-", ""), StringComparison.OrdinalIgnoreCase);
+
+ if (!typeMatch)
+ Debug.Console(0,
+ "WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
+ devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
+
+ // Check if the processor is a DMPS model
+ if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
+ {
+ Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
+
+ var propertiesConfig = JsonConvert.DeserializeObject(devConf.Properties.ToString());
+
+ if(propertiesConfig == null)
+ propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
+
+ DeviceManager.AddDevice(DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig));
+ }
+ else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
+ {
+ Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController.");
+
+ var butToken = devConf.Properties["buttons"];
+ if (butToken == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error,
+ "Error: Unable to deserialize buttons collection for device: {0}", devConf.Key);
+ continue;
+ }
+
+ var buttons = butToken.ToObject>();
+ var tpController = new Core.Touchpanels.Mpc3TouchpanelController(
+ string.Format("{0}-keypadButtons", devConf.Key), devConf.Name, Global.ControlSystem, buttons);
+
+ DeviceManager.AddDevice(tpController);
+ }
+ else
+ {
+ Debug.Console(2, "************Processor is not DMPS type***************");
+ }
+
+
+
+ continue;
+ }
+
+ // Try local factories first
+ IKeyed newDev = null;
+
+ if (newDev == null)
+ newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
+
+ if (newDev != null)
+ DeviceManager.AddDevice(newDev);
+ else
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
+ }
+ }
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Devices Loaded.");
+
+ }
+
+
+ ///
+ /// Helper method to load tie lines. This should run after devices have loaded
+ ///
+ public void LoadTieLines()
+ {
+ // In the future, we can't necessarily just clear here because devices
+ // might be making their own internal sources/tie lines
+
+ var tlc = TieLineCollection.Default;
+ //tlc.Clear();
+ if (ConfigReader.ConfigObject.TieLines == null)
+ {
+ return;
+ }
+
+ foreach (var tieLineConfig in ConfigReader.ConfigObject.TieLines)
+ {
+ var newTL = tieLineConfig.GetTieLine();
+ if (newTL != null)
+ tlc.Add(newTL);
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Tie Lines Loaded.");
+
+ }
+
+ ///
+ /// Reads all rooms from config and adds them to DeviceManager
+ ///
+ public void LoadRooms()
+ {
+ if (ConfigReader.ConfigObject.Rooms == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Configuration contains no rooms - Is this intentional? This may be a valid configuration.");
+ return;
+ }
+
+ uint fusionIpId = 0xf1;
+
+ foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
+ {
+ var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as IEssentialsRoom;
+ if (room != null)
+ {
+ // default to no join map key
+ string fusionJoinMapKey = string.Empty;
+
+ if (room.Config.Properties["fusion"] != null)
+ {
+ Debug.Console(2, "Custom Fusion config found. Using custom values");
+
+ var fusionConfig = room.Config.Properties["fusion"].ToObject();
+
+ if (fusionConfig != null)
+ {
+ fusionIpId = fusionConfig.IpIdInt;
+ fusionJoinMapKey = fusionConfig.JoinMapKey;
+ }
+ }
+
+ AddRoomAndBuildMC(room);
+
+ if (room is IEssentialsHuddleSpaceRoom)
+ {
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
+ DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey));
+
+ }
+ else if (room is IEssentialsHuddleVtc1Room)
+ {
+
+ if (!(room is EssentialsCombinedHuddleVtc1Room))
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
+ DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((IEssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey));
+ }
+
+ }
+ else if (room is EssentialsTechRoom)
+ {
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice,
+ "Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
+ DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)room, fusionIpId, fusionJoinMapKey));
+
+ }
+ fusionIpId += 1;
+ }
+ else
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
+
+ }
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
+
+ }
+
+ private static void AddRoomAndBuildMC(IEssentialsRoom room)
+ {
+ DeviceManager.AddDevice(room);
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge");
+
+ CreateMobileControlBridge(room);
+ }
+
+ private static void CreateMobileControlBridge(object room)
+ {
+ var mobileControl = GetMobileControlDevice();
+
+ if (mobileControl == null) return;
+
+ var mobileControl3 = mobileControl as IMobileControl3;
+
+ if (mobileControl3 != null)
+ {
+ mobileControl3.CreateMobileControlRoomBridge(room as IEssentialsRoom, mobileControl);
+ }
+ else
+ {
+ mobileControl.CreateMobileControlRoomBridge(room as EssentialsRoomBase, mobileControl);
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added...");
+ }
+
+ private static IMobileControl GetMobileControlDevice()
+ {
+ var mobileControlList = DeviceManager.AllDevices.OfType().ToList();
+
+ if (mobileControlList.Count > 1)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Warning,
+ "Multiple instances of Mobile Control Server found.");
+
+ return null;
+ }
+
+ if (mobileControlList.Count > 0)
+ {
+ return mobileControlList[0];
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control not enabled for this system");
+ return null;
+ }
+
+ ///
+ /// Fires up a logo server if not already running
+ ///
+ void LoadLogoServer()
+ {
+ if (ConfigReader.ConfigObject.Rooms == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "No rooms configured. Bypassing Logo server startup.");
+ return;
+ }
+
+ if (
+ !ConfigReader.ConfigObject.Rooms.Any(
+ CheckRoomConfig))
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "No rooms configured to use system Logo server. Bypassing Logo server startup");
+ return;
+ }
+
+ try
+ {
+ LogoServer = new HttpLogoServer(8080, Global.DirectorySeparator + "html" + Global.DirectorySeparator + "logo");
+ }
+ catch (Exception)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program");
+ }
+ }
+
+ private bool CheckRoomConfig(DeviceConfig c)
+ {
+ string logoDark = null;
+ string logoLight = null;
+ string logo = null;
+
+ try
+ {
+ if (c.Properties["logoDark"] != null)
+ {
+ logoDark = c.Properties["logoDark"].Value("type");
+ }
+
+ if (c.Properties["logoLight"] != null)
+ {
+ logoLight = c.Properties["logoLight"].Value("type");
+ }
+
+ if (c.Properties["logo"] != null)
+ {
+ logo = c.Properties["logo"].Value("type");
+ }
+
+ return ((logoDark != null && logoDark == "system") ||
+ (logoLight != null && logoLight == "system") || (logo != null && logo == "system"));
+ }
+ catch
+ {
+ Debug.Console(1, Debug.ErrorLogLevel.Notice, "Unable to find logo information in any room config");
+ return false;
+ }
+ }
+ }
+}
diff --git a/PepperDashEssentials/Devices/Amplifier.cs b/src/PepperDashEssentials/Devices/Amplifier.cs
similarity index 100%
rename from PepperDashEssentials/Devices/Amplifier.cs
rename to src/PepperDashEssentials/Devices/Amplifier.cs
diff --git a/PepperDashEssentials/Example Configuration/EssentialsHuddleSpaceRoom/configurationFile-HuddleSpace-2-Source.json b/src/PepperDashEssentials/Example Configuration/EssentialsHuddleSpaceRoom/configurationFile-HuddleSpace-2-Source.json
similarity index 100%
rename from PepperDashEssentials/Example Configuration/EssentialsHuddleSpaceRoom/configurationFile-HuddleSpace-2-Source.json
rename to src/PepperDashEssentials/Example Configuration/EssentialsHuddleSpaceRoom/configurationFile-HuddleSpace-2-Source.json
diff --git a/PepperDashEssentials/Example Configuration/EssentialsHuddleVtc1Room/configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json b/src/PepperDashEssentials/Example Configuration/EssentialsHuddleVtc1Room/configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json
similarity index 100%
rename from PepperDashEssentials/Example Configuration/EssentialsHuddleVtc1Room/configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json
rename to src/PepperDashEssentials/Example Configuration/EssentialsHuddleVtc1Room/configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json
diff --git a/PepperDashEssentials/Example Configuration/SIMPLBridging/SIMPLBridgeExample_configurationFile.json b/src/PepperDashEssentials/Example Configuration/SIMPLBridging/SIMPLBridgeExample_configurationFile.json
similarity index 100%
rename from PepperDashEssentials/Example Configuration/SIMPLBridging/SIMPLBridgeExample_configurationFile.json
rename to src/PepperDashEssentials/Example Configuration/SIMPLBridging/SIMPLBridgeExample_configurationFile.json
diff --git a/PepperDashEssentials/Example Configuration/SIMPLBridging/configurationFile-dmps3300c-avRouting.json b/src/PepperDashEssentials/Example Configuration/SIMPLBridging/configurationFile-dmps3300c-avRouting.json
similarity index 100%
rename from PepperDashEssentials/Example Configuration/SIMPLBridging/configurationFile-dmps3300c-avRouting.json
rename to src/PepperDashEssentials/Example Configuration/SIMPLBridging/configurationFile-dmps3300c-avRouting.json
diff --git a/PepperDashEssentials/Factory/DeviceFactory.cs b/src/PepperDashEssentials/Factory/DeviceFactory.cs
similarity index 96%
rename from PepperDashEssentials/Factory/DeviceFactory.cs
rename to src/PepperDashEssentials/Factory/DeviceFactory.cs
index 98c2dd13..425d0bdc 100644
--- a/PepperDashEssentials/Factory/DeviceFactory.cs
+++ b/src/PepperDashEssentials/Factory/DeviceFactory.cs
@@ -1,47 +1,47 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.CrestronIO;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharp.Reflection;
-
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-
-namespace PepperDash.Essentials
-{
- ///
- /// Responsible for loading all of the device types for this library
- ///
- public class DeviceFactory
- {
-
- public DeviceFactory()
- {
- var assy = Assembly.GetExecutingAssembly();
- PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
-
- var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
-
- if (types != null)
- {
- foreach (var type in types)
- {
- try
- {
- var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
- factory.LoadTypeFactories();
- }
- catch (Exception e)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
- }
- }
- }
- }
- }
-}
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.CrestronIO;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharp.Reflection;
+
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials
+{
+ ///
+ /// Responsible for loading all of the device types for this library
+ ///
+ public class DeviceFactory
+ {
+
+ public DeviceFactory()
+ {
+ var assy = Assembly.GetExecutingAssembly();
+ PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
+
+ var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
+
+ if (types != null)
+ {
+ foreach (var type in types)
+ {
+ try
+ {
+ var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
+ factory.LoadTypeFactories();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs b/src/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
similarity index 97%
rename from PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
rename to src/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
index c3877706..5ee5a893 100644
--- a/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
+++ b/src/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
@@ -1,358 +1,358 @@
-using System;
-using System.Linq;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.Fusion;
-
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.Fusion;
-
-namespace PepperDash.Essentials.Fusion
-{
- public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
- {
- BooleanSigData CodecIsInCall;
-
- public EssentialsHuddleVtc1FusionController(IEssentialsHuddleVtc1Room room, uint ipId, string joinMapKey)
- : base(room, ipId, joinMapKey)
- {
-
- }
-
- ///
- /// Called in base class constructor before RVI and GUID files are built
- ///
- protected override void ExecuteCustomSteps()
- {
- SetUpCodec();
- }
-
- ///
- /// Creates a static asset for the codec and maps the joins to the main room symbol
- ///
- void SetUpCodec()
- {
- try
- {
- var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
-
- if (codec == null)
- {
- Debug.Console(1, this, "Cannot link codec to Fusion because codec is null");
- return;
- }
-
- codec.UsageTracker = new UsageTracking(codec);
- codec.UsageTracker.UsageIsTracked = true;
- codec.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
-
- var codecPowerOnAction = new Action(b => { if (!b) codec.StandbyDeactivate(); });
- var codecPowerOffAction = new Action(b => { if (!b) codec.StandbyActivate(); });
-
- // Map FusionRoom Attributes:
-
- // Codec volume
- var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
- codecVolume.OutputSig.UserObject = new Action(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
- (codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
-
- // In Call Status
- CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
- codec.CallStatusChange += new EventHandler(codec_CallStatusChange);
-
- // Online status
- if (codec is ICommunicationMonitor)
- {
- var c = codec as ICommunicationMonitor;
- var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
- codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
- c.CommunicationMonitor.StatusChange += (o, a) =>
- {
- codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
- };
- Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
- }
-
- // Codec IP Address
- bool codecHasIpInfo = false;
- var codecComm = codec.Communication;
-
- string codecIpAddress = string.Empty;
- int codecIpPort = 0;
-
- StringSigData codecIpAddressSig;
- StringSigData codecIpPortSig;
-
- if(codecComm is GenericSshClient)
- {
- codecIpAddress = (codecComm as GenericSshClient).Hostname;
- codecIpPort = (codecComm as GenericSshClient).Port;
- codecHasIpInfo = true;
- }
- else if (codecComm is GenericTcpIpClient)
- {
- codecIpAddress = (codecComm as GenericTcpIpClient).Hostname;
- codecIpPort = (codecComm as GenericTcpIpClient).Port;
- codecHasIpInfo = true;
- }
-
- if (codecHasIpInfo)
- {
- codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
- codecIpAddressSig.InputSig.StringValue = codecIpAddress;
-
- codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
- codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
- }
-
- var tempAsset = new FusionAsset();
-
- var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(c => c.Key.Equals(codec.Key));
-
- if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
- {
- tempAsset = FusionStaticAssets[deviceConfig.Uid];
- }
- else
- {
- // Create a new asset
- tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), codec.Name, "Codec", "");
- FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
- }
-
- var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId);
- codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
- codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
- codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
-
- // TODO: Map relevant attributes on asset symbol
-
- codecAsset.TrySetMakeModel(codec);
- codecAsset.TryLinkAssetErrorToCommunication(codec);
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "Error setting up codec in Fusion: {0}", e);
- }
- }
-
- void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e)
- {
- var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
-
- CodecIsInCall.InputSig.BoolValue = codec.IsInCall;
- }
-
- // These methods are overridden because they access the room class which is of a different type
-
- protected override void CreateSymbolAndBasicSigs(uint ipId)
- {
- Debug.Console(0, this, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
-
- FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
- FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
- FusionRoom.ExtenderFusionRoomDataReservedSigs.Use();
-
- FusionRoom.Register();
-
- FusionRoom.FusionStateChange += FusionRoom_FusionStateChange;
-
- FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += FusionRoomSchedule_DeviceExtenderSigChange;
- FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange;
- FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange;
-
- CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
- CrestronConsole.AddNewConsoleCommand(CreateAdHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
-
- // Room to fusion room
- Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
-
- // Moved to
- CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly);
- // Don't think we need to get current status of this as nothing should be alive yet.
- (Room as IEssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
-
-
- FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as IEssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
- FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
-
-
- CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
- }
-
- protected override void SetUpSources()
- {
- // Sources
- var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as IEssentialsHuddleVtc1Room).SourceListKey);
- if (dict != null)
- {
- // NEW PROCESS:
- // Make these lists and insert the fusion attributes by iterating these
- var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
- uint i = 1;
- foreach (var kvp in setTopBoxes)
- {
- TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
- i++;
- if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
- break;
- }
-
- var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
- i = 1;
- foreach (var kvp in discPlayers)
- {
- TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
- i++;
- if (i > 5) // We only have five spots
- break;
- }
-
- var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop);
- i = 1;
- foreach (var kvp in laptops)
- {
- TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
- i++;
- if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
- break;
- }
-
- foreach (var kvp in dict)
- {
- var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
-
- if (usageDevice != null)
- {
- usageDevice.UsageTracker = new UsageTracking(usageDevice as Device);
- usageDevice.UsageTracker.UsageIsTracked = true;
- usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler(UsageTracker_DeviceUsageEnded);
- }
- }
-
- }
- else
- {
- Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
- (Room as IEssentialsHuddleVtc1Room).SourceListKey, Room.Key);
- }
- }
-
- protected override void SetUpDisplay()
- {
- try
- {
- //Setup Display Usage Monitoring
-
- var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase);
-
- // Consider updating this in multiple display systems
-
- foreach (DisplayBase display in displays)
- {
- display.UsageTracker = new UsageTracking(display);
- display.UsageTracker.UsageIsTracked = true;
- display.UsageTracker.DeviceUsageEnded += new EventHandler(UsageTracker_DeviceUsageEnded);
- }
-
- var defaultDisplay = (Room as IEssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
- if (defaultDisplay == null)
- {
- Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
- return;
- }
-
- var dispPowerOnAction = new Action(b => { if (!b) defaultDisplay.PowerOn(); });
- var dispPowerOffAction = new Action(b => { if (!b) defaultDisplay.PowerOff(); });
-
- // Display to fusion room sigs
- FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
- FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
-
- var defaultDisplayTwoWay = defaultDisplay as IHasPowerControlWithFeedback;
- if (defaultDisplayTwoWay != null)
- {
- defaultDisplayTwoWay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
- }
-
- if (defaultDisplay is IDisplayUsage)
- (defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
-
- MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay);
-
- var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
-
- //Check for existing asset in GUIDs collection
-
- var tempAsset = new FusionAsset();
-
- if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
- {
- tempAsset = FusionStaticAssets[deviceConfig.Uid];
- }
- else
- {
- // Create a new asset
- tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), defaultDisplay.Name, "Display", "");
- FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
- }
-
- var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
- dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
- dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
-
-
- var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback;
- if (defaultTwoWayDisplay != null)
- {
- defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
- if (defaultDisplay is IDisplayUsage)
- (defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
-
- defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
- }
-
- // Use extension methods
- dispAsset.TrySetMakeModel(defaultDisplay);
- dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "Error setting up display in Fusion: {0}", e);
- }
-
- }
-
- protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
- {
- string displayName = string.Format("Display {0} - ", displayIndex);
-
-
- if (display == (Room as IEssentialsHuddleVtc1Room).DefaultDisplay)
- {
- // Power on
- var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
- defaultDisplayPowerOn.OutputSig.UserObject = new Action(b => { if (!b) display.PowerOn(); });
-
- // Power Off
- var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
- defaultDisplayPowerOn.OutputSig.UserObject = new Action(b => { if (!b) display.PowerOff(); }); ;
-
- var displayTwoWay = display as IHasPowerControlWithFeedback;
- if (displayTwoWay != null)
- {
- displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
- displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
- }
-
- // Current Source
- var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
- defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
- }
- }
- }
+using System;
+using System.Linq;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.Fusion;
+
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Fusion;
+
+namespace PepperDash.Essentials.Fusion
+{
+ public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
+ {
+ BooleanSigData CodecIsInCall;
+
+ public EssentialsHuddleVtc1FusionController(IEssentialsHuddleVtc1Room room, uint ipId, string joinMapKey)
+ : base(room, ipId, joinMapKey)
+ {
+
+ }
+
+ ///
+ /// Called in base class constructor before RVI and GUID files are built
+ ///
+ protected override void ExecuteCustomSteps()
+ {
+ SetUpCodec();
+ }
+
+ ///
+ /// Creates a static asset for the codec and maps the joins to the main room symbol
+ ///
+ void SetUpCodec()
+ {
+ try
+ {
+ var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
+
+ if (codec == null)
+ {
+ Debug.Console(1, this, "Cannot link codec to Fusion because codec is null");
+ return;
+ }
+
+ codec.UsageTracker = new UsageTracking(codec);
+ codec.UsageTracker.UsageIsTracked = true;
+ codec.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
+
+ var codecPowerOnAction = new Action(b => { if (!b) codec.StandbyDeactivate(); });
+ var codecPowerOffAction = new Action(b => { if (!b) codec.StandbyActivate(); });
+
+ // Map FusionRoom Attributes:
+
+ // Codec volume
+ var codecVolume = FusionRoom.CreateOffsetUshortSig(JoinMap.VolumeFader1.JoinNumber, JoinMap.VolumeFader1.AttributeName, eSigIoMask.InputOutputSig);
+ codecVolume.OutputSig.UserObject = new Action(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
+ (codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
+
+ // In Call Status
+ CodecIsInCall = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecInCall.JoinNumber, JoinMap.VcCodecInCall.AttributeName, eSigIoMask.InputSigOnly);
+ codec.CallStatusChange += new EventHandler(codec_CallStatusChange);
+
+ // Online status
+ if (codec is ICommunicationMonitor)
+ {
+ var c = codec as ICommunicationMonitor;
+ var codecOnline = FusionRoom.CreateOffsetBoolSig(JoinMap.VcCodecOnline.JoinNumber, JoinMap.VcCodecOnline.AttributeName, eSigIoMask.InputSigOnly);
+ codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
+ c.CommunicationMonitor.StatusChange += (o, a) =>
+ {
+ codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
+ };
+ Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, JoinMap.VcCodecOnline.AttributeName);
+ }
+
+ // Codec IP Address
+ bool codecHasIpInfo = false;
+ var codecComm = codec.Communication;
+
+ string codecIpAddress = string.Empty;
+ int codecIpPort = 0;
+
+ StringSigData codecIpAddressSig;
+ StringSigData codecIpPortSig;
+
+ if(codecComm is GenericSshClient)
+ {
+ codecIpAddress = (codecComm as GenericSshClient).Hostname;
+ codecIpPort = (codecComm as GenericSshClient).Port;
+ codecHasIpInfo = true;
+ }
+ else if (codecComm is GenericTcpIpClient)
+ {
+ codecIpAddress = (codecComm as GenericTcpIpClient).Hostname;
+ codecIpPort = (codecComm as GenericTcpIpClient).Port;
+ codecHasIpInfo = true;
+ }
+
+ if (codecHasIpInfo)
+ {
+ codecIpAddressSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpAddress.JoinNumber, JoinMap.VcCodecIpAddress.AttributeName, eSigIoMask.InputSigOnly);
+ codecIpAddressSig.InputSig.StringValue = codecIpAddress;
+
+ codecIpPortSig = FusionRoom.CreateOffsetStringSig(JoinMap.VcCodecIpPort.JoinNumber, JoinMap.VcCodecIpPort.AttributeName, eSigIoMask.InputSigOnly);
+ codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
+ }
+
+ var tempAsset = new FusionAsset();
+
+ var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(c => c.Key.Equals(codec.Key));
+
+ if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
+ {
+ tempAsset = FusionStaticAssets[deviceConfig.Uid];
+ }
+ else
+ {
+ // Create a new asset
+ tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), codec.Name, "Codec", "");
+ FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
+ }
+
+ var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Codec", tempAsset.InstanceId);
+ codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
+ codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
+ codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
+
+ // TODO: Map relevant attributes on asset symbol
+
+ codecAsset.TrySetMakeModel(codec);
+ codecAsset.TryLinkAssetErrorToCommunication(codec);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error setting up codec in Fusion: {0}", e);
+ }
+ }
+
+ void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e)
+ {
+ var codec = (Room as IEssentialsHuddleVtc1Room).VideoCodec;
+
+ CodecIsInCall.InputSig.BoolValue = codec.IsInCall;
+ }
+
+ // These methods are overridden because they access the room class which is of a different type
+
+ protected override void CreateSymbolAndBasicSigs(uint ipId)
+ {
+ Debug.Console(0, this, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
+
+ FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
+ FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
+ FusionRoom.ExtenderFusionRoomDataReservedSigs.Use();
+
+ FusionRoom.Register();
+
+ FusionRoom.FusionStateChange += FusionRoom_FusionStateChange;
+
+ FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += FusionRoomSchedule_DeviceExtenderSigChange;
+ FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange;
+ FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange;
+
+ CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
+ CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
+ CrestronConsole.AddNewConsoleCommand(CreateAdHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
+
+ // Room to fusion room
+ Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
+
+ // Moved to
+ CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(JoinMap.Display1CurrentSourceName.JoinNumber, JoinMap.Display1CurrentSourceName.AttributeName, eSigIoMask.InputSigOnly);
+ // Don't think we need to get current status of this as nothing should be alive yet.
+ (Room as IEssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
+
+
+ FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as IEssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
+ FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
+
+
+ CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
+ }
+
+ protected override void SetUpSources()
+ {
+ // Sources
+ var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as IEssentialsHuddleVtc1Room).SourceListKey);
+ if (dict != null)
+ {
+ // NEW PROCESS:
+ // Make these lists and insert the fusion attributes by iterating these
+ var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
+ uint i = 1;
+ foreach (var kvp in setTopBoxes)
+ {
+ TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
+ i++;
+ if (i > JoinMap.Display1SetTopBoxSourceStart.JoinSpan) // We only have five spots
+ break;
+ }
+
+ var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
+ i = 1;
+ foreach (var kvp in discPlayers)
+ {
+ TryAddRouteActionSigs(JoinMap.Display1DiscPlayerSourceStart.AttributeName + " " + i, JoinMap.Display1DiscPlayerSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
+ i++;
+ if (i > 5) // We only have five spots
+ break;
+ }
+
+ var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop);
+ i = 1;
+ foreach (var kvp in laptops)
+ {
+ TryAddRouteActionSigs(JoinMap.Display1LaptopSourceStart.AttributeName + " " + i, JoinMap.Display1LaptopSourceStart.JoinNumber + i, kvp.Key, kvp.Value.SourceDevice);
+ i++;
+ if (i > JoinMap.Display1LaptopSourceStart.JoinSpan) // We only have ten spots???
+ break;
+ }
+
+ foreach (var kvp in dict)
+ {
+ var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
+
+ if (usageDevice != null)
+ {
+ usageDevice.UsageTracker = new UsageTracking(usageDevice as Device);
+ usageDevice.UsageTracker.UsageIsTracked = true;
+ usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler(UsageTracker_DeviceUsageEnded);
+ }
+ }
+
+ }
+ else
+ {
+ Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
+ (Room as IEssentialsHuddleVtc1Room).SourceListKey, Room.Key);
+ }
+ }
+
+ protected override void SetUpDisplay()
+ {
+ try
+ {
+ //Setup Display Usage Monitoring
+
+ var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase);
+
+ // Consider updating this in multiple display systems
+
+ foreach (DisplayBase display in displays)
+ {
+ display.UsageTracker = new UsageTracking(display);
+ display.UsageTracker.UsageIsTracked = true;
+ display.UsageTracker.DeviceUsageEnded += new EventHandler(UsageTracker_DeviceUsageEnded);
+ }
+
+ var defaultDisplay = (Room as IEssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
+ if (defaultDisplay == null)
+ {
+ Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
+ return;
+ }
+
+ var dispPowerOnAction = new Action(b => { if (!b) defaultDisplay.PowerOn(); });
+ var dispPowerOffAction = new Action(b => { if (!b) defaultDisplay.PowerOff(); });
+
+ // Display to fusion room sigs
+ FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
+ FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
+
+ var defaultDisplayTwoWay = defaultDisplay as IHasPowerControlWithFeedback;
+ if (defaultDisplayTwoWay != null)
+ {
+ defaultDisplayTwoWay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
+ }
+
+ if (defaultDisplay is IDisplayUsage)
+ (defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
+
+ MapDisplayToRoomJoins(1, JoinMap.Display1Start.JoinNumber, defaultDisplay);
+
+ var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
+
+ //Check for existing asset in GUIDs collection
+
+ var tempAsset = new FusionAsset();
+
+ if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
+ {
+ tempAsset = FusionStaticAssets[deviceConfig.Uid];
+ }
+ else
+ {
+ // Create a new asset
+ tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), defaultDisplay.Name, "Display", "");
+ FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
+ }
+
+ var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
+ dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
+ dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
+
+
+ var defaultTwoWayDisplay = defaultDisplay as IHasPowerControlWithFeedback;
+ if (defaultTwoWayDisplay != null)
+ {
+ defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
+ if (defaultDisplay is IDisplayUsage)
+ (defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
+
+ defaultTwoWayDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
+ }
+
+ // Use extension methods
+ dispAsset.TrySetMakeModel(defaultDisplay);
+ dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error setting up display in Fusion: {0}", e);
+ }
+
+ }
+
+ protected override void MapDisplayToRoomJoins(int displayIndex, uint joinOffset, DisplayBase display)
+ {
+ string displayName = string.Format("Display {0} - ", displayIndex);
+
+
+ if (display == (Room as IEssentialsHuddleVtc1Room).DefaultDisplay)
+ {
+ // Power on
+ var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
+ defaultDisplayPowerOn.OutputSig.UserObject = new Action(b => { if (!b) display.PowerOn(); });
+
+ // Power Off
+ var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
+ defaultDisplayPowerOn.OutputSig.UserObject = new Action(b => { if (!b) display.PowerOff(); }); ;
+
+ var displayTwoWay = display as IHasPowerControlWithFeedback;
+ if (displayTwoWay != null)
+ {
+ displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
+ displayTwoWay.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
+ }
+
+ // Current Source
+ var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
+ defaultDisplaySourceNone.OutputSig.UserObject = new Action(b => { if (!b) (Room as IEssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Fusion/EssentialsTechRoomFusionSystemController.cs b/src/PepperDashEssentials/Fusion/EssentialsTechRoomFusionSystemController.cs
similarity index 100%
rename from PepperDashEssentials/Fusion/EssentialsTechRoomFusionSystemController.cs
rename to src/PepperDashEssentials/Fusion/EssentialsTechRoomFusionSystemController.cs
diff --git a/PepperDashEssentials/Fusion/FusionSystemController.cs.orig b/src/PepperDashEssentials/Fusion/FusionSystemController.cs.orig
similarity index 100%
rename from PepperDashEssentials/Fusion/FusionSystemController.cs.orig
rename to src/PepperDashEssentials/Fusion/FusionSystemController.cs.orig
diff --git a/PepperDashEssentials/PepperDash Essentials TSW-760.sgd b/src/PepperDashEssentials/PepperDash Essentials TSW-760.sgd
similarity index 100%
rename from PepperDashEssentials/PepperDash Essentials TSW-760.sgd
rename to src/PepperDashEssentials/PepperDash Essentials TSW-760.sgd
diff --git a/PepperDashEssentials/PepperDash Essentials iPad.sgd b/src/PepperDashEssentials/PepperDash Essentials iPad.sgd
similarity index 100%
rename from PepperDashEssentials/PepperDash Essentials iPad.sgd
rename to src/PepperDashEssentials/PepperDash Essentials iPad.sgd
diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/src/PepperDashEssentials/PepperDashEssentials.csproj
similarity index 97%
rename from PepperDashEssentials/PepperDashEssentials.csproj
rename to src/PepperDashEssentials/PepperDashEssentials.csproj
index 66a20f72..d3fe8d02 100644
--- a/PepperDashEssentials/PepperDashEssentials.csproj
+++ b/src/PepperDashEssentials/PepperDashEssentials.csproj
@@ -1,233 +1,233 @@
-
-
- Release
- AnyCPU
- 9.0.30729
- 2.0
- {1BED5BA9-88C4-4365-9362-6F4B128071D3}
- Library
- Properties
- PepperDashEssentials
- PepperDashEssentials
- {0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- WindowsCE
- E2BECB1F-8C8C-41ba-B736-9BE7D946A398
- 5.0
- SmartDeviceProject1
- v3.5
- Windows CE
-
-
-
-
- .allowedReferenceRelatedFileExtensions
- true
- full
- false
- bin\
- DEBUG;TRACE;
- prompt
- 4
- 512
- true
- true
- off
-
-
- .allowedReferenceRelatedFileExtensions
- none
- true
- bin\
- prompt
- 4
- 512
- true
- true
- off
-
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll
-
-
-
- False
- ..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll
-
-
- False
- ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Always
-
-
- Always
-
-
- Always
-
-
- Always
-
-
-
- Always
-
-
- Always
-
-
- Always
-
-
-
-
- {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
- PepperDash_Essentials_Core
-
-
- {892B761C-E479-44CE-BD74-243E9214AF13}
- Essentials Devices Common
-
-
- {9199CE8A-0C9F-4952-8672-3EED798B284F}
- PepperDash_Essentials_DM
-
-
-
-
-
-
-
-
- rem S# Pro preparation will execute after these operations
-
+
+
+ Release
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {1BED5BA9-88C4-4365-9362-6F4B128071D3}
+ Library
+ Properties
+ PepperDashEssentials
+ PepperDashEssentials
+ {0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ WindowsCE
+ E2BECB1F-8C8C-41ba-B736-9BE7D946A398
+ 5.0
+ SmartDeviceProject1
+ v3.5
+ Windows CE
+
+
+
+
+ .allowedReferenceRelatedFileExtensions
+ true
+ full
+ false
+ bin\
+ DEBUG;TRACE;
+ prompt
+ 4
+ 512
+ true
+ true
+ off
+
+
+ .allowedReferenceRelatedFileExtensions
+ none
+ true
+ bin\
+ prompt
+ 4
+ 512
+ true
+ true
+ off
+
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll
+
+
+
+ False
+ ..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll
+
+
+ False
+ ..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+
+ Always
+
+
+ Always
+
+
+ Always
+
+
+
+
+ {A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}
+ PepperDash_Essentials_Core
+
+
+ {892B761C-E479-44CE-BD74-243E9214AF13}
+ Essentials Devices Common
+
+
+ {9199CE8A-0C9F-4952-8672-3EED798B284F}
+ PepperDash_Essentials_DM
+
+
+
+
+
+
+
+
+ rem S# Pro preparation will execute after these operations
+
\ No newline at end of file
diff --git a/PepperDashEssentials/PluginLoading/PluginLoading.cs b/src/PepperDashEssentials/PluginLoading/PluginLoading.cs
similarity index 100%
rename from PepperDashEssentials/PluginLoading/PluginLoading.cs
rename to src/PepperDashEssentials/PluginLoading/PluginLoading.cs
diff --git a/PepperDashEssentials/Properties/AssemblyInfo.cs b/src/PepperDashEssentials/Properties/AssemblyInfo.cs
similarity index 100%
rename from PepperDashEssentials/Properties/AssemblyInfo.cs
rename to src/PepperDashEssentials/Properties/AssemblyInfo.cs
diff --git a/PepperDashEssentials/Properties/AssemblyInfo.cs.orig b/src/PepperDashEssentials/Properties/AssemblyInfo.cs.orig
similarity index 100%
rename from PepperDashEssentials/Properties/AssemblyInfo.cs.orig
rename to src/PepperDashEssentials/Properties/AssemblyInfo.cs.orig
diff --git a/PepperDashEssentials/Properties/ControlSystem.cfg b/src/PepperDashEssentials/Properties/ControlSystem.cfg
similarity index 97%
rename from PepperDashEssentials/Properties/ControlSystem.cfg
rename to src/PepperDashEssentials/Properties/ControlSystem.cfg
index 384bf949..63f26150 100644
--- a/PepperDashEssentials/Properties/ControlSystem.cfg
+++ b/src/PepperDashEssentials/Properties/ControlSystem.cfg
@@ -1,7 +1,7 @@
-
-
- Test RMC3
- auto 192.168.1.40;username crestron
- Program01
- Internal Flash
+
+
+ Test RMC3
+ auto 192.168.1.40;username crestron
+ Program01
+ Internal Flash
\ No newline at end of file
diff --git a/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1 b/src/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1
similarity index 100%
rename from PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1
rename to src/PepperDashEssentials/Properties/UpdateAssemblyVersion.ps1
diff --git a/PepperDashEssentials/Room/Config/EssentialsDualDisplayRoomPropertiesConfig.cs b/src/PepperDashEssentials/Room/Config/EssentialsDualDisplayRoomPropertiesConfig.cs
similarity index 100%
rename from PepperDashEssentials/Room/Config/EssentialsDualDisplayRoomPropertiesConfig.cs
rename to src/PepperDashEssentials/Room/Config/EssentialsDualDisplayRoomPropertiesConfig.cs
diff --git a/PepperDashEssentials/Room/Config/EssentialsHuddleRoomPropertiesConfig.cs b/src/PepperDashEssentials/Room/Config/EssentialsHuddleRoomPropertiesConfig.cs
similarity index 100%
rename from PepperDashEssentials/Room/Config/EssentialsHuddleRoomPropertiesConfig.cs
rename to src/PepperDashEssentials/Room/Config/EssentialsHuddleRoomPropertiesConfig.cs
diff --git a/PepperDashEssentials/Room/Config/EssentialsHuddleVtc1PropertiesConfig.cs b/src/PepperDashEssentials/Room/Config/EssentialsHuddleVtc1PropertiesConfig.cs
similarity index 100%
rename from PepperDashEssentials/Room/Config/EssentialsHuddleVtc1PropertiesConfig.cs
rename to src/PepperDashEssentials/Room/Config/EssentialsHuddleVtc1PropertiesConfig.cs
diff --git a/PepperDashEssentials/Room/Config/EssentialsNDisplayRoomPropertiesConfig.cs b/src/PepperDashEssentials/Room/Config/EssentialsNDisplayRoomPropertiesConfig.cs
similarity index 100%
rename from PepperDashEssentials/Room/Config/EssentialsNDisplayRoomPropertiesConfig.cs
rename to src/PepperDashEssentials/Room/Config/EssentialsNDisplayRoomPropertiesConfig.cs
diff --git a/PepperDashEssentials/Room/Config/EssentialsPresentationPropertiesConfig.cs b/src/PepperDashEssentials/Room/Config/EssentialsPresentationPropertiesConfig.cs
similarity index 100%
rename from PepperDashEssentials/Room/Config/EssentialsPresentationPropertiesConfig.cs
rename to src/PepperDashEssentials/Room/Config/EssentialsPresentationPropertiesConfig.cs
diff --git a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/src/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs
similarity index 96%
rename from PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs
rename to src/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs
index 38067528..1739a45f 100644
--- a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs
+++ b/src/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs
@@ -1,411 +1,411 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-using Crestron.SimplSharp;
-using Newtonsoft.Json;
-
-using PepperDash.Core;
-using PepperDash.Essentials;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-
-namespace PepperDash.Essentials.Room.Config
-{
- public class EssentialsRoomConfigHelper
- {
- ///
- /// Returns a room object from this config data
- ///
- ///
- public static IKeyed GetRoomObject(DeviceConfig roomConfig)
- {
- var typeName = roomConfig.Type.ToLower();
-
- switch (typeName)
- {
- case "huddle" :
- {
- return new EssentialsHuddleSpaceRoom(roomConfig);
- }
- case "huddlevtc1" :
- {
- return new EssentialsHuddleVtc1Room(roomConfig);
- }
- case "ddvc01bridge" :
- {
- return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
- }
- case "dualdisplay" :
- {
- return new EssentialsDualDisplayRoom(roomConfig);
- }
- case "combinedhuddlevtc1" :
- {
- return new EssentialsCombinedHuddleVtc1Room(roomConfig);
- }
- case "techroom" :
- {
- return new EssentialsTechRoom(roomConfig);
- }
- default :
- {
- return Core.DeviceFactory.GetDevice(roomConfig);
- }
- }
- }
-
- ///
- /// Gets and operating, standalone emergegncy object that can be plugged into a room.
- /// Returns null if there is no emergency defined
- ///
- public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room)
- {
- // This emergency
- var emergency = props.Emergency;
- if (emergency != null)
- {
- //switch on emergency type here. Right now only contact and shutdown
- var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room);
- DeviceManager.AddDevice(e);
- }
- return null;
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public static Core.Privacy.MicrophonePrivacyController GetMicrophonePrivacy(
- EssentialsRoomPropertiesConfig props, IPrivacy room)
- {
- var microphonePrivacy = props.MicrophonePrivacy;
- if (microphonePrivacy == null)
- {
- Debug.Console(0, "Cannot create microphone privacy with null properties");
- return null;
- }
- // Get the MicrophonePrivacy device from the device manager
- var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as
- Core.Privacy.MicrophonePrivacyController);
- // Set this room as the IPrivacy device
- if (mP == null)
- {
- Debug.Console(0, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
- return null;
- }
- mP.SetPrivacyDevice(room);
-
- var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
-
- if (behaviour == null)
- {
- Debug.Console(0, "WARNING: No behaviour defined for MicrophonePrivacyController");
- return null;
- }
- if (behaviour == "trackroomstate")
- {
- // Tie LED enable to room power state
- var essRoom = room as IEssentialsRoom;
- essRoom.OnFeedback.OutputChange += (o, a) =>
- {
- if (essRoom.OnFeedback.BoolValue)
- mP.EnableLeds = true;
- else
- mP.EnableLeds = false;
- };
-
- mP.EnableLeds = essRoom.OnFeedback.BoolValue;
- }
- else if (behaviour == "trackcallstate")
- {
- // Tie LED enable to room power state
- var inCallRoom = room as IHasInCallFeedback;
- inCallRoom.InCallFeedback.OutputChange += (o, a) =>
- {
- if (inCallRoom.InCallFeedback.BoolValue)
- mP.EnableLeds = true;
- else
- mP.EnableLeds = false;
- };
-
- mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
- }
-
- return mP;
- }
-
- }
-
- ///
- ///
- ///
- public class EssentialsRoomPropertiesConfig
- {
- [JsonProperty("addresses")]
- public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
-
- [JsonProperty("description")]
- public string Description { get; set; }
-
- [JsonProperty("emergency")]
- public EssentialsRoomEmergencyConfig Emergency { get; set; }
-
- [JsonProperty("help")]
- public EssentialsHelpPropertiesConfig Help { get; set; }
-
- [JsonProperty("helpMessage")]
- public string HelpMessage { get; set; }
-
- ///
- /// Read this value to get the help message. It checks for the old and new config format.
- ///
- public string HelpMessageForDisplay
- {
- get
- {
- if(Help != null && !string.IsNullOrEmpty(Help.Message))
- {
- return Help.Message;
- }
- else
- {
- return HelpMessage;
- }
- }
- }
-
- [JsonProperty("environment")]
- public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
-
- [JsonProperty("logo")]
- public EssentialsLogoPropertiesConfig LogoLight { get; set; }
-
- [JsonProperty("logoDark")]
- public EssentialsLogoPropertiesConfig LogoDark { get; set; }
-
- [JsonProperty("microphonePrivacy")]
- public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
-
- [JsonProperty("occupancy")]
- public EssentialsRoomOccSensorConfig Occupancy { get; set; }
-
- [JsonProperty("oneButtonMeeting")]
- public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
-
- [JsonProperty("shutdownVacancySeconds")]
- public int ShutdownVacancySeconds { get; set; }
-
- [JsonProperty("shutdownPromptSeconds")]
- public int ShutdownPromptSeconds { get; set; }
-
- [JsonProperty("tech")]
- public EssentialsRoomTechConfig Tech { get; set; }
-
- [JsonProperty("volumes")]
- public EssentialsRoomVolumesConfig Volumes { get; set; }
-
- [JsonProperty("fusion")]
- public EssentialsRoomFusionConfig Fusion { get; set; }
-
- [JsonProperty("essentialsRoomUiBehaviorConfig", NullValueHandling=NullValueHandling.Ignore)]
- public EssentialsRoomUiBehaviorConfig UiBehavior { get; set; }
-
- [JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
- public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
-
- ///
- /// Indicates if this room represents a combination of other rooms
- ///
- [JsonProperty("isRoomCombinationScenario")]
- public bool IsRoomCombinationScenario { get; set; }
-
- public EssentialsRoomPropertiesConfig()
- {
- LogoLight = new EssentialsLogoPropertiesConfig();
- LogoDark = new EssentialsLogoPropertiesConfig();
- }
- }
-
- public class EssentialsRoomUiBehaviorConfig
- {
- [JsonProperty("disableActivityButtonsWhileWarmingCooling")]
- public bool DisableActivityButtonsWhileWarmingCooling { get; set; }
- }
-
- public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
- {
- [JsonProperty("defaultAudioKey")]
- public string DefaultAudioKey { get; set; }
- [JsonProperty("sourceListKey")]
- public string SourceListKey { get; set; }
- [JsonProperty("destinationListKey")]
- public string DestinationListKey { get; set; }
- [JsonProperty("defaultSourceItem")]
- public string DefaultSourceItem { get; set; }
- ///
- /// Indicates if the room supports advanced sharing
- ///
- [JsonProperty("supportsAdvancedSharing")]
- public bool SupportsAdvancedSharing { get; set; }
- ///
- /// Indicates if non-tech users can change the share mode
- ///
- [JsonProperty("userCanChangeShareMode")]
- public bool UserCanChangeShareMode { get; set; }
- }
-
- public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
- {
- [JsonProperty("videoCodecKey")]
- public string VideoCodecKey { get; set; }
- [JsonProperty("audioCodecKey")]
- public string AudioCodecKey { get; set; }
- }
-
- public class EssentialsEnvironmentPropertiesConfig
- {
- public bool Enabled { get; set; }
-
- [JsonProperty("deviceKeys")]
- public List DeviceKeys { get; set; }
-
- public EssentialsEnvironmentPropertiesConfig()
- {
- DeviceKeys = new List();
- }
-
- }
-
- public class EssentialsRoomFusionConfig
- {
- public uint IpIdInt
- {
- get
- {
- try
- {
- return Convert.ToUInt32(IpId, 16);
- }
- catch (Exception)
- {
- throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
- }
-
- }
- }
-
- [JsonProperty("ipId")]
- public string IpId { get; set; }
-
- [JsonProperty("joinMapKey")]
- public string JoinMapKey { get; set; }
-
- }
-
- public class EssentialsRoomMicrophonePrivacyConfig
- {
- [JsonProperty("deviceKey")]
- public string DeviceKey { get; set; }
-
- [JsonProperty("behaviour")]
- public string Behaviour { get; set; }
- }
-
- ///
- /// Properties for the help text box
- ///
- public class EssentialsHelpPropertiesConfig
- {
- [JsonProperty("message")]
- public string Message { get; set; }
-
- [JsonProperty("showCallButton")]
- public bool ShowCallButton { get; set; }
-
- ///
- /// Defaults to "Call Help Desk"
- ///
- [JsonProperty("callButtonText")]
- public string CallButtonText { get; set; }
-
- public EssentialsHelpPropertiesConfig()
- {
- CallButtonText = "Call Help Desk";
- }
- }
-
- ///
- ///
- ///
- public class EssentialsOneButtonMeetingPropertiesConfig
- {
- [JsonProperty("enable")]
- public bool Enable { get; set; }
- }
-
- public class EssentialsRoomAddressPropertiesConfig
- {
- [JsonProperty("phoneNumber")]
- public string PhoneNumber { get; set; }
-
- [JsonProperty("sipAddress")]
- public string SipAddress { get; set; }
- }
-
-
- ///
- /// Properties for the room's logo on panels
- ///
- public class EssentialsLogoPropertiesConfig
- {
- [JsonProperty("type")]
- public string Type { get; set; }
-
- [JsonProperty("url")]
- public string Url { get; set; }
- ///
- /// Gets either the custom URL, a local-to-processor URL, or null if it's a default logo
- ///
- public string GetLogoUrlLight()
- {
- if (Type == "url")
- return Url;
- if (Type == "system")
- return string.Format("http://{0}:8080/logo.png",
- CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
- return null;
- }
-
- public string GetLogoUrlDark()
- {
- if (Type == "url")
- return Url;
- if (Type == "system")
- return string.Format("http://{0}:8080/logo-dark.png",
- CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
- return null;
- }
- }
-
- ///
- /// Represents occupancy sensor(s) setup for a room
- ///
- public class EssentialsRoomOccSensorConfig
- {
- [JsonProperty("deviceKey")]
- public string DeviceKey { get; set; }
-
- [JsonProperty("timeoutMinutes")]
- public int TimeoutMinutes { get; set; }
- }
-
- public class EssentialsRoomTechConfig
- {
- [JsonProperty("password")]
- public string Password { get; set; }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.Room.Config
+{
+ public class EssentialsRoomConfigHelper
+ {
+ ///
+ /// Returns a room object from this config data
+ ///
+ ///
+ public static IKeyed GetRoomObject(DeviceConfig roomConfig)
+ {
+ var typeName = roomConfig.Type.ToLower();
+
+ switch (typeName)
+ {
+ case "huddle" :
+ {
+ return new EssentialsHuddleSpaceRoom(roomConfig);
+ }
+ case "huddlevtc1" :
+ {
+ return new EssentialsHuddleVtc1Room(roomConfig);
+ }
+ case "ddvc01bridge" :
+ {
+ return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
+ }
+ case "dualdisplay" :
+ {
+ return new EssentialsDualDisplayRoom(roomConfig);
+ }
+ case "combinedhuddlevtc1" :
+ {
+ return new EssentialsCombinedHuddleVtc1Room(roomConfig);
+ }
+ case "techroom" :
+ {
+ return new EssentialsTechRoom(roomConfig);
+ }
+ default :
+ {
+ return Core.DeviceFactory.GetDevice(roomConfig);
+ }
+ }
+ }
+
+ ///
+ /// Gets and operating, standalone emergegncy object that can be plugged into a room.
+ /// Returns null if there is no emergency defined
+ ///
+ public static EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, IEssentialsRoom room)
+ {
+ // This emergency
+ var emergency = props.Emergency;
+ if (emergency != null)
+ {
+ //switch on emergency type here. Right now only contact and shutdown
+ var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room);
+ DeviceManager.AddDevice(e);
+ }
+ return null;
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static Core.Privacy.MicrophonePrivacyController GetMicrophonePrivacy(
+ EssentialsRoomPropertiesConfig props, IPrivacy room)
+ {
+ var microphonePrivacy = props.MicrophonePrivacy;
+ if (microphonePrivacy == null)
+ {
+ Debug.Console(0, "Cannot create microphone privacy with null properties");
+ return null;
+ }
+ // Get the MicrophonePrivacy device from the device manager
+ var mP = (DeviceManager.GetDeviceForKey(props.MicrophonePrivacy.DeviceKey) as
+ Core.Privacy.MicrophonePrivacyController);
+ // Set this room as the IPrivacy device
+ if (mP == null)
+ {
+ Debug.Console(0, "ERROR: Selected device {0} is not MicrophonePrivacyController", props.MicrophonePrivacy.DeviceKey);
+ return null;
+ }
+ mP.SetPrivacyDevice(room);
+
+ var behaviour = props.MicrophonePrivacy.Behaviour.ToLower();
+
+ if (behaviour == null)
+ {
+ Debug.Console(0, "WARNING: No behaviour defined for MicrophonePrivacyController");
+ return null;
+ }
+ if (behaviour == "trackroomstate")
+ {
+ // Tie LED enable to room power state
+ var essRoom = room as IEssentialsRoom;
+ essRoom.OnFeedback.OutputChange += (o, a) =>
+ {
+ if (essRoom.OnFeedback.BoolValue)
+ mP.EnableLeds = true;
+ else
+ mP.EnableLeds = false;
+ };
+
+ mP.EnableLeds = essRoom.OnFeedback.BoolValue;
+ }
+ else if (behaviour == "trackcallstate")
+ {
+ // Tie LED enable to room power state
+ var inCallRoom = room as IHasInCallFeedback;
+ inCallRoom.InCallFeedback.OutputChange += (o, a) =>
+ {
+ if (inCallRoom.InCallFeedback.BoolValue)
+ mP.EnableLeds = true;
+ else
+ mP.EnableLeds = false;
+ };
+
+ mP.EnableLeds = inCallRoom.InCallFeedback.BoolValue;
+ }
+
+ return mP;
+ }
+
+ }
+
+ ///
+ ///
+ ///
+ public class EssentialsRoomPropertiesConfig
+ {
+ [JsonProperty("addresses")]
+ public EssentialsRoomAddressPropertiesConfig Addresses { get; set; }
+
+ [JsonProperty("description")]
+ public string Description { get; set; }
+
+ [JsonProperty("emergency")]
+ public EssentialsRoomEmergencyConfig Emergency { get; set; }
+
+ [JsonProperty("help")]
+ public EssentialsHelpPropertiesConfig Help { get; set; }
+
+ [JsonProperty("helpMessage")]
+ public string HelpMessage { get; set; }
+
+ ///
+ /// Read this value to get the help message. It checks for the old and new config format.
+ ///
+ public string HelpMessageForDisplay
+ {
+ get
+ {
+ if(Help != null && !string.IsNullOrEmpty(Help.Message))
+ {
+ return Help.Message;
+ }
+ else
+ {
+ return HelpMessage;
+ }
+ }
+ }
+
+ [JsonProperty("environment")]
+ public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
+
+ [JsonProperty("logo")]
+ public EssentialsLogoPropertiesConfig LogoLight { get; set; }
+
+ [JsonProperty("logoDark")]
+ public EssentialsLogoPropertiesConfig LogoDark { get; set; }
+
+ [JsonProperty("microphonePrivacy")]
+ public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
+
+ [JsonProperty("occupancy")]
+ public EssentialsRoomOccSensorConfig Occupancy { get; set; }
+
+ [JsonProperty("oneButtonMeeting")]
+ public EssentialsOneButtonMeetingPropertiesConfig OneButtonMeeting { get; set; }
+
+ [JsonProperty("shutdownVacancySeconds")]
+ public int ShutdownVacancySeconds { get; set; }
+
+ [JsonProperty("shutdownPromptSeconds")]
+ public int ShutdownPromptSeconds { get; set; }
+
+ [JsonProperty("tech")]
+ public EssentialsRoomTechConfig Tech { get; set; }
+
+ [JsonProperty("volumes")]
+ public EssentialsRoomVolumesConfig Volumes { get; set; }
+
+ [JsonProperty("fusion")]
+ public EssentialsRoomFusionConfig Fusion { get; set; }
+
+ [JsonProperty("essentialsRoomUiBehaviorConfig", NullValueHandling=NullValueHandling.Ignore)]
+ public EssentialsRoomUiBehaviorConfig UiBehavior { get; set; }
+
+ [JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
+ public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
+
+ ///
+ /// Indicates if this room represents a combination of other rooms
+ ///
+ [JsonProperty("isRoomCombinationScenario")]
+ public bool IsRoomCombinationScenario { get; set; }
+
+ public EssentialsRoomPropertiesConfig()
+ {
+ LogoLight = new EssentialsLogoPropertiesConfig();
+ LogoDark = new EssentialsLogoPropertiesConfig();
+ }
+ }
+
+ public class EssentialsRoomUiBehaviorConfig
+ {
+ [JsonProperty("disableActivityButtonsWhileWarmingCooling")]
+ public bool DisableActivityButtonsWhileWarmingCooling { get; set; }
+ }
+
+ public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
+ {
+ [JsonProperty("defaultAudioKey")]
+ public string DefaultAudioKey { get; set; }
+ [JsonProperty("sourceListKey")]
+ public string SourceListKey { get; set; }
+ [JsonProperty("destinationListKey")]
+ public string DestinationListKey { get; set; }
+ [JsonProperty("defaultSourceItem")]
+ public string DefaultSourceItem { get; set; }
+ ///
+ /// Indicates if the room supports advanced sharing
+ ///
+ [JsonProperty("supportsAdvancedSharing")]
+ public bool SupportsAdvancedSharing { get; set; }
+ ///
+ /// Indicates if non-tech users can change the share mode
+ ///
+ [JsonProperty("userCanChangeShareMode")]
+ public bool UserCanChangeShareMode { get; set; }
+ }
+
+ public class EssentialsConferenceRoomPropertiesConfig : EssentialsAvRoomPropertiesConfig
+ {
+ [JsonProperty("videoCodecKey")]
+ public string VideoCodecKey { get; set; }
+ [JsonProperty("audioCodecKey")]
+ public string AudioCodecKey { get; set; }
+ }
+
+ public class EssentialsEnvironmentPropertiesConfig
+ {
+ public bool Enabled { get; set; }
+
+ [JsonProperty("deviceKeys")]
+ public List DeviceKeys { get; set; }
+
+ public EssentialsEnvironmentPropertiesConfig()
+ {
+ DeviceKeys = new List();
+ }
+
+ }
+
+ public class EssentialsRoomFusionConfig
+ {
+ public uint IpIdInt
+ {
+ get
+ {
+ try
+ {
+ return Convert.ToUInt32(IpId, 16);
+ }
+ catch (Exception)
+ {
+ throw new FormatException(string.Format("ERROR:Unable to convert IP ID: {0} to hex. Error:\n{1}", IpId));
+ }
+
+ }
+ }
+
+ [JsonProperty("ipId")]
+ public string IpId { get; set; }
+
+ [JsonProperty("joinMapKey")]
+ public string JoinMapKey { get; set; }
+
+ }
+
+ public class EssentialsRoomMicrophonePrivacyConfig
+ {
+ [JsonProperty("deviceKey")]
+ public string DeviceKey { get; set; }
+
+ [JsonProperty("behaviour")]
+ public string Behaviour { get; set; }
+ }
+
+ ///
+ /// Properties for the help text box
+ ///
+ public class EssentialsHelpPropertiesConfig
+ {
+ [JsonProperty("message")]
+ public string Message { get; set; }
+
+ [JsonProperty("showCallButton")]
+ public bool ShowCallButton { get; set; }
+
+ ///
+ /// Defaults to "Call Help Desk"
+ ///
+ [JsonProperty("callButtonText")]
+ public string CallButtonText { get; set; }
+
+ public EssentialsHelpPropertiesConfig()
+ {
+ CallButtonText = "Call Help Desk";
+ }
+ }
+
+ ///
+ ///
+ ///
+ public class EssentialsOneButtonMeetingPropertiesConfig
+ {
+ [JsonProperty("enable")]
+ public bool Enable { get; set; }
+ }
+
+ public class EssentialsRoomAddressPropertiesConfig
+ {
+ [JsonProperty("phoneNumber")]
+ public string PhoneNumber { get; set; }
+
+ [JsonProperty("sipAddress")]
+ public string SipAddress { get; set; }
+ }
+
+
+ ///
+ /// Properties for the room's logo on panels
+ ///
+ public class EssentialsLogoPropertiesConfig
+ {
+ [JsonProperty("type")]
+ public string Type { get; set; }
+
+ [JsonProperty("url")]
+ public string Url { get; set; }
+ ///
+ /// Gets either the custom URL, a local-to-processor URL, or null if it's a default logo
+ ///
+ public string GetLogoUrlLight()
+ {
+ if (Type == "url")
+ return Url;
+ if (Type == "system")
+ return string.Format("http://{0}:8080/logo.png",
+ CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
+ return null;
+ }
+
+ public string GetLogoUrlDark()
+ {
+ if (Type == "url")
+ return Url;
+ if (Type == "system")
+ return string.Format("http://{0}:8080/logo-dark.png",
+ CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
+ return null;
+ }
+ }
+
+ ///
+ /// Represents occupancy sensor(s) setup for a room
+ ///
+ public class EssentialsRoomOccSensorConfig
+ {
+ [JsonProperty("deviceKey")]
+ public string DeviceKey { get; set; }
+
+ [JsonProperty("timeoutMinutes")]
+ public int TimeoutMinutes { get; set; }
+ }
+
+ public class EssentialsRoomTechConfig
+ {
+ [JsonProperty("password")]
+ public string Password { get; set; }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Config/EssentialsRoomEmergencyConfig.cs b/src/PepperDashEssentials/Room/Config/EssentialsRoomEmergencyConfig.cs
similarity index 100%
rename from PepperDashEssentials/Room/Config/EssentialsRoomEmergencyConfig.cs
rename to src/PepperDashEssentials/Room/Config/EssentialsRoomEmergencyConfig.cs
diff --git a/PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs b/src/PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
similarity index 100%
rename from PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
rename to src/PepperDashEssentials/Room/Config/EssentialsTechRoomConfig.cs
diff --git a/PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs b/src/PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs
similarity index 100%
rename from PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs
rename to src/PepperDashEssentials/Room/Config/SimplRoomPropertiesConfig.cs
diff --git a/PepperDashEssentials/Room/Emergency/EsentialsRoomEmergencyContactClosure.cs b/src/PepperDashEssentials/Room/Emergency/EsentialsRoomEmergencyContactClosure.cs
similarity index 100%
rename from PepperDashEssentials/Room/Emergency/EsentialsRoomEmergencyContactClosure.cs
rename to src/PepperDashEssentials/Room/Emergency/EsentialsRoomEmergencyContactClosure.cs
diff --git a/PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs b/src/PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs
similarity index 99%
rename from PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs
rename to src/PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs
index cbe1b579..0256d35f 100644
--- a/PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs
+++ b/src/PepperDashEssentials/Room/Types/EssentialsCombinedHuddleVtc1Room.cs
@@ -297,8 +297,8 @@ namespace PepperDash.Essentials
{
//DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
- var destinationList = ConfigReader.ConfigObject.DestinationLists[PropertiesConfig.DestinationListKey];
-
+ var destinationList = ConfigReader.ConfigObject.DestinationLists[PropertiesConfig.DestinationListKey];
+
Displays.Clear();
foreach (var destination in destinationList)
@@ -316,48 +316,48 @@ namespace PepperDash.Essentials
// Link power, warming, cooling to display
var dispTwoWay = display as IHasPowerControlWithFeedback;
if (dispTwoWay != null)
- {
- dispTwoWay.PowerIsOnFeedback.OutputChange -= PowerIsOnFeedback_OutputChange;
- dispTwoWay.PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
-
- if (dispTwoWay.PowerIsOnFeedback.BoolValue)
- {
- SetDefaultLevels();
+ {
+ dispTwoWay.PowerIsOnFeedback.OutputChange -= PowerIsOnFeedback_OutputChange;
+ dispTwoWay.PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
+
+ if (dispTwoWay.PowerIsOnFeedback.BoolValue)
+ {
+ SetDefaultLevels();
}
- }
-
- display.IsWarmingUpFeedback.OutputChange -= IsWarmingUpFeedback_OutputChange;
- display.IsWarmingUpFeedback.OutputChange += IsWarmingUpFeedback_OutputChange;
-
- display.IsCoolingDownFeedback.OutputChange -= IsCoolingDownFeedback_OutputChange;
+ }
+
+ display.IsWarmingUpFeedback.OutputChange -= IsWarmingUpFeedback_OutputChange;
+ display.IsWarmingUpFeedback.OutputChange += IsWarmingUpFeedback_OutputChange;
+
+ display.IsCoolingDownFeedback.OutputChange -= IsCoolingDownFeedback_OutputChange;
display.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange;
}
}
- }
-
- void IsCoolingDownFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- IsCoolingDownFeedback.FireUpdate();
- }
-
- void IsWarmingUpFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- IsWarmingUpFeedback.FireUpdate();
- if (!IsWarmingUpFeedback.BoolValue)
- (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
- }
-
- void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- var dispTwoWay = sender as IHasPowerControlWithFeedback;
-
- if (dispTwoWay != null && dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
- {
- //if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
- // CurrentSourceInfo = null;
- OnFeedback.FireUpdate();
- }
+ }
+
+ void IsCoolingDownFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ IsCoolingDownFeedback.FireUpdate();
+ }
+
+ void IsWarmingUpFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ IsWarmingUpFeedback.FireUpdate();
+ if (!IsWarmingUpFeedback.BoolValue)
+ (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
+ }
+
+ void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ var dispTwoWay = sender as IHasPowerControlWithFeedback;
+
+ if (dispTwoWay != null && dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
+ {
+ //if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
+ // CurrentSourceInfo = null;
+ OnFeedback.FireUpdate();
+ }
}
@@ -373,8 +373,8 @@ namespace PepperDash.Essentials
else
{
SetSourceListKey(Key);
- }
-
+ }
+
SetUpVideoCodec();
}
@@ -386,149 +386,149 @@ namespace PepperDash.Essentials
PropertiesConfig = newPropertiesConfig;
ConfigWriter.UpdateRoomConfig(config);
- }
-
- public override bool Deactivate()
- {
- // Stop listining to this event when room deactivated
- VideoCodec.IsReadyChange -= VideoCodec_IsReadyChange;
-
- // Clear occupancy
- RoomOccupancy = null;
-
- Debug.Console(0, this, "Room '{0}' Deactivated", Name);
-
- return base.Deactivate();
+ }
+
+ public override bool Deactivate()
+ {
+ // Stop listining to this event when room deactivated
+ VideoCodec.IsReadyChange -= VideoCodec_IsReadyChange;
+
+ // Clear occupancy
+ RoomOccupancy = null;
+
+ Debug.Console(0, this, "Room '{0}' Deactivated", Name);
+
+ return base.Deactivate();
}
public override bool CustomActivate()
- {
- try
- {
- if (DefaultAudioDevice is IBasicVolumeControls)
- DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
- else if (DefaultAudioDevice is IHasVolumeDevice)
- DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
- CurrentVolumeControls = DefaultVolumeControls;
-
-
- // Combines call feedback from both codecs if available
- InCallFeedback = new BoolFeedback(() =>
- {
- bool inAudioCall = false;
- bool inVideoCall = false;
-
- if (AudioCodec != null)
- inAudioCall = AudioCodec.IsInCall;
-
- if (VideoCodec != null)
- inVideoCall = VideoCodec.IsInCall;
-
- if (inAudioCall || inVideoCall)
- return true;
- else
- return false;
- });
-
- SetupDisplays();
-
- // Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
- this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
-
- Debug.Console(2, this, "Microphone Privacy Config evaluated.");
-
- // Get emergency object, if any
- this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
-
- Debug.Console(2, this, "Emergency Config evaluated.");
-
- if (AudioCodec != null)
- {
- AudioCodec.CallStatusChange -= AudioCodec_CallStatusChange;
- AudioCodec.CallStatusChange += AudioCodec_CallStatusChange;
- }
-
- VideoCodec.CallStatusChange -= VideoCodec_CallStatusChange;
- VideoCodec.CallStatusChange += VideoCodec_CallStatusChange;
-
- VideoCodec.IsReadyChange -= VideoCodec_IsReadyChange;
- VideoCodec.IsReadyChange += VideoCodec_IsReadyChange;
-
- VideoCodec.SharingContentIsOnFeedback.OutputChange -= SharingContentIsOnFeedback_OutputChange;
- VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange;
-
-
- IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
-
- // link privacy to VC (for now?)
- PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
-
- VideoCodec.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
- VideoCodec.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
-
- CallTypeFeedback = new IntFeedback(() => 0);
-
- SetSourceListKey();
-
- EnablePowerOnToLastSource = true;
-
-
- // Add Occupancy object from config
- if (PropertiesConfig.Occupancy != null)
- {
- Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Setting Occupancy Provider for room");
- this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
- IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
- }
-
- this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
- this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
-
- this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
- this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
-
- }
- catch (Exception e)
- {
- Debug.Console(0, this, "Error Activiating Room: {0}", e);
- }
-
-
- Debug.Console(0, this, "Room '{0}' Activated", Name);
+ {
+ try
+ {
+ if (DefaultAudioDevice is IBasicVolumeControls)
+ DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
+ else if (DefaultAudioDevice is IHasVolumeDevice)
+ DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
+ CurrentVolumeControls = DefaultVolumeControls;
+
+
+ // Combines call feedback from both codecs if available
+ InCallFeedback = new BoolFeedback(() =>
+ {
+ bool inAudioCall = false;
+ bool inVideoCall = false;
+
+ if (AudioCodec != null)
+ inAudioCall = AudioCodec.IsInCall;
+
+ if (VideoCodec != null)
+ inVideoCall = VideoCodec.IsInCall;
+
+ if (inAudioCall || inVideoCall)
+ return true;
+ else
+ return false;
+ });
+
+ SetupDisplays();
+
+ // Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
+ this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
+
+ Debug.Console(2, this, "Microphone Privacy Config evaluated.");
+
+ // Get emergency object, if any
+ this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
+
+ Debug.Console(2, this, "Emergency Config evaluated.");
+
+ if (AudioCodec != null)
+ {
+ AudioCodec.CallStatusChange -= AudioCodec_CallStatusChange;
+ AudioCodec.CallStatusChange += AudioCodec_CallStatusChange;
+ }
+
+ VideoCodec.CallStatusChange -= VideoCodec_CallStatusChange;
+ VideoCodec.CallStatusChange += VideoCodec_CallStatusChange;
+
+ VideoCodec.IsReadyChange -= VideoCodec_IsReadyChange;
+ VideoCodec.IsReadyChange += VideoCodec_IsReadyChange;
+
+ VideoCodec.SharingContentIsOnFeedback.OutputChange -= SharingContentIsOnFeedback_OutputChange;
+ VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange;
+
+
+ IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
+
+ // link privacy to VC (for now?)
+ PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
+
+ VideoCodec.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
+ VideoCodec.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
+
+ CallTypeFeedback = new IntFeedback(() => 0);
+
+ SetSourceListKey();
+
+ EnablePowerOnToLastSource = true;
+
+
+ // Add Occupancy object from config
+ if (PropertiesConfig.Occupancy != null)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Setting Occupancy Provider for room");
+ this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
+ IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
+ }
+
+ this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
+ this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
+
+ this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
+ this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
+
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, this, "Error Activiating Room: {0}", e);
+ }
+
+
+ Debug.Console(0, this, "Room '{0}' Activated", Name);
return base.CustomActivate();
- }
-
- void AudioCodec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
- {
- InCallFeedback.FireUpdate();
- }
-
- void PrivacyModeIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- PrivacyModeIsOnFeedback.FireUpdate();
- }
-
- void VideoCodec_IsReadyChange(object sender, EventArgs e)
- {
- SetUpVideoCodec();
- }
-
- void SetUpVideoCodec()
- {
- SetCodecExternalSources();
- SetCodecBranding();
- }
-
- void VideoCodec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
- {
- InCallFeedback.FireUpdate();
- }
-
- void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- IsSharingFeedback.FireUpdate();
- }
-
+ }
+
+ void AudioCodec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
+ {
+ InCallFeedback.FireUpdate();
+ }
+
+ void PrivacyModeIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ PrivacyModeIsOnFeedback.FireUpdate();
+ }
+
+ void VideoCodec_IsReadyChange(object sender, EventArgs e)
+ {
+ SetUpVideoCodec();
+ }
+
+ void SetUpVideoCodec()
+ {
+ SetCodecExternalSources();
+ SetCodecBranding();
+ }
+
+ void VideoCodec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
+ {
+ InCallFeedback.FireUpdate();
+ }
+
+ void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ IsSharingFeedback.FireUpdate();
+ }
+
///
@@ -922,9 +922,9 @@ namespace PepperDash.Essentials
videoCodecWithExternalSwitching.AddExternalSource(codecInputConnectorName, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
}
- }
-
- Debug.Console(1, this, "Successfully set up codec external sources for room: {0}", Name);
+ }
+
+ Debug.Console(1, this, "Successfully set up codec external sources for room: {0}", Name);
}
catch (Exception e)
{
diff --git a/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs b/src/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs
similarity index 100%
rename from PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs
rename to src/PepperDashEssentials/Room/Types/EssentialsDualDisplayRoom.cs
diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs b/src/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs
similarity index 97%
rename from PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs
rename to src/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs
index 5dbe7600..4ed3da6b 100644
--- a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs
+++ b/src/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs
@@ -1,564 +1,564 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using Newtonsoft.Json;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Room.Config;
-
-namespace PepperDash.Essentials
-{
- public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IEssentialsHuddleSpaceRoom
- {
- public event EventHandler CurrentVolumeDeviceChange;
- public event SourceInfoChangeHandler CurrentSourceChange;
-
- protected override Func OnFeedbackFunc
- {
- get
- {
- return () =>
- {
- var disp = DefaultDisplay as DisplayBase;
- var val = CurrentSourceInfo != null
- && CurrentSourceInfo.Type == eSourceListItemType.Route
- && disp != null;
- //&& disp.PowerIsOnFeedback.BoolValue;
- return val;
- };
- }
- }
- ///
- ///
- ///
- protected override Func IsWarmingFeedbackFunc
- {
- get
- {
- return () =>
- {
- var disp = DefaultDisplay as DisplayBase;
- if (disp != null)
- return disp.IsWarmingUpFeedback.BoolValue;
- else
- return false;
- };
- }
- }
- ///
- ///
- ///
- protected override Func IsCoolingFeedbackFunc
- {
- get
- {
- return () =>
- {
- var disp = DefaultDisplay as DisplayBase;
- if (disp != null)
- return disp.IsCoolingDownFeedback.BoolValue;
- else
- return false;
- };
- }
- }
-
- public EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; private set; }
-
- public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
- public IRoutingSink DefaultAudioDevice { get; private set; }
- public IBasicVolumeControls DefaultVolumeControls { get; private set; }
-
- public bool ExcludeFromGlobalFunctions { get; set; }
-
- public string DefaultSourceItem { get; set; }
-
- public ushort DefaultVolume { get; set; }
-
- ///
- /// If room is off, enables power on to last source. Default true
- ///
- public bool EnablePowerOnToLastSource { get; set; }
- string LastSourceKey;
-
- ///
- ///
- ///
- public IBasicVolumeControls CurrentVolumeControls
- {
- get { return _CurrentAudioDevice; }
- set
- {
- if (value == _CurrentAudioDevice) return;
-
- var oldDev = _CurrentAudioDevice;
- // derigister this room from the device, if it can
- if (oldDev is IInUseTracking)
- (oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
- var handler = CurrentVolumeDeviceChange;
- if (handler != null)
- CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
- _CurrentAudioDevice = value;
- if (handler != null)
- CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
- // register this room with new device, if it can
- if (_CurrentAudioDevice is IInUseTracking)
- (_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
- }
- }
- IBasicVolumeControls _CurrentAudioDevice;
-
- ///
- /// The SourceListItem last run - containing names and icons
- ///
- public SourceListItem CurrentSourceInfo
- {
- get { return _CurrentSourceInfo; }
- set
- {
- if (value == _CurrentSourceInfo) return;
-
- var handler = CurrentSourceChange;
- // remove from in-use tracker, if so equipped
- if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
- (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
-
- if (handler != null)
- handler(_CurrentSourceInfo, ChangeType.WillChange);
-
- _CurrentSourceInfo = value;
-
- // add to in-use tracking
- if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
- (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
- if (handler != null)
- handler( _CurrentSourceInfo, ChangeType.DidChange);
- }
- }
- SourceListItem _CurrentSourceInfo;
-
- public string CurrentSourceInfoKey { get; set; }
-
- public EssentialsHuddleSpaceRoom(DeviceConfig config)
- : base(config)
- {
- try
- {
- PropertiesConfig = JsonConvert.DeserializeObject
- (config.Properties.ToString());
- DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
-
-
- DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IRoutingSinkWithSwitching;
-
- InitializeRoom();
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "Error building room: \n{0}", e);
- }
- }
-
- void InitializeRoom()
- {
- if (DefaultAudioDevice is IBasicVolumeControls)
- DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
- else if (DefaultAudioDevice is IHasVolumeDevice)
- DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
- CurrentVolumeControls = DefaultVolumeControls;
-
- var disp = DefaultDisplay as DisplayBase;
- if (disp != null)
- {
- // Link power, warming, cooling to display
- var dispTwoWay = disp as IHasPowerControlWithFeedback;
- if (dispTwoWay != null)
- {
- dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
- {
- if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
- {
- if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
- CurrentSourceInfo = null;
- OnFeedback.FireUpdate();
- }
- };
- }
-
- disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
- {
- IsWarmingUpFeedback.FireUpdate();
- if (!IsWarmingUpFeedback.BoolValue)
- (DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
- };
- disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
- {
- IsCoolingDownFeedback.FireUpdate();
- };
- }
-
- SetupEnvironmentalControlDevices();
-
- SetSourceListKey();
-
- EnablePowerOnToLastSource = true;
- }
-
- private void SetupEnvironmentalControlDevices()
- {
- if (PropertiesConfig.Environment != null)
- {
- if (PropertiesConfig.Environment.Enabled)
- {
- foreach (var d in PropertiesConfig.Environment.DeviceKeys)
- {
- var envDevice = DeviceManager.GetDeviceForKey(d) as EssentialsDevice;
- EnvironmentalControlDevices.Add(envDevice);
- }
- }
- }
- }
-
- private void SetSourceListKey()
- {
- if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
- {
- SetSourceListKey(PropertiesConfig.SourceListKey);
- }
- else
- {
- SetSourceListKey(Key);
- }
-
- }
-
- protected override void CustomSetConfig(DeviceConfig config)
- {
- var newPropertiesConfig = JsonConvert.DeserializeObject(config.Properties.ToString());
-
- if (newPropertiesConfig != null)
- PropertiesConfig = newPropertiesConfig;
-
- ConfigWriter.UpdateRoomConfig(config);
- }
-
- ///
- ///
- ///
- protected override void EndShutdown()
- {
- SetDefaultLevels();
-
- RunDefaultPresentRoute();
-
- CrestronEnvironment.Sleep(1000);
-
- Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room");
-
- RunRouteAction("roomOff");
- }
-
- ///
- /// Routes the default source item, if any
- ///
- public override bool RunDefaultPresentRoute()
- {
- if (DefaultSourceItem == null)
- {
- Debug.Console(0, this, "Unable to run default present route, DefaultSourceItem is null.");
- return false;
- }
-
- RunRouteAction(DefaultSourceItem);
- return true;
- }
-
- public override bool CustomActivate()
- {
- // Add Occupancy object from config
- if (PropertiesConfig.Occupancy != null)
- this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
- IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
-
- this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
- this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
- this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
- this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
-
- return base.CustomActivate();
- }
-
- ///
- ///
- ///
- ///
- public void RunRouteAction(string routeKey)
- {
- RunRouteAction(routeKey, new Action(() => { }));
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void RunRouteAction(string routeKey, string sourceListKey)
- {
- RunRouteAction(routeKey, new Action(() => { }));
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback)
- {
- if (string.IsNullOrEmpty(sourceListKey))
- {
- RunRouteAction(routeKey, successCallback);
- }
- else
- throw new NotImplementedException();
- }
-
- ///
- /// Gets a source from config list SourceListKey and dynamically build and executes the
- /// route or commands
- ///
- ///
- public void RunRouteAction(string routeKey, Action successCallback)
- {
- // Run this on a separate thread
- new CTimer(o =>
- {
- Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Run route action '{0}'", routeKey);
- var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
- if(dict == null)
- {
- Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
- return;
- }
-
- // Try to get the list item by it's string key
- if (!dict.ContainsKey(routeKey))
- {
- Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
- routeKey, SourceListKey);
- return;
- }
-
- var item = dict[routeKey];
- //Debug.Console(2, this, "Action {0} has {1} steps",
- // item.SourceKey, item.RouteList.Count);
-
- // End usage timer on last source
- if (!string.IsNullOrEmpty(LastSourceKey))
- {
- var lastSource = dict[LastSourceKey].SourceDevice;
-
- try
- {
- if (lastSource != null && lastSource is IUsageTracking)
- (lastSource as IUsageTracking).UsageTracker.EndDeviceUsage();
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "*#* EXCEPTION in end usage tracking (257):\r{0}", e);
- }
- }
-
- // Let's run it
- if (routeKey.ToLower() != "roomoff")
- {
- LastSourceKey = routeKey;
- }
- else
- {
- CurrentSourceInfoKey = null;
- }
-
- foreach (var route in item.RouteList)
- {
- // if there is a $defaultAll on route, run two separate
- if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
- {
- // Going to assume a single-path route for now
- var tempVideo = new SourceRouteListItem
- {
- DestinationKey = "$defaultDisplay",
- SourceKey = route.SourceKey,
- Type = eRoutingSignalType.Video
- };
- DoRoute(tempVideo);
-
- //var tempAudio = new SourceRouteListItem
- //{
- // DestinationKey = "$defaultAudio",
- // SourceKey = route.SourceKey,
- // Type = eRoutingSignalType.Audio
- //};
- //DoRoute(tempAudio);
- //continue; -- not sure why this was here
- }
- else
- DoRoute(route);
- }
-
- // Start usage timer on routed source
- if (item.SourceDevice is IUsageTracking)
- {
- (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
- }
-
-
-
-
- // Set volume control, using default if non provided
- IBasicVolumeControls volDev = null;
- // Handle special cases for volume control
- if (string.IsNullOrEmpty(item.VolumeControlKey)
- || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
- volDev = DefaultVolumeControls;
- else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
- volDev = DefaultDisplay as IBasicVolumeControls;
- // Or a specific device, probably rarely used.
- else
- {
- var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
- if (dev is IBasicVolumeControls)
- volDev = dev as IBasicVolumeControls;
- else if (dev is IHasVolumeDevice)
- volDev = (dev as IHasVolumeDevice).VolumeDevice;
- }
-
- if (volDev != CurrentVolumeControls)
- {
- // zero the volume on the device we are leaving.
- // Set the volume to default on device we are entering
- if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
- {
- var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
- SavedVolumeLevels[vd] = (uint)vd.VolumeLevelFeedback.IntValue;
- vd.SetVolume(0);
- }
- CurrentVolumeControls = volDev;
- if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
- {
- var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
- ushort vol = (SavedVolumeLevels.ContainsKey(vd) ? (ushort)SavedVolumeLevels[vd] : DefaultVolume);
- vd.SetVolume(vol);
- }
- }
-
-
-
- // store the name and UI info for routes
- if (item.SourceKey == "$off")
- {
- CurrentSourceInfoKey = routeKey;
- CurrentSourceInfo = null;
- }
- else if (item.SourceKey != null)
- {
- CurrentSourceInfoKey = routeKey;
- CurrentSourceInfo = item;
- }
- // And finally, set the "control". This will trigger event
- //CurrentControlDevice = DeviceManager.GetDeviceForKey(item.SourceKey) as Device;
-
- OnFeedback.FireUpdate();
-
- // report back when done
- if (successCallback != null)
- successCallback();
-
- }, 0); // end of CTimer
- }
-
- ///
- /// Will power the room on with the last-used source
- ///
- public override void PowerOnToDefaultOrLastSource()
- {
- if (!EnablePowerOnToLastSource || LastSourceKey == null)
- return;
- RunRouteAction(LastSourceKey);
- }
-
- ///
- /// Does what it says
- ///
- public override void SetDefaultLevels()
- {
- Debug.Console(1, this, "Restoring default levels");
- var vc = CurrentVolumeControls as IBasicVolumeWithFeedback;
- if (vc != null)
- vc.SetVolume(DefaultVolume);
- }
-
- ///
- ///
- ///
- ///
- ///
- bool DoRoute(SourceRouteListItem route)
- {
- IRoutingSink dest = null;
-
- if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
- dest = DefaultAudioDevice;
- else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
- dest = DefaultDisplay;
- else
- dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
-
- if (dest == null)
- {
- Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
- return false;
- }
-
- if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
- {
- dest.ReleaseRoute();
- if (dest is IHasPowerControl)
- (dest as IHasPowerControl).PowerOff();
- }
- else
- {
- var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
- if (source == null)
- {
- Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
- return false;
- }
- dest.ReleaseAndMakeRoute(source, route.Type);
- }
- return true;
- }
-
- public override void RoomVacatedForTimeoutPeriod(object o)
- {
- //Implement this
- }
-
- ///
- /// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
- ///
- public static void AllRoomsOff()
- {
- var allRooms = DeviceManager.AllDevices.Where(d =>
- d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
- foreach (var room in allRooms)
- (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Room.Config;
+
+namespace PepperDash.Essentials
+{
+ public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IEssentialsHuddleSpaceRoom
+ {
+ public event EventHandler CurrentVolumeDeviceChange;
+ public event SourceInfoChangeHandler CurrentSourceChange;
+
+ protected override Func OnFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ var disp = DefaultDisplay as DisplayBase;
+ var val = CurrentSourceInfo != null
+ && CurrentSourceInfo.Type == eSourceListItemType.Route
+ && disp != null;
+ //&& disp.PowerIsOnFeedback.BoolValue;
+ return val;
+ };
+ }
+ }
+ ///
+ ///
+ ///
+ protected override Func IsWarmingFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ var disp = DefaultDisplay as DisplayBase;
+ if (disp != null)
+ return disp.IsWarmingUpFeedback.BoolValue;
+ else
+ return false;
+ };
+ }
+ }
+ ///
+ ///
+ ///
+ protected override Func IsCoolingFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ var disp = DefaultDisplay as DisplayBase;
+ if (disp != null)
+ return disp.IsCoolingDownFeedback.BoolValue;
+ else
+ return false;
+ };
+ }
+ }
+
+ public EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; private set; }
+
+ public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
+ public IRoutingSink DefaultAudioDevice { get; private set; }
+ public IBasicVolumeControls DefaultVolumeControls { get; private set; }
+
+ public bool ExcludeFromGlobalFunctions { get; set; }
+
+ public string DefaultSourceItem { get; set; }
+
+ public ushort DefaultVolume { get; set; }
+
+ ///
+ /// If room is off, enables power on to last source. Default true
+ ///
+ public bool EnablePowerOnToLastSource { get; set; }
+ string LastSourceKey;
+
+ ///
+ ///
+ ///
+ public IBasicVolumeControls CurrentVolumeControls
+ {
+ get { return _CurrentAudioDevice; }
+ set
+ {
+ if (value == _CurrentAudioDevice) return;
+
+ var oldDev = _CurrentAudioDevice;
+ // derigister this room from the device, if it can
+ if (oldDev is IInUseTracking)
+ (oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
+ var handler = CurrentVolumeDeviceChange;
+ if (handler != null)
+ CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
+ _CurrentAudioDevice = value;
+ if (handler != null)
+ CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
+ // register this room with new device, if it can
+ if (_CurrentAudioDevice is IInUseTracking)
+ (_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
+ }
+ }
+ IBasicVolumeControls _CurrentAudioDevice;
+
+ ///
+ /// The SourceListItem last run - containing names and icons
+ ///
+ public SourceListItem CurrentSourceInfo
+ {
+ get { return _CurrentSourceInfo; }
+ set
+ {
+ if (value == _CurrentSourceInfo) return;
+
+ var handler = CurrentSourceChange;
+ // remove from in-use tracker, if so equipped
+ if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
+ (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
+
+ if (handler != null)
+ handler(_CurrentSourceInfo, ChangeType.WillChange);
+
+ _CurrentSourceInfo = value;
+
+ // add to in-use tracking
+ if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
+ (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
+ if (handler != null)
+ handler( _CurrentSourceInfo, ChangeType.DidChange);
+ }
+ }
+ SourceListItem _CurrentSourceInfo;
+
+ public string CurrentSourceInfoKey { get; set; }
+
+ public EssentialsHuddleSpaceRoom(DeviceConfig config)
+ : base(config)
+ {
+ try
+ {
+ PropertiesConfig = JsonConvert.DeserializeObject
+ (config.Properties.ToString());
+ DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
+
+
+ DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IRoutingSinkWithSwitching;
+
+ InitializeRoom();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error building room: \n{0}", e);
+ }
+ }
+
+ void InitializeRoom()
+ {
+ if (DefaultAudioDevice is IBasicVolumeControls)
+ DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
+ else if (DefaultAudioDevice is IHasVolumeDevice)
+ DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
+ CurrentVolumeControls = DefaultVolumeControls;
+
+ var disp = DefaultDisplay as DisplayBase;
+ if (disp != null)
+ {
+ // Link power, warming, cooling to display
+ var dispTwoWay = disp as IHasPowerControlWithFeedback;
+ if (dispTwoWay != null)
+ {
+ dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
+ {
+ if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
+ {
+ if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
+ CurrentSourceInfo = null;
+ OnFeedback.FireUpdate();
+ }
+ };
+ }
+
+ disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
+ {
+ IsWarmingUpFeedback.FireUpdate();
+ if (!IsWarmingUpFeedback.BoolValue)
+ (DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
+ };
+ disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
+ {
+ IsCoolingDownFeedback.FireUpdate();
+ };
+ }
+
+ SetupEnvironmentalControlDevices();
+
+ SetSourceListKey();
+
+ EnablePowerOnToLastSource = true;
+ }
+
+ private void SetupEnvironmentalControlDevices()
+ {
+ if (PropertiesConfig.Environment != null)
+ {
+ if (PropertiesConfig.Environment.Enabled)
+ {
+ foreach (var d in PropertiesConfig.Environment.DeviceKeys)
+ {
+ var envDevice = DeviceManager.GetDeviceForKey(d) as EssentialsDevice;
+ EnvironmentalControlDevices.Add(envDevice);
+ }
+ }
+ }
+ }
+
+ private void SetSourceListKey()
+ {
+ if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
+ {
+ SetSourceListKey(PropertiesConfig.SourceListKey);
+ }
+ else
+ {
+ SetSourceListKey(Key);
+ }
+
+ }
+
+ protected override void CustomSetConfig(DeviceConfig config)
+ {
+ var newPropertiesConfig = JsonConvert.DeserializeObject(config.Properties.ToString());
+
+ if (newPropertiesConfig != null)
+ PropertiesConfig = newPropertiesConfig;
+
+ ConfigWriter.UpdateRoomConfig(config);
+ }
+
+ ///
+ ///
+ ///
+ protected override void EndShutdown()
+ {
+ SetDefaultLevels();
+
+ RunDefaultPresentRoute();
+
+ CrestronEnvironment.Sleep(1000);
+
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room");
+
+ RunRouteAction("roomOff");
+ }
+
+ ///
+ /// Routes the default source item, if any
+ ///
+ public override bool RunDefaultPresentRoute()
+ {
+ if (DefaultSourceItem == null)
+ {
+ Debug.Console(0, this, "Unable to run default present route, DefaultSourceItem is null.");
+ return false;
+ }
+
+ RunRouteAction(DefaultSourceItem);
+ return true;
+ }
+
+ public override bool CustomActivate()
+ {
+ // Add Occupancy object from config
+ if (PropertiesConfig.Occupancy != null)
+ this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
+ IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
+
+ this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
+ this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
+ this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
+ this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
+
+ return base.CustomActivate();
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey)
+ {
+ RunRouteAction(routeKey, new Action(() => { }));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey, string sourceListKey)
+ {
+ RunRouteAction(routeKey, new Action(() => { }));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback)
+ {
+ if (string.IsNullOrEmpty(sourceListKey))
+ {
+ RunRouteAction(routeKey, successCallback);
+ }
+ else
+ throw new NotImplementedException();
+ }
+
+ ///
+ /// Gets a source from config list SourceListKey and dynamically build and executes the
+ /// route or commands
+ ///
+ ///
+ public void RunRouteAction(string routeKey, Action successCallback)
+ {
+ // Run this on a separate thread
+ new CTimer(o =>
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Run route action '{0}'", routeKey);
+ var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
+ if(dict == null)
+ {
+ Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
+ return;
+ }
+
+ // Try to get the list item by it's string key
+ if (!dict.ContainsKey(routeKey))
+ {
+ Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
+ routeKey, SourceListKey);
+ return;
+ }
+
+ var item = dict[routeKey];
+ //Debug.Console(2, this, "Action {0} has {1} steps",
+ // item.SourceKey, item.RouteList.Count);
+
+ // End usage timer on last source
+ if (!string.IsNullOrEmpty(LastSourceKey))
+ {
+ var lastSource = dict[LastSourceKey].SourceDevice;
+
+ try
+ {
+ if (lastSource != null && lastSource is IUsageTracking)
+ (lastSource as IUsageTracking).UsageTracker.EndDeviceUsage();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "*#* EXCEPTION in end usage tracking (257):\r{0}", e);
+ }
+ }
+
+ // Let's run it
+ if (routeKey.ToLower() != "roomoff")
+ {
+ LastSourceKey = routeKey;
+ }
+ else
+ {
+ CurrentSourceInfoKey = null;
+ }
+
+ foreach (var route in item.RouteList)
+ {
+ // if there is a $defaultAll on route, run two separate
+ if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
+ {
+ // Going to assume a single-path route for now
+ var tempVideo = new SourceRouteListItem
+ {
+ DestinationKey = "$defaultDisplay",
+ SourceKey = route.SourceKey,
+ Type = eRoutingSignalType.Video
+ };
+ DoRoute(tempVideo);
+
+ //var tempAudio = new SourceRouteListItem
+ //{
+ // DestinationKey = "$defaultAudio",
+ // SourceKey = route.SourceKey,
+ // Type = eRoutingSignalType.Audio
+ //};
+ //DoRoute(tempAudio);
+ //continue; -- not sure why this was here
+ }
+ else
+ DoRoute(route);
+ }
+
+ // Start usage timer on routed source
+ if (item.SourceDevice is IUsageTracking)
+ {
+ (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
+ }
+
+
+
+
+ // Set volume control, using default if non provided
+ IBasicVolumeControls volDev = null;
+ // Handle special cases for volume control
+ if (string.IsNullOrEmpty(item.VolumeControlKey)
+ || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
+ volDev = DefaultVolumeControls;
+ else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
+ volDev = DefaultDisplay as IBasicVolumeControls;
+ // Or a specific device, probably rarely used.
+ else
+ {
+ var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
+ if (dev is IBasicVolumeControls)
+ volDev = dev as IBasicVolumeControls;
+ else if (dev is IHasVolumeDevice)
+ volDev = (dev as IHasVolumeDevice).VolumeDevice;
+ }
+
+ if (volDev != CurrentVolumeControls)
+ {
+ // zero the volume on the device we are leaving.
+ // Set the volume to default on device we are entering
+ if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
+ {
+ var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ SavedVolumeLevels[vd] = (uint)vd.VolumeLevelFeedback.IntValue;
+ vd.SetVolume(0);
+ }
+ CurrentVolumeControls = volDev;
+ if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
+ {
+ var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ ushort vol = (SavedVolumeLevels.ContainsKey(vd) ? (ushort)SavedVolumeLevels[vd] : DefaultVolume);
+ vd.SetVolume(vol);
+ }
+ }
+
+
+
+ // store the name and UI info for routes
+ if (item.SourceKey == "$off")
+ {
+ CurrentSourceInfoKey = routeKey;
+ CurrentSourceInfo = null;
+ }
+ else if (item.SourceKey != null)
+ {
+ CurrentSourceInfoKey = routeKey;
+ CurrentSourceInfo = item;
+ }
+ // And finally, set the "control". This will trigger event
+ //CurrentControlDevice = DeviceManager.GetDeviceForKey(item.SourceKey) as Device;
+
+ OnFeedback.FireUpdate();
+
+ // report back when done
+ if (successCallback != null)
+ successCallback();
+
+ }, 0); // end of CTimer
+ }
+
+ ///
+ /// Will power the room on with the last-used source
+ ///
+ public override void PowerOnToDefaultOrLastSource()
+ {
+ if (!EnablePowerOnToLastSource || LastSourceKey == null)
+ return;
+ RunRouteAction(LastSourceKey);
+ }
+
+ ///
+ /// Does what it says
+ ///
+ public override void SetDefaultLevels()
+ {
+ Debug.Console(1, this, "Restoring default levels");
+ var vc = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ if (vc != null)
+ vc.SetVolume(DefaultVolume);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ bool DoRoute(SourceRouteListItem route)
+ {
+ IRoutingSink dest = null;
+
+ if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
+ dest = DefaultAudioDevice;
+ else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
+ dest = DefaultDisplay;
+ else
+ dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
+
+ if (dest == null)
+ {
+ Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
+ return false;
+ }
+
+ if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
+ {
+ dest.ReleaseRoute();
+ if (dest is IHasPowerControl)
+ (dest as IHasPowerControl).PowerOff();
+ }
+ else
+ {
+ var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
+ if (source == null)
+ {
+ Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
+ return false;
+ }
+ dest.ReleaseAndMakeRoute(source, route.Type);
+ }
+ return true;
+ }
+
+ public override void RoomVacatedForTimeoutPeriod(object o)
+ {
+ //Implement this
+ }
+
+ ///
+ /// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
+ ///
+ public static void AllRoomsOff()
+ {
+ var allRooms = DeviceManager.AllDevices.Where(d =>
+ d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
+ foreach (var room in allRooms)
+ (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs.orig b/src/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs.orig
similarity index 100%
rename from PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs.orig
rename to src/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs.orig
diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/src/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
similarity index 97%
rename from PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
rename to src/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
index 2aae2f75..d5c5319d 100644
--- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
+++ b/src/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
@@ -1,946 +1,946 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using Newtonsoft.Json;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Room.Config;
-using PepperDash.Essentials.Devices.Common.Codec;
-using PepperDash.Essentials.Devices.Common.VideoCodec;
-using PepperDash.Essentials.Devices.Common.AudioCodec;
-using PepperDash.Essentials.Core.DeviceTypeInterfaces;
-
-namespace PepperDash.Essentials
-{
- public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IEssentialsHuddleVtc1Room
- {
- private IEssentialsRoomCombiner _roomCombiner;
-
- private bool _codecExternalSourceChange;
- public event EventHandler CurrentVolumeDeviceChange;
- public event SourceInfoChangeHandler CurrentSourceChange;
-
-
- //************************
- // Call-related stuff
-
- public BoolFeedback InCallFeedback { get; private set; }
-
- /////
- ///// Make this more specific
- /////
- //public List ActiveCalls { get; private set; }
-
- ///
- /// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis
- ///
- public IntFeedback CallTypeFeedback { get; private set; }
-
- ///
- ///
- ///
- public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
-
- ///
- /// When something in the room is sharing with the far end or through other means
- ///
- public BoolFeedback IsSharingFeedback { get; private set; }
-
- //************************
-
- protected override Func OnFeedbackFunc
- {
- get
- {
- return () =>
- {
- var disp = DefaultDisplay as DisplayBase;
- var val = CurrentSourceInfo != null
- && CurrentSourceInfo.Type == eSourceListItemType.Route
- && disp != null;
- //&& disp.PowerIsOnFeedback.BoolValue;
- return val;
- };
- }
- }
- ///
- ///
- ///
- protected override Func IsWarmingFeedbackFunc
- {
- get
- {
- return () =>
- {
- var disp = DefaultDisplay as DisplayBase;
- if (disp != null)
- return disp.IsWarmingUpFeedback.BoolValue;
- else
- return false;
- };
- }
- }
- ///
- ///
- ///
- protected override Func IsCoolingFeedbackFunc
- {
- get
- {
- return () =>
- {
- var disp = DefaultDisplay as DisplayBase;
- if (disp != null)
- return disp.IsCoolingDownFeedback.BoolValue;
- else
- return false;
- };
- }
- }
-
- public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
-
- public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
- public IBasicVolumeControls DefaultAudioDevice { get; private set; }
- public IBasicVolumeControls DefaultVolumeControls { get; private set; }
-
- public VideoCodecBase VideoCodec { get; private set; }
-
- public AudioCodecBase AudioCodec { get; private set; }
-
- public bool ExcludeFromGlobalFunctions { get; set; }
-
- public string DefaultSourceItem { get; set; }
-
- public ushort DefaultVolume { get; set; }
-
- ///
- /// If room is off, enables power on to last source. Default true
- ///
- public bool EnablePowerOnToLastSource { get; set; }
- string LastSourceKey;
-
- ///
- /// Sets the volume control device, and attaches/removes InUseTrackers with "audio"
- /// tag to device.
- ///
- public IBasicVolumeControls CurrentVolumeControls
- {
- get { return _CurrentAudioDevice; }
- set
- {
- if (value == _CurrentAudioDevice) return;
-
- var oldDev = _CurrentAudioDevice;
- // derigister this room from the device, if it can
- if (oldDev is IInUseTracking)
- (oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
- var handler = CurrentVolumeDeviceChange;
- if (handler != null)
- CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
- _CurrentAudioDevice = value;
- if (handler != null)
- CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
- // register this room with new device, if it can
- if (_CurrentAudioDevice is IInUseTracking)
- (_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
- }
- }
- IBasicVolumeControls _CurrentAudioDevice;
-
- ///
- /// The SourceListItem last run - containing names and icons
- ///
- public SourceListItem CurrentSourceInfo
- {
- get { return _CurrentSourceInfo; }
- set
- {
- if (value == _CurrentSourceInfo) return;
-
- var handler = CurrentSourceChange;
- // remove from in-use tracker, if so equipped
- if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
- (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
-
- if (handler != null)
- handler(_CurrentSourceInfo, ChangeType.WillChange);
-
- _CurrentSourceInfo = value;
-
- // add to in-use tracking
- if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
- (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
- if (handler != null)
- handler(_CurrentSourceInfo, ChangeType.DidChange);
-
- var vc = VideoCodec as IHasExternalSourceSwitching;
- if (vc != null && !_codecExternalSourceChange)
- {
- vc.SetSelectedSource(CurrentSourceInfoKey);
- }
-
- _codecExternalSourceChange = false;
- }
- }
- SourceListItem _CurrentSourceInfo;
-
- public string CurrentSourceInfoKey { get; set; }
-
- ///
- /// "codecOsd"
- ///
- public string DefaultCodecRouteString { get { return "codecOsd"; } }
-
- ///
- /// Temporary implementation. Returns the schedule-ready object or null if none. Fow now,
- /// always returns the VideoCodec if it is capable
- ///
- public IHasScheduleAwareness ScheduleSource { get { return VideoCodec as IHasScheduleAwareness; } }
-
- CCriticalSection SourceSelectLock = new CCriticalSection();
-
- public EssentialsHuddleVtc1Room(DeviceConfig config)
- : base(config)
- {
- try
- {
- PropertiesConfig = JsonConvert.DeserializeObject
- (config.Properties.ToString());
- DefaultDisplay = DeviceManager.GetDeviceForKey((PropertiesConfig as EssentialsHuddleVtc1PropertiesConfig).DefaultDisplayKey) as IRoutingSinkWithSwitching;
-
- VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
- PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
-
-
- if (VideoCodec == null)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "No Video Codec set. Please check 'videoCodecKey' property in room config");
- throw new ArgumentNullException("VideoCodec cannot be null");
- }
-
- AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
- PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
- if (AudioCodec == null)
- Debug.Console(0, this, "No Audio Codec Found");
-
- DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
- if (DefaultAudioDevice == null)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "No Default Audio Device set. Please check 'defaultAudioKey' property in room config");
- throw new ArgumentNullException("DefaultAudioDevice cannot be null");
- }
-
- Initialize();
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "Error building room: \n{0}", e);
- }
- }
-
-
- private void SetupEnvironmentalControlDevices()
- {
- if (PropertiesConfig.Environment != null)
- {
- if (PropertiesConfig.Environment.Enabled)
- {
- EnvironmentalControlDevices.Clear();
-
- foreach (var d in PropertiesConfig.Environment.DeviceKeys)
- {
- var envDevice = DeviceManager.GetDeviceForKey(d) as EssentialsDevice;
- EnvironmentalControlDevices.Add(envDevice);
- }
- }
- }
- }
-
-
- private void SetSourceListKey()
- {
- if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
- {
- SetSourceListKey(PropertiesConfig.SourceListKey);
- }
- else
- {
- SetSourceListKey(Key);
- }
-
- SetUpVideoCodec();
- }
-
- protected override void CustomSetConfig(DeviceConfig config)
- {
- var newPropertiesConfig = JsonConvert.DeserializeObject(config.Properties.ToString());
-
- if (newPropertiesConfig != null)
- PropertiesConfig = newPropertiesConfig;
-
- ConfigWriter.UpdateRoomConfig(config);
- }
-
- public override bool Deactivate()
- {
-
- // Stop listining to this event when room deactivated
- VideoCodec.IsReadyChange -= VideoCodec_IsReadyChange;
-
- // Clear occupancy
- RoomOccupancy = null;
-
- Debug.Console(0, this, "Room '{0}' Deactivated", Name);
-
- return base.Deactivate();
- }
-
- public override bool CustomActivate()
- {
- try
- {
- if (DefaultAudioDevice is IBasicVolumeControls)
- DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
- else if (DefaultAudioDevice is IHasVolumeDevice)
- DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
- CurrentVolumeControls = DefaultVolumeControls;
-
-
- // Combines call feedback from both codecs if available
- InCallFeedback = new BoolFeedback(() =>
- {
- bool inAudioCall = false;
- bool inVideoCall = false;
-
- if (AudioCodec != null)
- inAudioCall = AudioCodec.IsInCall;
-
- if (VideoCodec != null)
- inVideoCall = VideoCodec.IsInCall;
-
- if (inAudioCall || inVideoCall)
- return true;
- else
- return false;
- });
-
- var disp = DefaultDisplay as DisplayBase;
- if (disp != null)
- {
- // Link power, warming, cooling to display
- var dispTwoWay = disp as IHasPowerControlWithFeedback;
- if (dispTwoWay != null)
- {
- dispTwoWay.PowerIsOnFeedback.OutputChange -= PowerIsOnFeedback_OutputChange;
- dispTwoWay.PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
- }
-
- disp.IsWarmingUpFeedback.OutputChange -= IsWarmingUpFeedback_OutputChange;
- disp.IsWarmingUpFeedback.OutputChange += IsWarmingUpFeedback_OutputChange;
-
- disp.IsCoolingDownFeedback.OutputChange -= IsCoolingDownFeedback_OutputChange;
- disp.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange;
- }
-
-
-
- // Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
- this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
-
- Debug.Console(2, this, "Microphone Privacy Config evaluated.");
-
- // Get emergency object, if any
- this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
-
- Debug.Console(2, this, "Emergency Config evaluated.");
-
- if (AudioCodec != null)
- {
- AudioCodec.CallStatusChange -= AudioCodec_CallStatusChange;
- AudioCodec.CallStatusChange += AudioCodec_CallStatusChange;
- }
-
- VideoCodec.CallStatusChange -= VideoCodec_CallStatusChange;
- VideoCodec.CallStatusChange += VideoCodec_CallStatusChange;
-
- VideoCodec.IsReadyChange -= VideoCodec_IsReadyChange;
- VideoCodec.IsReadyChange += VideoCodec_IsReadyChange;
-
- VideoCodec.SharingContentIsOnFeedback.OutputChange -= SharingContentIsOnFeedback_OutputChange;
- VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange;
-
-
- IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
-
- // link privacy to VC (for now?)
- PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
-
- VideoCodec.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
- VideoCodec.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
-
- CallTypeFeedback = new IntFeedback(() => 0);
-
- SetupEnvironmentalControlDevices();
-
- SetSourceListKey();
-
- EnablePowerOnToLastSource = true;
-
-
- // Add Occupancy object from config
- if (PropertiesConfig.Occupancy != null)
- {
- Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Setting Occupancy Provider for room");
- this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
- IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
- }
-
- this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
- this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
-
- this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
- this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
- }
- catch (Exception e)
- {
- Debug.Console(0, this, "Error Activiating Room: {0}", e);
- }
-
- Debug.Console(0, this, "Room '{0}' Activated", Name);
- return base.CustomActivate();
- }
-
- void PrivacyModeIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- PrivacyModeIsOnFeedback.FireUpdate();
- }
-
- void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- IsSharingFeedback.FireUpdate();
- }
-
- void AudioCodec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
- {
- InCallFeedback.FireUpdate();
- }
-
- void VideoCodec_IsReadyChange(object sender, EventArgs e)
- {
- SetUpVideoCodec();
- }
-
- void SetUpVideoCodec()
- {
- SetCodecExternalSources();
- SetCodecBranding();
- }
-
- void VideoCodec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
- {
- InCallFeedback.FireUpdate();
- }
-
- void IsCoolingDownFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- IsCoolingDownFeedback.FireUpdate();
- }
-
- void IsWarmingUpFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- IsWarmingUpFeedback.FireUpdate();
- if (!IsWarmingUpFeedback.BoolValue)
- (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
-
- }
-
- void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
- {
- var dispTwoWay = DefaultDisplay as IHasPowerControlWithFeedback;
-
- if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
- {
- if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
- CurrentSourceInfo = null;
- OnFeedback.FireUpdate();
- }
- if (dispTwoWay.PowerIsOnFeedback.BoolValue)
- {
- SetDefaultLevels();
- }
-
- }
-
-
-
- ///
- ///
- ///
- protected override void EndShutdown()
- {
- VideoCodec.EndAllCalls();
-
- SetDefaultLevels();
-
- RunDefaultPresentRoute();
-
- CrestronEnvironment.Sleep(1000);
-
- Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room");
-
- RunRouteAction("roomOff");
- VideoCodec.StopSharing();
- VideoCodec.StandbyActivate();
- }
-
- ///
- /// Routes the default source item, if any. Returns true when default route exists
- ///
- public override bool RunDefaultPresentRoute()
- {
- if (DefaultSourceItem != null)
- RunRouteAction(DefaultSourceItem);
-
- return DefaultSourceItem != null;
- }
-
- ///
- /// Sets up the room when started into call mode without presenting a source
- ///
- ///
- public bool RunDefaultCallRoute()
- {
- Debug.Console(2, this, "RunDefaultCallRoute() Currently Sharing Content: {0}", VideoCodec.SharingContentIsOnFeedback.BoolValue);
-
- if (VideoCodec.SharingContentIsOnFeedback.BoolValue)
- {
- Debug.Console(2, this, "Currently sharing content. Ignoring request to run default call route.");
- return false;
- }
-
- RunRouteAction(DefaultCodecRouteString);
- return true;
- }
-
- public void RunRouteActionCodec(string routeKey, string sourceListKey)
- {
- _codecExternalSourceChange = true;
- RunRouteAction(routeKey, sourceListKey);
- }
-
- ///
- ///
- ///
- ///
- public void RunRouteAction(string routeKey)
- {
- RunRouteAction(routeKey, new Action(() => { }));
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void RunRouteAction(string routeKey, string sourceListKey)
- {
- if (string.IsNullOrEmpty(sourceListKey))
- {
- Debug.Console(1, this, "No sourceListKey present. RunRouteAction assumes default source list.");
- RunRouteAction(routeKey, new Action(() => { }));
- }
- else
- {
- Debug.Console(1, this, "sourceListKey present but not yet implemented");
-
- RunRouteAction(routeKey, new Action(() => { }));
- }
- }
-
- ///
- ///
- ///
- ///
- ///
- ///
- public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback)
- {
- if (string.IsNullOrEmpty(sourceListKey))
- {
- RunRouteAction(routeKey, successCallback);
- }
- else
- {
- Debug.Console(1, this, "sourceListKey present but not yet implemented");
-
- RunRouteAction(routeKey, successCallback);
- }
- }
-
- ///
- /// Gets a source from config list SourceListKey and dynamically build and executes the
- /// route or commands
- ///
- ///
- public void RunRouteAction(string routeKey, Action successCallback)
- {
- // Run this on a separate thread
- new CTimer(o =>
- {
- // try to prevent multiple simultaneous selections
- SourceSelectLock.TryEnter();
-
- try
- {
-
- Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Run route action '{0}'", routeKey);
- var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
- if (dict == null)
- {
- Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
- return;
- }
-
- // Try to get the list item by it's string key
- if (!dict.ContainsKey(routeKey))
- {
- Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
- routeKey, SourceListKey);
- return;
- }
-
- // End usage timer on last source
- if (!string.IsNullOrEmpty(LastSourceKey))
- {
- var usageLastSource = dict[LastSourceKey].SourceDevice as IUsageTracking;
- if (usageLastSource != null && usageLastSource.UsageTracker != null)
- {
- try
- {
- // There MAY have been failures in here. Protect
- usageLastSource.UsageTracker.EndDeviceUsage();
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e);
- }
- }
- }
-
- // Let's run it
- var item = dict[routeKey];
- if (routeKey.ToLower() != "roomoff")
- {
-
- LastSourceKey = routeKey;
- }
- else
- CurrentSourceInfoKey = null;
-
- // hand off the individual routes to this helper
- foreach (var route in item.RouteList)
- DoRouteItem(route);
-
- // Start usage timer on routed source
- var usageNewSource = item.SourceDevice as IUsageTracking;
- if (usageNewSource != null && usageNewSource.UsageTracker != null) // Have to make sure there is a usage tracker!
- {
- (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
- }
-
- // See if this can be moved into common, base-class method -------------
-
-
- // Set volume control, using default if non provided
- IBasicVolumeControls volDev = null;
- // Handle special cases for volume control
- if (string.IsNullOrEmpty(item.VolumeControlKey)
- || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
- volDev = DefaultVolumeControls;
- else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
- volDev = DefaultDisplay as IBasicVolumeControls;
- // Or a specific device, probably rarely used.
- else
- {
- var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
- if (dev is IBasicVolumeControls)
- volDev = dev as IBasicVolumeControls;
- else if (dev is IHasVolumeDevice)
- volDev = (dev as IHasVolumeDevice).VolumeDevice;
- }
-
- if (volDev != CurrentVolumeControls)
- {
- // zero the volume on the device we are leaving.
- // Set the volume to default on device we are entering
- if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
- {
- var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
- SavedVolumeLevels[vd] = (uint)vd.VolumeLevelFeedback.IntValue;
- vd.SetVolume(0);
- }
-
- CurrentVolumeControls = volDev;
- if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
- {
- var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
- ushort vol = (SavedVolumeLevels.ContainsKey(vd) ? (ushort)SavedVolumeLevels[vd] : DefaultVolume);
- vd.SetVolume(vol);
- }
- }
- // -----------------------------------------------------------------------
-
-
-
- // store the name and UI info for routes
- if (item.SourceKey == "$off")
- {
- CurrentSourceInfoKey = routeKey;
- CurrentSourceInfo = null;
- }
- else if (item.SourceKey != null)
- {
- CurrentSourceInfoKey = routeKey;
- CurrentSourceInfo = item;
- }
-
- OnFeedback.FireUpdate();
-
- if (OnFeedback.BoolValue)
- {
- if (VideoCodec.UsageTracker.InUseTracker.InUseFeedback.BoolValue)
- {
- Debug.Console(1, this, "Video Codec in use, deactivating standby on codec");
- VideoCodec.StandbyDeactivate();
- }
-
- if (VideoCodec.StandbyIsOnFeedback.BoolValue)
- {
- VideoCodec.StandbyDeactivate();
- }
- else
- {
- Debug.Console(1, this, "Video codec not in standby. No need to wake.");
- }
- }
- else
- {
- Debug.Console(1, this, "Room OnFeedback state: {0}", OnFeedback.BoolValue);
- }
-
- // report back when done
- if (successCallback != null)
- successCallback();
- }
- catch (Exception e)
- {
- Debug.Console(1, this, "ERROR in routing: {0}", e);
- }
-
- SourceSelectLock.Leave();
- }, 0); // end of CTimer
- }
-
- ///
- ///
- ///
- ///
- void DoRouteItem(SourceRouteListItem route)
- {
- // if there is a $defaultAll on route, run two separate
- if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
- {
- // Going to assume a single-path route for now
- var tempVideo = new SourceRouteListItem
- {
- DestinationKey = "$defaultDisplay",
- SourceKey = route.SourceKey,
- Type = eRoutingSignalType.Video
- };
- DoRoute(tempVideo);
- }
- else
- DoRoute(route);
- }
-
- ///
- ///
- ///
- ///
- ///
- bool DoRoute(SourceRouteListItem route)
- {
- IRoutingSink dest = null;
-
- if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
- dest = DefaultAudioDevice as IRoutingSink;
- else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
- dest = DefaultDisplay;
- else
- dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
-
-
- if (dest == null)
- {
- Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
- return false;
- }
-
- if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
- {
- dest.ReleaseRoute();
- if (dest is IHasPowerControl)
- (dest as IHasPowerControl).PowerOff();
-
- }
- else
- {
- var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
- if (source == null)
- {
- Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
- return false;
- }
- dest.ReleaseAndMakeRoute(source, route.Type);
- }
- return true;
- }
-
- public override void RoomVacatedForTimeoutPeriod(object o)
- {
- //Implement this
- }
-
- protected override bool AllowVacancyTimerToStart()
- {
- bool allowVideo = true;
- bool allowAudio = true;
-
- if (VideoCodec != null)
- {
- Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} {1} in a video call", Key, VideoCodec.IsInCall ? "is" : "is not");
- allowVideo = !VideoCodec.IsInCall;
- }
-
- if (AudioCodec != null)
- {
- Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} {1} in an audio call", Key, AudioCodec.IsInCall ? "is" : "is not");
- allowAudio = !AudioCodec.IsInCall;
- }
-
- Debug.Console(2, this, "Room {0} allowing vacancy timer to start: {1}", Key, allowVideo && allowAudio);
-
- return allowVideo && allowAudio;
- }
-
- ///
- /// Does what it says
- ///
- public override void SetDefaultLevels()
- {
- Debug.Console(1, this, "Restoring default levels");
- var vc = CurrentVolumeControls as IBasicVolumeWithFeedback;
- if (vc != null)
- vc.SetVolume(DefaultVolume);
- }
- ///
- /// Will power the room on with the last-used source
- ///
- public override void PowerOnToDefaultOrLastSource()
- {
- if (!EnablePowerOnToLastSource || LastSourceKey == null)
- return;
- RunRouteAction(LastSourceKey);
- }
-
- ///
- /// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
- ///
- public static void AllRoomsOff()
- {
- var allRooms = DeviceManager.AllDevices.Where(d =>
- d is IEssentialsRoom && !(d as IEssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
- foreach (var room in allRooms)
- (room as IEssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
- }
-
-
- ///
- /// Setup the external sources for the Cisco Touch 10 devices that support IHasExternalSourceSwitch
- ///
- private void SetCodecExternalSources()
- {
- var videoCodecWithExternalSwitching = VideoCodec as IHasExternalSourceSwitching;
-
- if (videoCodecWithExternalSwitching == null || !videoCodecWithExternalSwitching.ExternalSourceListEnabled)
- {
- return;
- }
-
- try
- {
- // Get the tie line that the external switcher is connected to
- string codecInputConnectorName = ConfigReader.ConfigObject.TieLines.SingleOrDefault(
- x => x.DestinationKey == VideoCodec.Key && x.DestinationPort == videoCodecWithExternalSwitching.ExternalSourceInputPort).DestinationPort;
-
- videoCodecWithExternalSwitching.ClearExternalSources();
- videoCodecWithExternalSwitching.RunRouteAction = RunRouteActionCodec;
- var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
-
- foreach (var kvp in srcList)
- {
- var srcConfig = kvp.Value;
-
- if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
- {
- videoCodecWithExternalSwitching.AddExternalSource(codecInputConnectorName, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
- videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
- }
- }
- Debug.Console(1, this, "Successfully set up codec external sources for room: {0}", Name);
-
- }
- catch (Exception e)
- {
- Debug.Console(2, this, "Error setting codec external sources: {0}", e);
- }
- }
-
- private void SetCodecBranding()
- {
- var vcWithBranding = VideoCodec as IHasBranding;
-
- if (vcWithBranding == null) return;
-
- Debug.Console(1, this, "Setting Codec Branding");
- vcWithBranding.InitializeBranding(Key);
- }
-
- #region IPrivacy Members
-
-
- public void PrivacyModeOff()
- {
- VideoCodec.PrivacyModeOff();
- }
-
- public void PrivacyModeOn()
- {
- VideoCodec.PrivacyModeOn();
- }
-
- public void PrivacyModeToggle()
- {
- VideoCodec.PrivacyModeToggle();
- }
-
- #endregion
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using Newtonsoft.Json;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Room.Config;
+using PepperDash.Essentials.Devices.Common.Codec;
+using PepperDash.Essentials.Devices.Common.VideoCodec;
+using PepperDash.Essentials.Devices.Common.AudioCodec;
+using PepperDash.Essentials.Core.DeviceTypeInterfaces;
+
+namespace PepperDash.Essentials
+{
+ public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IEssentialsHuddleVtc1Room
+ {
+ private IEssentialsRoomCombiner _roomCombiner;
+
+ private bool _codecExternalSourceChange;
+ public event EventHandler CurrentVolumeDeviceChange;
+ public event SourceInfoChangeHandler CurrentSourceChange;
+
+
+ //************************
+ // Call-related stuff
+
+ public BoolFeedback InCallFeedback { get; private set; }
+
+ /////
+ ///// Make this more specific
+ /////
+ //public List ActiveCalls { get; private set; }
+
+ ///
+ /// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis
+ ///
+ public IntFeedback CallTypeFeedback { get; private set; }
+
+ ///
+ ///
+ ///
+ public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
+
+ ///
+ /// When something in the room is sharing with the far end or through other means
+ ///
+ public BoolFeedback IsSharingFeedback { get; private set; }
+
+ //************************
+
+ protected override Func OnFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ var disp = DefaultDisplay as DisplayBase;
+ var val = CurrentSourceInfo != null
+ && CurrentSourceInfo.Type == eSourceListItemType.Route
+ && disp != null;
+ //&& disp.PowerIsOnFeedback.BoolValue;
+ return val;
+ };
+ }
+ }
+ ///
+ ///
+ ///
+ protected override Func IsWarmingFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ var disp = DefaultDisplay as DisplayBase;
+ if (disp != null)
+ return disp.IsWarmingUpFeedback.BoolValue;
+ else
+ return false;
+ };
+ }
+ }
+ ///
+ ///
+ ///
+ protected override Func IsCoolingFeedbackFunc
+ {
+ get
+ {
+ return () =>
+ {
+ var disp = DefaultDisplay as DisplayBase;
+ if (disp != null)
+ return disp.IsCoolingDownFeedback.BoolValue;
+ else
+ return false;
+ };
+ }
+ }
+
+ public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
+
+ public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
+ public IBasicVolumeControls DefaultAudioDevice { get; private set; }
+ public IBasicVolumeControls DefaultVolumeControls { get; private set; }
+
+ public VideoCodecBase VideoCodec { get; private set; }
+
+ public AudioCodecBase AudioCodec { get; private set; }
+
+ public bool ExcludeFromGlobalFunctions { get; set; }
+
+ public string DefaultSourceItem { get; set; }
+
+ public ushort DefaultVolume { get; set; }
+
+ ///
+ /// If room is off, enables power on to last source. Default true
+ ///
+ public bool EnablePowerOnToLastSource { get; set; }
+ string LastSourceKey;
+
+ ///
+ /// Sets the volume control device, and attaches/removes InUseTrackers with "audio"
+ /// tag to device.
+ ///
+ public IBasicVolumeControls CurrentVolumeControls
+ {
+ get { return _CurrentAudioDevice; }
+ set
+ {
+ if (value == _CurrentAudioDevice) return;
+
+ var oldDev = _CurrentAudioDevice;
+ // derigister this room from the device, if it can
+ if (oldDev is IInUseTracking)
+ (oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
+ var handler = CurrentVolumeDeviceChange;
+ if (handler != null)
+ CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
+ _CurrentAudioDevice = value;
+ if (handler != null)
+ CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
+ // register this room with new device, if it can
+ if (_CurrentAudioDevice is IInUseTracking)
+ (_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
+ }
+ }
+ IBasicVolumeControls _CurrentAudioDevice;
+
+ ///
+ /// The SourceListItem last run - containing names and icons
+ ///
+ public SourceListItem CurrentSourceInfo
+ {
+ get { return _CurrentSourceInfo; }
+ set
+ {
+ if (value == _CurrentSourceInfo) return;
+
+ var handler = CurrentSourceChange;
+ // remove from in-use tracker, if so equipped
+ if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
+ (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
+
+ if (handler != null)
+ handler(_CurrentSourceInfo, ChangeType.WillChange);
+
+ _CurrentSourceInfo = value;
+
+ // add to in-use tracking
+ if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
+ (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
+ if (handler != null)
+ handler(_CurrentSourceInfo, ChangeType.DidChange);
+
+ var vc = VideoCodec as IHasExternalSourceSwitching;
+ if (vc != null && !_codecExternalSourceChange)
+ {
+ vc.SetSelectedSource(CurrentSourceInfoKey);
+ }
+
+ _codecExternalSourceChange = false;
+ }
+ }
+ SourceListItem _CurrentSourceInfo;
+
+ public string CurrentSourceInfoKey { get; set; }
+
+ ///
+ /// "codecOsd"
+ ///
+ public string DefaultCodecRouteString { get { return "codecOsd"; } }
+
+ ///
+ /// Temporary implementation. Returns the schedule-ready object or null if none. Fow now,
+ /// always returns the VideoCodec if it is capable
+ ///
+ public IHasScheduleAwareness ScheduleSource { get { return VideoCodec as IHasScheduleAwareness; } }
+
+ CCriticalSection SourceSelectLock = new CCriticalSection();
+
+ public EssentialsHuddleVtc1Room(DeviceConfig config)
+ : base(config)
+ {
+ try
+ {
+ PropertiesConfig = JsonConvert.DeserializeObject
+ (config.Properties.ToString());
+ DefaultDisplay = DeviceManager.GetDeviceForKey((PropertiesConfig as EssentialsHuddleVtc1PropertiesConfig).DefaultDisplayKey) as IRoutingSinkWithSwitching;
+
+ VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
+ PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
+
+
+ if (VideoCodec == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "No Video Codec set. Please check 'videoCodecKey' property in room config");
+ throw new ArgumentNullException("VideoCodec cannot be null");
+ }
+
+ AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
+ PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
+ if (AudioCodec == null)
+ Debug.Console(0, this, "No Audio Codec Found");
+
+ DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
+ if (DefaultAudioDevice == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "No Default Audio Device set. Please check 'defaultAudioKey' property in room config");
+ throw new ArgumentNullException("DefaultAudioDevice cannot be null");
+ }
+
+ Initialize();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "Error building room: \n{0}", e);
+ }
+ }
+
+
+ private void SetupEnvironmentalControlDevices()
+ {
+ if (PropertiesConfig.Environment != null)
+ {
+ if (PropertiesConfig.Environment.Enabled)
+ {
+ EnvironmentalControlDevices.Clear();
+
+ foreach (var d in PropertiesConfig.Environment.DeviceKeys)
+ {
+ var envDevice = DeviceManager.GetDeviceForKey(d) as EssentialsDevice;
+ EnvironmentalControlDevices.Add(envDevice);
+ }
+ }
+ }
+ }
+
+
+ private void SetSourceListKey()
+ {
+ if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
+ {
+ SetSourceListKey(PropertiesConfig.SourceListKey);
+ }
+ else
+ {
+ SetSourceListKey(Key);
+ }
+
+ SetUpVideoCodec();
+ }
+
+ protected override void CustomSetConfig(DeviceConfig config)
+ {
+ var newPropertiesConfig = JsonConvert.DeserializeObject(config.Properties.ToString());
+
+ if (newPropertiesConfig != null)
+ PropertiesConfig = newPropertiesConfig;
+
+ ConfigWriter.UpdateRoomConfig(config);
+ }
+
+ public override bool Deactivate()
+ {
+
+ // Stop listining to this event when room deactivated
+ VideoCodec.IsReadyChange -= VideoCodec_IsReadyChange;
+
+ // Clear occupancy
+ RoomOccupancy = null;
+
+ Debug.Console(0, this, "Room '{0}' Deactivated", Name);
+
+ return base.Deactivate();
+ }
+
+ public override bool CustomActivate()
+ {
+ try
+ {
+ if (DefaultAudioDevice is IBasicVolumeControls)
+ DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
+ else if (DefaultAudioDevice is IHasVolumeDevice)
+ DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
+ CurrentVolumeControls = DefaultVolumeControls;
+
+
+ // Combines call feedback from both codecs if available
+ InCallFeedback = new BoolFeedback(() =>
+ {
+ bool inAudioCall = false;
+ bool inVideoCall = false;
+
+ if (AudioCodec != null)
+ inAudioCall = AudioCodec.IsInCall;
+
+ if (VideoCodec != null)
+ inVideoCall = VideoCodec.IsInCall;
+
+ if (inAudioCall || inVideoCall)
+ return true;
+ else
+ return false;
+ });
+
+ var disp = DefaultDisplay as DisplayBase;
+ if (disp != null)
+ {
+ // Link power, warming, cooling to display
+ var dispTwoWay = disp as IHasPowerControlWithFeedback;
+ if (dispTwoWay != null)
+ {
+ dispTwoWay.PowerIsOnFeedback.OutputChange -= PowerIsOnFeedback_OutputChange;
+ dispTwoWay.PowerIsOnFeedback.OutputChange += PowerIsOnFeedback_OutputChange;
+ }
+
+ disp.IsWarmingUpFeedback.OutputChange -= IsWarmingUpFeedback_OutputChange;
+ disp.IsWarmingUpFeedback.OutputChange += IsWarmingUpFeedback_OutputChange;
+
+ disp.IsCoolingDownFeedback.OutputChange -= IsCoolingDownFeedback_OutputChange;
+ disp.IsCoolingDownFeedback.OutputChange += IsCoolingDownFeedback_OutputChange;
+ }
+
+
+
+ // Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
+ this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this);
+
+ Debug.Console(2, this, "Microphone Privacy Config evaluated.");
+
+ // Get emergency object, if any
+ this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this);
+
+ Debug.Console(2, this, "Emergency Config evaluated.");
+
+ if (AudioCodec != null)
+ {
+ AudioCodec.CallStatusChange -= AudioCodec_CallStatusChange;
+ AudioCodec.CallStatusChange += AudioCodec_CallStatusChange;
+ }
+
+ VideoCodec.CallStatusChange -= VideoCodec_CallStatusChange;
+ VideoCodec.CallStatusChange += VideoCodec_CallStatusChange;
+
+ VideoCodec.IsReadyChange -= VideoCodec_IsReadyChange;
+ VideoCodec.IsReadyChange += VideoCodec_IsReadyChange;
+
+ VideoCodec.SharingContentIsOnFeedback.OutputChange -= SharingContentIsOnFeedback_OutputChange;
+ VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange;
+
+
+ IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
+
+ // link privacy to VC (for now?)
+ PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
+
+ VideoCodec.PrivacyModeIsOnFeedback.OutputChange -= PrivacyModeIsOnFeedback_OutputChange;
+ VideoCodec.PrivacyModeIsOnFeedback.OutputChange += PrivacyModeIsOnFeedback_OutputChange;
+
+ CallTypeFeedback = new IntFeedback(() => 0);
+
+ SetupEnvironmentalControlDevices();
+
+ SetSourceListKey();
+
+ EnablePowerOnToLastSource = true;
+
+
+ // Add Occupancy object from config
+ if (PropertiesConfig.Occupancy != null)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Setting Occupancy Provider for room");
+ this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
+ IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
+ }
+
+ this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
+ this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
+
+ this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
+ this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, this, "Error Activiating Room: {0}", e);
+ }
+
+ Debug.Console(0, this, "Room '{0}' Activated", Name);
+ return base.CustomActivate();
+ }
+
+ void PrivacyModeIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ PrivacyModeIsOnFeedback.FireUpdate();
+ }
+
+ void SharingContentIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ IsSharingFeedback.FireUpdate();
+ }
+
+ void AudioCodec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
+ {
+ InCallFeedback.FireUpdate();
+ }
+
+ void VideoCodec_IsReadyChange(object sender, EventArgs e)
+ {
+ SetUpVideoCodec();
+ }
+
+ void SetUpVideoCodec()
+ {
+ SetCodecExternalSources();
+ SetCodecBranding();
+ }
+
+ void VideoCodec_CallStatusChange(object sender, CodecCallStatusItemChangeEventArgs e)
+ {
+ InCallFeedback.FireUpdate();
+ }
+
+ void IsCoolingDownFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ IsCoolingDownFeedback.FireUpdate();
+ }
+
+ void IsWarmingUpFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ IsWarmingUpFeedback.FireUpdate();
+ if (!IsWarmingUpFeedback.BoolValue)
+ (CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
+
+ }
+
+ void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
+ {
+ var dispTwoWay = DefaultDisplay as IHasPowerControlWithFeedback;
+
+ if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
+ {
+ if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
+ CurrentSourceInfo = null;
+ OnFeedback.FireUpdate();
+ }
+ if (dispTwoWay.PowerIsOnFeedback.BoolValue)
+ {
+ SetDefaultLevels();
+ }
+
+ }
+
+
+
+ ///
+ ///
+ ///
+ protected override void EndShutdown()
+ {
+ VideoCodec.EndAllCalls();
+
+ SetDefaultLevels();
+
+ RunDefaultPresentRoute();
+
+ CrestronEnvironment.Sleep(1000);
+
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room");
+
+ RunRouteAction("roomOff");
+ VideoCodec.StopSharing();
+ VideoCodec.StandbyActivate();
+ }
+
+ ///
+ /// Routes the default source item, if any. Returns true when default route exists
+ ///
+ public override bool RunDefaultPresentRoute()
+ {
+ if (DefaultSourceItem != null)
+ RunRouteAction(DefaultSourceItem);
+
+ return DefaultSourceItem != null;
+ }
+
+ ///
+ /// Sets up the room when started into call mode without presenting a source
+ ///
+ ///
+ public bool RunDefaultCallRoute()
+ {
+ Debug.Console(2, this, "RunDefaultCallRoute() Currently Sharing Content: {0}", VideoCodec.SharingContentIsOnFeedback.BoolValue);
+
+ if (VideoCodec.SharingContentIsOnFeedback.BoolValue)
+ {
+ Debug.Console(2, this, "Currently sharing content. Ignoring request to run default call route.");
+ return false;
+ }
+
+ RunRouteAction(DefaultCodecRouteString);
+ return true;
+ }
+
+ public void RunRouteActionCodec(string routeKey, string sourceListKey)
+ {
+ _codecExternalSourceChange = true;
+ RunRouteAction(routeKey, sourceListKey);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey)
+ {
+ RunRouteAction(routeKey, new Action(() => { }));
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey, string sourceListKey)
+ {
+ if (string.IsNullOrEmpty(sourceListKey))
+ {
+ Debug.Console(1, this, "No sourceListKey present. RunRouteAction assumes default source list.");
+ RunRouteAction(routeKey, new Action(() => { }));
+ }
+ else
+ {
+ Debug.Console(1, this, "sourceListKey present but not yet implemented");
+
+ RunRouteAction(routeKey, new Action(() => { }));
+ }
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback)
+ {
+ if (string.IsNullOrEmpty(sourceListKey))
+ {
+ RunRouteAction(routeKey, successCallback);
+ }
+ else
+ {
+ Debug.Console(1, this, "sourceListKey present but not yet implemented");
+
+ RunRouteAction(routeKey, successCallback);
+ }
+ }
+
+ ///
+ /// Gets a source from config list SourceListKey and dynamically build and executes the
+ /// route or commands
+ ///
+ ///
+ public void RunRouteAction(string routeKey, Action successCallback)
+ {
+ // Run this on a separate thread
+ new CTimer(o =>
+ {
+ // try to prevent multiple simultaneous selections
+ SourceSelectLock.TryEnter();
+
+ try
+ {
+
+ Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Run route action '{0}'", routeKey);
+ var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
+ if (dict == null)
+ {
+ Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
+ return;
+ }
+
+ // Try to get the list item by it's string key
+ if (!dict.ContainsKey(routeKey))
+ {
+ Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
+ routeKey, SourceListKey);
+ return;
+ }
+
+ // End usage timer on last source
+ if (!string.IsNullOrEmpty(LastSourceKey))
+ {
+ var usageLastSource = dict[LastSourceKey].SourceDevice as IUsageTracking;
+ if (usageLastSource != null && usageLastSource.UsageTracker != null)
+ {
+ try
+ {
+ // There MAY have been failures in here. Protect
+ usageLastSource.UsageTracker.EndDeviceUsage();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e);
+ }
+ }
+ }
+
+ // Let's run it
+ var item = dict[routeKey];
+ if (routeKey.ToLower() != "roomoff")
+ {
+
+ LastSourceKey = routeKey;
+ }
+ else
+ CurrentSourceInfoKey = null;
+
+ // hand off the individual routes to this helper
+ foreach (var route in item.RouteList)
+ DoRouteItem(route);
+
+ // Start usage timer on routed source
+ var usageNewSource = item.SourceDevice as IUsageTracking;
+ if (usageNewSource != null && usageNewSource.UsageTracker != null) // Have to make sure there is a usage tracker!
+ {
+ (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
+ }
+
+ // See if this can be moved into common, base-class method -------------
+
+
+ // Set volume control, using default if non provided
+ IBasicVolumeControls volDev = null;
+ // Handle special cases for volume control
+ if (string.IsNullOrEmpty(item.VolumeControlKey)
+ || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
+ volDev = DefaultVolumeControls;
+ else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
+ volDev = DefaultDisplay as IBasicVolumeControls;
+ // Or a specific device, probably rarely used.
+ else
+ {
+ var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
+ if (dev is IBasicVolumeControls)
+ volDev = dev as IBasicVolumeControls;
+ else if (dev is IHasVolumeDevice)
+ volDev = (dev as IHasVolumeDevice).VolumeDevice;
+ }
+
+ if (volDev != CurrentVolumeControls)
+ {
+ // zero the volume on the device we are leaving.
+ // Set the volume to default on device we are entering
+ if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
+ {
+ var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ SavedVolumeLevels[vd] = (uint)vd.VolumeLevelFeedback.IntValue;
+ vd.SetVolume(0);
+ }
+
+ CurrentVolumeControls = volDev;
+ if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
+ {
+ var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ ushort vol = (SavedVolumeLevels.ContainsKey(vd) ? (ushort)SavedVolumeLevels[vd] : DefaultVolume);
+ vd.SetVolume(vol);
+ }
+ }
+ // -----------------------------------------------------------------------
+
+
+
+ // store the name and UI info for routes
+ if (item.SourceKey == "$off")
+ {
+ CurrentSourceInfoKey = routeKey;
+ CurrentSourceInfo = null;
+ }
+ else if (item.SourceKey != null)
+ {
+ CurrentSourceInfoKey = routeKey;
+ CurrentSourceInfo = item;
+ }
+
+ OnFeedback.FireUpdate();
+
+ if (OnFeedback.BoolValue)
+ {
+ if (VideoCodec.UsageTracker.InUseTracker.InUseFeedback.BoolValue)
+ {
+ Debug.Console(1, this, "Video Codec in use, deactivating standby on codec");
+ VideoCodec.StandbyDeactivate();
+ }
+
+ if (VideoCodec.StandbyIsOnFeedback.BoolValue)
+ {
+ VideoCodec.StandbyDeactivate();
+ }
+ else
+ {
+ Debug.Console(1, this, "Video codec not in standby. No need to wake.");
+ }
+ }
+ else
+ {
+ Debug.Console(1, this, "Room OnFeedback state: {0}", OnFeedback.BoolValue);
+ }
+
+ // report back when done
+ if (successCallback != null)
+ successCallback();
+ }
+ catch (Exception e)
+ {
+ Debug.Console(1, this, "ERROR in routing: {0}", e);
+ }
+
+ SourceSelectLock.Leave();
+ }, 0); // end of CTimer
+ }
+
+ ///
+ ///
+ ///
+ ///
+ void DoRouteItem(SourceRouteListItem route)
+ {
+ // if there is a $defaultAll on route, run two separate
+ if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
+ {
+ // Going to assume a single-path route for now
+ var tempVideo = new SourceRouteListItem
+ {
+ DestinationKey = "$defaultDisplay",
+ SourceKey = route.SourceKey,
+ Type = eRoutingSignalType.Video
+ };
+ DoRoute(tempVideo);
+ }
+ else
+ DoRoute(route);
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ bool DoRoute(SourceRouteListItem route)
+ {
+ IRoutingSink dest = null;
+
+ if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
+ dest = DefaultAudioDevice as IRoutingSink;
+ else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
+ dest = DefaultDisplay;
+ else
+ dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
+
+
+ if (dest == null)
+ {
+ Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
+ return false;
+ }
+
+ if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
+ {
+ dest.ReleaseRoute();
+ if (dest is IHasPowerControl)
+ (dest as IHasPowerControl).PowerOff();
+
+ }
+ else
+ {
+ var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
+ if (source == null)
+ {
+ Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
+ return false;
+ }
+ dest.ReleaseAndMakeRoute(source, route.Type);
+ }
+ return true;
+ }
+
+ public override void RoomVacatedForTimeoutPeriod(object o)
+ {
+ //Implement this
+ }
+
+ protected override bool AllowVacancyTimerToStart()
+ {
+ bool allowVideo = true;
+ bool allowAudio = true;
+
+ if (VideoCodec != null)
+ {
+ Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} {1} in a video call", Key, VideoCodec.IsInCall ? "is" : "is not");
+ allowVideo = !VideoCodec.IsInCall;
+ }
+
+ if (AudioCodec != null)
+ {
+ Debug.Console(2,this, Debug.ErrorLogLevel.Notice, "Room {0} {1} in an audio call", Key, AudioCodec.IsInCall ? "is" : "is not");
+ allowAudio = !AudioCodec.IsInCall;
+ }
+
+ Debug.Console(2, this, "Room {0} allowing vacancy timer to start: {1}", Key, allowVideo && allowAudio);
+
+ return allowVideo && allowAudio;
+ }
+
+ ///
+ /// Does what it says
+ ///
+ public override void SetDefaultLevels()
+ {
+ Debug.Console(1, this, "Restoring default levels");
+ var vc = CurrentVolumeControls as IBasicVolumeWithFeedback;
+ if (vc != null)
+ vc.SetVolume(DefaultVolume);
+ }
+ ///
+ /// Will power the room on with the last-used source
+ ///
+ public override void PowerOnToDefaultOrLastSource()
+ {
+ if (!EnablePowerOnToLastSource || LastSourceKey == null)
+ return;
+ RunRouteAction(LastSourceKey);
+ }
+
+ ///
+ /// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
+ ///
+ public static void AllRoomsOff()
+ {
+ var allRooms = DeviceManager.AllDevices.Where(d =>
+ d is IEssentialsRoom && !(d as IEssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
+ foreach (var room in allRooms)
+ (room as IEssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
+ }
+
+
+ ///
+ /// Setup the external sources for the Cisco Touch 10 devices that support IHasExternalSourceSwitch
+ ///
+ private void SetCodecExternalSources()
+ {
+ var videoCodecWithExternalSwitching = VideoCodec as IHasExternalSourceSwitching;
+
+ if (videoCodecWithExternalSwitching == null || !videoCodecWithExternalSwitching.ExternalSourceListEnabled)
+ {
+ return;
+ }
+
+ try
+ {
+ // Get the tie line that the external switcher is connected to
+ string codecInputConnectorName = ConfigReader.ConfigObject.TieLines.SingleOrDefault(
+ x => x.DestinationKey == VideoCodec.Key && x.DestinationPort == videoCodecWithExternalSwitching.ExternalSourceInputPort).DestinationPort;
+
+ videoCodecWithExternalSwitching.ClearExternalSources();
+ videoCodecWithExternalSwitching.RunRouteAction = RunRouteActionCodec;
+ var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
+
+ foreach (var kvp in srcList)
+ {
+ var srcConfig = kvp.Value;
+
+ if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
+ {
+ videoCodecWithExternalSwitching.AddExternalSource(codecInputConnectorName, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
+ videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
+ }
+ }
+ Debug.Console(1, this, "Successfully set up codec external sources for room: {0}", Name);
+
+ }
+ catch (Exception e)
+ {
+ Debug.Console(2, this, "Error setting codec external sources: {0}", e);
+ }
+ }
+
+ private void SetCodecBranding()
+ {
+ var vcWithBranding = VideoCodec as IHasBranding;
+
+ if (vcWithBranding == null) return;
+
+ Debug.Console(1, this, "Setting Codec Branding");
+ vcWithBranding.InitializeBranding(Key);
+ }
+
+ #region IPrivacy Members
+
+
+ public void PrivacyModeOff()
+ {
+ VideoCodec.PrivacyModeOff();
+ }
+
+ public void PrivacyModeOn()
+ {
+ VideoCodec.PrivacyModeOn();
+ }
+
+ public void PrivacyModeToggle()
+ {
+ VideoCodec.PrivacyModeToggle();
+ }
+
+ #endregion
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs.orig b/src/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs.orig
similarity index 100%
rename from PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs.orig
rename to src/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs.orig
diff --git a/PepperDashEssentials/Room/Types/EssentialsNDisplayRoomBase.cs b/src/PepperDashEssentials/Room/Types/EssentialsNDisplayRoomBase.cs
similarity index 100%
rename from PepperDashEssentials/Room/Types/EssentialsNDisplayRoomBase.cs
rename to src/PepperDashEssentials/Room/Types/EssentialsNDisplayRoomBase.cs
diff --git a/PepperDashEssentials/Room/Types/EssentialsTechRoom.cs b/src/PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
similarity index 100%
rename from PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
rename to src/PepperDashEssentials/Room/Types/EssentialsTechRoom.cs
diff --git a/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs b/src/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs
similarity index 100%
rename from PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs
rename to src/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleSpaceRoom.cs
diff --git a/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleVtc1Room.cs b/src/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleVtc1Room.cs
similarity index 100%
rename from PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleVtc1Room.cs
rename to src/PepperDashEssentials/Room/Types/Interfaces/IEssentialsHuddleVtc1Room.cs
diff --git a/PepperDashEssentials/SGD/PepperDash Essentials TSW-560.sgd b/src/PepperDashEssentials/SGD/PepperDash Essentials TSW-560.sgd
similarity index 100%
rename from PepperDashEssentials/SGD/PepperDash Essentials TSW-560.sgd
rename to src/PepperDashEssentials/SGD/PepperDash Essentials TSW-560.sgd
diff --git a/PepperDashEssentials/SGD/PepperDash Essentials TSW-760.sgd b/src/PepperDashEssentials/SGD/PepperDash Essentials TSW-760.sgd
similarity index 100%
rename from PepperDashEssentials/SGD/PepperDash Essentials TSW-760.sgd
rename to src/PepperDashEssentials/SGD/PepperDash Essentials TSW-760.sgd
diff --git a/PepperDashEssentials/SGD/PepperDash Essentials iPad.sgd b/src/PepperDashEssentials/SGD/PepperDash Essentials iPad.sgd
similarity index 100%
rename from PepperDashEssentials/SGD/PepperDash Essentials iPad.sgd
rename to src/PepperDashEssentials/SGD/PepperDash Essentials iPad.sgd
diff --git a/PepperDashEssentials/UI - FILES ORPHANED-DELETE/CrestronTouchpanelPropertiesConfig.cs b/src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/CrestronTouchpanelPropertiesConfig.cs
similarity index 100%
rename from PepperDashEssentials/UI - FILES ORPHANED-DELETE/CrestronTouchpanelPropertiesConfig.cs
rename to src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/CrestronTouchpanelPropertiesConfig.cs
diff --git a/PepperDashEssentials/UI - FILES ORPHANED-DELETE/DualDisplaySourceSRLController.cs b/src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/DualDisplaySourceSRLController.cs
similarity index 100%
rename from PepperDashEssentials/UI - FILES ORPHANED-DELETE/DualDisplaySourceSRLController.cs
rename to src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/DualDisplaySourceSRLController.cs
diff --git a/PepperDashEssentials/UI - FILES ORPHANED-DELETE/EssentialsTouchpanelController.cs b/src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/EssentialsTouchpanelController.cs
similarity index 100%
rename from PepperDashEssentials/UI - FILES ORPHANED-DELETE/EssentialsTouchpanelController.cs
rename to src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/EssentialsTouchpanelController.cs
diff --git a/PepperDashEssentials/UI - FILES ORPHANED-DELETE/SubpageReferenceListActivityItem.cs b/src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/SubpageReferenceListActivityItem.cs
similarity index 100%
rename from PepperDashEssentials/UI - FILES ORPHANED-DELETE/SubpageReferenceListActivityItem.cs
rename to src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/SubpageReferenceListActivityItem.cs
diff --git a/PepperDashEssentials/UI - FILES ORPHANED-DELETE/SubpageReferenceListSourceItem.cs b/src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/SubpageReferenceListSourceItem.cs
similarity index 100%
rename from PepperDashEssentials/UI - FILES ORPHANED-DELETE/SubpageReferenceListSourceItem.cs
rename to src/PepperDashEssentials/UI - FILES ORPHANED-DELETE/SubpageReferenceListSourceItem.cs
diff --git a/PepperDashEssentials/UI/DualDisplaySourceSRLController.cs b/src/PepperDashEssentials/UI/DualDisplaySourceSRLController.cs
similarity index 100%
rename from PepperDashEssentials/UI/DualDisplaySourceSRLController.cs
rename to src/PepperDashEssentials/UI/DualDisplaySourceSRLController.cs
diff --git a/PepperDashEssentials/UI/EssentialsTouchpanelController.cs b/src/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
similarity index 100%
rename from PepperDashEssentials/UI/EssentialsTouchpanelController.cs
rename to src/PepperDashEssentials/UI/EssentialsTouchpanelController.cs
diff --git a/PepperDashEssentials/UI/HttpLogoServer.cs b/src/PepperDashEssentials/UI/HttpLogoServer.cs
similarity index 97%
rename from PepperDashEssentials/UI/HttpLogoServer.cs
rename to src/PepperDashEssentials/UI/HttpLogoServer.cs
index b81a51f4..0ff60e93 100644
--- a/PepperDashEssentials/UI/HttpLogoServer.cs
+++ b/src/PepperDashEssentials/UI/HttpLogoServer.cs
@@ -1,123 +1,123 @@
-using System;
-using System.Collections.Generic;
-using Crestron.SimplSharp;
-using Crestron.SimplSharp.CrestronIO;
-using Crestron.SimplSharp.Net.Http;
-
-using PepperDash.Core;
-
-namespace PepperDash.Essentials
-{
- public class HttpLogoServer
- {
- ///
- ///
- ///
- readonly HttpServer _server;
-
- ///
- ///
- ///
- readonly string _fileDirectory;
-
- ///
- ///
- ///
- public static Dictionary ExtensionContentTypes;
-
- ///
- ///
- ///
- ///
- ///
- public HttpLogoServer(int port, string directory)
- {
- ExtensionContentTypes = new Dictionary
- {
- //{ ".css", "text/css" },
- //{ ".htm", "text/html" },
- //{ ".html", "text/html" },
- { ".jpg", "image/jpeg" },
- { ".jpeg", "image/jpeg" },
- //{ ".js", "application/javascript" },
- //{ ".json", "application/json" },
- //{ ".map", "application/x-navimap" },
- { ".pdf", "application/pdf" },
- { ".png", "image/png" },
- //{ ".txt", "text/plain" },
- };
-
- _server = new HttpServer {Port = port};
- _fileDirectory = directory;
- _server.OnHttpRequest += Server_OnHttpRequest;
- _server.Open();
-
- CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
- }
-
- ///
- ///
- ///
- void Server_OnHttpRequest(object sender, OnHttpRequestArgs args)
- {
- var path = args.Request.Path;
- Debug.Console(2, "HTTP Request with path: '{0}'", args.Request.Path);
-
- try
- {
- if (File.Exists(_fileDirectory + path))
- {
- var filePath = path.Replace('/', '\\');
- var localPath = string.Format(@"{0}{1}", _fileDirectory, filePath);
-
- Debug.Console(2, "HTTP Logo Server attempting to find file: '{0}'", localPath);
- if (File.Exists(localPath))
- {
- args.Response.Header.ContentType = GetContentType(new FileInfo(localPath).Extension);
- args.Response.ContentStream = new FileStream(localPath, FileMode.Open, FileAccess.Read);
- }
- else
- {
- Debug.Console(2, "HTTP Logo Server Cannot find file '{0}'", localPath);
- args.Response.ContentString = string.Format("Not found: '{0}'", filePath);
- args.Response.Code = 404;
- }
- }
- else
- {
- Debug.Console(2, "HTTP Logo Server: '{0}' does not exist", _fileDirectory + path);
- args.Response.ContentString = string.Format("Not found: '{0}'", _fileDirectory + path);
- args.Response.Code = 404;
- }
- }
- catch (Exception ex)
- {
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception getting file: {0}", ex.Message);
- Debug.Console(0, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
-
- args.Response.Code = 400;
- args.Response.ContentString = string.Format("invalid request");
- }
- }
-
- ///
- ///
- ///
- void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType)
- {
- if (programEventType == eProgramStatusEventType.Stopping)
- _server.Close();
- }
-
- ///
- ///
- ///
- ///
- ///
- public static string GetContentType(string extension)
- {
- var type = ExtensionContentTypes.ContainsKey(extension) ? ExtensionContentTypes[extension] : "text/plain";
- return type;
- }
- }
+using System;
+using System.Collections.Generic;
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.CrestronIO;
+using Crestron.SimplSharp.Net.Http;
+
+using PepperDash.Core;
+
+namespace PepperDash.Essentials
+{
+ public class HttpLogoServer
+ {
+ ///
+ ///
+ ///
+ readonly HttpServer _server;
+
+ ///
+ ///
+ ///
+ readonly string _fileDirectory;
+
+ ///
+ ///
+ ///
+ public static Dictionary ExtensionContentTypes;
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public HttpLogoServer(int port, string directory)
+ {
+ ExtensionContentTypes = new Dictionary
+ {
+ //{ ".css", "text/css" },
+ //{ ".htm", "text/html" },
+ //{ ".html", "text/html" },
+ { ".jpg", "image/jpeg" },
+ { ".jpeg", "image/jpeg" },
+ //{ ".js", "application/javascript" },
+ //{ ".json", "application/json" },
+ //{ ".map", "application/x-navimap" },
+ { ".pdf", "application/pdf" },
+ { ".png", "image/png" },
+ //{ ".txt", "text/plain" },
+ };
+
+ _server = new HttpServer {Port = port};
+ _fileDirectory = directory;
+ _server.OnHttpRequest += Server_OnHttpRequest;
+ _server.Open();
+
+ CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironment_ProgramStatusEventHandler;
+ }
+
+ ///
+ ///
+ ///
+ void Server_OnHttpRequest(object sender, OnHttpRequestArgs args)
+ {
+ var path = args.Request.Path;
+ Debug.Console(2, "HTTP Request with path: '{0}'", args.Request.Path);
+
+ try
+ {
+ if (File.Exists(_fileDirectory + path))
+ {
+ var filePath = path.Replace('/', '\\');
+ var localPath = string.Format(@"{0}{1}", _fileDirectory, filePath);
+
+ Debug.Console(2, "HTTP Logo Server attempting to find file: '{0}'", localPath);
+ if (File.Exists(localPath))
+ {
+ args.Response.Header.ContentType = GetContentType(new FileInfo(localPath).Extension);
+ args.Response.ContentStream = new FileStream(localPath, FileMode.Open, FileAccess.Read);
+ }
+ else
+ {
+ Debug.Console(2, "HTTP Logo Server Cannot find file '{0}'", localPath);
+ args.Response.ContentString = string.Format("Not found: '{0}'", filePath);
+ args.Response.Code = 404;
+ }
+ }
+ else
+ {
+ Debug.Console(2, "HTTP Logo Server: '{0}' does not exist", _fileDirectory + path);
+ args.Response.ContentString = string.Format("Not found: '{0}'", _fileDirectory + path);
+ args.Response.Code = 404;
+ }
+ }
+ catch (Exception ex)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Exception getting file: {0}", ex.Message);
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
+
+ args.Response.Code = 400;
+ args.Response.ContentString = string.Format("invalid request");
+ }
+ }
+
+ ///
+ ///
+ ///
+ void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType)
+ {
+ if (programEventType == eProgramStatusEventType.Stopping)
+ _server.Close();
+ }
+
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static string GetContentType(string extension)
+ {
+ var type = ExtensionContentTypes.ContainsKey(extension) ? ExtensionContentTypes[extension] : "text/plain";
+ return type;
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs b/src/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs
similarity index 96%
rename from PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs
rename to src/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs
index 1a127000..a76f5bcb 100644
--- a/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs
+++ b/src/PepperDashEssentials/UI/JoinConstants/UIBoolJoin.cs
@@ -1,991 +1,991 @@
-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
-{
- ///
- /// Where all UI element common joins are defined
- ///
- public class UIBoolJoin
- {
- ///
- /// 901
- ///
- public const uint VolumeUpPress = 901;
- ///
- /// 902
- ///
- public const uint VolumeDownPress = 902;
-
- //****************************************************
- // Codec General
-
- ///
- /// 1001
- ///
- public const uint CallEndPress = 1001;
- ///
- /// 1002
- ///
- public const uint CallEndAllConfirmPress = 1002;
- ///
- /// 1003 - For tapping the text field to reveal the keyboard
- ///
- public const uint CodecDirectorySearchTextPress = 1003;
- ///
- /// 1004
- ///
- public const uint CallStopSharingPress = 1004;
- ///
- /// 1005
- ///
- public const uint CallSharedSourceInfoVisible = 1005;
- ///
- /// 1006
- ///
- public const uint CallEndAllConfirmVisible = 1006;
- ///
- /// 1007
- ///
- public const uint MeetingPasswordVisible = 1007;
- ///
- /// 1008
- ///
- public const uint MeetingLeavePress = 1008;
-
-
-
-
-
- // Audio Conference
- ///
- /// 1101
- ///
- public const uint ACKeypadVisible = 1101;
- ///
- /// 1102
- ///
- public const uint ACStagingPopoverVisible = 1102;
- ///
- /// 1111
- ///
- public const uint ACSpeedDial1Press = 1111;
- ///
- /// 1112
- ///
- public const uint ACSpeedDial2Press = 1112;
- ///
- /// 1113
- ///
- public const uint ACSpeedDial3Press = 1113;
- ///
- /// 1114
- ///
- public const uint ACSpeedDial4Press = 1114;
- ///
- /// 1121
- ///
- public const uint ACSpeedDial1Visible = 1121;
- ///
- /// 1122
- ///
- public const uint ACSpeedDial2Visible = 1122;
- ///
- /// 1123
- ///
- public const uint ACSpeedDial3Visible = 1123;
- ///
- /// 1124
- ///
- public const uint ACSpeedDial4Visible = 1124;
-
- //******************************************************
- // Video Conference
- ///
- /// 1201
- ///
- public const uint VCKeypadWithFavoritesVisible = 1201;
- ///
- /// 1202
- ///
- public const uint VCStagingInactivePopoverWithRecentsVisible = 1202;
- ///
- ///
- ///
- public const uint VCStagingActivePopoverVisible = 1203;
- ///
- ///
- ///
- public const uint VCKeypadVisible = 1204;
- ///
- /// 1205
- ///
- public const uint VCDirectoryVisible = 1205;
- ///
- /// 1206
- ///
- public const uint VCRecentsVisible = 1206;
-
- ///
- /// 1202
- ///
- public const uint VCStagingInactivePopoverWithoutRecentsVisible = 1207;
-
- ///
- /// 1208
- ///
- public const uint VCCameraAutoVisible = 1208;
-
- ///
- /// 1209
- ///
- public const uint VCCameraManualVisible = 1209;
-
- ///
- /// 1210
- ///
- public const uint VCCameraOffVisible = 1210;
-
- ///
- /// 1211 - 1215
- ///
- public const uint VCFavoritePressStart = 1211;
- // RANGE IN USE
- public const uint VCFavoritePressEnd = 1215;
- ///
- /// 1221 - 1225
- ///
- public const uint VCFavoriteVisibleStart = 1221;
- // RANGE IN USE
- public const uint VCFavoriteVisibleEnd = 1225;
-
- ///
- /// 1230
- ///
- public const uint VCStagingMeetNowPress = 1230;
- ///
- /// 1231
- ///
- public const uint VCStagingRecentsPress = 1231;
- ///
- /// 1232
- ///
- public const uint VCStagingDirectoryPress = 1232;
- ///
- /// 1233
- ///
- public const uint VCStagingKeypadPress = 1233;
- ///
- /// 1234
- ///
- public const uint VCStagingConnectPress = 1234;
- ///
- /// 1235
- ///
- public const uint VCStagingCameraPress = 1235;
- ///
- /// 1236
- ///
- public const uint VCStagingConnectEnable = 1236;
- ///
- /// 1237 - When the user touches the text field, should trigger keyboard
- ///
- public const uint VCKeypadTextPress = 1237;
- ///
- /// 1238
- ///
- public const uint VCKeypadBackspacePress = 1238;
- ///
- /// 1239
- ///
- public const uint VCKeypadBackspaceVisible = 1239;
- ///
- /// 1240
- ///
- public const uint VCDirectoryBackPress = 1240;
- ///
- /// 1241 For touching the text area to bring up keyboard
- ///
- public const uint VCDirectorySearchTextPress = 1241;
- ///
- /// 1242
- ///
- public const uint VCStagingSelfViewLayoutPress = 1242;
- ///
- /// 1243
- ///
- public const uint VCDirectoryBackVisible = 1243;
- ///
- /// 1244
- ///
- public const uint VCDirectoryBackspacePress = 1244;
- ///
- /// 1245
- ///
- public const uint VCDirectoryBackspaceVisible = 1245;
- ///
- /// 1251
- ///
- public const uint VCSelfViewTogglePress = 1251;
- ///
- /// 1252
- ///
- public const uint VCLayoutTogglePress = 1252;
- ///
- /// 1253
- ///
- public const uint VCSelfViewPipTogglePress = 1253;
- ///
- /// 1254
- ///
- public const uint VCLayoutToggleEnable = 1254;
- ///
- /// 1255
- ///
- public const uint VCMinMaxPress = 1255;
- ///
- /// 1256
- ///
- public const uint VCMinMaxEnable = 1256;
-
- ///
- /// 1260
- ///
- public const uint VCCameraModeBarVisible = 1260;
-
- ///
- /// 1261
- ///
- public const uint VCCameraSelectBarWithoutModeVisible = 1261;
-
- ///
- /// 1262
- ///
- public const uint VCCameraAutoModeIsOnFb = 1262;
-
- ///
- /// 1271
- ///
- public const uint VCCameraZoomIn = 1271;
- ///
- /// 1272
- ///
- public const uint VCCameraZoomOut = 1272;
-
-
- ///
- /// 1280
- ///
- public const uint VCCameraPresetSavedLabelVisible = 1280;
- ///
- /// 1281
- ///
- public const uint VCCameraPreset1 = 1281;
- ///
- /// 1282
- ///
- public const uint VCCameraPreset2 = 1282;
- ///
- /// 1283
- ///
- public const uint VCCameraPreset3 = 1283;
-
-
- ///
- /// 1291
- ///
- public const uint VCCameraPreset1Visible = 1291;
- ///
- /// 1292
- ///
- public const uint VCCameraPreset2Visible = 1292;
- ///
- /// 1293
- ///
- public const uint VCCameraPreset3Visible = 1293;
-
-
- // Letter joins start at 2921;
-
- //******************************************************
-
- // Environment Joins
-
- // Popup Container
-
- ///
- /// 2001 - 2004
- ///
- public const uint EnvironmentBackgroundSubpageVisibleBase = 2000;
-
-
- // ColumnOne
-
- ///
- /// 2011 - 2015
- ///
- public const uint EnvironmentColumnOneLightingTypeVisibleBase = 2010;
-
- ///
- /// 2016 - 2020
- ///
- public const uint EnvironmentColumnOneShadingTypeVisibleBase = 2015;
-
- // ColumnTwo
-
- ///
- /// 2021 - 2025
- ///
- public const uint EnvironmentColumnTwoLightingTypeVisibleBase = 2020;
-
- ///
- /// 2026 - 2030
- ///
- public const uint EnvironmentColumnTwoShadingTypeVisibleBase = 2025;
-
- // ColumnThree
-
- ///
- /// 2031 - 2035
- ///
- public const uint EnvironmentColumnThreeLightingTypeVisibleBase = 2030;
-
- ///
- /// 2036 - 2040
- ///
- public const uint EnvironmentColumnThreeShadingTypeVisibleBase = 2035;
-
- // ColumnFour
-
- ///
- /// 2041 - 2045
- ///
- public const uint EnvironmentColumnFourLightingTypeVisibleBase = 2040;
-
- ///
- /// 2046 - 2050
- ///
- public const uint EnvironmentColumnFourShadingTypeVisibleBase = 2045;
-
- // Button press
-
- ///
- /// 2051 - 2060
- ///
- public const uint EnvironmentColumnOneButtonPressBase = 2050;
-
- ///
- /// 2061 - 2070
- ///
- public const uint EnvironmentColumnTwoButtonPressBase = 2060;
-
- ///
- /// 2071 - 2080
- ///
- public const uint EnvironmentColumnThreeButtonPressBase = 2070;
-
- ///
- /// 2081 - 2090
- ///
- public const uint EnvironmentColumnFourButtonPressBase = 2080;
-
- // Button visibility
-
- ///
- /// 2151 - 2160
- ///
- public const uint EnvironmentColumnOneButtonVisibleBase = 2150;
-
- ///
- /// 2161 - 2170
- ///
- public const uint EnvironmentColumnTwoButtonVisibleBase = 2160;
-
- ///
- /// 2171 - 2180
- ///
- public const uint EnvironmentColumnThreeButtonVisibleBase = 2170;
-
- ///
- /// 2181 - 2190
- ///
- public const uint EnvironmentColumnFourButtonVisibleBase = 2180;
-
-
- //******************************************************
-
- ///
- /// 3101
- ///
- public const uint TechExitButton = 3101;
- ///
- /// 3106
- ///
- public const uint TechCommonItemsVisbible = 3106;
- ///
- /// 3107
- ///
- public const uint TechSystemStatusVisible = 3107;
- ///
- /// 3108
- ///
- public const uint TechDisplayControlsVisible = 3108;
- ///
- /// 3109
- ///
- public const uint TechPanelSetupVisible = 3109;
- ///
- /// 3110
- ///
- public const uint TechAdvancedVolumeVisible = 3110;
- ///
- /// 3111
- ///
- public const uint TechAboutVisible = 3111;
- ///
- /// 3112
- ///
- public const uint TechSchedulerVisible = 3112;
-
- //*****************************************************
- ///
- /// 3811
- ///
- public const uint VolumeSingleMute1Visible = 3811;
- ///
- /// 3812
- ///
- public const uint VolumeSlider1Press = 3812;
- ///
- /// 3813
- ///
- public const uint Volume1ProgramMutePressAndFB = 3813;
- ///
- /// 3821
- ///
- public const uint Volume2Visible = 3821;
- ///
- /// 3822
- ///
- public const uint VolumeSlider2Press = 3822;
- ///
- /// 3823
- ///
- public const uint Volume2MutePressAndFB = 3823;
- ///
- /// 3831
- ///
- public const uint Volume3Visible = 3831;
- ///
- /// 3832
- ///
- public const uint VolumeSlider3Press = 3832;
- ///
- /// 3833
- ///
- public const uint Volume3MutePressAndFB = 3833;
- ///
- /// 3841
- ///
- public const uint Volume4Visible = 3841;
- ///
- /// 3842
- ///
- public const uint VolumeSlider4Press = 3842;
- ///
- /// 3843
- ///
- public const uint Volume4MutePressAndFB = 3843;
- ///
- /// 3851
- ///
- public const uint Volume5Visible = 3851;
- ///
- /// 3852
- ///
- public const uint VolumeSlider5Press = 3852;
- ///
- /// 3853
- ///
- public const uint Volume5MutePressAndFB = 3853;
- ///
- /// 3861
- ///
- public const uint Volume6Visible = 3861;
- ///
- /// 3862
- ///
- public const uint VolumeSlider6Press = 3862;
- ///
- /// 3863
- ///
- public const uint Volume6MutePressAndFB = 3863;
-
- ///
- /// 3869 - when the system is off and the gear is pressed
- ///
- public const uint VolumesPagePowerOffVisible = 3869;
- ///
- /// 3870
- ///
- public const uint VolumesPageVisible = 3870;
- ///
- /// 3871
- ///
- public const uint VolumeDualMute1Visible = 3871;
- ///
- /// 3874
- ///
- public const uint Volume1SpeechMutePressAndFB = 3874;
- ///
- /// 3875
- ///
- public const uint Volume1BackerVisibility = 3875;
- ///
- /// 3891
- ///
- public const uint VolumeDefaultPress = 3891;
- ///
- /// 3951
- ///
- /// 3952
- ///
- public const uint HeaderIcon2Press = 3952;
- ///
- /// 3953
- ///
- public const uint HeaderIcon3Press = 3953;
- ///
- /// 3954
- ///
- public const uint HeaderIcon4Press = 3954;
- ///
- /// 3955
- ///
- public const uint HeaderIcon5Press = 3955;
-
- /// 3960
- ///
- public const uint HeaderPopupCaretsSubpageVisibile = 3960;
- ///
- /// 3961
- ///
- public const uint HeaderCaret1Visible = 3961;
- ///
- /// 3962
- ///
- public const uint HeaderCaret2Visible = 3962;
- ///
- /// 3963
- ///
- public const uint HeaderCaret3Visible = 3963;
- ///
- /// 3964
- ///
- public const uint HeaderCaret4Visible = 3964;
- ///
- /// 3965
- ///
- public const uint HeaderCaret5Visible = 3965;
-
- ///
- /// 3999
- ///
- public const uint GenericModalVisible = 3999;
- ///
- /// 12345
- ///
- public const uint AvNoControlsSubVisible = 12345;
-
- // 10000 - 14999 are general "source" pages
-
- ///
- /// 15001
- ///
- public const uint StartPageVisible = 15001;
- ///
- /// 15002 Shows the start page in the source controls area of the screen
- ///
- public const uint TapToBeginVisible = 15002;
- ///
- /// 15003 Message text when no source is showing
- ///
- public const uint SelectASourceVisible = 15003;
- ///
- /// 15004
- ///
- public const uint RoomIsOn = 15004;
- ///
- /// 15005 Shows always-on volume control subpage with only audio mute
- ///
- public const uint VolumeControlsSingleMuteVisible = 15005;
- ///
- /// 15006 Shows always-on volume control subpage with mic and audio mutes
- ///
- public const uint VolumeControlsDualMuteVisible = 15006;
- ///
- /// 15010
- ///
- public const uint ShowPanelSetupPress = 15010;
- ///
- /// 15011 - Top bar with room name and button that pops up dialog with room data
- ///
- public const uint TopBarHabaneroVisible = 15011;
- ///
- /// 15012
- ///
- public const uint SourceStagingBarVisible = 15012;
- ///
- /// 15013
- ///
- public const uint PowerOffStep1Visible = 15013;
- ///
- /// 15014
- ///
- public const uint PowerOffStep2Visible = 15014;
- ///
- /// 15015
- ///
- public const uint ShowPowerOffPress = 15015;
- ///
- /// 15016
- ///
- public const uint PowerOffMorePress = 15016;
- ///
- /// 15017
- ///
- public const uint StagingPageAdditionalArrowsVisible = 15017;
- ///
- /// 15018 The Header with dynamic buttons
- ///
- public const uint TopBarHabaneroDynamicVisible = 15018;
- ///
- /// 15019 Shown when system is starting and not ready for use
- ///
- public const uint SystemInitializingVisible = 15019;
- ///
- /// 15020
- ///
- public const uint PanelSetupVisible = 15020;
- ///
- /// 15021
- ///
- public const uint SourceWaitOverlayVisible = 15021;
- ///
- /// 15022
- ///
- public const uint ActivityFooterVisible = 15022;
- ///
- /// 15024
- ///
- public const uint HeaderCallStatusLeftPositionVisible = 15024;
- ///
- /// 15025
- ///
- public const uint HeaderCallStatusRightPositionVisible = 15025;
- ///
- /// 15027
- ///
- public const uint HeaderCallStatusLabelPress = 15027;
- ///
- /// 15028 The gear button in header
- ///
- public const uint FIXFIX_HeaderGearButtonPress_FIXFIX = 15028;
- ///
- /// 15029 the room button in header
- ///
- public const uint HeaderRoomButtonPress = 15029;
- ///
- /// 15030 Visibility for room data popup
- ///
- public const uint RoomHeaderInfoPageVisible = 15030;
- ///
- /// 15031
- ///
- public const uint AllRoomsOffPress = 15031;
- ///
- /// 15032
- ///
- public const uint DisplayPowerTogglePress = 15032;
- ///
- /// 15033
- ///
- public const uint PowerOffCancelPress = 15033;
- ///
- /// 15034
- ///
- public const uint PowerOffConfirmPress = 15034;
- ///
- /// 15035
- ///
- public const uint VolumeButtonPopupPress = 15035;
- ///
- /// 15035
- ///
- public const uint VolumeButtonPopupVisible = 15035;
- ///
- /// 15036
- ///
- public const uint VolumeGaugePopupVisible = 15036;
- ///
- /// 15037
- ///
- public const uint GearButtonVisible = 15037;
- ///
- /// 15038
- ///
- public const uint CalendarHeaderButtonVisible = 15038;
- ///
- /// 15039
- ///
- public const uint CalendarHeaderButtonPress = 15039;
- ///
- /// 15040
- ///
- public const uint CallStatusPageVisible = 15040;
- ///
- /// 15041
- ///
- public const uint LightsPageVisible = 15041;
- ///
- /// 15042 Closes whichever interlocked modal is open
- ///
- public const uint InterlockedModalClosePress = 15042;
- ///
- /// 15043 Vis for modal backer for full-screen source
- ///
- public const uint SourceBackgroundOverlayVisible = 15043;
- ///
- /// 15044 Close button for source modal overlay
- ///
- public const uint SourceBackgroundOverlayClosePress = 15044;
- ///
- /// 15045
- ///
- public const uint ZoomRoomContentSharingVisible = 15045;
- ///
- /// 15046
- ///
- public const uint MeetingsOrContacMethodsListVisible = 15046;
- ///
- /// 15047 The "Join" button on the next meeting ribbon
- ///
- public const uint NextMeetingJoinPress = 15047;
- ///
- /// 15048 Dismisses the ribbon
- ///
- public const uint NextMeetingModalClosePress = 15048;
- ///
- /// 15049
- ///
- public const uint NextMeetingModalVisible = 15049;
- ///
- /// 15050
- ///
- public const uint NextMeetingNotificationRibbonVisible = 15050;
- ///
- /// 15051
- ///
- public const uint Display1SelectPressAndFb = 15051;
- ///
- /// 15052
- ///
- public const uint Display1ControlButtonEnable = 15052;
- ///
- /// 15053
- ///
- public const uint Display1ControlButtonPress = 15053;
- ///
- /// 15054
- ///
- public const uint Display1AudioButtonEnable = 15054;
- ///
- /// 15055
- ///
- public const uint Display1AudioButtonPressAndFb = 15055;
- ///
- /// 15056
- ///
- public const uint Display2SelectPressAndFb = 15056;
- ///
- /// 15057
- ///
- public const uint Display2ControlButtonEnable = 15057;
- ///
- /// 15058
- ///
- public const uint Display2ControlButtonPress = 15058;
- ///
- /// 15059
- ///
- public const uint Display2AudioButtonEnable = 15059;
- ///
- /// 15060
- ///
- public const uint Display2AudioButtonPressAndFb = 15060;
- ///
- /// 15061 Reveals the dual-display subpage
- ///
- public const uint DualDisplayPageVisible = 15061;
- ///
- /// 15062 Reveals the toggle switch for the sharing mode
- ///
- public const uint ToggleSharingModeVisible = 15062;
- ///
- /// 15063 Press for the toggle mode switch
- ///
- public const uint ToggleSharingModePress = 15063;
- ///
- /// 15064
- ///
- public const uint LogoDefaultVisible = 15064;
- ///
- /// 15065
- ///
- public const uint LogoUrlVisible = 15065;
- ///
- /// 15066 - Reveals the active calls header item
- ///
- public const uint HeaderActiveCallsListVisible = 15066;
- ///
- /// 15067
- ///
- public const uint NotificationRibbonVisible = 15067;
- ///
- /// 15068
- ///
- public const uint HeaderMeetingInfoVisible = 15068;
-
- ///
- /// 15083 - Press for Call help desk on AC/VC
- ///
- public const uint HelpPageShowCallButtonPress = 15083;
- ///
- /// 15084 - Show the "call help desk" button on help page
- ///
- public const uint HelpPageShowCallButtonVisible = 15084;
- ///
- /// 15085 Visibility join for help subpage
- ///
- public const uint HelpPageVisible = 15085;
- ///
- /// 15086 Press for help header button
- ///
- public const uint HelpPress = 15086;
- ///
- /// 15088
- ///
- public const uint DateOnlyVisible = 15088;
- ///
- /// 15089
- ///
- public const uint TimeOnlyVisible = 15089;
- ///
- /// 15090
- ///
- public const uint DateAndTimeVisible = 15090;
- ///
- /// 15091
- ///
- public const uint SetupFullDistrib = 15091;
-
- ///
- /// 15092
- ///
- public const uint StartMCPageVisible = 15092;
-
-
- ///
- /// 15093
- ///
- public const uint RoomHeaderInfoMCPageVisible = 15093;
-
- ///
- /// 15094
- ///
- public const uint MCScreenSaverVisible = 15094;
-
- ///
- /// 15095
- ///
- public const uint MCScreenSaverPosition1Visible = 15095;
-
- ///
- /// 15096
- ///
- public const uint MCScreenSaverPosition2Visible = 15096;
-
- ///
- /// 15097
- ///
- public const uint MCScreenSaverPosition3Visible = 15097;
-
- ///
- /// 15098
- ///
- public const uint MCScreenSaverPosition4Visible = 15098;
-
- ///
- /// 15099
- ///
- public const uint MCScreenSaverClosePress = 15099;
-
- // PIN dialogs ************************************
-
- ///
- /// 15201
- ///
- public const uint PinDialog4DigitVisible = 15201;
- ///
- /// 15206
- ///
- public const uint PinDialogCancelPress = 15206;
- ///
- /// 15207
- ///
- public const uint PinDialogErrorVisible = 15207;
- ///
- /// 15211
- ///
- public const uint PinDialogDot1 = 15211;
- ///
- /// 15212
- ///
- public const uint PinDialogDot2 = 15212;
- ///
- /// 15213
- ///
- public const uint PinDialogDot3 = 15213;
- ///
- /// 15214
- ///
- public const uint PinDialogDot4 = 15214;
-
- // Password Prompt Dialog **************************
-
- ///
- /// 15301
- ///
- public const uint PasswordPromptDialogVisible = 15301;
- ///
- /// 15302
- ///
- public const uint PasswordPromptTextPress = 15302;
- ///
- /// 15306
- ///
- public const uint PasswordPromptCancelPress = 15306;
- ///
- /// 15307
- ///
- public const uint PasswordPromptErrorVisible = 15307;
- }
+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
+{
+ ///
+ /// Where all UI element common joins are defined
+ ///
+ public class UIBoolJoin
+ {
+ ///
+ /// 901
+ ///
+ public const uint VolumeUpPress = 901;
+ ///
+ /// 902
+ ///
+ public const uint VolumeDownPress = 902;
+
+ //****************************************************
+ // Codec General
+
+ ///
+ /// 1001
+ ///
+ public const uint CallEndPress = 1001;
+ ///
+ /// 1002
+ ///
+ public const uint CallEndAllConfirmPress = 1002;
+ ///
+ /// 1003 - For tapping the text field to reveal the keyboard
+ ///
+ public const uint CodecDirectorySearchTextPress = 1003;
+ ///
+ /// 1004
+ ///
+ public const uint CallStopSharingPress = 1004;
+ ///
+ /// 1005
+ ///
+ public const uint CallSharedSourceInfoVisible = 1005;
+ ///
+ /// 1006
+ ///
+ public const uint CallEndAllConfirmVisible = 1006;
+ ///
+ /// 1007
+ ///
+ public const uint MeetingPasswordVisible = 1007;
+ ///
+ /// 1008
+ ///
+ public const uint MeetingLeavePress = 1008;
+
+
+
+
+
+ // Audio Conference
+ ///
+ /// 1101
+ ///
+ public const uint ACKeypadVisible = 1101;
+ ///
+ /// 1102
+ ///
+ public const uint ACStagingPopoverVisible = 1102;
+ ///
+ /// 1111
+ ///
+ public const uint ACSpeedDial1Press = 1111;
+ ///
+ /// 1112
+ ///
+ public const uint ACSpeedDial2Press = 1112;
+ ///
+ /// 1113
+ ///
+ public const uint ACSpeedDial3Press = 1113;
+ ///
+ /// 1114
+ ///
+ public const uint ACSpeedDial4Press = 1114;
+ ///
+ /// 1121
+ ///
+ public const uint ACSpeedDial1Visible = 1121;
+ ///
+ /// 1122
+ ///
+ public const uint ACSpeedDial2Visible = 1122;
+ ///
+ /// 1123
+ ///
+ public const uint ACSpeedDial3Visible = 1123;
+ ///
+ /// 1124
+ ///
+ public const uint ACSpeedDial4Visible = 1124;
+
+ //******************************************************
+ // Video Conference
+ ///
+ /// 1201
+ ///
+ public const uint VCKeypadWithFavoritesVisible = 1201;
+ ///
+ /// 1202
+ ///
+ public const uint VCStagingInactivePopoverWithRecentsVisible = 1202;
+ ///
+ ///
+ ///
+ public const uint VCStagingActivePopoverVisible = 1203;
+ ///
+ ///
+ ///
+ public const uint VCKeypadVisible = 1204;
+ ///
+ /// 1205
+ ///
+ public const uint VCDirectoryVisible = 1205;
+ ///
+ /// 1206
+ ///
+ public const uint VCRecentsVisible = 1206;
+
+ ///
+ /// 1202
+ ///
+ public const uint VCStagingInactivePopoverWithoutRecentsVisible = 1207;
+
+ ///
+ /// 1208
+ ///
+ public const uint VCCameraAutoVisible = 1208;
+
+ ///
+ /// 1209
+ ///
+ public const uint VCCameraManualVisible = 1209;
+
+ ///
+ /// 1210
+ ///
+ public const uint VCCameraOffVisible = 1210;
+
+ ///
+ /// 1211 - 1215
+ ///
+ public const uint VCFavoritePressStart = 1211;
+ // RANGE IN USE
+ public const uint VCFavoritePressEnd = 1215;
+ ///
+ /// 1221 - 1225
+ ///
+ public const uint VCFavoriteVisibleStart = 1221;
+ // RANGE IN USE
+ public const uint VCFavoriteVisibleEnd = 1225;
+
+ ///
+ /// 1230
+ ///
+ public const uint VCStagingMeetNowPress = 1230;
+ ///
+ /// 1231
+ ///
+ public const uint VCStagingRecentsPress = 1231;
+ ///
+ /// 1232
+ ///
+ public const uint VCStagingDirectoryPress = 1232;
+ ///
+ /// 1233
+ ///
+ public const uint VCStagingKeypadPress = 1233;
+ ///
+ /// 1234
+ ///
+ public const uint VCStagingConnectPress = 1234;
+ ///
+ /// 1235
+ ///
+ public const uint VCStagingCameraPress = 1235;
+ ///
+ /// 1236
+ ///
+ public const uint VCStagingConnectEnable = 1236;
+ ///
+ /// 1237 - When the user touches the text field, should trigger keyboard
+ ///
+ public const uint VCKeypadTextPress = 1237;
+ ///
+ /// 1238
+ ///
+ public const uint VCKeypadBackspacePress = 1238;
+ ///
+ /// 1239
+ ///
+ public const uint VCKeypadBackspaceVisible = 1239;
+ ///
+ /// 1240
+ ///
+ public const uint VCDirectoryBackPress = 1240;
+ ///
+ /// 1241 For touching the text area to bring up keyboard
+ ///
+ public const uint VCDirectorySearchTextPress = 1241;
+ ///
+ /// 1242
+ ///
+ public const uint VCStagingSelfViewLayoutPress = 1242;
+ ///
+ /// 1243
+ ///
+ public const uint VCDirectoryBackVisible = 1243;
+ ///
+ /// 1244
+ ///
+ public const uint VCDirectoryBackspacePress = 1244;
+ ///
+ /// 1245
+ ///
+ public const uint VCDirectoryBackspaceVisible = 1245;
+ ///
+ /// 1251
+ ///
+ public const uint VCSelfViewTogglePress = 1251;
+ ///
+ /// 1252
+ ///
+ public const uint VCLayoutTogglePress = 1252;
+ ///
+ /// 1253
+ ///
+ public const uint VCSelfViewPipTogglePress = 1253;
+ ///
+ /// 1254
+ ///
+ public const uint VCLayoutToggleEnable = 1254;
+ ///
+ /// 1255
+ ///
+ public const uint VCMinMaxPress = 1255;
+ ///
+ /// 1256
+ ///
+ public const uint VCMinMaxEnable = 1256;
+
+ ///
+ /// 1260
+ ///
+ public const uint VCCameraModeBarVisible = 1260;
+
+ ///
+ /// 1261
+ ///
+ public const uint VCCameraSelectBarWithoutModeVisible = 1261;
+
+ ///
+ /// 1262
+ ///
+ public const uint VCCameraAutoModeIsOnFb = 1262;
+
+ ///
+ /// 1271
+ ///
+ public const uint VCCameraZoomIn = 1271;
+ ///
+ /// 1272
+ ///
+ public const uint VCCameraZoomOut = 1272;
+
+
+ ///
+ /// 1280
+ ///
+ public const uint VCCameraPresetSavedLabelVisible = 1280;
+ ///
+ /// 1281
+ ///
+ public const uint VCCameraPreset1 = 1281;
+ ///
+ /// 1282
+ ///
+ public const uint VCCameraPreset2 = 1282;
+ ///
+ /// 1283
+ ///
+ public const uint VCCameraPreset3 = 1283;
+
+
+ ///
+ /// 1291
+ ///
+ public const uint VCCameraPreset1Visible = 1291;
+ ///
+ /// 1292
+ ///
+ public const uint VCCameraPreset2Visible = 1292;
+ ///
+ /// 1293
+ ///
+ public const uint VCCameraPreset3Visible = 1293;
+
+
+ // Letter joins start at 2921;
+
+ //******************************************************
+
+ // Environment Joins
+
+ // Popup Container
+
+ ///
+ /// 2001 - 2004
+ ///
+ public const uint EnvironmentBackgroundSubpageVisibleBase = 2000;
+
+
+ // ColumnOne
+
+ ///
+ /// 2011 - 2015
+ ///
+ public const uint EnvironmentColumnOneLightingTypeVisibleBase = 2010;
+
+ ///
+ /// 2016 - 2020
+ ///
+ public const uint EnvironmentColumnOneShadingTypeVisibleBase = 2015;
+
+ // ColumnTwo
+
+ ///
+ /// 2021 - 2025
+ ///
+ public const uint EnvironmentColumnTwoLightingTypeVisibleBase = 2020;
+
+ ///
+ /// 2026 - 2030
+ ///
+ public const uint EnvironmentColumnTwoShadingTypeVisibleBase = 2025;
+
+ // ColumnThree
+
+ ///
+ /// 2031 - 2035
+ ///
+ public const uint EnvironmentColumnThreeLightingTypeVisibleBase = 2030;
+
+ ///
+ /// 2036 - 2040
+ ///
+ public const uint EnvironmentColumnThreeShadingTypeVisibleBase = 2035;
+
+ // ColumnFour
+
+ ///
+ /// 2041 - 2045
+ ///
+ public const uint EnvironmentColumnFourLightingTypeVisibleBase = 2040;
+
+ ///
+ /// 2046 - 2050
+ ///
+ public const uint EnvironmentColumnFourShadingTypeVisibleBase = 2045;
+
+ // Button press
+
+ ///
+ /// 2051 - 2060
+ ///
+ public const uint EnvironmentColumnOneButtonPressBase = 2050;
+
+ ///
+ /// 2061 - 2070
+ ///
+ public const uint EnvironmentColumnTwoButtonPressBase = 2060;
+
+ ///
+ /// 2071 - 2080
+ ///
+ public const uint EnvironmentColumnThreeButtonPressBase = 2070;
+
+ ///
+ /// 2081 - 2090
+ ///
+ public const uint EnvironmentColumnFourButtonPressBase = 2080;
+
+ // Button visibility
+
+ ///
+ /// 2151 - 2160
+ ///
+ public const uint EnvironmentColumnOneButtonVisibleBase = 2150;
+
+ ///
+ /// 2161 - 2170
+ ///
+ public const uint EnvironmentColumnTwoButtonVisibleBase = 2160;
+
+ ///
+ /// 2171 - 2180
+ ///
+ public const uint EnvironmentColumnThreeButtonVisibleBase = 2170;
+
+ ///
+ /// 2181 - 2190
+ ///
+ public const uint EnvironmentColumnFourButtonVisibleBase = 2180;
+
+
+ //******************************************************
+
+ ///
+ /// 3101
+ ///
+ public const uint TechExitButton = 3101;
+ ///
+ /// 3106
+ ///
+ public const uint TechCommonItemsVisbible = 3106;
+ ///
+ /// 3107
+ ///
+ public const uint TechSystemStatusVisible = 3107;
+ ///
+ /// 3108
+ ///
+ public const uint TechDisplayControlsVisible = 3108;
+ ///
+ /// 3109
+ ///
+ public const uint TechPanelSetupVisible = 3109;
+ ///
+ /// 3110
+ ///
+ public const uint TechAdvancedVolumeVisible = 3110;
+ ///
+ /// 3111
+ ///
+ public const uint TechAboutVisible = 3111;
+ ///
+ /// 3112
+ ///
+ public const uint TechSchedulerVisible = 3112;
+
+ //*****************************************************
+ ///
+ /// 3811
+ ///
+ public const uint VolumeSingleMute1Visible = 3811;
+ ///
+ /// 3812
+ ///
+ public const uint VolumeSlider1Press = 3812;
+ ///
+ /// 3813
+ ///
+ public const uint Volume1ProgramMutePressAndFB = 3813;
+ ///
+ /// 3821
+ ///
+ public const uint Volume2Visible = 3821;
+ ///
+ /// 3822
+ ///
+ public const uint VolumeSlider2Press = 3822;
+ ///
+ /// 3823
+ ///
+ public const uint Volume2MutePressAndFB = 3823;
+ ///
+ /// 3831
+ ///
+ public const uint Volume3Visible = 3831;
+ ///
+ /// 3832
+ ///
+ public const uint VolumeSlider3Press = 3832;
+ ///
+ /// 3833
+ ///
+ public const uint Volume3MutePressAndFB = 3833;
+ ///
+ /// 3841
+ ///
+ public const uint Volume4Visible = 3841;
+ ///
+ /// 3842
+ ///
+ public const uint VolumeSlider4Press = 3842;
+ ///
+ /// 3843
+ ///
+ public const uint Volume4MutePressAndFB = 3843;
+ ///
+ /// 3851
+ ///
+ public const uint Volume5Visible = 3851;
+ ///
+ /// 3852
+ ///
+ public const uint VolumeSlider5Press = 3852;
+ ///
+ /// 3853
+ ///
+ public const uint Volume5MutePressAndFB = 3853;
+ ///
+ /// 3861
+ ///
+ public const uint Volume6Visible = 3861;
+ ///
+ /// 3862
+ ///
+ public const uint VolumeSlider6Press = 3862;
+ ///
+ /// 3863
+ ///
+ public const uint Volume6MutePressAndFB = 3863;
+
+ ///
+ /// 3869 - when the system is off and the gear is pressed
+ ///
+ public const uint VolumesPagePowerOffVisible = 3869;
+ ///
+ /// 3870
+ ///
+ public const uint VolumesPageVisible = 3870;
+ ///
+ /// 3871
+ ///
+ public const uint VolumeDualMute1Visible = 3871;
+ ///
+ /// 3874
+ ///
+ public const uint Volume1SpeechMutePressAndFB = 3874;
+ ///
+ /// 3875
+ ///
+ public const uint Volume1BackerVisibility = 3875;
+ ///
+ /// 3891
+ ///
+ public const uint VolumeDefaultPress = 3891;
+ ///
+ /// 3951
+ ///
+ /// 3952
+ ///
+ public const uint HeaderIcon2Press = 3952;
+ ///
+ /// 3953
+ ///
+ public const uint HeaderIcon3Press = 3953;
+ ///
+ /// 3954
+ ///
+ public const uint HeaderIcon4Press = 3954;
+ ///
+ /// 3955
+ ///
+ public const uint HeaderIcon5Press = 3955;
+
+ /// 3960
+ ///
+ public const uint HeaderPopupCaretsSubpageVisibile = 3960;
+ ///
+ /// 3961
+ ///
+ public const uint HeaderCaret1Visible = 3961;
+ ///
+ /// 3962
+ ///
+ public const uint HeaderCaret2Visible = 3962;
+ ///
+ /// 3963
+ ///
+ public const uint HeaderCaret3Visible = 3963;
+ ///
+ /// 3964
+ ///
+ public const uint HeaderCaret4Visible = 3964;
+ ///
+ /// 3965
+ ///
+ public const uint HeaderCaret5Visible = 3965;
+
+ ///
+ /// 3999
+ ///
+ public const uint GenericModalVisible = 3999;
+ ///
+ /// 12345
+ ///
+ public const uint AvNoControlsSubVisible = 12345;
+
+ // 10000 - 14999 are general "source" pages
+
+ ///
+ /// 15001
+ ///
+ public const uint StartPageVisible = 15001;
+ ///
+ /// 15002 Shows the start page in the source controls area of the screen
+ ///
+ public const uint TapToBeginVisible = 15002;
+ ///
+ /// 15003 Message text when no source is showing
+ ///
+ public const uint SelectASourceVisible = 15003;
+ ///
+ /// 15004
+ ///
+ public const uint RoomIsOn = 15004;
+ ///
+ /// 15005 Shows always-on volume control subpage with only audio mute
+ ///
+ public const uint VolumeControlsSingleMuteVisible = 15005;
+ ///
+ /// 15006 Shows always-on volume control subpage with mic and audio mutes
+ ///
+ public const uint VolumeControlsDualMuteVisible = 15006;
+ ///
+ /// 15010
+ ///
+ public const uint ShowPanelSetupPress = 15010;
+ ///
+ /// 15011 - Top bar with room name and button that pops up dialog with room data
+ ///
+ public const uint TopBarHabaneroVisible = 15011;
+ ///
+ /// 15012
+ ///
+ public const uint SourceStagingBarVisible = 15012;
+ ///
+ /// 15013
+ ///
+ public const uint PowerOffStep1Visible = 15013;
+ ///
+ /// 15014
+ ///
+ public const uint PowerOffStep2Visible = 15014;
+ ///
+ /// 15015
+ ///
+ public const uint ShowPowerOffPress = 15015;
+ ///
+ /// 15016
+ ///
+ public const uint PowerOffMorePress = 15016;
+ ///
+ /// 15017
+ ///
+ public const uint StagingPageAdditionalArrowsVisible = 15017;
+ ///
+ /// 15018 The Header with dynamic buttons
+ ///
+ public const uint TopBarHabaneroDynamicVisible = 15018;
+ ///
+ /// 15019 Shown when system is starting and not ready for use
+ ///
+ public const uint SystemInitializingVisible = 15019;
+ ///
+ /// 15020
+ ///
+ public const uint PanelSetupVisible = 15020;
+ ///
+ /// 15021
+ ///
+ public const uint SourceWaitOverlayVisible = 15021;
+ ///
+ /// 15022
+ ///
+ public const uint ActivityFooterVisible = 15022;
+ ///
+ /// 15024
+ ///
+ public const uint HeaderCallStatusLeftPositionVisible = 15024;
+ ///
+ /// 15025
+ ///
+ public const uint HeaderCallStatusRightPositionVisible = 15025;
+ ///
+ /// 15027
+ ///
+ public const uint HeaderCallStatusLabelPress = 15027;
+ ///
+ /// 15028 The gear button in header
+ ///
+ public const uint FIXFIX_HeaderGearButtonPress_FIXFIX = 15028;
+ ///
+ /// 15029 the room button in header
+ ///
+ public const uint HeaderRoomButtonPress = 15029;
+ ///
+ /// 15030 Visibility for room data popup
+ ///
+ public const uint RoomHeaderInfoPageVisible = 15030;
+ ///
+ /// 15031
+ ///
+ public const uint AllRoomsOffPress = 15031;
+ ///
+ /// 15032
+ ///
+ public const uint DisplayPowerTogglePress = 15032;
+ ///
+ /// 15033
+ ///
+ public const uint PowerOffCancelPress = 15033;
+ ///
+ /// 15034
+ ///
+ public const uint PowerOffConfirmPress = 15034;
+ ///
+ /// 15035
+ ///
+ public const uint VolumeButtonPopupPress = 15035;
+ ///
+ /// 15035
+ ///
+ public const uint VolumeButtonPopupVisible = 15035;
+ ///
+ /// 15036
+ ///
+ public const uint VolumeGaugePopupVisible = 15036;
+ ///
+ /// 15037
+ ///
+ public const uint GearButtonVisible = 15037;
+ ///
+ /// 15038
+ ///
+ public const uint CalendarHeaderButtonVisible = 15038;
+ ///
+ /// 15039
+ ///
+ public const uint CalendarHeaderButtonPress = 15039;
+ ///
+ /// 15040
+ ///
+ public const uint CallStatusPageVisible = 15040;
+ ///
+ /// 15041
+ ///
+ public const uint LightsPageVisible = 15041;
+ ///
+ /// 15042 Closes whichever interlocked modal is open
+ ///
+ public const uint InterlockedModalClosePress = 15042;
+ ///
+ /// 15043 Vis for modal backer for full-screen source
+ ///
+ public const uint SourceBackgroundOverlayVisible = 15043;
+ ///
+ /// 15044 Close button for source modal overlay
+ ///
+ public const uint SourceBackgroundOverlayClosePress = 15044;
+ ///
+ /// 15045
+ ///
+ public const uint ZoomRoomContentSharingVisible = 15045;
+ ///
+ /// 15046
+ ///
+ public const uint MeetingsOrContacMethodsListVisible = 15046;
+ ///
+ /// 15047 The "Join" button on the next meeting ribbon
+ ///
+ public const uint NextMeetingJoinPress = 15047;
+ ///
+ /// 15048 Dismisses the ribbon
+ ///
+ public const uint NextMeetingModalClosePress = 15048;
+ ///
+ /// 15049
+ ///
+ public const uint NextMeetingModalVisible = 15049;
+ ///
+ /// 15050
+ ///
+ public const uint NextMeetingNotificationRibbonVisible = 15050;
+ ///
+ /// 15051
+ ///
+ public const uint Display1SelectPressAndFb = 15051;
+ ///
+ /// 15052
+ ///
+ public const uint Display1ControlButtonEnable = 15052;
+ ///
+ /// 15053
+ ///
+ public const uint Display1ControlButtonPress = 15053;
+ ///
+ /// 15054
+ ///
+ public const uint Display1AudioButtonEnable = 15054;
+ ///
+ /// 15055
+ ///
+ public const uint Display1AudioButtonPressAndFb = 15055;
+ ///
+ /// 15056
+ ///
+ public const uint Display2SelectPressAndFb = 15056;
+ ///
+ /// 15057
+ ///
+ public const uint Display2ControlButtonEnable = 15057;
+ ///
+ /// 15058
+ ///
+ public const uint Display2ControlButtonPress = 15058;
+ ///
+ /// 15059
+ ///
+ public const uint Display2AudioButtonEnable = 15059;
+ ///
+ /// 15060
+ ///
+ public const uint Display2AudioButtonPressAndFb = 15060;
+ ///
+ /// 15061 Reveals the dual-display subpage
+ ///
+ public const uint DualDisplayPageVisible = 15061;
+ ///
+ /// 15062 Reveals the toggle switch for the sharing mode
+ ///
+ public const uint ToggleSharingModeVisible = 15062;
+ ///
+ /// 15063 Press for the toggle mode switch
+ ///
+ public const uint ToggleSharingModePress = 15063;
+ ///
+ /// 15064
+ ///
+ public const uint LogoDefaultVisible = 15064;
+ ///
+ /// 15065
+ ///
+ public const uint LogoUrlVisible = 15065;
+ ///
+ /// 15066 - Reveals the active calls header item
+ ///
+ public const uint HeaderActiveCallsListVisible = 15066;
+ ///
+ /// 15067
+ ///
+ public const uint NotificationRibbonVisible = 15067;
+ ///
+ /// 15068
+ ///
+ public const uint HeaderMeetingInfoVisible = 15068;
+
+ ///
+ /// 15083 - Press for Call help desk on AC/VC
+ ///
+ public const uint HelpPageShowCallButtonPress = 15083;
+ ///
+ /// 15084 - Show the "call help desk" button on help page
+ ///
+ public const uint HelpPageShowCallButtonVisible = 15084;
+ ///
+ /// 15085 Visibility join for help subpage
+ ///
+ public const uint HelpPageVisible = 15085;
+ ///
+ /// 15086 Press for help header button
+ ///
+ public const uint HelpPress = 15086;
+ ///
+ /// 15088
+ ///
+ public const uint DateOnlyVisible = 15088;
+ ///
+ /// 15089
+ ///
+ public const uint TimeOnlyVisible = 15089;
+ ///
+ /// 15090
+ ///
+ public const uint DateAndTimeVisible = 15090;
+ ///
+ /// 15091
+ ///
+ public const uint SetupFullDistrib = 15091;
+
+ ///
+ /// 15092
+ ///
+ public const uint StartMCPageVisible = 15092;
+
+
+ ///
+ /// 15093
+ ///
+ public const uint RoomHeaderInfoMCPageVisible = 15093;
+
+ ///
+ /// 15094
+ ///
+ public const uint MCScreenSaverVisible = 15094;
+
+ ///
+ /// 15095
+ ///
+ public const uint MCScreenSaverPosition1Visible = 15095;
+
+ ///
+ /// 15096
+ ///
+ public const uint MCScreenSaverPosition2Visible = 15096;
+
+ ///
+ /// 15097
+ ///
+ public const uint MCScreenSaverPosition3Visible = 15097;
+
+ ///
+ /// 15098
+ ///
+ public const uint MCScreenSaverPosition4Visible = 15098;
+
+ ///
+ /// 15099
+ ///
+ public const uint MCScreenSaverClosePress = 15099;
+
+ // PIN dialogs ************************************
+
+ ///
+ /// 15201
+ ///
+ public const uint PinDialog4DigitVisible = 15201;
+ ///
+ /// 15206
+ ///
+ public const uint PinDialogCancelPress = 15206;
+ ///
+ /// 15207
+ ///
+ public const uint PinDialogErrorVisible = 15207;
+ ///
+ /// 15211
+ ///
+ public const uint PinDialogDot1 = 15211;
+ ///
+ /// 15212
+ ///
+ public const uint PinDialogDot2 = 15212;
+ ///
+ /// 15213
+ ///
+ public const uint PinDialogDot3 = 15213;
+ ///
+ /// 15214
+ ///
+ public const uint PinDialogDot4 = 15214;
+
+ // Password Prompt Dialog **************************
+
+ ///
+ /// 15301
+ ///
+ public const uint PasswordPromptDialogVisible = 15301;
+ ///
+ /// 15302
+ ///
+ public const uint PasswordPromptTextPress = 15302;
+ ///
+ /// 15306
+ ///
+ public const uint PasswordPromptCancelPress = 15306;
+ ///
+ /// 15307
+ ///
+ public const uint PasswordPromptErrorVisible = 15307;
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/UI/JoinConstants/UISmartObjectJoin.cs b/src/PepperDashEssentials/UI/JoinConstants/UISmartObjectJoin.cs
similarity index 100%
rename from PepperDashEssentials/UI/JoinConstants/UISmartObjectJoin.cs
rename to src/PepperDashEssentials/UI/JoinConstants/UISmartObjectJoin.cs
diff --git a/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs b/src/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs
similarity index 100%
rename from PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs
rename to src/PepperDashEssentials/UI/JoinConstants/UIStringlJoin.cs
diff --git a/PepperDashEssentials/UI/JoinConstants/UIUshortJoin.cs b/src/PepperDashEssentials/UI/JoinConstants/UIUshortJoin.cs
similarity index 100%
rename from PepperDashEssentials/UI/JoinConstants/UIUshortJoin.cs
rename to src/PepperDashEssentials/UI/JoinConstants/UIUshortJoin.cs
diff --git a/PepperDashEssentials/UI/SmartObjectHeaderButtonList.cs b/src/PepperDashEssentials/UI/SmartObjectHeaderButtonList.cs
similarity index 100%
rename from PepperDashEssentials/UI/SmartObjectHeaderButtonList.cs
rename to src/PepperDashEssentials/UI/SmartObjectHeaderButtonList.cs
diff --git a/PepperDashEssentials/UI/SubpageReferenceListActivityItem.cs b/src/PepperDashEssentials/UI/SubpageReferenceListActivityItem.cs
similarity index 100%
rename from PepperDashEssentials/UI/SubpageReferenceListActivityItem.cs
rename to src/PepperDashEssentials/UI/SubpageReferenceListActivityItem.cs
diff --git a/PepperDashEssentials/UI/SubpageReferenceListCallStagingItem.cs b/src/PepperDashEssentials/UI/SubpageReferenceListCallStagingItem.cs
similarity index 100%
rename from PepperDashEssentials/UI/SubpageReferenceListCallStagingItem.cs
rename to src/PepperDashEssentials/UI/SubpageReferenceListCallStagingItem.cs
diff --git a/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs b/src/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs
similarity index 100%
rename from PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs
rename to src/PepperDashEssentials/UI/SubpageReferenceListSourceItem.cs
diff --git a/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs b/src/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs
similarity index 100%
rename from PepperDashEssentials/UIDrivers/DualDisplayRouting.cs
rename to src/PepperDashEssentials/UIDrivers/DualDisplayRouting.cs
diff --git a/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs b/src/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs
similarity index 97%
rename from PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs
rename to src/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs
index 6b908739..978206eb 100644
--- a/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs
+++ b/src/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsEnvironmentDriver.cs
@@ -1,256 +1,256 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.Shades;
-using PepperDash.Essentials.Core.Lighting;
-
-namespace PepperDash.Essentials
-{
- public class EssentialsEnvironmentDriver : PanelDriverBase
- {
- ///
- /// Do I need this here?
- ///
- CrestronTouchpanelPropertiesConfig Config;
-
- ///
- /// The list of devices this driver is responsible for controlling
- ///
- public List Devices { get; private set; }
-
- ///
- /// The parent driver for this
- ///
- EssentialsPanelMainInterfaceDriver Parent;
-
- ///
- /// The list of sub drivers for the devices
- ///
- public List DeviceSubDrivers { get; private set; }
-
- public uint BackgroundSubpageJoin { get; private set; }
-
- public EssentialsEnvironmentDriver(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
- : base(parent.TriList)
- {
- Config = config;
- Parent = parent;
-
- Devices = new List();
- DeviceSubDrivers = new List();
-
- Parent.AvDriver.PopupInterlock.StatusChanged += new EventHandler(PopupInterlock_CurrentJoinChanged);
-
- // Calculate the join offests for each device page and assign join actions for each button
- }
-
- void PopupInterlock_CurrentJoinChanged(object sender, StatusChangedEventArgs e)
- {
- // Hide this driver and all sub drivers if popup interlock is not shown
- if (!e.IsShown || e.NewJoin != BackgroundSubpageJoin)
- {
- foreach (var driver in DeviceSubDrivers)
- {
- driver.Hide();
- }
-
- base.Hide();
- }
- }
-
- void IsShownFeedback_OutputChange(object sender, EventArgs e)
- {
-
- }
-
- ///
- /// Shows this driver and all sub drivers
- ///
- public override void Show()
- {
- Parent.AvDriver.PopupInterlock.ShowInterlocked(BackgroundSubpageJoin);
-
- foreach (var driver in DeviceSubDrivers)
- {
- driver.Show();
- }
-
- base.Show();
- }
-
- ///
- /// Hides this driver and all sub drivers
- ///
- public override void Hide()
- {
- Parent.AvDriver.PopupInterlock.HideAndClear();
-
- foreach (var driver in DeviceSubDrivers)
- {
- driver.Hide();
- }
-
- base.Hide();
- }
-
- public override void Toggle()
- {
- if (IsVisible)
- Hide();
- else
- Show();
- }
-
-
- ///
- /// Reads the device keys from the config and gets the devices by key
- ///
- public void GetDevicesFromConfig(Room.Config.EssentialsEnvironmentPropertiesConfig EnvironmentPropertiesConfig)
- {
- if (EnvironmentPropertiesConfig != null)
- {
- Devices.Clear();
- DeviceSubDrivers.Clear();
-
- uint column = 1;
-
- foreach (var dKey in EnvironmentPropertiesConfig.DeviceKeys)
- {
- var device = DeviceManager.GetDeviceForKey(dKey);
-
- if (device != null)
- {
- // Build the driver
- var devicePanelDriver = GetPanelDriverForDevice(device, column);
-
- // Add new PanelDriverBase SubDriver
- if (devicePanelDriver != null)
- {
- Devices.Add(device);
- DeviceSubDrivers.Add(devicePanelDriver);
-
- Debug.Console(1, "Adding '{0}' to Environment Devices", device.Key);
-
- column++;
-
-
- // Quit if device count is exceeded
- if (column > 4)
- break;
- }
- else
- Debug.Console(1, "Unable to build environment driver for device: '{0}'", device.Key);
-
- }
-
- }
-
- SetupEnvironmentUiJoins();
- }
- else
- {
- Debug.Console(1, "Unable to get devices from config. No EnvironmentPropertiesConfig object in room config");
- }
- }
-
- ///
- /// Returns the appropriate panel driver for the device
- ///
- ///
- ///
- ///
- PanelDriverBase GetPanelDriverForDevice(IKeyed device, uint column)
- {
- PanelDriverBase panelDriver = null;
-
- uint buttonPressJoinBase = 0;
- uint buttonVisibleJoinBase = 0;
- uint stringJoinBase = 0;
- uint shadeTypeVisibleBase = 0;
- uint lightingTypeVisibleBase = 0;
-
- switch (column)
- {
- case 1:
- {
- buttonPressJoinBase = UIBoolJoin.EnvironmentColumnOneButtonPressBase;
- buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnOneButtonVisibleBase;
- stringJoinBase = UIStringJoin.EnvironmentColumnOneLabelBase;
- shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnOneShadingTypeVisibleBase;
- lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnOneLightingTypeVisibleBase;
- break;
- }
- case 2:
- {
- buttonPressJoinBase = UIBoolJoin.EnvironmentColumnTwoButtonPressBase;
- buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnTwoButtonVisibleBase;
- stringJoinBase = UIStringJoin.EnvironmentColumnTwoLabelBase;
- shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnTwoShadingTypeVisibleBase;
- lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnTwoLightingTypeVisibleBase;
- break;
- }
- case 3:
- {
- buttonPressJoinBase = UIBoolJoin.EnvironmentColumnThreeButtonPressBase;
- buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnThreeButtonVisibleBase;
- stringJoinBase = UIStringJoin.EnvironmentColumnThreeLabelBase;
- shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnThreeShadingTypeVisibleBase;
- lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnThreeLightingTypeVisibleBase;
- break;
- }
- case 4:
- {
- buttonPressJoinBase = UIBoolJoin.EnvironmentColumnFourButtonPressBase;
- buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnFourButtonVisibleBase;
- stringJoinBase = UIStringJoin.EnvironmentColumnFourLabelBase;
- shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnFourShadingTypeVisibleBase;
- lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnFourLightingTypeVisibleBase;
- break;
- }
- default:
- {
- Debug.Console(1, "Environment Driver: Invalid column number specified");
- break;
- }
- }
-
- // Determine if device is a shade or lighting type and construct the appropriate driver
- if (device is ShadeBase)
- {
- panelDriver = new EssentialsShadeDriver(this, device.Key, buttonPressJoinBase, stringJoinBase, shadeTypeVisibleBase);
- }
- else if (device is LightingBase)
- {
- panelDriver = new EssentialsLightingDriver(this, device.Key, buttonPressJoinBase, buttonVisibleJoinBase, stringJoinBase, lightingTypeVisibleBase);
- }
-
- // Return the driver
-
- return panelDriver;
- }
-
- ///
- /// Determines the join values for the generic environment subpages
- ///
- void SetupEnvironmentUiJoins()
- {
- // Calculate which background subpage join to use
- BackgroundSubpageJoin = UIBoolJoin.EnvironmentBackgroundSubpageVisibleBase + (uint)DeviceSubDrivers.Count;
-
-
- }
-
- }
-
- public interface IEnvironmentSubdriver
- {
- uint SubpageVisibleJoin { get; }
- }
-
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Shades;
+using PepperDash.Essentials.Core.Lighting;
+
+namespace PepperDash.Essentials
+{
+ public class EssentialsEnvironmentDriver : PanelDriverBase
+ {
+ ///
+ /// Do I need this here?
+ ///
+ CrestronTouchpanelPropertiesConfig Config;
+
+ ///
+ /// The list of devices this driver is responsible for controlling
+ ///
+ public List Devices { get; private set; }
+
+ ///
+ /// The parent driver for this
+ ///
+ EssentialsPanelMainInterfaceDriver Parent;
+
+ ///
+ /// The list of sub drivers for the devices
+ ///
+ public List DeviceSubDrivers { get; private set; }
+
+ public uint BackgroundSubpageJoin { get; private set; }
+
+ public EssentialsEnvironmentDriver(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
+ : base(parent.TriList)
+ {
+ Config = config;
+ Parent = parent;
+
+ Devices = new List();
+ DeviceSubDrivers = new List();
+
+ Parent.AvDriver.PopupInterlock.StatusChanged += new EventHandler(PopupInterlock_CurrentJoinChanged);
+
+ // Calculate the join offests for each device page and assign join actions for each button
+ }
+
+ void PopupInterlock_CurrentJoinChanged(object sender, StatusChangedEventArgs e)
+ {
+ // Hide this driver and all sub drivers if popup interlock is not shown
+ if (!e.IsShown || e.NewJoin != BackgroundSubpageJoin)
+ {
+ foreach (var driver in DeviceSubDrivers)
+ {
+ driver.Hide();
+ }
+
+ base.Hide();
+ }
+ }
+
+ void IsShownFeedback_OutputChange(object sender, EventArgs e)
+ {
+
+ }
+
+ ///
+ /// Shows this driver and all sub drivers
+ ///
+ public override void Show()
+ {
+ Parent.AvDriver.PopupInterlock.ShowInterlocked(BackgroundSubpageJoin);
+
+ foreach (var driver in DeviceSubDrivers)
+ {
+ driver.Show();
+ }
+
+ base.Show();
+ }
+
+ ///
+ /// Hides this driver and all sub drivers
+ ///
+ public override void Hide()
+ {
+ Parent.AvDriver.PopupInterlock.HideAndClear();
+
+ foreach (var driver in DeviceSubDrivers)
+ {
+ driver.Hide();
+ }
+
+ base.Hide();
+ }
+
+ public override void Toggle()
+ {
+ if (IsVisible)
+ Hide();
+ else
+ Show();
+ }
+
+
+ ///
+ /// Reads the device keys from the config and gets the devices by key
+ ///
+ public void GetDevicesFromConfig(Room.Config.EssentialsEnvironmentPropertiesConfig EnvironmentPropertiesConfig)
+ {
+ if (EnvironmentPropertiesConfig != null)
+ {
+ Devices.Clear();
+ DeviceSubDrivers.Clear();
+
+ uint column = 1;
+
+ foreach (var dKey in EnvironmentPropertiesConfig.DeviceKeys)
+ {
+ var device = DeviceManager.GetDeviceForKey(dKey);
+
+ if (device != null)
+ {
+ // Build the driver
+ var devicePanelDriver = GetPanelDriverForDevice(device, column);
+
+ // Add new PanelDriverBase SubDriver
+ if (devicePanelDriver != null)
+ {
+ Devices.Add(device);
+ DeviceSubDrivers.Add(devicePanelDriver);
+
+ Debug.Console(1, "Adding '{0}' to Environment Devices", device.Key);
+
+ column++;
+
+
+ // Quit if device count is exceeded
+ if (column > 4)
+ break;
+ }
+ else
+ Debug.Console(1, "Unable to build environment driver for device: '{0}'", device.Key);
+
+ }
+
+ }
+
+ SetupEnvironmentUiJoins();
+ }
+ else
+ {
+ Debug.Console(1, "Unable to get devices from config. No EnvironmentPropertiesConfig object in room config");
+ }
+ }
+
+ ///
+ /// Returns the appropriate panel driver for the device
+ ///
+ ///
+ ///
+ ///
+ PanelDriverBase GetPanelDriverForDevice(IKeyed device, uint column)
+ {
+ PanelDriverBase panelDriver = null;
+
+ uint buttonPressJoinBase = 0;
+ uint buttonVisibleJoinBase = 0;
+ uint stringJoinBase = 0;
+ uint shadeTypeVisibleBase = 0;
+ uint lightingTypeVisibleBase = 0;
+
+ switch (column)
+ {
+ case 1:
+ {
+ buttonPressJoinBase = UIBoolJoin.EnvironmentColumnOneButtonPressBase;
+ buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnOneButtonVisibleBase;
+ stringJoinBase = UIStringJoin.EnvironmentColumnOneLabelBase;
+ shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnOneShadingTypeVisibleBase;
+ lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnOneLightingTypeVisibleBase;
+ break;
+ }
+ case 2:
+ {
+ buttonPressJoinBase = UIBoolJoin.EnvironmentColumnTwoButtonPressBase;
+ buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnTwoButtonVisibleBase;
+ stringJoinBase = UIStringJoin.EnvironmentColumnTwoLabelBase;
+ shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnTwoShadingTypeVisibleBase;
+ lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnTwoLightingTypeVisibleBase;
+ break;
+ }
+ case 3:
+ {
+ buttonPressJoinBase = UIBoolJoin.EnvironmentColumnThreeButtonPressBase;
+ buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnThreeButtonVisibleBase;
+ stringJoinBase = UIStringJoin.EnvironmentColumnThreeLabelBase;
+ shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnThreeShadingTypeVisibleBase;
+ lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnThreeLightingTypeVisibleBase;
+ break;
+ }
+ case 4:
+ {
+ buttonPressJoinBase = UIBoolJoin.EnvironmentColumnFourButtonPressBase;
+ buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnFourButtonVisibleBase;
+ stringJoinBase = UIStringJoin.EnvironmentColumnFourLabelBase;
+ shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnFourShadingTypeVisibleBase;
+ lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnFourLightingTypeVisibleBase;
+ break;
+ }
+ default:
+ {
+ Debug.Console(1, "Environment Driver: Invalid column number specified");
+ break;
+ }
+ }
+
+ // Determine if device is a shade or lighting type and construct the appropriate driver
+ if (device is ShadeBase)
+ {
+ panelDriver = new EssentialsShadeDriver(this, device.Key, buttonPressJoinBase, stringJoinBase, shadeTypeVisibleBase);
+ }
+ else if (device is LightingBase)
+ {
+ panelDriver = new EssentialsLightingDriver(this, device.Key, buttonPressJoinBase, buttonVisibleJoinBase, stringJoinBase, lightingTypeVisibleBase);
+ }
+
+ // Return the driver
+
+ return panelDriver;
+ }
+
+ ///
+ /// Determines the join values for the generic environment subpages
+ ///
+ void SetupEnvironmentUiJoins()
+ {
+ // Calculate which background subpage join to use
+ BackgroundSubpageJoin = UIBoolJoin.EnvironmentBackgroundSubpageVisibleBase + (uint)DeviceSubDrivers.Count;
+
+
+ }
+
+ }
+
+ public interface IEnvironmentSubdriver
+ {
+ uint SubpageVisibleJoin { get; }
+ }
+
}
\ No newline at end of file
diff --git a/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsLightingDriver.cs b/src/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsLightingDriver.cs
similarity index 100%
rename from PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsLightingDriver.cs
rename to src/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsLightingDriver.cs
diff --git a/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs b/src/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs
similarity index 99%
rename from PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs
rename to src/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs
index fb40252c..9ab9ad54 100644
--- a/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs
+++ b/src/PepperDashEssentials/UIDrivers/Environment Drivers/EssentialsShadeDriver.cs
@@ -97,8 +97,8 @@ namespace PepperDash.Essentials
{
TriList.SetSigFalseAction(ButtonPressJoinBase + 1, ShadeDevice.Open);
- TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).Stop);
-
+ TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).Stop);
+
if (ShadeDevice is IShadesOpenCloseStop)
TriList.SetString(StringJoinBase + 2, "Stop");
diff --git a/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs b/src/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs
similarity index 97%
rename from PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs
rename to src/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs
index c63af9d5..4b4ed6b8 100644
--- a/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs
+++ b/src/PepperDashEssentials/UIDrivers/Essentials/EssentialsHeaderDriver.cs
@@ -1,399 +1,399 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.UI;
-using Crestron.SimplSharpPro.DeviceSupport;
-
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.SmartObjects;
-using PepperDash.Essentials.Core.PageManagers;
-using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
-using PepperDash.Essentials.Room.Config;
-using PepperDash.Essentials.Devices.Common.Codec;
-using PepperDash.Essentials.Devices.Common.VideoCodec;
-
-
-namespace PepperDash.Essentials
-{
- ///
- ///
- ///
- public class EssentialsHeaderDriver : PanelDriverBase
- {
- uint EnvironmentCaretVisible;
- uint CalendarCaretVisible;
- uint CallCaretVisible;
-
- JoinedSigInterlock CaretInterlock;
-
- CrestronTouchpanelPropertiesConfig Config;
-
- ///
- /// The parent driver for this
- ///
- EssentialsPanelMainInterfaceDriver Parent;
-
- ///
- /// Indicates that the SetHeaderButtons method has completed successfully
- ///
- public bool HeaderButtonsAreSetUp { get; private set; }
-
- StringInputSig HeaderCallButtonIconSig;
-
- public EssentialsHeaderDriver(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
- : base(parent.TriList)
- {
- Config = config;
- Parent = parent;
- CaretInterlock = new JoinedSigInterlock(TriList);
- }
-
- void SetUpGear(IAVDriver avDriver, IEssentialsRoom currentRoom)
- {
- // Gear
- TriList.SetString(UIStringJoin.HeaderButtonIcon5, "Gear");
- TriList.SetSigHeldAction(UIBoolJoin.HeaderIcon5Press, 2000,
- avDriver.ShowTech,
- null,
- () =>
- {
- if (currentRoom.OnFeedback.BoolValue)
- {
- avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible);
- CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret5Visible);
- }
- else
- {
- avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPagePowerOffVisible);
- CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret5Visible);
- }
- });
- TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
- avDriver.PopupInterlock.HideAndClear());
- }
-
- public void SetUpHelpButton(EssentialsRoomPropertiesConfig roomConf)
- {
- // Help roomConf and popup
- if (roomConf.Help != null)
- {
- TriList.SetString(UIStringJoin.HelpMessage, roomConf.Help.Message);
- TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, roomConf.Help.ShowCallButton);
- TriList.SetString(UIStringJoin.HelpPageCallButtonText, roomConf.Help.CallButtonText);
- if (roomConf.Help.ShowCallButton)
- {
- TriList.SetSigFalseAction(UIBoolJoin.HelpPageShowCallButtonPress, () => { }); // ************ FILL IN
- }
- else
- {
- TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress);
- }
- }
- else // older config
- {
- TriList.SetString(UIStringJoin.HelpMessage, roomConf.HelpMessage);
- TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, false);
- TriList.SetString(UIStringJoin.HelpPageCallButtonText, null);
- TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress);
- }
- TriList.SetString(UIStringJoin.HeaderButtonIcon4, "Help");
- TriList.SetSigFalseAction(UIBoolJoin.HeaderIcon4Press, () =>
- {
- string message = null;
- var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey)
- as IEssentialsHuddleSpaceRoom;
- if (room != null)
- message = room.PropertiesConfig.HelpMessage;
- else
- message = "Sorry, no help message available. No room connected.";
- //TriList.StringInput[UIStringJoin.HelpMessage].StringValue = message;
- Parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HelpPageVisible);
- CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret4Visible);
- });
- }
-
- uint SetUpEnvironmentButton(EssentialsEnvironmentDriver environmentDriver, uint nextJoin)
- {
- if (environmentDriver != null)
- {
- var tempJoin = nextJoin;
- TriList.SetString(tempJoin, "Lights");
- EnvironmentCaretVisible = tempJoin + 10;
- TriList.SetSigFalseAction(tempJoin, () =>
- {
- environmentDriver.Toggle();
- CaretInterlock.ShowInterlocked(EnvironmentCaretVisible);
- });
- nextJoin--;
- return nextJoin;
- }
- else
- return nextJoin;
- }
-
- uint SetUpCalendarButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin)
- {
- // Calendar button
- if (avDriver.CurrentRoom.ScheduleSource != null)
- {
- var tempJoin = nextJoin;
- TriList.SetString(tempJoin, "Calendar");
- CalendarCaretVisible = tempJoin + 10;
- TriList.SetSigFalseAction(tempJoin, () =>
- {
- avDriver.CalendarPress();
- CaretInterlock.ShowInterlocked(CalendarCaretVisible);
- });
-
- nextJoin--;
- return nextJoin;
- }
- else
- return nextJoin;
- }
-
- uint SetUpCallButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin)
- {
- // Call button
- var tempJoin = nextJoin;
- TriList.SetString(tempJoin, "DND");
- CallCaretVisible = tempJoin + 10;
- TriList.SetSigFalseAction(tempJoin, () =>
- {
- avDriver.ShowActiveCallsListOrMeetingInfo();
- if(avDriver.CurrentRoom.InCallFeedback.BoolValue)
- CaretInterlock.ShowInterlocked(CallCaretVisible);
- });
- HeaderCallButtonIconSig = TriList.StringInput[tempJoin];
-
- nextJoin--;
- return nextJoin;
- }
-
- ///
- /// Evaluates the call status and sets the icon mode and text label
- ///
- public void ComputeHeaderCallStatus(VideoCodecBase codec)
- {
- if (codec == null)
- {
- Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. codec is null");
- return;
- }
-
- if (HeaderCallButtonIconSig == null)
- {
- Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. HeaderCallButtonIconSig is null");
- return;
- }
-
- var meetingInfoCodec = codec as IHasMeetingInfo;
-
- // Set mode of header button
- SetHeaderCallIcon(codec);
-
- // Set the call status text
- Debug.Console(1, "Active Call Count: {0}", codec.ActiveCalls.Count);
-
- if (codec.ActiveCalls.Count > 0)
- {
- if (codec.ActiveCalls.Count == 1 && meetingInfoCodec == null)
- TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "1 Active Call");
- else if (codec.ActiveCalls.Count == 1 && meetingInfoCodec != null)
- {
- var headerCallStatusLabel = meetingInfoCodec.MeetingInfo.IsSharingMeeting
- ? "Sharing-Only Meeting"
- : "Active Meeting";
-
- headerCallStatusLabel = meetingInfoCodec.MeetingInfo.WaitingForHost
- ? "Waiting For Host"
- : headerCallStatusLabel;
-
- TriList.SetString(UIStringJoin.HeaderCallStatusLabel, headerCallStatusLabel);
- }
- else if (codec.ActiveCalls.Count > 1)
- TriList.SetString(UIStringJoin.HeaderCallStatusLabel, string.Format("{0} Active Calls", codec.ActiveCalls.Count));
- }
- else
- TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "No Active Calls");
- }
-
- private void SetHeaderCallIcon(VideoCodecBase codec)
- {
- if (!codec.IsInCall)
- {
- HeaderCallButtonIconSig.StringValue = "DND";
- //HeaderCallButton.SetIcon(HeaderListButton.OnHook);
- }
- else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video))
- {
- HeaderCallButtonIconSig.StringValue = "Misc-06_Dark";
- }
- //HeaderCallButton.SetIcon(HeaderListButton.Camera);
- //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2);
- else
- {
- HeaderCallButtonIconSig.StringValue = "Misc-09_Dark";
- }
- //HeaderCallButton.SetIcon(HeaderListButton.Phone);
- //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
- }
-
- ///
- /// Sets up Header Buttons for the EssentialsHuddleVtc1Room type
- ///
- public void SetupHeaderButtons(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, IEssentialsHuddleVtc1Room currentRoom)
- {
- HeaderButtonsAreSetUp = false;
-
- TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
-
- var roomConf = currentRoom.PropertiesConfig;
-
- // Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it
- Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged;
- Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged;
-
- SetUpGear(avDriver, currentRoom);
-
- SetUpHelpButton(roomConf);
-
- uint nextJoin = 3953;
-
- nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin);
-
- nextJoin = SetUpCalendarButton(avDriver, nextJoin);
-
- nextJoin = SetUpCallButton(avDriver, nextJoin);
-
- // blank any that remain
- for (var i = nextJoin; i > 3950; i--)
- {
- TriList.SetString(i, "Blank");
- TriList.SetSigFalseAction(i, () => { });
- }
-
- TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress,
- () =>
- {
- avDriver.ShowActiveCallsListOrMeetingInfo();
- if (avDriver.CurrentRoom.InCallFeedback.BoolValue)
- CaretInterlock.ShowInterlocked(CallCaretVisible);
- });
-
- // Set Call Status Subpage Position
-
- if (nextJoin == 3951)
- {
- // Set to right position
- TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, false);
- TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, true);
- }
- else if (nextJoin == 3950)
- {
- // Set to left position
- TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true);
- TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, false);
- }
-
- HeaderButtonsAreSetUp = true;
-
- ComputeHeaderCallStatus(currentRoom.VideoCodec);
- }
-
- ///
- /// Sets up Header Buttons for the EssentialsHuddleSpaceRoom type
- ///
- public void SetupHeaderButtons(EssentialsHuddlePanelAvFunctionsDriver avDriver, IEssentialsHuddleSpaceRoom currentRoom)
- {
- HeaderButtonsAreSetUp = false;
-
- TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
-
- var roomConf = currentRoom.PropertiesConfig;
-
- // Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it
- Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged;
- Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged;
-
- SetUpGear(avDriver, currentRoom);
-
- SetUpHelpButton(roomConf);
-
- uint nextJoin = 3953;
-
- nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin);
-
- // blank any that remain
- for (var i = nextJoin; i > 3950; i--)
- {
- TriList.SetString(i, "Blank");
- TriList.SetSigFalseAction(i, () => { });
- }
-
- HeaderButtonsAreSetUp = true;
- }
-
- /////
- ///// Whenever a popup is shown/hidden, show/hide the header carets subpage and set the visibility of the correct caret
- /////
- /////
- /////
- //void IsShownFeedback_OutputChange(object sender, EventArgs e)
- //{
- // var popupInterlockIsShown = Parent.AvDriver.PopupInterlock.IsShown;
- // // Set the visible state for the HeaderPopupCaretsSubpage to match that of the PopupInterlock state
- // TriList.SetBool(UIBoolJoin.HeaderPopupCaretsSubpageVisibile, popupInterlockIsShown);
-
- // // Clear all caret visibility
- // for (uint i = UIBoolJoin.HeaderCaret5Visible; i >= UIBoolJoin.HeaderCaret1Visible; i--)
- // {
- // TriList.SetBool(i, false);
- // }
-
- // // Set the current caret visible if the popup is still shown
- // if (popupInterlockIsShown)
- // TriList.SetBool(NextCaretVisible, true);
- //}
-
- ///
- /// Whenever a popup is shown/hidden, show/hide the header carets subpage and set the visibility of the correct caret
- ///
- ///
- ///
- void PopupInterlock_StatusChanged(object sender, StatusChangedEventArgs e)
- {
- // Set the visible state for the HeaderPopupCaretsSubpage to match that of the PopupInterlock state
-
- bool headerPopupShown = false;
-
- // Check if the popup interlock is shown, and if one of the header popups is current, then show the carets subpage
- if (e.IsShown)
- {
- if (Parent.EnvironmentDriver != null && e.NewJoin == Parent.EnvironmentDriver.BackgroundSubpageJoin)
- headerPopupShown = true;
- else if (e.NewJoin == UIBoolJoin.HeaderActiveCallsListVisible)
- headerPopupShown = true;
- else if (e.NewJoin == UIBoolJoin.HeaderMeetingInfoVisible)
- headerPopupShown = true;
- else if (e.NewJoin == UIBoolJoin.HelpPageVisible)
- headerPopupShown = true;
- else if (e.NewJoin == UIBoolJoin.MeetingsOrContacMethodsListVisible)
- headerPopupShown = true;
- else if (e.NewJoin == UIBoolJoin.VolumesPagePowerOffVisible || e.NewJoin == UIBoolJoin.VolumesPageVisible)
- headerPopupShown = true;
- }
-
- // Set the carets subpage visibility
- TriList.SetBool(UIBoolJoin.HeaderPopupCaretsSubpageVisibile, headerPopupShown);
-
- if (!e.IsShown)
- CaretInterlock.HideAndClear();
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.UI;
+using Crestron.SimplSharpPro.DeviceSupport;
+
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.SmartObjects;
+using PepperDash.Essentials.Core.PageManagers;
+using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
+using PepperDash.Essentials.Room.Config;
+using PepperDash.Essentials.Devices.Common.Codec;
+using PepperDash.Essentials.Devices.Common.VideoCodec;
+
+
+namespace PepperDash.Essentials
+{
+ ///
+ ///
+ ///
+ public class EssentialsHeaderDriver : PanelDriverBase
+ {
+ uint EnvironmentCaretVisible;
+ uint CalendarCaretVisible;
+ uint CallCaretVisible;
+
+ JoinedSigInterlock CaretInterlock;
+
+ CrestronTouchpanelPropertiesConfig Config;
+
+ ///
+ /// The parent driver for this
+ ///
+ EssentialsPanelMainInterfaceDriver Parent;
+
+ ///
+ /// Indicates that the SetHeaderButtons method has completed successfully
+ ///
+ public bool HeaderButtonsAreSetUp { get; private set; }
+
+ StringInputSig HeaderCallButtonIconSig;
+
+ public EssentialsHeaderDriver(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
+ : base(parent.TriList)
+ {
+ Config = config;
+ Parent = parent;
+ CaretInterlock = new JoinedSigInterlock(TriList);
+ }
+
+ void SetUpGear(IAVDriver avDriver, IEssentialsRoom currentRoom)
+ {
+ // Gear
+ TriList.SetString(UIStringJoin.HeaderButtonIcon5, "Gear");
+ TriList.SetSigHeldAction(UIBoolJoin.HeaderIcon5Press, 2000,
+ avDriver.ShowTech,
+ null,
+ () =>
+ {
+ if (currentRoom.OnFeedback.BoolValue)
+ {
+ avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible);
+ CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret5Visible);
+ }
+ else
+ {
+ avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPagePowerOffVisible);
+ CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret5Visible);
+ }
+ });
+ TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
+ avDriver.PopupInterlock.HideAndClear());
+ }
+
+ public void SetUpHelpButton(EssentialsRoomPropertiesConfig roomConf)
+ {
+ // Help roomConf and popup
+ if (roomConf.Help != null)
+ {
+ TriList.SetString(UIStringJoin.HelpMessage, roomConf.Help.Message);
+ TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, roomConf.Help.ShowCallButton);
+ TriList.SetString(UIStringJoin.HelpPageCallButtonText, roomConf.Help.CallButtonText);
+ if (roomConf.Help.ShowCallButton)
+ {
+ TriList.SetSigFalseAction(UIBoolJoin.HelpPageShowCallButtonPress, () => { }); // ************ FILL IN
+ }
+ else
+ {
+ TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress);
+ }
+ }
+ else // older config
+ {
+ TriList.SetString(UIStringJoin.HelpMessage, roomConf.HelpMessage);
+ TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, false);
+ TriList.SetString(UIStringJoin.HelpPageCallButtonText, null);
+ TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress);
+ }
+ TriList.SetString(UIStringJoin.HeaderButtonIcon4, "Help");
+ TriList.SetSigFalseAction(UIBoolJoin.HeaderIcon4Press, () =>
+ {
+ string message = null;
+ var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey)
+ as IEssentialsHuddleSpaceRoom;
+ if (room != null)
+ message = room.PropertiesConfig.HelpMessage;
+ else
+ message = "Sorry, no help message available. No room connected.";
+ //TriList.StringInput[UIStringJoin.HelpMessage].StringValue = message;
+ Parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HelpPageVisible);
+ CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret4Visible);
+ });
+ }
+
+ uint SetUpEnvironmentButton(EssentialsEnvironmentDriver environmentDriver, uint nextJoin)
+ {
+ if (environmentDriver != null)
+ {
+ var tempJoin = nextJoin;
+ TriList.SetString(tempJoin, "Lights");
+ EnvironmentCaretVisible = tempJoin + 10;
+ TriList.SetSigFalseAction(tempJoin, () =>
+ {
+ environmentDriver.Toggle();
+ CaretInterlock.ShowInterlocked(EnvironmentCaretVisible);
+ });
+ nextJoin--;
+ return nextJoin;
+ }
+ else
+ return nextJoin;
+ }
+
+ uint SetUpCalendarButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin)
+ {
+ // Calendar button
+ if (avDriver.CurrentRoom.ScheduleSource != null)
+ {
+ var tempJoin = nextJoin;
+ TriList.SetString(tempJoin, "Calendar");
+ CalendarCaretVisible = tempJoin + 10;
+ TriList.SetSigFalseAction(tempJoin, () =>
+ {
+ avDriver.CalendarPress();
+ CaretInterlock.ShowInterlocked(CalendarCaretVisible);
+ });
+
+ nextJoin--;
+ return nextJoin;
+ }
+ else
+ return nextJoin;
+ }
+
+ uint SetUpCallButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin)
+ {
+ // Call button
+ var tempJoin = nextJoin;
+ TriList.SetString(tempJoin, "DND");
+ CallCaretVisible = tempJoin + 10;
+ TriList.SetSigFalseAction(tempJoin, () =>
+ {
+ avDriver.ShowActiveCallsListOrMeetingInfo();
+ if(avDriver.CurrentRoom.InCallFeedback.BoolValue)
+ CaretInterlock.ShowInterlocked(CallCaretVisible);
+ });
+ HeaderCallButtonIconSig = TriList.StringInput[tempJoin];
+
+ nextJoin--;
+ return nextJoin;
+ }
+
+ ///
+ /// Evaluates the call status and sets the icon mode and text label
+ ///
+ public void ComputeHeaderCallStatus(VideoCodecBase codec)
+ {
+ if (codec == null)
+ {
+ Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. codec is null");
+ return;
+ }
+
+ if (HeaderCallButtonIconSig == null)
+ {
+ Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. HeaderCallButtonIconSig is null");
+ return;
+ }
+
+ var meetingInfoCodec = codec as IHasMeetingInfo;
+
+ // Set mode of header button
+ SetHeaderCallIcon(codec);
+
+ // Set the call status text
+ Debug.Console(1, "Active Call Count: {0}", codec.ActiveCalls.Count);
+
+ if (codec.ActiveCalls.Count > 0)
+ {
+ if (codec.ActiveCalls.Count == 1 && meetingInfoCodec == null)
+ TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "1 Active Call");
+ else if (codec.ActiveCalls.Count == 1 && meetingInfoCodec != null)
+ {
+ var headerCallStatusLabel = meetingInfoCodec.MeetingInfo.IsSharingMeeting
+ ? "Sharing-Only Meeting"
+ : "Active Meeting";
+
+ headerCallStatusLabel = meetingInfoCodec.MeetingInfo.WaitingForHost
+ ? "Waiting For Host"
+ : headerCallStatusLabel;
+
+ TriList.SetString(UIStringJoin.HeaderCallStatusLabel, headerCallStatusLabel);
+ }
+ else if (codec.ActiveCalls.Count > 1)
+ TriList.SetString(UIStringJoin.HeaderCallStatusLabel, string.Format("{0} Active Calls", codec.ActiveCalls.Count));
+ }
+ else
+ TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "No Active Calls");
+ }
+
+ private void SetHeaderCallIcon(VideoCodecBase codec)
+ {
+ if (!codec.IsInCall)
+ {
+ HeaderCallButtonIconSig.StringValue = "DND";
+ //HeaderCallButton.SetIcon(HeaderListButton.OnHook);
+ }
+ else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video))
+ {
+ HeaderCallButtonIconSig.StringValue = "Misc-06_Dark";
+ }
+ //HeaderCallButton.SetIcon(HeaderListButton.Camera);
+ //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2);
+ else
+ {
+ HeaderCallButtonIconSig.StringValue = "Misc-09_Dark";
+ }
+ //HeaderCallButton.SetIcon(HeaderListButton.Phone);
+ //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
+ }
+
+ ///
+ /// Sets up Header Buttons for the EssentialsHuddleVtc1Room type
+ ///
+ public void SetupHeaderButtons(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, IEssentialsHuddleVtc1Room currentRoom)
+ {
+ HeaderButtonsAreSetUp = false;
+
+ TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
+
+ var roomConf = currentRoom.PropertiesConfig;
+
+ // Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it
+ Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged;
+ Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged;
+
+ SetUpGear(avDriver, currentRoom);
+
+ SetUpHelpButton(roomConf);
+
+ uint nextJoin = 3953;
+
+ nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin);
+
+ nextJoin = SetUpCalendarButton(avDriver, nextJoin);
+
+ nextJoin = SetUpCallButton(avDriver, nextJoin);
+
+ // blank any that remain
+ for (var i = nextJoin; i > 3950; i--)
+ {
+ TriList.SetString(i, "Blank");
+ TriList.SetSigFalseAction(i, () => { });
+ }
+
+ TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress,
+ () =>
+ {
+ avDriver.ShowActiveCallsListOrMeetingInfo();
+ if (avDriver.CurrentRoom.InCallFeedback.BoolValue)
+ CaretInterlock.ShowInterlocked(CallCaretVisible);
+ });
+
+ // Set Call Status Subpage Position
+
+ if (nextJoin == 3951)
+ {
+ // Set to right position
+ TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, false);
+ TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, true);
+ }
+ else if (nextJoin == 3950)
+ {
+ // Set to left position
+ TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true);
+ TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, false);
+ }
+
+ HeaderButtonsAreSetUp = true;
+
+ ComputeHeaderCallStatus(currentRoom.VideoCodec);
+ }
+
+ ///
+ /// Sets up Header Buttons for the EssentialsHuddleSpaceRoom type
+ ///
+ public void SetupHeaderButtons(EssentialsHuddlePanelAvFunctionsDriver avDriver, IEssentialsHuddleSpaceRoom currentRoom)
+ {
+ HeaderButtonsAreSetUp = false;
+
+ TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
+
+ var roomConf = currentRoom.PropertiesConfig;
+
+ // Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it
+ Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged;
+ Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged;
+
+ SetUpGear(avDriver, currentRoom);
+
+ SetUpHelpButton(roomConf);
+
+ uint nextJoin = 3953;
+
+ nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin);
+
+ // blank any that remain
+ for (var i = nextJoin; i > 3950; i--)
+ {
+ TriList.SetString(i, "Blank");
+ TriList.SetSigFalseAction(i, () => { });
+ }
+
+ HeaderButtonsAreSetUp = true;
+ }
+
+ /////
+ ///// Whenever a popup is shown/hidden, show/hide the header carets subpage and set the visibility of the correct caret
+ /////
+ /////
+ /////
+ //void IsShownFeedback_OutputChange(object sender, EventArgs e)
+ //{
+ // var popupInterlockIsShown = Parent.AvDriver.PopupInterlock.IsShown;
+ // // Set the visible state for the HeaderPopupCaretsSubpage to match that of the PopupInterlock state
+ // TriList.SetBool(UIBoolJoin.HeaderPopupCaretsSubpageVisibile, popupInterlockIsShown);
+
+ // // Clear all caret visibility
+ // for (uint i = UIBoolJoin.HeaderCaret5Visible; i >= UIBoolJoin.HeaderCaret1Visible; i--)
+ // {
+ // TriList.SetBool(i, false);
+ // }
+
+ // // Set the current caret visible if the popup is still shown
+ // if (popupInterlockIsShown)
+ // TriList.SetBool(NextCaretVisible, true);
+ //}
+
+ ///
+ /// Whenever a popup is shown/hidden, show/hide the header carets subpage and set the visibility of the correct caret
+ ///
+ ///
+ ///
+ void PopupInterlock_StatusChanged(object sender, StatusChangedEventArgs e)
+ {
+ // Set the visible state for the HeaderPopupCaretsSubpage to match that of the PopupInterlock state
+
+ bool headerPopupShown = false;
+
+ // Check if the popup interlock is shown, and if one of the header popups is current, then show the carets subpage
+ if (e.IsShown)
+ {
+ if (Parent.EnvironmentDriver != null && e.NewJoin == Parent.EnvironmentDriver.BackgroundSubpageJoin)
+ headerPopupShown = true;
+ else if (e.NewJoin == UIBoolJoin.HeaderActiveCallsListVisible)
+ headerPopupShown = true;
+ else if (e.NewJoin == UIBoolJoin.HeaderMeetingInfoVisible)
+ headerPopupShown = true;
+ else if (e.NewJoin == UIBoolJoin.HelpPageVisible)
+ headerPopupShown = true;
+ else if (e.NewJoin == UIBoolJoin.MeetingsOrContacMethodsListVisible)
+ headerPopupShown = true;
+ else if (e.NewJoin == UIBoolJoin.VolumesPagePowerOffVisible || e.NewJoin == UIBoolJoin.VolumesPageVisible)
+ headerPopupShown = true;
+ }
+
+ // Set the carets subpage visibility
+ TriList.SetBool(UIBoolJoin.HeaderPopupCaretsSubpageVisibile, headerPopupShown);
+
+ if (!e.IsShown)
+ CaretInterlock.HideAndClear();
+ }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs b/src/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs
similarity index 96%
rename from PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs
rename to src/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs
index 2b787063..6b9ae605 100644
--- a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs
+++ b/src/PepperDashEssentials/UIDrivers/Essentials/EssentialsPanelMainInterfaceDriver.cs
@@ -1,168 +1,168 @@
-using System;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro.DeviceSupport;
-using Crestron.SimplSharpPro.UI;
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.SmartObjects;
-
-namespace PepperDash.Essentials
-{
- ///
- ///
- ///
- public class EssentialsPanelMainInterfaceDriver : PanelDriverBase, IHasScreenSaverController, IDisposable
- {
- CTimer InactivityTimer;
-
- ///
- /// Assign the appropriate A/V driver.
- /// Want to keep the AvDriver alive, because it may hold states
- ///
- public IAVDriver AvDriver { get; set;}
-
- public EssentialsHeaderDriver HeaderDriver { get; set; }
-
- public EssentialsEnvironmentDriver EnvironmentDriver { get; set; }
-
- public PanelDriverBase CurrentChildDriver { get; private set; }
-
- public ScreenSaverController ScreenSaverController { get; set; }
-
- private readonly long _timeoutMs;
-
- CrestronTouchpanelPropertiesConfig Config;
-
- ///
- /// The main interlock for popups
- ///
- //public JoinedSigInterlock PopupInterlock { get; private set; }
-
- public EssentialsPanelMainInterfaceDriver(BasicTriListWithSmartObject trilist,
- CrestronTouchpanelPropertiesConfig config)
- : base(trilist)
- {
- Config = config;
-
- _timeoutMs = Config.ScreenSaverTimeoutMin * 60 * 1000;
-
- var tsx52or60 = trilist as Tswx52ButtonVoiceControl;
-
- if (tsx52or60 != null)
- {
- tsx52or60.ExtenderTouchDetectionReservedSigs.Use();
- tsx52or60.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange;
- tsx52or60.ExtenderTouchDetectionReservedSigs.Time.UShortValue = 1;
- ManageInactivityTimer();
-
- }
- else
- {
- var tswx70 = trilist as TswX70Base;
- if (tswx70 != null)
- {
- tswx70.ExtenderTouchDetectionReservedSigs.Use();
- tswx70.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange;
- tswx70.ExtenderTouchDetectionReservedSigs.Time.UShortValue = 1;
- ManageInactivityTimer();
- }
- }
- }
-
- #region IDisposable Members
-
- public void Dispose()
- {
- var avDriver = AvDriver as PanelDriverBase;
- if (avDriver != null)
- {
- avDriver.Hide();
- }
- if (ScreenSaverController != null)
- {
- ScreenSaverController.Dispose();
- }
- if (HeaderDriver != null)
- {
- HeaderDriver.Hide();
- }
- if (EnvironmentDriver != null)
- {
- EnvironmentDriver.Hide();
- }
- if (CurrentChildDriver != null)
- {
- CurrentChildDriver.Hide();
- }
- }
-
- #endregion
-
- void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args)
- {
-
- if (args.Sig.BoolValue)
- {
- ManageInactivityTimer();
- }
- }
-
- private void ManageInactivityTimer()
- {
- if (InactivityTimer != null)
- {
- InactivityTimer.Reset(_timeoutMs);
- }
- else
- {
- InactivityTimer = new CTimer((o) => InactivityTimerExpired(), _timeoutMs);
- }
- }
-
- void InactivityTimerExpired()
- {
- InactivityTimer.Stop();
- InactivityTimer.Dispose();
- InactivityTimer = null;
-
- ScreenSaverController.Show();
- }
-
- public override void Show()
- {
- CurrentChildDriver = null;
- ShowSubDriver(AvDriver as PanelDriverBase);
-
- base.Show();
- }
-
- public override void Hide()
- {
- TriList.BooleanInput[AvDriver.StartPageVisibleJoin].BoolValue = false;
- base.Hide();
- }
-
- void ShowSubDriver(PanelDriverBase driver)
- {
- CurrentChildDriver = driver;
- if (driver == null)
- return;
- this.Hide();
- driver.Show();
- }
-
- ///
- ///
- ///
- public override void BackButtonPressed()
- {
- if(CurrentChildDriver != null)
- CurrentChildDriver.BackButtonPressed();
- }
- }
-
- public interface IHasScreenSaverController
- {
- ScreenSaverController ScreenSaverController { get; }
- }
+using System;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro.DeviceSupport;
+using Crestron.SimplSharpPro.UI;
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.SmartObjects;
+
+namespace PepperDash.Essentials
+{
+ ///
+ ///
+ ///
+ public class EssentialsPanelMainInterfaceDriver : PanelDriverBase, IHasScreenSaverController, IDisposable
+ {
+ CTimer InactivityTimer;
+
+ ///
+ /// Assign the appropriate A/V driver.
+ /// Want to keep the AvDriver alive, because it may hold states
+ ///
+ public IAVDriver AvDriver { get; set;}
+
+ public EssentialsHeaderDriver HeaderDriver { get; set; }
+
+ public EssentialsEnvironmentDriver EnvironmentDriver { get; set; }
+
+ public PanelDriverBase CurrentChildDriver { get; private set; }
+
+ public ScreenSaverController ScreenSaverController { get; set; }
+
+ private readonly long _timeoutMs;
+
+ CrestronTouchpanelPropertiesConfig Config;
+
+ ///
+ /// The main interlock for popups
+ ///
+ //public JoinedSigInterlock PopupInterlock { get; private set; }
+
+ public EssentialsPanelMainInterfaceDriver(BasicTriListWithSmartObject trilist,
+ CrestronTouchpanelPropertiesConfig config)
+ : base(trilist)
+ {
+ Config = config;
+
+ _timeoutMs = Config.ScreenSaverTimeoutMin * 60 * 1000;
+
+ var tsx52or60 = trilist as Tswx52ButtonVoiceControl;
+
+ if (tsx52or60 != null)
+ {
+ tsx52or60.ExtenderTouchDetectionReservedSigs.Use();
+ tsx52or60.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange;
+ tsx52or60.ExtenderTouchDetectionReservedSigs.Time.UShortValue = 1;
+ ManageInactivityTimer();
+
+ }
+ else
+ {
+ var tswx70 = trilist as TswX70Base;
+ if (tswx70 != null)
+ {
+ tswx70.ExtenderTouchDetectionReservedSigs.Use();
+ tswx70.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange;
+ tswx70.ExtenderTouchDetectionReservedSigs.Time.UShortValue = 1;
+ ManageInactivityTimer();
+ }
+ }
+ }
+
+ #region IDisposable Members
+
+ public void Dispose()
+ {
+ var avDriver = AvDriver as PanelDriverBase;
+ if (avDriver != null)
+ {
+ avDriver.Hide();
+ }
+ if (ScreenSaverController != null)
+ {
+ ScreenSaverController.Dispose();
+ }
+ if (HeaderDriver != null)
+ {
+ HeaderDriver.Hide();
+ }
+ if (EnvironmentDriver != null)
+ {
+ EnvironmentDriver.Hide();
+ }
+ if (CurrentChildDriver != null)
+ {
+ CurrentChildDriver.Hide();
+ }
+ }
+
+ #endregion
+
+ void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args)
+ {
+
+ if (args.Sig.BoolValue)
+ {
+ ManageInactivityTimer();
+ }
+ }
+
+ private void ManageInactivityTimer()
+ {
+ if (InactivityTimer != null)
+ {
+ InactivityTimer.Reset(_timeoutMs);
+ }
+ else
+ {
+ InactivityTimer = new CTimer((o) => InactivityTimerExpired(), _timeoutMs);
+ }
+ }
+
+ void InactivityTimerExpired()
+ {
+ InactivityTimer.Stop();
+ InactivityTimer.Dispose();
+ InactivityTimer = null;
+
+ ScreenSaverController.Show();
+ }
+
+ public override void Show()
+ {
+ CurrentChildDriver = null;
+ ShowSubDriver(AvDriver as PanelDriverBase);
+
+ base.Show();
+ }
+
+ public override void Hide()
+ {
+ TriList.BooleanInput[AvDriver.StartPageVisibleJoin].BoolValue = false;
+ base.Hide();
+ }
+
+ void ShowSubDriver(PanelDriverBase driver)
+ {
+ CurrentChildDriver = driver;
+ if (driver == null)
+ return;
+ this.Hide();
+ driver.Show();
+ }
+
+ ///
+ ///
+ ///
+ public override void BackButtonPressed()
+ {
+ if(CurrentChildDriver != null)
+ CurrentChildDriver.BackButtonPressed();
+ }
+ }
+
+ public interface IHasScreenSaverController
+ {
+ ScreenSaverController ScreenSaverController { get; }
+ }
}
\ No newline at end of file
diff --git a/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs b/src/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs
similarity index 100%
rename from PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs
rename to src/PepperDashEssentials/UIDrivers/Essentials/EssentialsPresentationPanelAvFunctionsDriver.cs
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs b/src/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
similarity index 100%
rename from PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
rename to src/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs b/src/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs
similarity index 100%
rename from PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs
rename to src/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddleTechPageDriver.cs
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddlePresentationUiDriver.cs b/src/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddlePresentationUiDriver.cs
similarity index 100%
rename from PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddlePresentationUiDriver.cs
rename to src/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddlePresentationUiDriver.cs
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/src/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
similarity index 97%
rename from PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
rename to src/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
index 80fb0ba8..78aeb311 100644
--- a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
+++ b/src/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
@@ -1,1652 +1,1652 @@
-using System;
-using System.Linq;
-using System.Collections.Generic;
-using System.Globalization;
-using Crestron.SimplSharp;
-using Crestron.SimplSharpPro;
-using Crestron.SimplSharpPro.UI;
-
-using PepperDash.Core;
-using PepperDash.Essentials.Core;
-using PepperDash.Essentials.Core.Config;
-using PepperDash.Essentials.Core.DeviceTypeInterfaces;
-using PepperDash.Essentials.Core.SmartObjects;
-using PepperDash.Essentials.Core.PageManagers;
-using PepperDash.Essentials.Room.Config;
-using PepperDash.Essentials.Devices.Common.Codec;
-using PepperDash.Essentials.Devices.Common.VideoCodec;
-using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
-
-namespace PepperDash.Essentials
-{
- ///
- ///
- ///
- public class EssentialsHuddleVtc1PanelAvFunctionsDriver : PanelDriverBase, IAVWithVCDriver
- {
- CrestronTouchpanelPropertiesConfig Config;
-
- public enum UiDisplayMode
- {
- Presentation, AudioSetup, Call, Start
- }
-
- public uint StartPageVisibleJoin { get; private set; }
-
- ///
- /// Whether volume ramping from this panel will show the volume
- /// gauge popup.
- ///
- public bool ShowVolumeGauge { get; set; }
-
- ///
- ///
- ///
- public uint PowerOffTimeout { get; set; }
-
- ///
- ///
- ///
- public string DefaultRoomKey { get; set; }
-
-
- ///
- ///
- ///
- public IEssentialsHuddleVtc1Room CurrentRoom
- {
- get { return _CurrentRoom; }
- set
- {
- SetCurrentRoom(value);
- }
- }
- IEssentialsHuddleVtc1Room _CurrentRoom;
-
- ///
- /// For hitting feedbacks
- ///
- BoolInputSig CallButtonSig;
- BoolInputSig ShareButtonSig;
- BoolInputSig EndMeetingButtonSig;
-
- BoolFeedback CallSharingInfoVisibleFeedback;
-
- ///
- /// The parent driver for this
- ///
- public PanelDriverBase Parent { get; private set; }
-
- ///
- /// All children attached to this driver. For hiding and showing as a group.
- ///
- List ChildDrivers = new List();
-
- List CurrentDisplayModeSigsInUse = new List();
-
- //// Important smart objects
-
- ///
- /// Smart Object 3200
- ///
- SubpageReferenceList SourceStagingSrl;
-
- ///
- /// Smart Object 15022
- ///
- SubpageReferenceList ActivityFooterSrl;
-
- ///
- ///
- ///
- public SubpageReferenceList MeetingOrContactMethodModalSrl { get; set; }
-
- public uint CallListOrMeetingInfoPopoverVisibilityJoin { get; private set; }
-
-
- ///
- /// The list of buttons on the header. Managed with visibility only
- ///
- //SmartObjectHeaderButtonList HeaderButtonsList;
-
- ///
- /// The AV page mangagers that have been used, to keep them alive for later
- ///
- Dictionary