mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
Merge branch 'development' into feature/dmps-dm-fixes
This commit is contained in:
@@ -708,11 +708,12 @@ namespace PepperDash.Essentials
|
|||||||
IRoutingSink dest = null;
|
IRoutingSink dest = null;
|
||||||
|
|
||||||
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
||||||
dest = DefaultAudioDevice as IRoutingSinkNoSwitching;
|
dest = DefaultAudioDevice as IRoutingSink;
|
||||||
else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
|
else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
|
||||||
dest = DefaultDisplay;
|
dest = DefaultDisplay;
|
||||||
else
|
else
|
||||||
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching;
|
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
|
||||||
|
|
||||||
|
|
||||||
if (dest == null)
|
if (dest == null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -105,9 +105,6 @@ namespace PepperDash.Essentials.Core
|
|||||||
protected void LinkDisplayToApi(DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey,
|
protected void LinkDisplayToApi(DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey,
|
||||||
EiscApiAdvanced bridge)
|
EiscApiAdvanced bridge)
|
||||||
{
|
{
|
||||||
var inputNumber = 0;
|
|
||||||
var inputKeys = new List<string>();
|
|
||||||
|
|
||||||
var joinMap = new DisplayControllerJoinMap(joinStart);
|
var joinMap = new DisplayControllerJoinMap(joinStart);
|
||||||
|
|
||||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
@@ -124,6 +121,11 @@ namespace PepperDash.Essentials.Core
|
|||||||
Debug.Console(0,this,"Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
Debug.Console(0,this,"Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LinkDisplayToApi(displayDevice, trilist, joinMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LinkDisplayToApi(DisplayBase displayDevice, BasicTriList trilist, DisplayControllerJoinMap joinMap)
|
||||||
|
{
|
||||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
|
Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
|
||||||
|
|
||||||
@@ -135,6 +137,9 @@ namespace PepperDash.Essentials.Core
|
|||||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var inputNumber = 0;
|
||||||
|
var inputKeys = new List<string>();
|
||||||
|
|
||||||
var inputNumberFeedback = new IntFeedback(() => inputNumber);
|
var inputNumberFeedback = new IntFeedback(() => inputNumber);
|
||||||
|
|
||||||
// Two way feedbacks
|
// Two way feedbacks
|
||||||
|
|||||||
@@ -89,6 +89,11 @@ namespace PepperDash.Essentials.Core.Lighting
|
|||||||
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return LinkLightingToApi(lightingDevice, trilist, joinMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected GenericLightingJoinMap LinkLightingToApi(LightingBase lightingDevice, BasicTriList trilist, GenericLightingJoinMap joinMap)
|
||||||
|
{
|
||||||
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||||
@@ -99,21 +104,35 @@ namespace PepperDash.Essentials.Core.Lighting
|
|||||||
var sceneIndex = 0;
|
var sceneIndex = 0;
|
||||||
foreach (var scene in lightingDevice.LightingScenes)
|
foreach (var scene in lightingDevice.LightingScenes)
|
||||||
{
|
{
|
||||||
var index1 = sceneIndex;
|
var index = sceneIndex;
|
||||||
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () =>
|
|
||||||
{
|
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + index), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[index]));
|
||||||
var index = index1;
|
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + index)]);
|
||||||
Debug.Console(2, this, "LightingDevice: sceneIndex: {0} index: {1} > inside action", index1, index);
|
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + index)].StringValue = scene.Name;
|
||||||
lightingDevice.SelectScene(lightingDevice.LightingScenes[index]);
|
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + index)].BoolValue = true;
|
||||||
});
|
|
||||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]);
|
|
||||||
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
|
|
||||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
|
|
||||||
sceneIndex++;
|
sceneIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += (sender, args) =>
|
||||||
|
{
|
||||||
|
if (!args.DeviceOnLine) return;
|
||||||
|
|
||||||
|
sceneIndex = 0;
|
||||||
|
foreach (var scene in lightingDevice.LightingScenes)
|
||||||
|
{
|
||||||
|
var index = sceneIndex;
|
||||||
|
|
||||||
|
trilist.StringInput[(uint) (joinMap.SelectSceneDirect.JoinNumber + index)].StringValue = scene.Name;
|
||||||
|
trilist.BooleanInput[(uint) (joinMap.ButtonVisibility.JoinNumber + index)].BoolValue = true;
|
||||||
|
scene.IsActiveFeedback.FireUpdate();
|
||||||
|
|
||||||
|
sceneIndex++;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return joinMap;
|
return joinMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LightingScene
|
public class LightingScene
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Core
|
|||||||
Type = type;
|
Type = type;
|
||||||
ConnectionType = connType;
|
ConnectionType = connType;
|
||||||
Selector = selector;
|
Selector = selector;
|
||||||
IsInternal = IsInternal;
|
IsInternal = isInternal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
|
using Crestron.SimplSharp.Reflection;
|
||||||
using Crestron.SimplSharp.Ssh;
|
using Crestron.SimplSharp.Ssh;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
@@ -462,10 +463,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
}
|
}
|
||||||
|
|
||||||
SharingContentIsOnFeedback.FireUpdate();
|
SharingContentIsOnFeedback.FireUpdate();
|
||||||
|
|
||||||
trilist.SetBool(joinMap.HookState.JoinNumber, IsInCall);
|
|
||||||
|
|
||||||
trilist.SetString(joinMap.CurrentCallData.JoinNumber, UpdateCallStatusXSig());
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1015,7 +1012,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
||||||
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
||||||
var directoryXSig = UpdateDirectoryXSig(codec.DirectoryRoot, !codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
|
var directoryXSig = UpdateDirectoryXSig(codec.DirectoryRoot, codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false);
|
||||||
|
|
||||||
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
|
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
|
||||||
|
|
||||||
@@ -1030,7 +1027,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
||||||
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
||||||
var directoryXSig = UpdateDirectoryXSig(args.Directory, !codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
|
var directoryXSig = UpdateDirectoryXSig(args.Directory, codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false);
|
||||||
|
|
||||||
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
|
Debug.Console(2, this, "Directory XSig Length: {0}", directoryXSig.Length);
|
||||||
|
|
||||||
@@ -1041,10 +1038,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
if (!args.DeviceOnLine) return;
|
if (!args.DeviceOnLine) return;
|
||||||
|
|
||||||
// TODO [ ] Issue #868
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
trilist.SetString(joinMap.DirectoryEntries.JoinNumber, "\xFC");
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber,
|
||||||
UpdateDirectoryXSig(codec.CurrentDirectoryResult,
|
Encoding.GetEncoding(XSigEncoding).GetString(clearBytes, 0, clearBytes.Length));
|
||||||
!codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue);
|
var directoryXSig = UpdateDirectoryXSig(codec.DirectoryRoot, codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false);
|
||||||
|
trilist.SetString(joinMap.DirectoryEntries.JoinNumber, directoryXSig);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1185,29 +1183,42 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
|
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
|
||||||
{
|
{
|
||||||
var contactIndex = 1;
|
var xSigMaxIndex = 1023;
|
||||||
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count];
|
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
|
? xSigMaxIndex
|
||||||
|
: directory.CurrentDirectoryResults.Count];
|
||||||
|
|
||||||
Debug.Console(2, this, "Is root {0} Directory Count: {1}", isRoot, directory.CurrentDirectoryResults.Count);
|
Debug.Console(2, this, "IsRoot: {0}, Directory Count: {1}, TokenArray.Length: {2}", isRoot, directory.CurrentDirectoryResults.Count, tokenArray.Length);
|
||||||
|
|
||||||
foreach (var entry in directory.CurrentDirectoryResults)
|
var contacts = directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
|
? directory.CurrentDirectoryResults.Take(xSigMaxIndex)
|
||||||
|
: directory.CurrentDirectoryResults;
|
||||||
|
|
||||||
|
var contactsToDisplay = isRoot
|
||||||
|
? contacts.Where(c => c.ParentFolderId == "root")
|
||||||
|
: contacts.Where(c => c.ParentFolderId != "root");
|
||||||
|
|
||||||
|
var counterIndex = 1;
|
||||||
|
foreach (var entry in contactsToDisplay)
|
||||||
{
|
{
|
||||||
var arrayIndex = contactIndex - 1;
|
var arrayIndex = counterIndex - 1;
|
||||||
|
var entryIndex = counterIndex;
|
||||||
|
|
||||||
Debug.Console(2, this, "Entry Name: {0}, Folder ID: {1}", entry.Name, entry.FolderId);
|
Debug.Console(2, this, "Entry{2:0000} Name: {0}, Folder ID: {1}, Type: {3}, ParentFolderId: {4}",
|
||||||
|
entry.Name, entry.FolderId, entryIndex, entry.GetType().GetCType().FullName, entry.ParentFolderId);
|
||||||
|
|
||||||
if (entry is DirectoryFolder && entry.ParentFolderId == "root")
|
if (entry is DirectoryFolder)
|
||||||
{
|
{
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(contactIndex, String.Format("[+] {0}", entry.Name));
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, String.Format("[+] {0}", entry.Name));
|
||||||
|
|
||||||
contactIndex++;
|
counterIndex++;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(contactIndex, entry.Name);
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, entry.Name);
|
||||||
|
|
||||||
contactIndex++;
|
counterIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetXSigString(tokenArray);
|
return GetXSigString(tokenArray);
|
||||||
@@ -1351,9 +1362,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
{
|
{
|
||||||
if (!args.DeviceOnLine) return;
|
if (!args.DeviceOnLine) return;
|
||||||
|
|
||||||
// TODO [ ] Issue #868
|
// TODO [ ] #983
|
||||||
|
Debug.Console(0, this, "LinkVideoCodecCallControlsToApi: device is {0}, IsInCall {1}", args.DeviceOnLine ? "online" : "offline", IsInCall);
|
||||||
|
trilist.SetBool(joinMap.HookState.JoinNumber, IsInCall);
|
||||||
trilist.SetString(joinMap.CurrentCallData.JoinNumber, "\xFC");
|
trilist.SetString(joinMap.CurrentCallData.JoinNumber, "\xFC");
|
||||||
UpdateCallStatusXSig();
|
trilist.SetString(joinMap.CurrentCallData.JoinNumber, UpdateCallStatusXSig());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2729,7 +2729,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
Debug.Console(2, this, "OnDirectoryResultReturned. Result has {0} contacts", result.Contacts.Count);
|
Debug.Console(2, this, "OnDirectoryResultReturned. Result has {0} contacts", result.Contacts.Count);
|
||||||
|
|
||||||
|
CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
|
||||||
|
|
||||||
var directoryResult = result;
|
var directoryResult = result;
|
||||||
|
var directoryIsRoot = CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false;
|
||||||
|
|
||||||
// If result is Root, create a copy and filter out contacts whose parent folder is not root
|
// If result is Root, create a copy and filter out contacts whose parent folder is not root
|
||||||
//if (!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
|
//if (!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue)
|
||||||
@@ -2747,7 +2750,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
Debug.Console(2, this, "Updating directoryResult. IsOnRoot: {0} Contact Count: {1}",
|
Debug.Console(2, this, "Updating directoryResult. IsOnRoot: {0} Contact Count: {1}",
|
||||||
!CurrentDirectoryResultIsNotDirectoryRoot.BoolValue, directoryResult.Contacts.Count);
|
directoryIsRoot, directoryResult.Contacts.Count);
|
||||||
|
|
||||||
// This will return the latest results to all UIs. Multiple indendent UI Directory browsing will require a different methodology
|
// This will return the latest results to all UIs. Multiple indendent UI Directory browsing will require a different methodology
|
||||||
var handler = DirectoryResultReturned;
|
var handler = DirectoryResultReturned;
|
||||||
@@ -2756,11 +2759,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
handler(this, new DirectoryEventArgs
|
handler(this, new DirectoryEventArgs
|
||||||
{
|
{
|
||||||
Directory = directoryResult,
|
Directory = directoryResult,
|
||||||
DirectoryIsOnRoot = !CurrentDirectoryResultIsNotDirectoryRoot.BoolValue
|
DirectoryIsOnRoot = directoryIsRoot
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user