mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-24 01:45:07 +00:00
Compare commits
116 Commits
1.11.0
...
1.12.9-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cc6cfafe9 | ||
|
|
5de4382cd0 | ||
|
|
86f904c8f9 | ||
|
|
6b60f4ddb1 | ||
|
|
d03581fea8 | ||
|
|
decc8ed3a5 | ||
|
|
b0637288e9 | ||
|
|
ea8c3995bd | ||
|
|
f6e08eb077 | ||
|
|
c2d49c65f0 | ||
|
|
99bc3f4f3e | ||
|
|
e8f773b2e6 | ||
|
|
e342bede11 | ||
|
|
81c779e595 | ||
|
|
d980209bd8 | ||
|
|
c2a439d20d | ||
|
|
52d945fca3 | ||
|
|
0ef8fcfd27 | ||
|
|
042416b470 | ||
|
|
84f2222c38 | ||
|
|
966377ee2e | ||
|
|
3d27b0928f | ||
|
|
860182dbfc | ||
|
|
f325ff7af0 | ||
|
|
58a5600ac6 | ||
|
|
efb6d3ef83 | ||
|
|
04477d62cc | ||
|
|
668cbc430c | ||
|
|
e54de1f1cb | ||
|
|
f48b1a2de3 | ||
|
|
8e57e7ec31 | ||
|
|
1b43b44d19 | ||
|
|
4306128474 | ||
|
|
5263b16bb7 | ||
|
|
a2b67798f3 | ||
|
|
1b43fba37e | ||
|
|
f262c1a3bb | ||
|
|
93ee695c57 | ||
|
|
ba0bae3c4e | ||
|
|
37a98d00af | ||
|
|
247827ac25 | ||
|
|
5e797db096 | ||
|
|
57eeeec0fb | ||
|
|
db19da124c | ||
|
|
c07f52b06f | ||
|
|
92e48a62a8 | ||
|
|
f3653039ca | ||
|
|
3b79c2c8c3 | ||
|
|
c9efa3cfaa | ||
|
|
bd8a3de172 | ||
|
|
7bc7e7ff4f | ||
|
|
afe0568177 | ||
|
|
07c8c50c19 | ||
|
|
c34b4fc3a0 | ||
|
|
b711548c3b | ||
|
|
906433ff8d | ||
|
|
b6675477be | ||
|
|
0b307ee40a | ||
|
|
f5d89e2067 | ||
|
|
c9a175031d | ||
|
|
4fd01610c1 | ||
|
|
c19becc170 | ||
|
|
fc3840173e | ||
|
|
ce51a62d97 | ||
|
|
2be42f88bc | ||
|
|
60afe203dd | ||
|
|
6f9a9ee255 | ||
|
|
a09212417c | ||
|
|
4d6da37c60 | ||
|
|
95627df1a6 | ||
|
|
bef07fe41b | ||
|
|
99e1ec3b3b | ||
|
|
e44e7c976f | ||
|
|
fea3189a18 | ||
|
|
578754de85 | ||
|
|
4903232c10 | ||
|
|
83d2497264 | ||
|
|
50f5145a89 | ||
|
|
969abcc8b6 | ||
|
|
c136943c3a | ||
|
|
a734a869c1 | ||
|
|
c6495577e7 | ||
|
|
5359604098 | ||
|
|
70d2633eb0 | ||
|
|
58aa9dae08 | ||
|
|
6715a680cc | ||
|
|
f3fc0f2b26 | ||
|
|
330bb2d002 | ||
|
|
c0436b1230 | ||
|
|
26b968463b | ||
|
|
d33b89f232 | ||
|
|
10d77ac006 | ||
|
|
c19ab76a4c | ||
|
|
040c57b5e1 | ||
|
|
d6864bf214 | ||
|
|
62275890cb | ||
|
|
2a6b845fde | ||
|
|
4fb2d6d755 | ||
|
|
5994704fbd | ||
|
|
ca1cbb6e05 | ||
|
|
f82b7f8f12 | ||
|
|
dbd77f5f9f | ||
|
|
55031d16af | ||
|
|
4938071f70 | ||
|
|
3670bde7cf | ||
|
|
4deb9a0828 | ||
|
|
a524b1607d | ||
|
|
155f511ce2 | ||
|
|
21b09c593a | ||
|
|
cdeca09855 | ||
|
|
93435b60b5 | ||
|
|
b67eb6325b | ||
|
|
38cb86218c | ||
|
|
47c24a237e | ||
|
|
c0c67f6c15 | ||
|
|
eb3922aa43 |
@@ -55,7 +55,7 @@ namespace PepperDash.Essentials
|
||||
return null;
|
||||
}
|
||||
|
||||
// DSP format: deviceKey--levelName, biampTesira-1--master
|
||||
// DSP/DMPS format: deviceKey--levelName, biampTesira-1--master
|
||||
match = Regex.Match(DeviceKey, @"([-_\w]+)--(.+)");
|
||||
if (match.Success)
|
||||
{
|
||||
@@ -67,6 +67,27 @@ namespace PepperDash.Essentials
|
||||
if (dsp.LevelControlPoints.ContainsKey(levelTag)) // should always...
|
||||
return dsp.LevelControlPoints[levelTag];
|
||||
}
|
||||
|
||||
var dmps = DeviceManager.GetDeviceForKey(devKey) as DmpsAudioOutputController;
|
||||
if (dmps != null)
|
||||
{
|
||||
var levelTag = match.Groups[2].Value;
|
||||
switch (levelTag)
|
||||
{
|
||||
case "master":
|
||||
return dmps.MasterVolumeLevel;
|
||||
case "source":
|
||||
return dmps.SourceVolumeLevel;
|
||||
case "micsmaster":
|
||||
return dmps.MicsMasterVolumeLevel;
|
||||
case "codec1":
|
||||
return dmps.Codec1VolumeLevel;
|
||||
case "codec2":
|
||||
return dmps.Codec2VolumeLevel;
|
||||
default:
|
||||
return dmps.MasterVolumeLevel;
|
||||
}
|
||||
}
|
||||
// No volume for some reason. We have failed as developers
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -46,28 +46,29 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public override void InitializeSystem()
|
||||
{
|
||||
_startTimer = new CTimer(StartSystem,StartupTime);
|
||||
|
||||
|
||||
// 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.
|
||||
if (Global.ControlSystemIsDmpsType)
|
||||
bool preventInitializationComplete = Global.ControlSystemIsDmpsType;
|
||||
if (preventInitializationComplete)
|
||||
{
|
||||
Debug.Console(1, "******************* InitializeSystem() Entering **********************");
|
||||
|
||||
_initializeEvent = new CEvent();
|
||||
|
||||
_startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
|
||||
_initializeEvent = new CEvent(true, false);
|
||||
DeviceManager.AllDevicesRegistered += (o, a) =>
|
||||
{
|
||||
_initializeEvent.Set();
|
||||
Debug.Console(1, "******************* InitializeSystem() Exiting **********************");
|
||||
};
|
||||
|
||||
_initializeEvent.Wait(30000);
|
||||
Debug.Console(1, "******************* InitializeSystem() Exiting **********************");
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
_startTimer = new CTimer(StartSystem, preventInitializationComplete, StartupTime);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartSystem(object obj)
|
||||
private void StartSystem(object preventInitialization)
|
||||
{
|
||||
DeterminePlatform();
|
||||
|
||||
@@ -83,10 +84,10 @@ namespace PepperDash.Essentials
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "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(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 =>
|
||||
{
|
||||
@@ -103,12 +104,16 @@ namespace PepperDash.Essentials
|
||||
(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:\r\n" +
|
||||
"System URL: {0}\r\n" +
|
||||
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
|
||||
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
|
||||
CrestronConsole.AddNewConsoleCommand(s =>
|
||||
CrestronConsole.ConsoleCommandResponse(
|
||||
"This system can be found at the following URLs:\r\n" +
|
||||
"System URL: {0}\r\n" +
|
||||
"Template URL: {1}",
|
||||
ConfigReader.ConfigObject.SystemUrl,
|
||||
ConfigReader.ConfigObject.TemplateUrl),
|
||||
"portalinfo",
|
||||
"Shows portal URLS from configuration",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand(DeviceManager.GetRoutingPorts,
|
||||
@@ -120,7 +125,10 @@ namespace PepperDash.Essentials
|
||||
return;
|
||||
}
|
||||
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
if (!(bool)preventInitialization)
|
||||
{
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -195,6 +203,8 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
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/
|
||||
@@ -296,6 +306,10 @@ namespace PepperDash.Essentials
|
||||
if (!Directory.Exists(pluginDir))
|
||||
Directory.Create(pluginDir);
|
||||
|
||||
var joinmapDir = Global.FilePathPrefix + "joinmaps";
|
||||
if(!Directory.Exists(joinmapDir))
|
||||
Directory.Create(joinmapDir);
|
||||
|
||||
return configExists;
|
||||
}
|
||||
|
||||
|
||||
@@ -745,6 +745,28 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
//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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does what it says
|
||||
|
||||
@@ -97,10 +97,10 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
TriList.SetSigFalseAction(ButtonPressJoinBase + 1, ShadeDevice.Open);
|
||||
|
||||
TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).StopOrPreset);
|
||||
|
||||
if(ShadeDevice is RelayControlledShade)
|
||||
TriList.SetString(StringJoinBase + 2, (ShadeDevice as RelayControlledShade).StopOrPresetButtonLabel);
|
||||
TriList.SetSigFalseAction(ButtonPressJoinBase + 2, (ShadeDevice as IShadesOpenCloseStop).Stop);
|
||||
|
||||
if (ShadeDevice is IShadesOpenCloseStop)
|
||||
TriList.SetString(StringJoinBase + 2, "Stop");
|
||||
|
||||
TriList.SetSigFalseAction(ButtonPressJoinBase + 3, ShadeDevice.Close);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,33 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
bridge.PrintJoinMaps();
|
||||
}
|
||||
}
|
||||
public static void JoinmapMarkdown(string command)
|
||||
{
|
||||
var targets = command.Split(' ');
|
||||
|
||||
var bridgeKey = targets[0].Trim();
|
||||
|
||||
var bridge = DeviceManager.GetDeviceForKey(bridgeKey) as EiscApiAdvanced;
|
||||
|
||||
if (bridge == null)
|
||||
{
|
||||
Debug.Console(0, "Unable to find advanced bridge with key: '{0}'", bridgeKey);
|
||||
return;
|
||||
}
|
||||
|
||||
if (targets.Length > 1)
|
||||
{
|
||||
var deviceKey = targets[1].Trim();
|
||||
|
||||
if (string.IsNullOrEmpty(deviceKey)) return;
|
||||
bridge.MarkdownJoinMapForDevice(deviceKey, bridgeKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
bridge.MarkdownForBridge(bridgeKey);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -227,6 +254,19 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
joinMap.Value.PrintJoinMapInfo();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Generates markdown for all join maps on this bridge
|
||||
/// </summary>
|
||||
public virtual void MarkdownForBridge(string bridgeKey)
|
||||
{
|
||||
Debug.Console(0, this, "Writing Joinmaps to files for EISC IPID: {0}", Eisc.ID.ToString("X"));
|
||||
|
||||
foreach (var joinMap in JoinMaps)
|
||||
{
|
||||
Debug.Console(0, "Generating markdown for device '{0}':", joinMap.Key);
|
||||
joinMap.Value.MarkdownJoinMapInfo(joinMap.Key, bridgeKey);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prints the join map for a device by key
|
||||
@@ -242,9 +282,26 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
|
||||
Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
|
||||
joinMap.PrintJoinMapInfo();
|
||||
}
|
||||
/// <summary>
|
||||
/// Prints the join map for a device by key
|
||||
/// </summary>
|
||||
/// <param name="deviceKey"></param>
|
||||
public void MarkdownJoinMapForDevice(string deviceKey, string bridgeKey)
|
||||
{
|
||||
var joinMap = JoinMaps[deviceKey];
|
||||
|
||||
if (joinMap == null)
|
||||
{
|
||||
Debug.Console(0, this, "Unable to find joinMap for device with key: '{0}'", deviceKey);
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Console(0, "Join map for device '{0}' on EISC '{1}':", deviceKey, Key);
|
||||
joinMap.MarkdownJoinMapInfo(deviceKey, bridgeKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used for debugging to trigger an action based on a join number and type
|
||||
@@ -394,35 +451,51 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
var controlProperties = CommFactory.GetControlPropertiesConfig(dc);
|
||||
|
||||
BasicTriList eisc;
|
||||
|
||||
switch (dc.Type.ToLower())
|
||||
{
|
||||
case "eiscapiadv":
|
||||
case "eiscapiadvanced":
|
||||
{
|
||||
var eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
|
||||
eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
|
||||
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
return new EiscApiAdvanced(dc, eisc);
|
||||
break;
|
||||
}
|
||||
case "eiscapiadvancedserver":
|
||||
{
|
||||
var eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
|
||||
return new EiscApiAdvanced(dc, eisc);
|
||||
eisc = new EISCServer(controlProperties.IpIdInt, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "eiscapiadvancedclient":
|
||||
{
|
||||
var eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
return new EiscApiAdvanced(dc, eisc);
|
||||
eisc = new EISCClient(controlProperties.IpIdInt, controlProperties.TcpSshProperties.Address, Global.ControlSystem);
|
||||
break;
|
||||
}
|
||||
case "vceiscapiadv":
|
||||
case "vceiscapiadvanced":
|
||||
{
|
||||
var eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, InitialParametersClass.RoomId,
|
||||
if (string.IsNullOrEmpty(controlProperties.RoomId))
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to build VC-4 EISC Client for device {0}. Room ID is missing or empty", dc.Key);
|
||||
eisc = null;
|
||||
break;
|
||||
}
|
||||
eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, controlProperties.RoomId,
|
||||
Global.ControlSystem);
|
||||
return new EiscApiAdvanced(dc, eisc);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return null;
|
||||
eisc = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if (eisc == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new EiscApiAdvanced(dc, eisc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public class IDigitalInputJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public class IDigitalInputJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
|
||||
[JoinName("InputState")]
|
||||
public JoinDataComplete InputState = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Room Email Url", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
@@ -26,6 +26,6 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
protected IDigitalInputJoinMap(uint joinStart, Type type)
|
||||
: base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public class IDigitalOutputJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
|
||||
[JoinName("OutputState")]
|
||||
public JoinDataComplete OutputState = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Get / Set state of Digital Input", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
public IDigitalOutputJoinMap(uint joinStart)
|
||||
: this(joinStart, typeof(IDigitalOutputJoinMap))
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when extending this Join map
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
/// <param name="type">Type of the child join map</param>
|
||||
protected IDigitalOutputJoinMap(uint joinStart, Type type)
|
||||
: base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
public class DinIo8Controller:CrestronGenericBaseDevice, IIOPorts
|
||||
{
|
||||
private DinIo8 _device;
|
||||
|
||||
public DinIo8Controller(string key, Func<DeviceConfig, DinIo8> preActivationFunc, DeviceConfig config):base(key, config.Name)
|
||||
{
|
||||
AddPreActivationAction(() =>
|
||||
{
|
||||
_device = preActivationFunc(config);
|
||||
|
||||
RegisterCrestronGenericBase(_device);
|
||||
});
|
||||
}
|
||||
|
||||
#region Implementation of IIOPorts
|
||||
|
||||
public CrestronCollection<Versiport> VersiPorts
|
||||
{
|
||||
get { return _device.VersiPorts; }
|
||||
}
|
||||
|
||||
public int NumberOfVersiPorts
|
||||
{
|
||||
get { return _device.NumberOfVersiPorts; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class DinIo8ControllerFactory : EssentialsDeviceFactory<DinIo8Controller>
|
||||
{
|
||||
public DinIo8ControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "DinIo8" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new DinIo8 Device");
|
||||
|
||||
return new DinIo8Controller(dc.Key, GetDinIo8Device, dc);
|
||||
}
|
||||
|
||||
static DinIo8 GetDinIo8Device(DeviceConfig dc)
|
||||
{
|
||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
||||
var cresnetId = control.CresnetIdInt;
|
||||
var branchId = control.ControlPortNumber;
|
||||
var parentKey = string.IsNullOrEmpty(control.ControlPortDevKey) ? "processor" : control.ControlPortDevKey;
|
||||
|
||||
if (parentKey.Equals("processor", StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
Debug.Console(0, "Device {0} is a valid cresnet master - creating new DinIo8", parentKey);
|
||||
return new DinIo8(cresnetId, Global.ControlSystem);
|
||||
}
|
||||
var cresnetBridge = DeviceManager.GetDeviceForKey(parentKey) as IHasCresnetBranches;
|
||||
|
||||
if (cresnetBridge != null)
|
||||
{
|
||||
Debug.Console(0, "Device {0} is a valid cresnet master - creating new DinIo8", parentKey);
|
||||
return new DinIo8(cresnetId, cresnetBridge.CresnetBranches[branchId]);
|
||||
}
|
||||
Debug.Console(0, "Device {0} is not a valid cresnet master", parentKey);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a generic digital input deviced tied to a versiport
|
||||
/// </summary>
|
||||
public class GenericVersiportDigitalOutputDevice : EssentialsBridgeableDevice, IDigitalOutput
|
||||
{
|
||||
public Versiport OutputPort { get; private set; }
|
||||
|
||||
public BoolFeedback OutputStateFeedback { get; private set; }
|
||||
|
||||
Func<bool> OutputStateFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () => OutputPort.DigitalOut;
|
||||
}
|
||||
}
|
||||
|
||||
public GenericVersiportDigitalOutputDevice(string key, string name, Func<IOPortConfig, Versiport> postActivationFunc, IOPortConfig config) :
|
||||
base(key, name)
|
||||
{
|
||||
OutputStateFeedback = new BoolFeedback(OutputStateFeedbackFunc);
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
OutputPort = postActivationFunc(config);
|
||||
|
||||
OutputPort.Register();
|
||||
if (!OutputPort.SupportsDigitalOutput)
|
||||
{
|
||||
Debug.Console(0, this, "Device does not support configuration as a Digital Output");
|
||||
return;
|
||||
}
|
||||
|
||||
OutputPort.VersiportChange += OutputPort_VersiportChange;
|
||||
|
||||
|
||||
|
||||
Debug.Console(1, this, "Created GenericVersiportDigitalOutputDevice on port '{0}'.", config.PortNumber);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void OutputPort_VersiportChange(Versiport port, VersiportEventArgs args)
|
||||
{
|
||||
Debug.Console(1, this, "Versiport change: {0}", args.Event);
|
||||
|
||||
if(args.Event == eVersiportEvent.DigitalOutChange)
|
||||
OutputStateFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set value of the versiport digital output
|
||||
/// </summary>
|
||||
/// <param name="state">value to set the output to</param>
|
||||
public void SetOutput(bool state)
|
||||
{
|
||||
OutputPort.DigitalOut = state;
|
||||
}
|
||||
|
||||
#region Bridge Linking
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = new IDigitalOutputJoinMap(joinStart);
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<IDigitalOutputJoinMap>(joinMapSerialized);
|
||||
|
||||
if (bridge != null)
|
||||
{
|
||||
bridge.AddJoinMap(Key, joinMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
// Link feedback for input state
|
||||
OutputStateFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OutputState.JoinNumber]);
|
||||
trilist.SetBoolSigAction(joinMap.OutputState.JoinNumber, SetOutput);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to link device '{0}'. Input is null", Key);
|
||||
Debug.Console(1, this, "Error: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public static Versiport GetVersiportDigitalOutput(IOPortConfig dc)
|
||||
{
|
||||
|
||||
IIOPorts ioPortDevice;
|
||||
|
||||
if (dc.PortDeviceKey.Equals("processor"))
|
||||
{
|
||||
if (!Global.ControlSystem.SupportsVersiport)
|
||||
{
|
||||
Debug.Console(0, "GetVersiportDigitalOuptut: Processor does not support Versiports");
|
||||
return null;
|
||||
}
|
||||
ioPortDevice = Global.ControlSystem;
|
||||
}
|
||||
else
|
||||
{
|
||||
var ioPortDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IIOPorts;
|
||||
if (ioPortDev == null)
|
||||
{
|
||||
Debug.Console(0, "GetVersiportDigitalOuptut: Device {0} is not a valid device", dc.PortDeviceKey);
|
||||
return null;
|
||||
}
|
||||
ioPortDevice = ioPortDev;
|
||||
}
|
||||
if (ioPortDevice == null)
|
||||
{
|
||||
Debug.Console(0, "GetVersiportDigitalOuptut: Device '0' is not a valid IIOPorts Device", dc.PortDeviceKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (dc.PortNumber > ioPortDevice.NumberOfVersiPorts)
|
||||
{
|
||||
Debug.Console(0, "GetVersiportDigitalOuptut: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||
}
|
||||
|
||||
return ioPortDevice.VersiPorts[dc.PortNumber];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class GenericVersiportDigitalOutputDeviceFactory : EssentialsDeviceFactory<GenericVersiportDigitalInputDevice>
|
||||
{
|
||||
public GenericVersiportDigitalOutputDeviceFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "versiportoutput" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new Generic Versiport Device");
|
||||
|
||||
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
||||
|
||||
if (props == null) return null;
|
||||
|
||||
var portDevice = new GenericVersiportDigitalOutputDevice(dc.Key, dc.Name, GenericVersiportDigitalOutputDevice.GetVersiportDigitalOutput, props);
|
||||
|
||||
return portDevice;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a device that provides digital input
|
||||
/// </summary>
|
||||
public interface IDigitalOutput
|
||||
{
|
||||
BoolFeedback OutputStateFeedback { get; }
|
||||
void SetOutput(bool state);
|
||||
}
|
||||
}
|
||||
@@ -1,61 +1,56 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes the functionality required to prompt a user to enter a password
|
||||
/// </summary>
|
||||
public interface IPasswordPrompt
|
||||
{
|
||||
/// <summary>
|
||||
/// Notifies when a password is required or is entered incorrectly
|
||||
/// </summary>
|
||||
event EventHandler<PasswordPromptEventArgs> PasswordRequired;
|
||||
|
||||
/// <summary>
|
||||
/// Submits the password
|
||||
/// </summary>
|
||||
/// <param name="password"></param>
|
||||
void SubmitPassword(string password);
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes the functionality required to prompt a user to enter a password
|
||||
/// </summary>
|
||||
public interface IPasswordPrompt
|
||||
{
|
||||
/// <summary>
|
||||
/// Notifies when a password is required or is entered incorrectly
|
||||
/// </summary>
|
||||
event EventHandler<PasswordPromptEventArgs> PasswordRequired;
|
||||
|
||||
/// <summary>
|
||||
/// Cancels the password submission
|
||||
/// Submits the password
|
||||
/// </summary>
|
||||
void CancelPasswordPrompt();
|
||||
}
|
||||
|
||||
public class PasswordPromptEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates if the last submitted password was incorrect
|
||||
/// </summary>
|
||||
public bool LastAttemptWasIncorrect { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the login attempt has failed
|
||||
/// </summary>
|
||||
public bool LoginAttemptFailed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the process was cancelled and the prompt should be dismissed
|
||||
/// </summary>
|
||||
public bool LoginAttemptCancelled { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// A message to be displayed to the user
|
||||
/// </summary>
|
||||
public string Message { get; private set; }
|
||||
|
||||
public PasswordPromptEventArgs(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message)
|
||||
{
|
||||
LastAttemptWasIncorrect = lastAttemptIncorrect;
|
||||
LoginAttemptFailed = loginFailed;
|
||||
LoginAttemptCancelled = loginCancelled;
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
/// <param name="password"></param>
|
||||
void SubmitPassword(string password);
|
||||
}
|
||||
|
||||
public class PasswordPromptEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates if the last submitted password was incorrect
|
||||
/// </summary>
|
||||
public bool LastAttemptWasIncorrect { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the login attempt has failed
|
||||
/// </summary>
|
||||
public bool LoginAttemptFailed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates that the process was cancelled and the prompt should be dismissed
|
||||
/// </summary>
|
||||
public bool LoginAttemptCancelled { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// A message to be displayed to the user
|
||||
/// </summary>
|
||||
public string Message { get; private set; }
|
||||
|
||||
public PasswordPromptEventArgs(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message)
|
||||
{
|
||||
LastAttemptWasIncorrect = lastAttemptIncorrect;
|
||||
LoginAttemptFailed = loginFailed;
|
||||
LoginAttemptCancelled = loginCancelled;
|
||||
Message = message;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,5 +16,9 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
return string.IsNullOrEmpty(s.Trim()) ? null : s;
|
||||
}
|
||||
public static string ReplaceIfNullOrEmpty(this string s, string newString)
|
||||
{
|
||||
return string.IsNullOrEmpty(s) ? newString : s;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
@@ -193,19 +198,6 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
protected void AddJoins(Type type)
|
||||
{
|
||||
// Add all the JoinDataComplete properties to the Joins Dictionary and pass in the offset
|
||||
//Joins = this.GetType()
|
||||
// .GetCType()
|
||||
// .GetFields(BindingFlags.Public | BindingFlags.Instance)
|
||||
// .Where(field => field.IsDefined(typeof(JoinNameAttribute), true))
|
||||
// .Select(field => (JoinDataComplete)field.GetValue(this))
|
||||
// .ToDictionary(join => join.GetNameAttribute(), join =>
|
||||
// {
|
||||
// join.SetJoinOffset(_joinOffset);
|
||||
// return join;
|
||||
// });
|
||||
|
||||
//type = this.GetType(); <- this wasn't working because 'this' was always the base class, never the derived class
|
||||
var fields =
|
||||
type.GetCType()
|
||||
.GetFields(BindingFlags.Public | BindingFlags.Instance)
|
||||
@@ -219,7 +211,7 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
Debug.Console(0, "Unable to caset base class to {0}", type.Name);
|
||||
Debug.Console(0, "Unable to cast base class to {0}", type.Name);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -256,12 +248,64 @@ namespace PepperDash.Essentials.Core
|
||||
var analogs = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Analog Joins", analogs.Count);
|
||||
PrintJoinList(GetSortedJoins(analogs));
|
||||
|
||||
|
||||
Debug.Console(0, "Serials:");
|
||||
var serials = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Serial Joins", serials.Count);
|
||||
PrintJoinList(GetSortedJoins(serials));
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// Prints the join information to console
|
||||
/// </summary>
|
||||
public void MarkdownJoinMapInfo(string deviceKey, string bridgeKey)
|
||||
{
|
||||
var pluginType = GetType().Name;
|
||||
|
||||
Debug.Console(0, "{0}:\n", pluginType);
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
sb.AppendLine(String.Format("# {0}", GetType().Name));
|
||||
sb.AppendLine(String.Format("Generated from '{0}' on bridge '{1}'", deviceKey, bridgeKey));
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("## Digitals");
|
||||
// Get the joins of each type and print them
|
||||
var digitals = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Digital) == eJoinType.Digital).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Digital Joins", digitals.Count);
|
||||
var digitalSb = AppendJoinList(GetSortedJoins(digitals));
|
||||
digitalSb.AppendLine("## Analogs");
|
||||
digitalSb.AppendLine();
|
||||
|
||||
Debug.Console(0, "Analogs:");
|
||||
var analogs = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Analog) == eJoinType.Analog).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Analog Joins", analogs.Count);
|
||||
var analogSb = AppendJoinList(GetSortedJoins(analogs));
|
||||
analogSb.AppendLine("## Serials");
|
||||
analogSb.AppendLine();
|
||||
|
||||
Debug.Console(0, "Serials:");
|
||||
var serials = Joins.Where(j => (j.Value.Metadata.JoinType & eJoinType.Serial) == eJoinType.Serial).ToDictionary(j => j.Key, j => j.Value);
|
||||
Debug.Console(2, "Found {0} Serial Joins", serials.Count);
|
||||
var serialSb = AppendJoinList(GetSortedJoins(serials));
|
||||
|
||||
sb.EnsureCapacity(sb.Length + digitalSb.Length + analogSb.Length + serialSb.Length);
|
||||
sb.Append(digitalSb).Append(analogSb).Append(serialSb);
|
||||
|
||||
WriteJoinmapMarkdown(sb, pluginType, bridgeKey, deviceKey);
|
||||
|
||||
}
|
||||
|
||||
private static void WriteJoinmapMarkdown(StringBuilder stringBuilder, string pluginType, string bridgeKey, string deviceKey)
|
||||
{
|
||||
var fileName = String.Format("{0}{1}{2}__{3}__{4}.md", Global.FilePathPrefix, "joinMaps/", pluginType, bridgeKey, deviceKey);
|
||||
|
||||
using (var sw = new StreamWriter(fileName))
|
||||
{
|
||||
sw.WriteLine(stringBuilder.ToString());
|
||||
Debug.Console(0, "Joinmap Readme generated and written to {0}", fileName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -283,15 +327,49 @@ namespace PepperDash.Essentials.Core
|
||||
foreach (var join in joins)
|
||||
{
|
||||
Debug.Console(0,
|
||||
@"Join Number: {0} | JoinSpan: '{1}' | Description: '{2}' | Type: '{3}' | Capabilities: '{4}'",
|
||||
@"Join Number: {0} | JoinSpan: '{1}' | JoinName: {2} | Description: '{3}' | Type: '{4}' | Capabilities: '{5}'",
|
||||
join.Value.JoinNumber,
|
||||
join.Value.JoinSpan,
|
||||
join.Key,
|
||||
String.IsNullOrEmpty(join.Value.AttributeName) ? join.Value.Metadata.Label : join.Value.AttributeName,
|
||||
join.Value.Metadata.JoinType.ToString(),
|
||||
join.Value.Metadata.JoinCapabilities.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
static StringBuilder AppendJoinList(List<KeyValuePair<string, JoinDataComplete>> joins)
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
const string stringFormatter = "| {0} | {1} | {2} | {3} | {4} |";
|
||||
const int joinNumberLen = 11;
|
||||
const int joinSpanLen = 9;
|
||||
const int typeLen = 19;
|
||||
const int capabilitiesLen = 12;
|
||||
var descriptionLen = (from @join in joins select @join.Value into j select j.Metadata.Description.Length).Concat(new[] {11}).Max();
|
||||
|
||||
//build header
|
||||
sb.AppendLine(String.Format(stringFormatter,
|
||||
String.Format("Join Number").PadRight(joinNumberLen, ' '),
|
||||
String.Format("Join Span").PadRight(joinSpanLen, ' '),
|
||||
String.Format("Description").PadRight(descriptionLen, ' '),
|
||||
String.Format("Type").PadRight(typeLen, ' '),
|
||||
String.Format("Capabilities").PadRight(capabilitiesLen, ' ')));
|
||||
//build table seperator
|
||||
sb.AppendLine(String.Format(stringFormatter,
|
||||
new String('-', joinNumberLen),
|
||||
new String('-', joinSpanLen),
|
||||
new String('-', descriptionLen),
|
||||
new String('-', typeLen),
|
||||
new String('-', capabilitiesLen)));
|
||||
|
||||
foreach (var join in joins)
|
||||
{
|
||||
sb.AppendLine(join.Value.GetMarkdownFormattedData(stringFormatter, descriptionLen));
|
||||
}
|
||||
sb.AppendLine();
|
||||
return sb;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to find the matching key for the custom join and if found overwrites the default JoinData with the custom
|
||||
/// </summary>
|
||||
@@ -458,6 +536,64 @@ namespace PepperDash.Essentials.Core
|
||||
Metadata = metadata;
|
||||
}
|
||||
|
||||
public string GetMarkdownFormattedData(string stringFormatter, int descriptionLen)
|
||||
{
|
||||
|
||||
//Fixed Width Headers
|
||||
var joinNumberLen = String.Format("Join Number").Length;
|
||||
var joinSpanLen = String.Format("Join Span").Length;
|
||||
var typeLen = String.Format("AnalogDigitalSerial").Length;
|
||||
var capabilitiesLen = String.Format("ToFromFusion").Length;
|
||||
|
||||
//Track which one failed, if it did
|
||||
const string placeholder = "unknown";
|
||||
var dataArray = new Dictionary<string, string>
|
||||
{
|
||||
{"joinNumber", placeholder.PadRight(joinNumberLen, ' ')},
|
||||
{"joinSpan", placeholder.PadRight(joinSpanLen, ' ')},
|
||||
{"description", placeholder.PadRight(descriptionLen, ' ')},
|
||||
{"joinType", placeholder.PadRight(typeLen, ' ')},
|
||||
{"capabilities", placeholder.PadRight(capabilitiesLen, ' ')}
|
||||
};
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
dataArray["joinNumber"] = String.Format("{0}", JoinNumber.ToString(CultureInfo.InvariantCulture).ReplaceIfNullOrEmpty(placeholder)).PadRight(joinNumberLen, ' ');
|
||||
dataArray["joinSpan"] = String.Format("{0}", JoinSpan.ToString(CultureInfo.InvariantCulture).ReplaceIfNullOrEmpty(placeholder)).PadRight(joinSpanLen, ' ');
|
||||
dataArray["description"] = String.Format("{0}", Metadata.Description.ReplaceIfNullOrEmpty(placeholder)).PadRight(descriptionLen, ' ');
|
||||
dataArray["joinType"] = String.Format("{0}", Metadata.JoinType.ToString().ReplaceIfNullOrEmpty(placeholder)).PadRight(typeLen, ' ');
|
||||
dataArray["capabilities"] = String.Format("{0}", Metadata.JoinCapabilities.ToString().ReplaceIfNullOrEmpty(placeholder)).PadRight(capabilitiesLen, ' ');
|
||||
|
||||
return String.Format(stringFormatter,
|
||||
dataArray["joinNumber"],
|
||||
dataArray["joinSpan"],
|
||||
dataArray["description"],
|
||||
dataArray["joinType"],
|
||||
dataArray["capabilities"]);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//Don't Throw - we don't want to kill the system if this falls over - it's not mission critical. Print the error, use placeholder data
|
||||
var errorKey = string.Empty;
|
||||
foreach (var item in dataArray)
|
||||
{
|
||||
if (item.Value.TrimEnd() == placeholder) ;
|
||||
errorKey = item.Key;
|
||||
break;
|
||||
}
|
||||
Debug.Console(0, "Unable to decode join metadata {1}- {0}", e.Message, !String.IsNullOrEmpty(errorKey) ? (' ' + errorKey) : String.Empty);
|
||||
return String.Format(stringFormatter,
|
||||
dataArray["joinNumber"],
|
||||
dataArray["joinSpan"],
|
||||
dataArray["description"],
|
||||
dataArray["joinType"],
|
||||
dataArray["capabilities"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the join offset value
|
||||
/// </summary>
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
<Compile Include="Bridges\IBridge.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\IDigitalOutputJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\PduJoinMapBase.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\CameraControllerJoinMap.cs" />
|
||||
@@ -179,12 +180,15 @@
|
||||
<Compile Include="Crestron IO\Cards\InternalCardCageController.cs" />
|
||||
<Compile Include="Crestron IO\DinCenCn\DinCenCnController.cs" />
|
||||
<Compile Include="Crestron IO\DinCenCn\IHasCresnetBranches.cs" />
|
||||
<Compile Include="Crestron IO\DinIo8\DinIo8Controller.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\CenIoDigIn104Controller.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
||||
<Compile Include="Crestron IO\IOPortConfig.cs" />
|
||||
<Compile Include="Crestron IO\Ir\CenIoIr104Controller.cs" />
|
||||
<Compile Include="Crestron IO\Outputs\GenericVersiportOutputDevice.cs" />
|
||||
<Compile Include="Crestron IO\Outputs\IDigitalOutput.cs" />
|
||||
<Compile Include="Crestron IO\Relay\CenIoRy104Controller.cs" />
|
||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using PepperDash.Core;
|
||||
|
||||
@@ -187,9 +188,20 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
if (_delayEnabled)
|
||||
Thread.Sleep(_delayTime);
|
||||
}
|
||||
catch (System.Threading.ThreadAbortException)
|
||||
{
|
||||
//swallowing this exception, as it should only happen on shut down
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue: {1}:{0}", ex.Message, ex);
|
||||
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
|
||||
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "---\r\n{0}", ex.InnerException.Message);
|
||||
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.InnerException.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
else _waitHandle.Wait();
|
||||
@@ -202,7 +214,7 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
{
|
||||
if (Disposed)
|
||||
{
|
||||
Debug.Console(1, this, "I've been disposed so you can't enqueue any messages. Are you trying to dispatch a message while the program is stopping?");
|
||||
Debug.Console(1, this, "Queue has been disposed. Enqueuing messages not allowed while program is stopping.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -446,7 +458,14 @@ namespace PepperDash_Essentials_Core.Queues
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}", ex.Message);
|
||||
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.StackTrace);
|
||||
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Caught an exception in the Queue {0}", ex.InnerException.Message);
|
||||
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Stack Trace: {0}", ex.InnerException.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
else _waitHandle.Wait();
|
||||
|
||||
@@ -343,7 +343,7 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
void RoomIsOccupiedFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false)
|
||||
if (RoomOccupancy.RoomIsOccupiedFeedback.BoolValue == false && AllowVacancyTimerToStart())
|
||||
{
|
||||
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "Notice: Vacancy Detected");
|
||||
// Trigger the timer when the room is vacant
|
||||
@@ -362,6 +362,15 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
/// <param name="o"></param>
|
||||
public abstract void RoomVacatedForTimeoutPeriod(object o);
|
||||
|
||||
/// <summary>
|
||||
/// Allow the vacancy event from an occupancy sensor to turn the room off.
|
||||
/// </summary>
|
||||
/// <returns>If the timer should be allowed. Defaults to true</returns>
|
||||
protected virtual bool AllowVacancyTimerToStart()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -148,6 +148,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
Secrets.Add(key, provider);
|
||||
Debug.Console(1, "Secrets provider '{0}' added to SecretsManager", key);
|
||||
return;
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to add Provider '{0}' to Secrets. Provider with that key already exists", key );
|
||||
}
|
||||
@@ -164,13 +165,13 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
Secrets.Add(key, provider);
|
||||
Debug.Console(1, "Secrets provider '{0}' added to SecretsManager", key);
|
||||
|
||||
return;
|
||||
}
|
||||
if (overwrite)
|
||||
{
|
||||
Secrets.Add(key, provider);
|
||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Provider with the key '{0}' already exists in secrets. Overwriting with new secrets provider.", key);
|
||||
|
||||
return;
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to add Provider '{0}' to Secrets. Provider with that key already exists", key);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Requirements for a device that implements basic Open/Close shade control
|
||||
/// </summary>
|
||||
[Obsolete("Please use IShadesOpenCloseStop instead")]
|
||||
public interface IShadesOpenClose
|
||||
{
|
||||
void Open();
|
||||
@@ -28,15 +29,26 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Requirements for a device that implements basic Open/Close/Stop shade control (Uses 3 relays)
|
||||
/// </summary>
|
||||
public interface IShadesOpenCloseStop : IShadesOpenClose
|
||||
{
|
||||
void StopOrPreset();
|
||||
string StopOrPresetButtonLabel { get; }
|
||||
public interface IShadesOpenCloseStop
|
||||
{
|
||||
void Open();
|
||||
void Close();
|
||||
void Stop();
|
||||
}
|
||||
|
||||
public interface IShadesOpenClosePreset : IShadesOpenCloseStop
|
||||
{
|
||||
void RecallPreset(uint presetNumber);
|
||||
void SavePreset(uint presetNumber);
|
||||
string StopOrPresetButtonLabel { get; }
|
||||
|
||||
event EventHandler PresetSaved;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Requirements for a shade that implements press/hold raise/lower functions
|
||||
/// </summary>
|
||||
/// </summary>
|
||||
[Obsolete("Please use IShadesOpenCloseStop instead")]
|
||||
public interface IShadesRaiseLower
|
||||
{
|
||||
void Raise(bool state);
|
||||
@@ -55,7 +67,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Requirements for a shade/scene that is open or closed
|
||||
/// </summary>
|
||||
public interface IShadesOpenClosedFeedback: IShadesOpenClose
|
||||
public interface IShadesOpenClosedFeedback: IShadesOpenCloseStop
|
||||
{
|
||||
BoolFeedback ShadeIsOpenFeedback { get; }
|
||||
BoolFeedback ShadeIsClosedFeedback { get; }
|
||||
@@ -63,15 +75,16 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public interface IShadesStop
|
||||
/// </summary>
|
||||
[Obsolete("Please use IShadesOpenCloseStop instead")]
|
||||
public interface IShadesStop
|
||||
{
|
||||
void Stop();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// Used to implement raise/stop/lower/stop from single button
|
||||
/// </summary>
|
||||
public interface IShadesStopOrMove
|
||||
{
|
||||
void OpenOrStop();
|
||||
@@ -82,7 +95,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Basic feedback for shades/scene stopped
|
||||
/// </summary>
|
||||
public interface IShadesStopFeedback
|
||||
public interface IShadesStopFeedback : IShadesOpenCloseStop
|
||||
{
|
||||
BoolFeedback IsStoppedFeedback { get; }
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
/// <summary>
|
||||
/// Base class for a shade device
|
||||
/// </summary>
|
||||
public abstract class ShadeBase : EssentialsDevice, IShadesOpenClose
|
||||
public abstract class ShadeBase : EssentialsDevice, IShadesOpenCloseStop
|
||||
{
|
||||
public ShadeBase(string key, string name)
|
||||
: base(key, name)
|
||||
@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
#region iShadesOpenClose Members
|
||||
|
||||
public abstract void Open();
|
||||
public abstract void StopOrPreset();
|
||||
public abstract void Stop();
|
||||
public abstract void Close();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace PepperDash.Essentials.Core.UI
|
||||
:base(key, name)
|
||||
{
|
||||
|
||||
if (Panel == null)
|
||||
if (panel == null)
|
||||
{
|
||||
Debug.Console(0, this, "Panel is not valid. Touchpanel class WILL NOT work correctly");
|
||||
return;
|
||||
@@ -71,6 +71,8 @@ namespace PepperDash.Essentials.Core.UI
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Panel.LoadSmartObjects(sgdName);
|
||||
});
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
|
||||
@@ -329,6 +329,9 @@ namespace PepperDash.Essentials.DM
|
||||
DmRmcPropertiesConfig props, string pKey, uint ipid)
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
CrestronGenericBaseDevice rx;
|
||||
bool useChassisForOfflineFeedback = false;
|
||||
|
||||
if (parentDev is DmpsRoutingController)
|
||||
{
|
||||
var dmps = parentDev as DmpsRoutingController;
|
||||
@@ -342,22 +345,33 @@ namespace PepperDash.Essentials.DM
|
||||
return null;
|
||||
}
|
||||
// Must use different constructor for DMPS4K types. No IPID
|
||||
if (Global.ControlSystemIsDmps4kType || typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||
if (Global.ControlSystemIsDmps4kType)
|
||||
{
|
||||
var rmc = GetDmRmcControllerForDmps4k(key, name, typeName, dmps, props.ParentOutputNumber);
|
||||
Debug.Console(0, "DM endpoint output {0} is for Dmps4k, changing online feedback to chassis", num);
|
||||
rmc.IsOnline.SetValueFunc(() => dmps.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
rx = GetDmRmcControllerForDmps4k(key, name, typeName, dmps, props.ParentOutputNumber);
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rx = GetDmRmcControllerForDmps(key, name, typeName, ipid, dmps, props.ParentOutputNumber);
|
||||
if (typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||
{
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
}
|
||||
if (useChassisForOfflineFeedback)
|
||||
{
|
||||
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||
rx.IsOnline.SetValueFunc(() => dmps.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
dmps.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
||||
{
|
||||
foreach (var feedback in rmc.Feedbacks)
|
||||
foreach (var feedback in rx.Feedbacks)
|
||||
{
|
||||
if (feedback != null)
|
||||
feedback.FireUpdate();
|
||||
}
|
||||
};
|
||||
return rmc;
|
||||
}
|
||||
return GetDmRmcControllerForDmps(key, name, typeName, ipid, dmps, props.ParentOutputNumber);
|
||||
return rx;
|
||||
}
|
||||
else if (parentDev is DmChassisController)
|
||||
{
|
||||
@@ -380,23 +394,33 @@ namespace PepperDash.Essentials.DM
|
||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
||||
chassis is DmMd128x128 || chassis is DmMd64x64
|
||||
|| typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||
{
|
||||
var rmc = GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
|
||||
Debug.Console(0, "DM endpoint output {0} is for Cpu3, changing online feedback to chassis", num);
|
||||
rmc.IsOnline.SetValueFunc(() => controller.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
controller.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
||||
{
|
||||
foreach (var feedback in rmc.Feedbacks)
|
||||
{
|
||||
if (feedback != null)
|
||||
feedback.FireUpdate();
|
||||
}
|
||||
};
|
||||
return rmc;
|
||||
rx = GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
return GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
|
||||
else
|
||||
{
|
||||
rx = GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
|
||||
if (typeName == "hdbasetrx" || typeName == "dmrmc4k100c1g")
|
||||
{
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
}
|
||||
if (useChassisForOfflineFeedback)
|
||||
{
|
||||
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||
rx.IsOnline.SetValueFunc(() => controller.OutputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
controller.OutputEndpointOnlineFeedbacks[num].OutputChange += (o, a) =>
|
||||
{
|
||||
foreach (var feedback in rx.Feedbacks)
|
||||
{
|
||||
if (feedback != null)
|
||||
feedback.FireUpdate();
|
||||
}
|
||||
};
|
||||
}
|
||||
return rx;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -499,9 +523,7 @@ namespace PepperDash.Essentials.DM
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
|
||||
|
||||
@@ -126,6 +126,7 @@ namespace PepperDash.Essentials.DM
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
DMInput dmInput;
|
||||
BasicDmTxControllerBase tx;
|
||||
bool useChassisForOfflineFeedback = false;
|
||||
|
||||
if (parentDev is DmChassisController)
|
||||
{
|
||||
@@ -155,15 +156,23 @@ namespace PepperDash.Essentials.DM
|
||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||
{
|
||||
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
|
||||
Debug.Console(0, "DM endpoint output {0} is for Cpu3, changing online feedback to chassis", num);
|
||||
tx.IsOnline.SetValueFunc(() => switchDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
switchDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||
return tx;
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||
tx = GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||
if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g")
|
||||
{
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
}
|
||||
if (useChassisForOfflineFeedback)
|
||||
{
|
||||
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||
tx.IsOnline.SetValueFunc(() => switchDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
switchDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||
}
|
||||
return tx;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -203,15 +212,23 @@ namespace PepperDash.Essentials.DM
|
||||
if(Global.ControlSystemIsDmps4kType)
|
||||
{
|
||||
tx = GetDmTxForChassisWithoutIpId(key, name, typeName, dmInput);
|
||||
Debug.Console(0, "DM endpoint output {0} is for DMPS3-4K, changing online feedback to chassis", num);
|
||||
tx.IsOnline.SetValueFunc(() => dmpsDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
dmpsDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||
return tx;
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||
tx = GetDmTxForChassisWithIpId(key, name, typeName, ipid, dmInput);
|
||||
if (typeName == "hdbasettx" || typeName == "dmtx4k100c1g")
|
||||
{
|
||||
useChassisForOfflineFeedback = true;
|
||||
}
|
||||
}
|
||||
if (useChassisForOfflineFeedback)
|
||||
{
|
||||
Debug.Console(0, "DM endpoint output {0} does not have direct online feedback, changing online feedback to chassis", num);
|
||||
tx.IsOnline.SetValueFunc(() => dmpsDev.InputEndpointOnlineFeedbacks[num].BoolValue);
|
||||
dmpsDev.InputEndpointOnlineFeedbacks[num].OutputChange += (o, a) => tx.IsOnline.FireUpdate();
|
||||
}
|
||||
return tx;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -223,7 +223,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
|
||||
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
|
||||
|
||||
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
|
||||
for (int i = 0; i < joinMap.NumberOfPresets.JoinSpan; i++)
|
||||
{
|
||||
int tempNum = i;
|
||||
|
||||
|
||||
@@ -56,9 +56,9 @@ namespace PepperDash.Essentials.Devices.Common.Environment.Somfy
|
||||
PulseOutput(OpenRelay, RelayPulseTime);
|
||||
}
|
||||
|
||||
public override void StopOrPreset()
|
||||
public override void Stop()
|
||||
{
|
||||
Debug.Console(1, this, "Stopping or recalling preset on Shade: '{0}'", this.Name);
|
||||
Debug.Console(1, this, "Stopping Shade: '{0}'", this.Name);
|
||||
|
||||
PulseOutput(StopOrPresetRelay, RelayPulseTime);
|
||||
}
|
||||
|
||||
@@ -43,10 +43,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
[JsonProperty("isLocked", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Boolean IsLocked { get; private set; }
|
||||
[JsonProperty("isRecording", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Boolean IsRecording { get; private set; }
|
||||
public Boolean IsRecording { get; private set; }
|
||||
[JsonProperty("canRecord", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public Boolean CanRecord { get; private set; }
|
||||
|
||||
|
||||
public MeetingInfo(string id, string name, string host, string password, string shareStatus, bool isHost, bool isSharingMeeting, bool waitingForHost, bool isLocked, bool isRecording)
|
||||
public MeetingInfo(string id, string name, string host, string password, string shareStatus, bool isHost, bool isSharingMeeting, bool waitingForHost, bool isLocked, bool isRecording, bool canRecord)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
@@ -57,7 +59,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
|
||||
IsSharingMeeting = isSharingMeeting;
|
||||
WaitingForHost = waitingForHost;
|
||||
IsLocked = isLocked;
|
||||
IsRecording = isRecording;
|
||||
IsRecording = isRecording;
|
||||
CanRecord = CanRecord;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
public interface IHasPresentationOnlyMeeting
|
||||
{
|
||||
void StartSharingOnlyMeeting();
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode mode);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration, string password);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode displayMode);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration);
|
||||
void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration, string password);
|
||||
void StartNormalMeetingFromSharingOnlyMeeting();
|
||||
}
|
||||
|
||||
|
||||
@@ -1393,11 +1393,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, call.IsOnHold);
|
||||
|
||||
//serials
|
||||
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty);
|
||||
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty);
|
||||
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString());
|
||||
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, call.Type.ToString());
|
||||
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, call.Status.ToString());
|
||||
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, call.Name ?? String.Empty);
|
||||
tokenArray[stringIndex + 1] = new XSigSerialToken(stringIndex + 2, call.Number ?? String.Empty);
|
||||
tokenArray[stringIndex + 2] = new XSigSerialToken(stringIndex + 3, call.Direction.ToString());
|
||||
tokenArray[stringIndex + 3] = new XSigSerialToken(stringIndex + 4, call.Type.ToString());
|
||||
tokenArray[stringIndex + 4] = new XSigSerialToken(stringIndex + 5, call.Status.ToString());
|
||||
if(call.Duration != null)
|
||||
{
|
||||
// May need to verify correct string format here
|
||||
@@ -1407,9 +1407,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
arrayIndex += offset;
|
||||
stringIndex += maxStrings;
|
||||
digitalIndex++;
|
||||
digitalIndex += maxDigitals;
|
||||
}
|
||||
while (digitalIndex < maxCalls)
|
||||
while (arrayIndex < maxCalls * offset)
|
||||
{
|
||||
//digitals
|
||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, false);
|
||||
@@ -1417,16 +1417,16 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
|
||||
|
||||
//serials
|
||||
tokenArray[arrayIndex + 1] = new XSigSerialToken(stringIndex + 1, String.Empty);
|
||||
tokenArray[arrayIndex + 2] = new XSigSerialToken(stringIndex + 2, String.Empty);
|
||||
tokenArray[arrayIndex + 3] = new XSigSerialToken(stringIndex + 3, String.Empty);
|
||||
tokenArray[arrayIndex + 4] = new XSigSerialToken(stringIndex + 4, String.Empty);
|
||||
tokenArray[arrayIndex + 5] = new XSigSerialToken(stringIndex + 5, String.Empty);
|
||||
tokenArray[arrayIndex + 6] = new XSigSerialToken(stringIndex + 6, String.Empty);
|
||||
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, String.Empty);
|
||||
tokenArray[stringIndex + 1] = new XSigSerialToken(stringIndex + 2, String.Empty);
|
||||
tokenArray[stringIndex + 2] = new XSigSerialToken(stringIndex + 3, String.Empty);
|
||||
tokenArray[stringIndex + 3] = new XSigSerialToken(stringIndex + 4, String.Empty);
|
||||
tokenArray[stringIndex + 4] = new XSigSerialToken(stringIndex + 5, String.Empty);
|
||||
tokenArray[stringIndex + 5] = new XSigSerialToken(stringIndex + 6, String.Empty);
|
||||
|
||||
arrayIndex += offset;
|
||||
stringIndex += maxStrings;
|
||||
digitalIndex++;
|
||||
digitalIndex += maxDigitals;
|
||||
}
|
||||
|
||||
return GetXSigString(tokenArray);
|
||||
|
||||
@@ -448,6 +448,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
private bool _isAirHostClientConnected;
|
||||
private bool _isSharingBlackMagic;
|
||||
private bool _isDirectPresentationConnected;
|
||||
private bool _isBlackMagicConnected;
|
||||
|
||||
|
||||
public string directPresentationPairingCode { get; set; }
|
||||
@@ -484,7 +485,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
public bool isBlackMagicConnected { get; set; }
|
||||
public bool isBlackMagicConnected
|
||||
{
|
||||
get { return _isBlackMagicConnected; }
|
||||
set
|
||||
{
|
||||
if (value != _isBlackMagicConnected)
|
||||
{
|
||||
_isBlackMagicConnected = value;
|
||||
NotifyPropertyChanged("isBlackMagicConnected");
|
||||
}
|
||||
}
|
||||
}
|
||||
public bool isBlackMagicDataAvailable { get; set; }
|
||||
|
||||
public bool isDirectPresentationConnected
|
||||
@@ -627,6 +639,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
// backer variables
|
||||
private bool _can_Switch_Speaker_View;
|
||||
private bool _can_Switch_Wall_View;
|
||||
private bool _can_Switch_Strip_View;
|
||||
private bool _can_Switch_Share_On_All_Screens;
|
||||
private bool _can_Switch_Floating_Share_Content;
|
||||
private bool _is_In_First_Page;
|
||||
@@ -714,6 +727,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("can_Switch_Strip_View")]
|
||||
public bool can_Switch_Strip_View
|
||||
{
|
||||
get
|
||||
{
|
||||
return _can_Switch_Strip_View;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _can_Switch_Strip_View)
|
||||
{
|
||||
_can_Switch_Strip_View = value;
|
||||
NotifyPropertyChanged("can_Switch_Strip_View");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("is_In_First_Page")]
|
||||
public bool is_In_First_Page
|
||||
{
|
||||
@@ -775,11 +805,43 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
public class CallRecordInfo : NotifiableObject
|
||||
{
|
||||
private bool _meetingIsBeingRecorded;
|
||||
private bool _canRecord;
|
||||
private bool _emailRequired;
|
||||
|
||||
public bool canRecord { get; set; }
|
||||
public bool emailRequired { get; set; }
|
||||
public bool amIRecording { get; set; }
|
||||
|
||||
public bool canRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return _canRecord;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _canRecord)
|
||||
{
|
||||
_canRecord = value;
|
||||
NotifyPropertyChanged("canRecord");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool emailRequired
|
||||
{
|
||||
get
|
||||
{
|
||||
return _emailRequired;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value != _emailRequired)
|
||||
{
|
||||
_emailRequired = value;
|
||||
NotifyPropertyChanged("emailRequired");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool meetingIsBeingRecorded
|
||||
{
|
||||
get
|
||||
@@ -798,6 +860,17 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if recording is allowed (when meeting capable and and email is not required to be entered by the user)
|
||||
/// </summary>
|
||||
public bool AllowRecord
|
||||
{
|
||||
get
|
||||
{
|
||||
return canRecord && !emailRequired;
|
||||
}
|
||||
}
|
||||
|
||||
public CallRecordInfo()
|
||||
{
|
||||
Debug.Console(2, Debug.ErrorLogLevel.Notice, "********************************************* CallRecordInfo() ******************************************");
|
||||
|
||||
@@ -59,9 +59,22 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
private CameraBase _selectedCamera;
|
||||
private string _lastDialedMeetingNumber;
|
||||
|
||||
private CTimer contactsDebounceTimer;
|
||||
|
||||
|
||||
private readonly ZoomRoomPropertiesConfig _props;
|
||||
|
||||
private bool _meetingPasswordRequired;
|
||||
|
||||
private bool _waitingForUserToAcceptOrRejectIncomingCall;
|
||||
|
||||
public void Poll(string pollString)
|
||||
{
|
||||
if(_meetingPasswordRequired || _waitingForUserToAcceptOrRejectIncomingCall) return;
|
||||
|
||||
SendText(string.Format("{0}{1}", pollString, SendDelimiter));
|
||||
}
|
||||
|
||||
public ZoomRoom(DeviceConfig config, IBasicCommunication comm)
|
||||
: base(config)
|
||||
{
|
||||
@@ -75,13 +88,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
if (_props.CommunicationMonitorProperties != null)
|
||||
{
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication,
|
||||
_props.CommunicationMonitorProperties);
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, _props.CommunicationMonitorProperties.PollInterval, _props.CommunicationMonitorProperties.TimeToWarning, _props.CommunicationMonitorProperties.TimeToError,
|
||||
() => Poll(_props.CommunicationMonitorProperties.PollString));
|
||||
}
|
||||
else
|
||||
{
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000,
|
||||
"zStatus SystemUnit" + SendDelimiter);
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, () => Poll("zStatus SystemUnit"));
|
||||
}
|
||||
|
||||
DeviceManager.AddDevice(CommunicationMonitor);
|
||||
@@ -252,7 +264,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
protected override Func<bool> SharingContentIsOnFeedbackFunc
|
||||
{
|
||||
get { return () => Status.Call.Sharing.IsSharing; }
|
||||
get { return () => Status.Sharing.isAirHostClientConnected || Status.Sharing.isDirectPresentationConnected || Status.Sharing.isSharingBlackMagic; }
|
||||
}
|
||||
|
||||
protected Func<bool> FarEndIsSharingContentFeedbackFunc
|
||||
@@ -366,26 +378,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public void SelectCamera(string key)
|
||||
{
|
||||
if (Cameras == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (CameraIsMutedFeedback.BoolValue)
|
||||
{
|
||||
CameraMuteOff();
|
||||
}
|
||||
|
||||
var camera = Cameras.FirstOrDefault(c => c.Key.IndexOf(key, StringComparison.OrdinalIgnoreCase) > -1);
|
||||
if (camera != null)
|
||||
{
|
||||
Debug.Console(1, this, "Selected Camera with key: '{0}'", camera.Key);
|
||||
SelectedCamera = camera;
|
||||
|
||||
if (CameraIsMutedFeedback.BoolValue)
|
||||
{
|
||||
CameraMuteOff();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Unable to select camera with key: '{0}'", key);
|
||||
}
|
||||
SendText(string.Format("zConfiguration Video Camera selectedId: {0}", key));
|
||||
}
|
||||
|
||||
public CameraBase FarEndCamera { get; private set; }
|
||||
@@ -529,6 +527,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// </summary>
|
||||
private void SetUpCallFeedbackActions()
|
||||
{
|
||||
Status.Sharing.PropertyChanged -= HandleSharingStateUpdate;
|
||||
Status.Sharing.PropertyChanged += HandleSharingStateUpdate;
|
||||
|
||||
Status.Call.Sharing.PropertyChanged -= HandleSharingStateUpdate;
|
||||
Status.Call.Sharing.PropertyChanged += HandleSharingStateUpdate;
|
||||
|
||||
@@ -541,7 +542,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
private void HandleCallRecordInfoStateUpdate(object sender, PropertyChangedEventArgs a)
|
||||
{
|
||||
if (a.PropertyName == "meetingIsBeingRecorded")
|
||||
if (a.PropertyName == "meetingIsBeingRecorded" || a.PropertyName == "emailRequired" || a.PropertyName == "canRecord")
|
||||
{
|
||||
MeetingIsRecordingFeedback.FireUpdate();
|
||||
|
||||
@@ -554,7 +555,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
MeetingInfo.IsSharingMeeting,
|
||||
MeetingInfo.WaitingForHost,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
MeetingInfo = meetingInfo;
|
||||
}
|
||||
}
|
||||
@@ -580,10 +581,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
private void HandleSharingStateUpdate(object sender, PropertyChangedEventArgs a)
|
||||
{
|
||||
if (a.PropertyName != "State")
|
||||
{
|
||||
return;
|
||||
}
|
||||
//if (a.PropertyName != "State")
|
||||
//{
|
||||
// return;
|
||||
//}
|
||||
|
||||
SharingContentIsOnFeedback.FireUpdate();
|
||||
ReceivingContent.FireUpdate();
|
||||
@@ -593,21 +594,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
// Update the share status of the meeting info
|
||||
if (MeetingInfo == null)
|
||||
{
|
||||
var sharingStatus = GetSharingStatus();
|
||||
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", sharingStatus, GetIsHostMyself(), true, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", GetSharingStatus(), GetIsHostMyself(), true, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
return;
|
||||
}
|
||||
|
||||
var meetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, Participants.Host != null ? Participants.Host.Name : "None",
|
||||
MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingInfo.Password, GetSharingStatus(), GetIsHostMyself(), MeetingInfo.IsSharingMeeting, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
MeetingInfo = meetingInfo;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "Error processing state property update. {0}", e.Message);
|
||||
Debug.Console(2, this, e.StackTrace);
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", "None", false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", "None", false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,8 +646,27 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
if (a.PropertyName == "SelectedId")
|
||||
{
|
||||
SelectCamera(Configuration.Video.Camera.SelectedId);
|
||||
// this will in turn fire the affected feedbacks
|
||||
if (Cameras == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var camera = Cameras.FirstOrDefault(c => c.Key.IndexOf(Configuration.Video.Camera.SelectedId, StringComparison.OrdinalIgnoreCase) > -1);
|
||||
if (camera != null)
|
||||
{
|
||||
Debug.Console(1, this, "Camera selected with key: '{0}'", camera.Key);
|
||||
|
||||
SelectedCamera = camera;
|
||||
|
||||
if (CameraIsMutedFeedback.BoolValue)
|
||||
{
|
||||
CameraMuteOff();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "No camera found with key: '{0}'", Configuration.Video.Camera.SelectedId);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -714,7 +732,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
MeetingInfo.IsSharingMeeting,
|
||||
MeetingInfo.WaitingForHost,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue
|
||||
MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -776,7 +794,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
MeetingInfo.IsSharingMeeting,
|
||||
MeetingInfo.WaitingForHost,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
MeetingInfo = meetingInfo;
|
||||
break;
|
||||
}
|
||||
@@ -810,8 +828,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
Debug.Console(1, this, "Status.Layout.PropertyChanged a.PropertyName: {0}", a.PropertyName);
|
||||
switch (a.PropertyName.ToLower())
|
||||
{
|
||||
case "can_switch_speaker_view":
|
||||
case "can_Switch_speaker_view":
|
||||
case "can_switch_wall_view":
|
||||
case "can_switch_strip_view":
|
||||
case "video_type":
|
||||
case "can_switch_share_on_all_screens":
|
||||
{
|
||||
ComputeAvailableLayouts();
|
||||
@@ -827,7 +847,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
LayoutViewIsOnLastPageFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case "can_Switch_Floating_Share_Content":
|
||||
case "can_switch_floating_share_content":
|
||||
{
|
||||
CanSwapContentWithThumbnailFeedback.FireUpdate();
|
||||
break;
|
||||
@@ -957,6 +977,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public void SendText(string command)
|
||||
{
|
||||
if (_meetingPasswordRequired)
|
||||
{
|
||||
Debug.Console(2, this, "Blocking commands to ZoomRoom while waiting for user to enter meeting password");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_waitingForUserToAcceptOrRejectIncomingCall)
|
||||
{
|
||||
Debug.Console(2, this, "Blocking commands to ZoomRoom while waiting for user to accept or reject incoming call");
|
||||
return;
|
||||
}
|
||||
|
||||
if (CommDebuggingIsOn)
|
||||
{
|
||||
Debug.Console(1, this, "Sending: '{0}'", command);
|
||||
@@ -1352,22 +1384,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Phonebook);
|
||||
|
||||
var directoryResults =
|
||||
zStatus.Phonebook.ConvertZoomContactsToGeneric(Status.Phonebook.Contacts);
|
||||
|
||||
if (!PhonebookSyncState.InitialSyncComplete)
|
||||
{
|
||||
PhonebookSyncState.InitialPhonebookFoldersReceived();
|
||||
PhonebookSyncState.PhonebookRootEntriesReceived();
|
||||
PhonebookSyncState.SetPhonebookHasFolders(true);
|
||||
PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
|
||||
}
|
||||
|
||||
directoryResults.ResultsFolderId = "root";
|
||||
|
||||
DirectoryRoot = directoryResults;
|
||||
|
||||
CurrentDirectoryResult = directoryResults;
|
||||
UpdateDirectory();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1468,13 +1485,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
MeetingInfo.Id,
|
||||
MeetingInfo.Name,
|
||||
Participants.Host.Name,
|
||||
MeetingInfo.Password,
|
||||
MeetingInfo.ShareStatus,
|
||||
MeetingInfo.Password,
|
||||
GetSharingStatus(),
|
||||
GetIsHostMyself(),
|
||||
MeetingInfo.IsSharingMeeting,
|
||||
MeetingInfo.WaitingForHost,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingIsRecordingFeedback.BoolValue,
|
||||
Status.Call.CallRecordInfo.AllowRecord
|
||||
);
|
||||
MeetingInfo = meetingInfo;
|
||||
|
||||
PrintCurrentCallParticipants();
|
||||
@@ -1494,36 +1513,37 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
case "phonebook":
|
||||
{
|
||||
zStatus.Contact contact = new zStatus.Contact();
|
||||
|
||||
if (responseObj["Updated Contact"] != null)
|
||||
{
|
||||
var updatedContact =
|
||||
JsonConvert.DeserializeObject<zStatus.Contact>(
|
||||
responseObj["Updated Contact"].ToString());
|
||||
|
||||
var existingContact =
|
||||
Status.Phonebook.Contacts.FirstOrDefault(c => c.Jid.Equals(updatedContact.Jid));
|
||||
|
||||
if (existingContact != null)
|
||||
{
|
||||
// Update existing contact
|
||||
JsonConvert.PopulateObject(responseObj["Updated Contact"].ToString(),
|
||||
existingContact);
|
||||
}
|
||||
{
|
||||
contact = responseObj["Updated Contact"].ToObject<zStatus.Contact>();
|
||||
}
|
||||
else if (responseObj["Added Contact"] != null)
|
||||
{
|
||||
var jToken = responseObj["Updated Contact"];
|
||||
if (jToken != null)
|
||||
{
|
||||
var newContact =
|
||||
JsonConvert.DeserializeObject<zStatus.Contact>(
|
||||
jToken.ToString());
|
||||
|
||||
// Add a new contact
|
||||
Status.Phonebook.Contacts.Add(newContact);
|
||||
}
|
||||
contact = responseObj["Added Contact"].ToObject<zStatus.Contact>();
|
||||
}
|
||||
|
||||
var existingContactIndex = Status.Phonebook.Contacts.FindIndex(c => c.Jid.Equals(contact.Jid));
|
||||
|
||||
if (existingContactIndex > 0)
|
||||
{
|
||||
Status.Phonebook.Contacts[existingContactIndex] = contact;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status.Phonebook.Contacts.Add(contact);
|
||||
}
|
||||
|
||||
if(contactsDebounceTimer == null)
|
||||
{
|
||||
contactsDebounceTimer = new CTimer(o => UpdateDirectory(), 2000);
|
||||
}
|
||||
else
|
||||
{
|
||||
contactsDebounceTimer.Reset();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case "bookingslistresult":
|
||||
@@ -1559,7 +1579,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
{
|
||||
JsonConvert.PopulateObject(responseObj.ToString(), Status.Call.Sharing);
|
||||
|
||||
SetLayout();
|
||||
SetDefaultLayout();
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1579,6 +1599,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
Id = incomingCall.callerJID
|
||||
};
|
||||
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = true;
|
||||
|
||||
ActiveCalls.Add(newCall);
|
||||
|
||||
OnCallStatusChange(newCall);
|
||||
@@ -1605,6 +1627,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
OnCallStatusChange(existingCall);
|
||||
}
|
||||
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = false;
|
||||
|
||||
UpdateCallStatus();
|
||||
}
|
||||
|
||||
@@ -1689,14 +1713,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
if (MeetingInfo == null)
|
||||
{
|
||||
MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "",
|
||||
GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
|
||||
UpdateCallStatus();
|
||||
break;
|
||||
}
|
||||
|
||||
MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "",
|
||||
GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
GetSharingStatus(), false, false, true, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
|
||||
UpdateCallStatus();
|
||||
|
||||
@@ -1706,12 +1730,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
if (MeetingInfo == null)
|
||||
{
|
||||
MeetingInfo = new MeetingInfo("Waiting For Host", "Waiting For Host", "Waiting For Host", "",
|
||||
GetSharingStatus(), false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
GetSharingStatus(), false, false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
break;
|
||||
}
|
||||
|
||||
MeetingInfo = new MeetingInfo(MeetingInfo.Id, MeetingInfo.Name, MeetingInfo.Host, MeetingInfo.Password,
|
||||
GetSharingStatus(), GetIsHostMyself(), false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
GetSharingStatus(), GetIsHostMyself(), false, false, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1801,7 +1825,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
if (result.Success)
|
||||
{
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", "", true, true, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue);
|
||||
MeetingInfo = new MeetingInfo("", "", "", "", GetSharingStatus(), true, true, MeetingInfo.WaitingForHost, MeetingIsLockedFeedback.BoolValue, MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1935,7 +1959,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
private void SetLayout()
|
||||
private void SetDefaultLayout()
|
||||
{
|
||||
if (!_props.AutoDefaultLayouts) return;
|
||||
|
||||
@@ -1948,8 +1972,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
else
|
||||
{
|
||||
SendText(String.Format("zconfiguration call layout style: {0}",
|
||||
_props.DefaultCallLayout));
|
||||
if (_props.DefaultCallLayout == (_props.DefaultCallLayout & AvailableLayouts))
|
||||
{
|
||||
SendText(String.Format("zconfiguration call layout style: {0}",
|
||||
_props.DefaultCallLayout));
|
||||
}
|
||||
else
|
||||
Debug.Console(0, this, "Unable to set default Layout. {0} not currently an available layout based on meeting state", _props.DefaultCallLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1982,6 +2011,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// </summary>
|
||||
private void GetBookings()
|
||||
{
|
||||
if (_meetingPasswordRequired || _waitingForUserToAcceptOrRejectIncomingCall) return;
|
||||
|
||||
SendText("zCommand Bookings List");
|
||||
}
|
||||
|
||||
@@ -2147,10 +2178,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
!String.Equals(Status.Call.Info.meeting_type,"NORMAL"),
|
||||
false,
|
||||
MeetingIsLockedFeedback.BoolValue,
|
||||
MeetingIsRecordingFeedback.BoolValue
|
||||
MeetingIsRecordingFeedback.BoolValue, Status.Call.CallRecordInfo.AllowRecord
|
||||
);
|
||||
|
||||
SetDefaultLayout();
|
||||
}
|
||||
// TODO [ ] Issue #868
|
||||
|
||||
else if (item.Status == eCodecCallStatus.Disconnected)
|
||||
{
|
||||
MeetingInfo = new MeetingInfo(
|
||||
@@ -2163,19 +2196,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
false, Status.Call.CallRecordInfo.AllowRecord
|
||||
);
|
||||
}
|
||||
|
||||
_meetingPasswordRequired = false;
|
||||
base.OnCallStatusChange(item);
|
||||
|
||||
Debug.Console(1, this, "[OnCallStatusChange] Current Call Status: {0}",
|
||||
Status.Call != null ? Status.Call.Status.ToString() : "no call");
|
||||
|
||||
if (_props.AutoDefaultLayouts)
|
||||
{
|
||||
SetLayout();
|
||||
}
|
||||
}
|
||||
|
||||
private string GetSharingStatus()
|
||||
@@ -2211,6 +2240,42 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateDirectory()
|
||||
{
|
||||
Debug.Console(2, this, "Updating directory");
|
||||
var directoryResults = zStatus.Phonebook.ConvertZoomContactsToGeneric(Status.Phonebook.Contacts);
|
||||
|
||||
if (!PhonebookSyncState.InitialSyncComplete)
|
||||
{
|
||||
PhonebookSyncState.InitialPhonebookFoldersReceived();
|
||||
PhonebookSyncState.PhonebookRootEntriesReceived();
|
||||
PhonebookSyncState.SetPhonebookHasFolders(true);
|
||||
PhonebookSyncState.SetNumberOfContacts(Status.Phonebook.Contacts.Count);
|
||||
}
|
||||
|
||||
directoryResults.ResultsFolderId = "root";
|
||||
|
||||
DirectoryRoot = directoryResults;
|
||||
|
||||
CurrentDirectoryResult = directoryResults;
|
||||
|
||||
//
|
||||
if (contactsDebounceTimer != null)
|
||||
{
|
||||
ClearContactDebounceTimer();
|
||||
}
|
||||
}
|
||||
|
||||
private void ClearContactDebounceTimer()
|
||||
{
|
||||
Debug.Console(2, this, "Clearing Timer");
|
||||
if (!contactsDebounceTimer.Disposed && contactsDebounceTimer != null)
|
||||
{
|
||||
contactsDebounceTimer.Dispose();
|
||||
contactsDebounceTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Will return true if the host is myself (this zoom room)
|
||||
/// </summary>
|
||||
@@ -2243,6 +2308,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts sharing HDMI source
|
||||
/// </summary>
|
||||
public override void StartSharing()
|
||||
{
|
||||
SendText("zCommand Call Sharing HDMI Start");
|
||||
@@ -2388,6 +2456,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
/// <param name="joinMap"></param>
|
||||
public void LinkZoomRoomToApi(BasicTriList trilist, ZoomRoomJoinMap joinMap)
|
||||
{
|
||||
var meetingInfoCodec = this as IHasMeetingInfo;
|
||||
if (meetingInfoCodec != null)
|
||||
{
|
||||
if (meetingInfoCodec.MeetingInfo != null)
|
||||
{
|
||||
trilist.SetBool(joinMap.MeetingCanRecord.JoinNumber, meetingInfoCodec.MeetingInfo.CanRecord);
|
||||
}
|
||||
|
||||
meetingInfoCodec.MeetingInfoChanged += (o, a) =>
|
||||
{
|
||||
trilist.SetBool(joinMap.MeetingCanRecord.JoinNumber, a.Info.CanRecord);
|
||||
};
|
||||
}
|
||||
|
||||
var recordingCodec = this as IHasMeetingRecordingWithPrompt;
|
||||
if (recordingCodec != null)
|
||||
{
|
||||
@@ -2502,13 +2584,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
//trilist.SetString(joinMap.CurrentSource.JoinNumber, args.Info.ShareStatus);
|
||||
};
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.StartMeetingNow.JoinNumber, () => StartMeeting(0));
|
||||
trilist.SetSigTrueAction(joinMap.ShareOnlyMeeting.JoinNumber, StartSharingOnlyMeeting);
|
||||
trilist.SetSigTrueAction(joinMap.StartNormalMeetingFromSharingOnlyMeeting.JoinNumber, StartNormalMeetingFromSharingOnlyMeeting);
|
||||
trilist.SetSigFalseAction(joinMap.StartMeetingNow.JoinNumber, () => StartMeeting(0));
|
||||
trilist.SetSigFalseAction(joinMap.ShareOnlyMeeting.JoinNumber, StartSharingOnlyMeeting);
|
||||
trilist.SetSigFalseAction(joinMap.StartNormalMeetingFromSharingOnlyMeeting.JoinNumber, StartNormalMeetingFromSharingOnlyMeeting);
|
||||
|
||||
trilist.SetStringSigAction(joinMap.SubmitPassword.JoinNumber, SubmitPassword);
|
||||
//trilist.SetSigFalseAction(joinMap.CancelPasswordPrompt.JoinNumber, () =>
|
||||
// OnPasswordRequired(false, false, true, ""));
|
||||
|
||||
// Subscribe to call status to clear ShowPasswordPrompt when in meeting
|
||||
this.CallStatusChange += (o, a) =>
|
||||
@@ -2527,7 +2607,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
PasswordRequired += (devices, args) =>
|
||||
{
|
||||
Debug.Console(0, this, "***********************************PaswordRequired. Message: {0} Cancelled: {1} Last Incorrect: {2} Failed: {3}", args.Message, args.LoginAttemptCancelled, args.LastAttemptWasIncorrect, args.LoginAttemptFailed);
|
||||
Debug.Console(2, this, "***********************************PaswordRequired. Message: {0} Cancelled: {1} Last Incorrect: {2} Failed: {3}", args.Message, args.LoginAttemptCancelled, args.LastAttemptWasIncorrect, args.LoginAttemptFailed);
|
||||
|
||||
if (args.LoginAttemptCancelled)
|
||||
{
|
||||
@@ -2567,7 +2647,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
var wirelessInfoCodec = this as IZoomWirelessShareInstructions;
|
||||
if (wirelessInfoCodec != null)
|
||||
{
|
||||
SetSharingStateJoins(Status.Sharing, trilist, joinMap);
|
||||
if (Status != null && Status.Sharing != null)
|
||||
{
|
||||
SetSharingStateJoins(Status.Sharing, trilist, joinMap);
|
||||
}
|
||||
|
||||
wirelessInfoCodec.ShareInfoChanged += (o, a) =>
|
||||
{
|
||||
@@ -2601,6 +2684,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public void AcceptCall()
|
||||
{
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = false;
|
||||
|
||||
var incomingCall =
|
||||
ActiveCalls.FirstOrDefault(
|
||||
c => c.Status.Equals(eCodecCallStatus.Ringing) && c.Direction.Equals(eCodecCallDirection.Incoming));
|
||||
@@ -2610,6 +2695,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public override void AcceptCall(CodecActiveCallItem call)
|
||||
{
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = false;
|
||||
|
||||
SendText(string.Format("zCommand Call Accept callerJID: {0}", call.Id));
|
||||
|
||||
call.Status = eCodecCallStatus.Connected;
|
||||
@@ -2621,6 +2708,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public void RejectCall()
|
||||
{
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = false;
|
||||
|
||||
var incomingCall =
|
||||
ActiveCalls.FirstOrDefault(
|
||||
c => c.Status.Equals(eCodecCallStatus.Ringing) && c.Direction.Equals(eCodecCallDirection.Incoming));
|
||||
@@ -2630,6 +2719,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public override void RejectCall(CodecActiveCallItem call)
|
||||
{
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = false;
|
||||
|
||||
SendText(string.Format("zCommand Call Reject callerJID: {0}", call.Id));
|
||||
|
||||
call.Status = eCodecCallStatus.Disconnected;
|
||||
@@ -2756,16 +2847,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public void LeaveMeeting()
|
||||
{
|
||||
SendText("zCommand Call Leave");
|
||||
_meetingPasswordRequired = false;
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = false;
|
||||
|
||||
SendText("zCommand Call Leave");
|
||||
}
|
||||
|
||||
public override void EndCall(CodecActiveCallItem call)
|
||||
{
|
||||
_meetingPasswordRequired = false;
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = false;
|
||||
|
||||
SendText("zCommand Call Disconnect");
|
||||
}
|
||||
|
||||
public override void EndAllCalls()
|
||||
{
|
||||
_meetingPasswordRequired = false;
|
||||
_waitingForUserToAcceptOrRejectIncomingCall = false;
|
||||
|
||||
SendText("zCommand Call Disconnect");
|
||||
}
|
||||
|
||||
@@ -3264,7 +3364,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
// There is no property that directly reports if strip mode is valid, but API stipulates
|
||||
// that strip mode is available if the number of screens is 1
|
||||
if (Status.NumberOfScreens.NumOfScreens == 1)
|
||||
if (Status.NumberOfScreens.NumOfScreens == 1 || Status.Layout.can_Switch_Strip_View || Status.Layout.video_type.ToLower() == "strip")
|
||||
{
|
||||
availableLayouts |= zConfiguration.eLayoutStyle.Strip;
|
||||
}
|
||||
@@ -3279,10 +3379,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
var handler = LayoutInfoChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
|
||||
var currentLayout = zConfiguration.eLayoutStyle.None;
|
||||
|
||||
currentLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle), string.IsNullOrEmpty(LocalLayoutFeedback.StringValue) ? "None" : LocalLayoutFeedback.StringValue, true);
|
||||
|
||||
handler(this, new LayoutInfoChangedEventArgs()
|
||||
{
|
||||
AvailableLayouts = AvailableLayouts,
|
||||
CurrentSelectedLayout = (zConfiguration.eLayoutStyle)Enum.Parse(typeof(zConfiguration.eLayoutStyle),string.IsNullOrEmpty(LocalLayoutFeedback.StringValue) ? "None" : LocalLayoutFeedback.StringValue , true),
|
||||
CurrentSelectedLayout = currentLayout,
|
||||
LayoutViewIsOnFirstPage = LayoutViewIsOnFirstPageFeedback.BoolValue,
|
||||
LayoutViewIsOnLastPage = LayoutViewIsOnLastPageFeedback.BoolValue,
|
||||
CanSwapContentWithThumbnail = CanSwapContentWithThumbnailFeedback.BoolValue,
|
||||
@@ -3410,22 +3515,21 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public void SubmitPassword(string password)
|
||||
{
|
||||
_meetingPasswordRequired = false;
|
||||
Debug.Console(2, this, "Password Submitted: {0}", password);
|
||||
Dial(_lastDialedMeetingNumber, password);
|
||||
//OnPasswordRequired(false, false, true, "");
|
||||
}
|
||||
|
||||
public void CancelPasswordPrompt()
|
||||
{
|
||||
OnPasswordRequired(false, false, true, "Login Cancelled");
|
||||
}
|
||||
|
||||
void OnPasswordRequired(bool lastAttemptIncorrect, bool loginFailed, bool loginCancelled, string message)
|
||||
{
|
||||
_meetingPasswordRequired = !loginFailed || !loginCancelled;
|
||||
|
||||
var handler = PasswordRequired;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message));
|
||||
{
|
||||
Debug.Console(2, this, "Meeting Password Required: {0}", _meetingPasswordRequired);
|
||||
|
||||
handler(this, new PasswordPromptEventArgs(lastAttemptIncorrect, loginFailed, loginCancelled, message));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3464,19 +3568,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
StartSharingOnlyMeeting(eSharingMeetingMode.None, 30, String.Empty);
|
||||
}
|
||||
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode mode)
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode)
|
||||
{
|
||||
StartSharingOnlyMeeting(mode, 30, String.Empty);
|
||||
StartSharingOnlyMeeting(displayMode, DefaultMeetingDurationMin, String.Empty);
|
||||
}
|
||||
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration)
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration)
|
||||
{
|
||||
StartSharingOnlyMeeting(mode, duration, String.Empty);
|
||||
StartSharingOnlyMeeting(displayMode, duration, String.Empty);
|
||||
}
|
||||
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode mode, ushort duration, string password)
|
||||
public void StartSharingOnlyMeeting(eSharingMeetingMode displayMode, uint duration, string password)
|
||||
{
|
||||
SendText(String.Format("zCommand Dial Sharing Duration: {0} DisplayState: {1} Password: {2}", duration, mode, password));
|
||||
SendText(String.Format("zCommand Dial Sharing Duration: {0} DisplayState: {1} Password: {2}", duration, displayMode, password));
|
||||
}
|
||||
|
||||
public void StartNormalMeetingFromSharingOnlyMeeting()
|
||||
@@ -3568,6 +3672,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
void OnShareInfoChanged(zStatus.Sharing status)
|
||||
{
|
||||
Debug.Console(2, this,
|
||||
@"ShareInfoChanged:
|
||||
isSharingHDMI: {0}
|
||||
isSharingAirplay: {1}
|
||||
AirplayPassword: {2}
|
||||
OSD Display State: {3}
|
||||
",
|
||||
status.isSharingBlackMagic,
|
||||
status.isAirHostClientConnected,
|
||||
status.password,
|
||||
status.dispState);
|
||||
|
||||
var handler = ShareInfoChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "FB Indicates the password prompt is active",
|
||||
Description = "Pulse to start an ad-hoc meeting with the default duration",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
@@ -373,6 +373,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("MeetingCanRecord")]
|
||||
public JoinDataComplete MeetingCanRecord = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 246,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "When high, indicated that the current meeting can be recorded",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
|
||||
#region Sharing Status
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
@@ -29,11 +30,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
/* This layout will be selected when Sharing starts (either from Far end or locally)*/
|
||||
[JsonProperty("defaultSharingLayout")]
|
||||
public string DefaultSharingLayout { get; set; }
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public zConfiguration.eLayoutStyle DefaultSharingLayout { get; set; }
|
||||
|
||||
//This layout will be selected when a call is connected and no content is being shared
|
||||
[JsonProperty("defaultCallLayout")]
|
||||
public string DefaultCallLayout { get; set; }
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public zConfiguration.eLayoutStyle DefaultCallLayout { get; set; }
|
||||
|
||||
[JsonProperty("minutesBeforeMeetingStart")]
|
||||
public int MinutesBeforeMeetingStart { get; set; }
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<packages>
|
||||
<package id="PepperDashCore" version="1.1.1" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||
<package id="PepperDashCore" version="1.1.4" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||
</packages>
|
||||
Reference in New Issue
Block a user