diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
index f2b17526..42a4a353 100644
--- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
+++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs
@@ -214,17 +214,25 @@ namespace PepperDash.Essentials
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
-
+
if (VideoCodec == null)
- throw new ArgumentNullException("codec cannot be 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");
+ }
InitializeRoom();
}
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs
index 4e731f41..63684837 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/CenOdtOccupancySensorBaseJoinMap.cs
@@ -46,6 +46,14 @@ namespace PepperDash.Essentials.Core.Bridges
public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata { Description = "Raw Occupancy Us Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+ [JoinName("IdentityModeOn")]
+ public JoinDataComplete IdentityMode = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata { Description = "Enable Identity Mode", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
+
+ [JoinName("IdentityModeFeedback")]
+ public JoinDataComplete IdentityModeFeedback = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
+ new JoinMetadata { Description = "Identity Mode Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
+
[JoinName("EnableLedFlash")]
public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata { Description = "Enable Led Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsPartitionSensorJoinMap.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsPartitionSensorJoinMap.cs
index 3854a4fb..5a583d69 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsPartitionSensorJoinMap.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Bridges/JoinMaps/GlsPartitionSensorJoinMap.cs
@@ -5,6 +5,9 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
{
public class GlsPartitionSensorJoinMap : JoinMapBaseAdvanced
{
+
+ #region Digital
+
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(
new JoinData
@@ -19,20 +22,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Digital
});
- [JoinName("Name")]
- public JoinDataComplete Name = new JoinDataComplete(
- new JoinData
- {
- JoinNumber = 1,
- JoinSpan = 1
- },
- new JoinMetadata
- {
- Description = "Sensor Name",
- JoinCapabilities = eJoinCapabilities.ToSIMPL,
- JoinType = eJoinType.Serial
- });
-
+
[JoinName("Enable")]
public JoinDataComplete Enable = new JoinDataComplete(
new JoinData
@@ -101,7 +91,11 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
Description = "Sensor Decrease Sensitivity",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
- });
+ });
+
+ #endregion
+
+ #region Analog
[JoinName("Sensitivity")]
public JoinDataComplete Sensitivity = new JoinDataComplete(
@@ -117,6 +111,28 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
JoinType = eJoinType.Analog
});
+ #endregion
+
+
+ #region Serial
+
+ [JoinName("Name")]
+ public JoinDataComplete Name = new JoinDataComplete(
+ new JoinData
+ {
+ JoinNumber = 1,
+ JoinSpan = 1
+ },
+ new JoinMetadata
+ {
+ Description = "Sensor Name",
+ JoinCapabilities = eJoinCapabilities.ToSIMPL,
+ JoinType = eJoinType.Serial
+ });
+
+ #endregion
+
+
///
/// Constructor to use when instantiating this Join Map without inheriting from it
///
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs
new file mode 100644
index 00000000..19ca8438
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Crestron IO/Relay/CenIoRy104Controller.cs
@@ -0,0 +1,77 @@
+using System.Collections.Generic;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.GeneralIO;
+using PepperDash.Core;
+using PepperDash.Essentials.Core.Config;
+
+namespace PepperDash.Essentials.Core
+{
+ ///
+ /// Wrapper class for CEN-IO-RY-104 relay module
+ ///
+ [Description("Wrapper class for the CEN-IO-RY-104 relay module")]
+ public class CenIoRy104Controller : EssentialsDevice, IRelayPorts
+ {
+ private readonly CenIoRy104 _ry104;
+
+ ///
+ /// Constructor
+ ///
+ ///
+ ///
+ ///
+ public CenIoRy104Controller(string key, string name, CenIoRy104 ry104)
+ : base(key, name)
+ {
+ _ry104 = ry104;
+ }
+
+ ///
+ /// Relay port collection
+ ///
+ public CrestronCollection RelayPorts
+ {
+ get { return _ry104.RelayPorts; }
+ }
+
+ ///
+ /// Number of relay ports property
+ ///
+ public int NumberOfRelayPorts
+ {
+ get { return _ry104.NumberOfRelayPorts; }
+ }
+ }
+
+ ///
+ /// CEN-IO-RY Controller factory
+ ///
+ public class CenIoRy104ControllerFactory : EssentialsDeviceFactory
+ {
+ ///
+ /// Constructor
+ ///
+ public CenIoRy104ControllerFactory()
+ {
+ TypeNames = new List() { "ceniory104" };
+ }
+
+ public override EssentialsDevice BuildDevice(DeviceConfig dc)
+ {
+ Debug.Console(1, "Factory Attempting to create a new CEN-IO-RY-104 Device");
+
+ var controlPropertiesConfig = CommFactory.GetControlPropertiesConfig(dc);
+ if (controlPropertiesConfig == null)
+ {
+ Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device");
+ return null;
+ }
+
+ var ipid = controlPropertiesConfig.IpIdInt;
+ if (ipid != 0) return new CenIoRy104Controller(dc.Key, dc.Name, new CenIoRy104(ipid, Global.ControlSystem));
+
+ Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device using IP-ID-{0}", ipid);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/CenOdtOccupancySensorBaseController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/CenOdtOccupancySensorBaseController.cs
index dcf0b193..eae2f993 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/CenOdtOccupancySensorBaseController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/CenOdtOccupancySensorBaseController.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Resources;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
@@ -61,6 +62,8 @@ namespace PepperDash.Essentials.Core
public BoolFeedback RawOccupancyUsFeedback { get; private set; }
+ public BoolFeedback IdentityModeFeedback { get; private set; }
+
// Debug properties
public bool InTestMode { get; private set; }
@@ -117,6 +120,8 @@ namespace PepperDash.Essentials.Core
RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByUltrasonicSensorFeedback.BoolValue);
+ IdentityModeFeedback = new BoolFeedback(()=>OccSensor.IdentityModeOnFeedback.BoolValue);
+
UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback);
@@ -199,6 +204,27 @@ namespace PepperDash.Essentials.Core
{
SetAndWhenVacatedState((bool)PropertiesConfig.AndWhenVacatedState);
}
+
+ // TODO [ ] feature/cenoodtcpoe-sensor-sensitivity-configuration
+ if (PropertiesConfig.UsSensitivityOccupied != null)
+ {
+ SetUsSensitivityOccupied((ushort)PropertiesConfig.UsSensitivityOccupied);
+ }
+
+ if (PropertiesConfig.UsSensitivityVacant != null)
+ {
+ SetUsSensitivityVacant((ushort)PropertiesConfig.UsSensitivityVacant);
+ }
+
+ if (PropertiesConfig.PirSensitivityOccupied != null)
+ {
+ SetPirSensitivityOccupied((ushort)PropertiesConfig.PirSensitivityOccupied);
+ }
+
+ if (PropertiesConfig.PirSensitivityVacant != null)
+ {
+ SetPirSensitivityVacant((ushort)PropertiesConfig.PirSensitivityVacant);
+ }
}
///
@@ -279,7 +305,21 @@ namespace PepperDash.Essentials.Core
}
}
- ///
+ ///
+ /// Sets the identity mode on or off
+ ///
+ ///
+ public void SetIdentityMode(bool state)
+ {
+ if (state)
+ OccSensor.IdentityModeOn();
+ else
+ OccSensor.IdentityModeOff();
+
+ Debug.Console(1, this, "Identity Mode: {0}", OccSensor.IdentityModeOnFeedback.BoolValue ? "On" : "Off");
+ }
+
+ ///
/// Enables or disables the PIR sensor
///
///
@@ -506,6 +546,54 @@ namespace PepperDash.Essentials.Core
}
}
+ ///
+ /// Sets the US sensor sensitivity for occupied state
+ ///
+ ///
+ public void SetUsSensitivityOccupied(ushort sensitivity)
+ {
+ var level = (eSensitivityLevel) sensitivity;
+ if (level == 0) return;
+
+ OccSensor.UltrasonicSensorSensitivityInOccupiedState = level;
+ }
+
+ ///
+ /// Sets the US sensor sensitivity for vacant state
+ ///
+ ///
+ public void SetUsSensitivityVacant(ushort sensitivity)
+ {
+ var level = (eSensitivityLevel)sensitivity;
+ if (level == 0) return;
+
+ OccSensor.UltrasonicSensorSensitivityInVacantState = level;
+ }
+
+ ///
+ /// Sets the PIR sensor sensitivity for occupied state
+ ///
+ ///
+ public void SetPirSensitivityOccupied(ushort sensitivity)
+ {
+ var level = (eSensitivityLevel)sensitivity;
+ if (level == 0) return;
+
+ OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = level;
+ }
+
+ ///
+ /// Sets the PIR sensor sensitivity for vacant state
+ ///
+ ///
+ public void SetPirSensitivityVacant(ushort sensitivity)
+ {
+ var level = (eSensitivityLevel)sensitivity;
+ if (level == 0) return;
+
+ OccSensor.PassiveInfraredSensorSensitivityInVacantState = level;
+ }
+
///
/// Method to print current settings to console
///
@@ -647,8 +735,11 @@ namespace PepperDash.Essentials.Core
//Sensor Raw States
occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
- occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
-
+ occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
+
+ // Identity mode
+ trilist.SetBoolSigAction(joinMap.IdentityMode.JoinNumber, occController.SetIdentityMode);
+ occController.IdentityModeFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IdentityModeFeedback.JoinNumber]);
}
public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorPropertiesConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorPropertiesConfig.cs
index 1f21b2a8..392c05b0 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorPropertiesConfig.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/Occupancy/GlsOccupancySensorPropertiesConfig.cs
@@ -47,5 +47,35 @@ namespace PepperDash.Essentials.Core
[JsonProperty("andWhenVacatedState")]
public bool? AndWhenVacatedState { get; set; }
+
+ // PoE Sensors: CenOdtCPoe
+
+ ///
+ /// Sets the sensitivity level for US while sensor is in occupied state
+ /// 1 = low; 2 = medium; 3 = high; 4 = xlow; 5 = 2xlow; 6 = 3xlow
+ ///
+ [JsonProperty("usSensitivityOccupied")]
+ public ushort? UsSensitivityOccupied { get; set; }
+
+ ///
+ /// Sets the sensitivity level for US while sensor is in vacant state
+ /// 1 = low; 2 = medium; 3 = high; 4 = xlow; 5 = 2xlow; 6 = 3xlow
+ ///
+ [JsonProperty("usSensitivityVacant")]
+ public ushort? UsSensitivityVacant { get; set; }
+
+ ///
+ /// Sets the sensitivity level for PIR while sensor is in occupied state
+ /// 1 = low; 2 = medium; 3 = high
+ ///
+ [JsonProperty("pirSensitivityOccupied")]
+ public ushort? PirSensitivityOccupied { get; set; }
+
+ ///
+ /// Sets the sensitivity level for PIR while sensor is in vacant state
+ /// 1 = low; 2 = medium; 3 = high
+ ///
+ [JsonProperty("pirSensitivityVacant")]
+ public ushort? PirSensitivityVacant { get; set; }
}
}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorController.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorController.cs
index 5f40bf7e..16b2f265 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorController.cs
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorController.cs
@@ -1,4 +1,5 @@
-using Crestron.SimplSharpPro;
+using Crestron.SimplSharp;
+using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
@@ -9,15 +10,18 @@ using PepperDash.Essentials.Core.Bridges.JoinMaps;
using System;
using System.Collections.Generic;
using PepperDash.Essentials.Core.Config;
+using PepperDash_Essentials_Core.PartitionSensor;
namespace PepperDash.Essentials.Core
{
[Description("Wrapper class for GLS Cresnet Partition Sensor")]
public class GlsPartitionSensorController : CrestronGenericBridgeableBaseDevice, IPartitionStateProvider
{
- private GlsPartCn _partitionSensor;
- public StringFeedback NameFeedback { get; private set; }
+ public GlsPartitionSensorPropertiesConfig PropertiesConfig { get; private set; }
+
+ private GlsPartCn _partitionSensor;
+
public BoolFeedback EnableFeedback { get; private set; }
public BoolFeedback PartitionPresentFeedback { get; private set; }
public BoolFeedback PartitionNotSensedFeedback { get; private set; }
@@ -32,23 +36,71 @@ namespace PepperDash.Essentials.Core
public GlsPartitionSensorController(string key, Func preActivationFunc, DeviceConfig config)
: base(key, config.Name)
{
+
+ var props = config.Properties.ToObject();
+ if (props != null)
+ {
+ PropertiesConfig = props;
+ }
+ else
+ {
+ Debug.Console(1, this, "props are null. Unable to deserialize into GlsPartSensorPropertiesConfig");
+ }
+
AddPreActivationAction(() =>
{
_partitionSensor = preActivationFunc(config);
-
+
RegisterCrestronGenericBase(_partitionSensor);
-
- NameFeedback = new StringFeedback(() => Name);
+
EnableFeedback = new BoolFeedback(() => InTestMode ? TestEnableFeedback : _partitionSensor.EnableFeedback.BoolValue);
PartitionPresentFeedback = new BoolFeedback(() => InTestMode ? TestPartitionSensedFeedback : _partitionSensor.PartitionSensedFeedback.BoolValue);
PartitionNotSensedFeedback = new BoolFeedback(() => InTestMode ? !TestPartitionSensedFeedback : _partitionSensor.PartitionNotSensedFeedback.BoolValue);
SensitivityFeedback = new IntFeedback(() => InTestMode ? TestSensitivityFeedback : _partitionSensor.SensitivityFeedback.UShortValue);
- if (_partitionSensor != null) _partitionSensor.BaseEvent += PartitionSensor_BaseEvent;
+ if (_partitionSensor != null)
+ {
+ _partitionSensor.BaseEvent += PartitionSensor_BaseEvent;
+ }
});
- }
- private void PartitionSensor_BaseEvent(GenericBase device, BaseEventArgs args)
+ AddPostActivationAction(() =>
+ {
+ _partitionSensor.OnlineStatusChange += (o, a) =>
+ {
+ if (a.DeviceOnLine)
+ {
+ ApplySettingsToSensorFromConfig();
+ }
+ };
+
+ if (_partitionSensor.IsOnline)
+ {
+ ApplySettingsToSensorFromConfig();
+ }
+ });
+ }
+
+ private void ApplySettingsToSensorFromConfig()
+ {
+ if (_partitionSensor.IsOnline == false) return;
+
+ Debug.Console(1, this, "Attempting to apply settings to sensor from config");
+
+ if (PropertiesConfig.Sensitivity != null)
+ {
+ Debug.Console(1, this, "Sensitivity found, attempting to set value '{0}' from config",
+ PropertiesConfig.Sensitivity);
+ _partitionSensor.Sensitivity.UShortValue = (ushort) PropertiesConfig.Sensitivity;
+ }
+ else
+ {
+ Debug.Console(1, this, "Sensitivity null, no value specified in config");
+ }
+
+ }
+
+ private void PartitionSensor_BaseEvent(GenericBase device, BaseEventArgs args)
{
Debug.Console(2, this, "EventId: {0}, Index: {1}", args.EventId, args.Index);
@@ -61,11 +113,13 @@ namespace PepperDash.Essentials.Core
}
case (GlsPartCn.PartitionSensedFeedbackEventId):
{
+ Debug.Console(1, this, "Partition Sensed State: {0}", _partitionSensor.PartitionSensedFeedback.BoolValue);
PartitionPresentFeedback.FireUpdate();
break;
}
case (GlsPartCn.PartitionNotSensedFeedbackEventId):
{
+ Debug.Console(1, this, "Partition Not Sensed State: {0}", _partitionSensor.PartitionNotSensedFeedback.BoolValue);
PartitionNotSensedFeedback.FireUpdate();
break;
}
@@ -73,7 +127,7 @@ namespace PepperDash.Essentials.Core
{
SensitivityFeedback.FireUpdate();
break;
- }
+ }
default:
{
Debug.Console(2, this, "Unhandled args.EventId: {0}", args.EventId);
@@ -133,7 +187,22 @@ namespace PepperDash.Essentials.Core
Debug.Console(1, this, "InTestMode: {0}, unable to set sensitivity value: {1}", InTestMode.ToString(), value);
}
- public void SetEnableState(bool state)
+ public void GetSettings()
+ {
+ var dash = new string('*', 50);
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+
+ Debug.Console(0, this, "Enabled State: {0}", _partitionSensor.EnableFeedback.BoolValue);
+
+ Debug.Console(0, this, "Partition Sensed State: {0}", _partitionSensor.PartitionSensedFeedback.BoolValue);
+ Debug.Console(0, this, "Partition Not Sensed State: {0}", _partitionSensor.PartitionNotSensedFeedback.BoolValue);
+
+ Debug.Console(0, this, "Sensitivity Value: {0}", _partitionSensor.SensitivityFeedback.UShortValue);
+
+ CrestronConsole.PrintLine(string.Format("{0}\n", dash));
+ }
+
+ public void SetEnableState(bool state)
{
Debug.Console(2, this, "Sensor is {0}, SetEnableState: {1}", _partitionSensor == null ? "null" : "not null", state);
if (_partitionSensor == null)
@@ -189,18 +258,20 @@ namespace PepperDash.Essentials.Core
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, this, "Linking to Bridge Type {0}", GetType().Name);
- // link input from simpl
+ IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = _partitionSensor.Name;
+
trilist.SetBoolSigAction(joinMap.Enable.JoinNumber, SetEnableState);
+ EnableFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Enable.JoinNumber]);
+
+ PartitionPresentFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionSensed.JoinNumber]);
+ PartitionNotSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionNotSensed.JoinNumber]);
+
trilist.SetSigTrueAction(joinMap.IncreaseSensitivity.JoinNumber, IncreaseSensitivity);
trilist.SetSigTrueAction(joinMap.DecreaseSensitivity.JoinNumber, DecreaseSensitivity);
- trilist.SetUShortSigAction(joinMap.Sensitivity.JoinNumber, SetSensitivity);
- // link output to simpl
- IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
- EnableFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Enable.JoinNumber]);
- PartitionPresentFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionSensed.JoinNumber]);
- PartitionNotSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionNotSensed.JoinNumber]);
- SensitivityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Sensitivity.JoinNumber]);
+ SensitivityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Sensitivity.JoinNumber]);
+ trilist.SetUShortSigAction(joinMap.Sensitivity.JoinNumber, SetSensitivity);
FeedbacksFireUpdates();
@@ -218,6 +289,7 @@ namespace PepperDash.Essentials.Core
{
if (a.DeviceOnLine)
{
+ trilist.StringInput[joinMap.Name.JoinNumber].StringValue = _partitionSensor.Name;
FeedbacksFireUpdates();
}
};
@@ -225,8 +297,7 @@ namespace PepperDash.Essentials.Core
private void FeedbacksFireUpdates()
{
- IsOnline.FireUpdate();
- NameFeedback.FireUpdate();
+ IsOnline.FireUpdate();
EnableFeedback.FireUpdate();
PartitionPresentFeedback.FireUpdate();
PartitionNotSensedFeedback.FireUpdate();
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorPropertiesConfig.cs b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorPropertiesConfig.cs
new file mode 100644
index 00000000..8a303662
--- /dev/null
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PartitionSensor/GlsPartitionSensorPropertiesConfig.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Crestron.SimplSharp;
+using Newtonsoft.Json;
+
+namespace PepperDash_Essentials_Core.PartitionSensor
+{
+ public class GlsPartitionSensorPropertiesConfig
+ {
+ ///
+ /// Sets the sensor sensitivity
+ ///
+ ///
+ /// The sensitivity range shall be between 1(lowest) to 10 (highest).
+ ///
+ [JsonProperty("sensitivity")]
+ public ushort? Sensitivity { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
index abd7c498..3c7a6c31 100644
--- a/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
+++ b/essentials-framework/Essentials Core/PepperDashEssentialsBase/PepperDash_Essentials_Core.csproj
@@ -182,6 +182,7 @@
+
@@ -236,6 +237,7 @@
+
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
index 96cc8097..412dee6b 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmBladeChassisController.cs
@@ -483,7 +483,7 @@ namespace PepperDash.Essentials.DM
Debug.Console(2, this, "Adding output port '{0}'", portKey);
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
{
- FeedbackMatchObject = Chassis.Outputs[(uint)selector]
+ FeedbackMatchObject = selector
});
}*/
diff --git a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
index c74aea2b..030536df 100644
--- a/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
+++ b/essentials-framework/Essentials DM/Essentials_DM/Chassis/DmChassisController.cs
@@ -1285,7 +1285,10 @@ namespace PepperDash.Essentials.DM
var output = outputSelector as DMOutput;
- if (output == null)
+ var isUsbInput = (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput;
+ var isUsbOutput = (sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput;
+
+ if (output == null && !(isUsbOutput || isUsbInput))
{
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
"Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
@@ -1316,7 +1319,10 @@ namespace PepperDash.Essentials.DM
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
{
Chassis.VideoEnter.BoolValue = true;
- output.VideoOut = input; //Chassis.Outputs[output].VideoOut = inCard;
+ if (output != null)
+ {
+ output.VideoOut = input; //Chassis.Outputs[output].VideoOut = inCard;
+ }
}
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
@@ -1326,17 +1332,66 @@ namespace PepperDash.Essentials.DM
{
dmMdMnxn.AudioEnter.BoolValue = true;
}
- output.AudioOut = input;
- //Chassis.Outputs[output].AudioOut = inCard;
+ if (output != null)
+ {
+ output.AudioOut = input;
+ }
}
- if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput || (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
+ if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
+
{
- Chassis.USBEnter.BoolValue = true;
- output.USBRoutedTo = input;
+ Chassis.USBEnter.BoolValue = true;
+ if (inputSelector == null && output != null)
+ {
+ //clearing the route is intended
+ output.USBRoutedTo = null;
+ return;
+ }
+
+ if (inputSelector != null && input == null)
+ {
+ //input selector is DMOutput...we're doing a out to out route
+ var tempInput = inputSelector as DMOutput;
+
+ if (tempInput == null || output == null)
+ {
+ return;
+ }
+ output.USBRoutedTo = tempInput;
+ return;
+ }
+
+ if (input != null & output != null)
+ {
+ output.USBRoutedTo = input;
+ }
}
+ if((sigType & eRoutingSignalType.UsbInput) != eRoutingSignalType.UsbInput)
+ {
+ return;
+ }
+
+ Chassis.USBEnter.BoolValue = true;
+ if (output != null)
+ {
+ output.USBRoutedTo = input;
+ return;
+ }
+ var tempOutput = outputSelector as DMInput;
+
+ if (tempOutput == null)
+ {
+ Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
+ "Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
+ outputSelector);
+ return;
+ }
+
+ tempOutput.USBRoutedTo = input;
}
+
#endregion
#region IRoutingNumeric Members
@@ -1349,8 +1404,10 @@ namespace PepperDash.Essentials.DM
DMInputOutputBase dmCard;
+ //Routing Input to Input or Output to Input
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
{
+ Debug.Console(2, this, "Executing USB Input switch.\r\n in:{0} output: {1}", inputSelector, outputSelector);
if (outputSelector > chassisSize)
{
uint outputIndex;
@@ -1370,13 +1427,14 @@ namespace PepperDash.Essentials.DM
dmCard = Chassis.Inputs[inputSelector];
}
- ExecuteSwitch(dmCard, Chassis.Outputs[outputSelector], sigType);
+ ExecuteSwitch(dmCard, Chassis.Inputs[outputSelector], sigType);
return;
}
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
{
Debug.Console(2, this, "Executing USB Output switch.\r\n in:{0} output: {1}", inputSelector, outputSelector);
+ //routing Output to Output or Input to Output
if (inputSelector > chassisSize)
{
//wanting to route an output to an output. Subtract chassis size and get output, unless it's 8x8