diff --git a/PepperDashEssentials/AppServer/CotijaSystemController.cs b/PepperDashEssentials/AppServer/CotijaSystemController.cs index 23af9779..75592e38 100644 --- a/PepperDashEssentials/AppServer/CotijaSystemController.cs +++ b/PepperDashEssentials/AppServer/CotijaSystemController.cs @@ -17,6 +17,7 @@ using PepperDash.Core; using PepperDash.Essentials.Core; using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Room.Cotija; +using PepperDash.Essentials.AppServer.Messengers; namespace PepperDash.Essentials { @@ -39,6 +40,8 @@ namespace PepperDash.Essentials Dictionary PushedActions = new Dictionary(); + public ConfigMessenger ConfigMessenger { get; private set; } + CTimer ServerHeartbeatCheckTimer; long ServerHeartbeatInterval = 20000; @@ -49,7 +52,7 @@ namespace PepperDash.Essentials DateTime LastAckMessage; - string SystemUuid; + public string SystemUuid; List RoomBridges = new List(); @@ -97,9 +100,15 @@ namespace PepperDash.Essentials CrestronConsole.AddNewConsoleCommand(s => CleanUpWebsocketClient(), "mobiledisco", "Disconnects websocket", ConsoleAccessLevelEnum.AccessOperator); + CrestronConsole.AddNewConsoleCommand(s => ParseStreamRx(s), "mobilesimulateaction", "Simulates a message from the server", ConsoleAccessLevelEnum.AccessOperator); + CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler); CrestronEnvironment.EthernetEventHandler += new EthernetEventHandler(CrestronEnvironment_EthernetEventHandler); - + + // Config Messenger + var cmKey = Key + "-config"; + ConfigMessenger = new ConfigMessenger(cmKey, "/config"); + ConfigMessenger.RegisterWithAppServer(this); } /// @@ -138,7 +147,9 @@ namespace PepperDash.Essentials /// void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType) { - if (programEventType == eProgramStatusEventType.Stopping && WSClient.Connected) + if (programEventType == eProgramStatusEventType.Stopping + && WSClient != null + && WSClient.Connected) { CleanUpWebsocketClient(); } @@ -315,10 +326,12 @@ namespace PepperDash.Essentials CrestronConsole.ConsoleCommandResponse(@"Mobile Control Information: Server address: {0} System Name: {1} - System UUID: {2} - System User code: {3} - Connected?: {4} - Seconds Since Last Ack: {5}", url, name, SystemUuid, + System URL: {2} + System UUID: {3} + System User code: {4} + Connected?: {5} + Seconds Since Last Ack: {6}" + , url, name, ConfigReader.ConfigObject.SystemUrl, SystemUuid, code, conn, secSinceLastAck.Seconds); } @@ -448,9 +461,9 @@ namespace PepperDash.Essentials Debug.Console(1, this, "Socket send result error: {0}", result); } } - else if (!WSClient.Connected) + else if (WSClient == null) { - Debug.Console(1, this, "Cannot send. Not connected {0}"); + Debug.Console(1, this, "Cannot send. Not connected."); } } diff --git a/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs new file mode 100644 index 00000000..1e3cfa12 --- /dev/null +++ b/PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; + +using PepperDash.Core; +using PepperDash.Essentials.Core.Config; + +namespace PepperDash.Essentials.AppServer.Messengers +{ + + /// + /// Handles interactions with the app server to update the config + /// + public class ConfigMessenger : MessengerBase + { + public ConfigMessenger(string key, string messagePath) + : base(key, messagePath) + { + ConfigUpdater.ConfigStatusChanged -= ConfigUpdater_ConfigStatusChanged; + ConfigUpdater.ConfigStatusChanged += new EventHandler(ConfigUpdater_ConfigStatusChanged); + } + + void ConfigUpdater_ConfigStatusChanged(object sender, ConfigStatusEventArgs e) + { + PostUpdateStatus(e.UpdateStatus.ToString()); + } + + protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController) + { + appServerController.AddAction(MessagePath + "/updateConfig", new Action(s => GetConfigFile(s))); + } + + /// + /// Generates or passes the URL to make the request to GET the config from a server + /// + /// + void GetConfigFile(string url) + { + try + { + // Attempt to parse the URL + var parser = new Crestron.SimplSharp.Net.Http.UrlParser(url); + + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Successfully parsed URL from AppServer message: {0}", parser.Url); + } + catch (Exception e) + { + // If unable to parse the URL, generate it from config data + Debug.Console(2, "Error parsing URL: {0}", e); + + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Unable to parse URL from AppServer message. Generating URL from config data"); + url = string.Format("http://{0}/api/system/{1}/config", AppServerController.Config.ServerUrl, AppServerController.SystemUuid); + } + + ConfigUpdater.GetConfigFromServer(url); + } + + /// + /// Posts a message with the current status of the config update + /// + /// + void PostUpdateStatus(string status) + { + PostStatusMessage(new + { + updateStatus = status + }); + } + + } + + +} \ No newline at end of file diff --git a/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs b/PepperDashEssentials/AppServer/Messengers/Ddvc01AtcMessenger.cs similarity index 92% rename from PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs rename to PepperDashEssentials/AppServer/Messengers/Ddvc01AtcMessenger.cs index 8e28d995..b578018b 100644 --- a/PepperDashEssentials/AppServer/Messengers/AtcDdvc01Messenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/Ddvc01AtcMessenger.cs @@ -16,12 +16,33 @@ namespace PepperDash.Essentials.AppServer.Messengers { BasicTriList EISC; + /// + /// 221 + /// const uint BDialHangup = 221; + /// + /// 251 + /// const uint BIncomingAnswer = 251; + /// + /// 252 + /// const uint BIncomingReject = 252; + /// + /// 241 + /// const uint BSpeedDial1 = 241; + /// + /// 242 + /// const uint BSpeedDial2 = 242; + /// + /// 243 + /// const uint BSpeedDial3 = 243; + /// + /// 244 + /// const uint BSpeedDial4 = 244; /// @@ -46,7 +67,7 @@ namespace PepperDash.Essentials.AppServer.Messengers const uint SCallDirection = 222; /// - /// + /// 201-212 0-9*# /// Dictionary DTMFMap = new Dictionary { @@ -64,6 +85,9 @@ namespace PepperDash.Essentials.AppServer.Messengers { "#", 212 }, }; + /// + /// + /// CodecActiveCallItem CurrentCallItem; @@ -160,6 +184,9 @@ namespace PepperDash.Essentials.AppServer.Messengers })); } + /// + /// + /// void SendCallsList() { PostStatusMessage(new diff --git a/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs b/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs new file mode 100644 index 00000000..d6f20ab4 --- /dev/null +++ b/PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs @@ -0,0 +1,604 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Crestron.SimplSharp; +using Crestron.SimplSharpPro.DeviceSupport; +using Crestron.SimplSharpPro.EthernetCommunication; + +using PepperDash.Core; +using PepperDash.Essentials.Core; +using PepperDash.Essentials.Devices.Common.Codec; + +namespace PepperDash.Essentials.AppServer.Messengers +{ + public class Ddvc01VtcMessenger : MessengerBase + { + BasicTriList EISC; + + /********* Bools *********/ + /// + /// 724 + /// + const uint BDialHangup = 724; + /// + /// 750 + /// + const uint BCallIncoming = 750; + /// + /// 751 + /// + const uint BIncomingAnswer = 751; + /// + /// 752 + /// + const uint BIncomingReject = 752; + /// + /// 741 + /// + const uint BSpeedDial1 = 741; + /// + /// 742 + /// + const uint BSpeedDial2 = 742; + /// + /// 743 + /// + const uint BSpeedDial3 = 743; + /// + /// 744 + /// + const uint BSpeedDial4 = 744; + /// + /// 800 + /// + const uint BDirectorySearchBusy = 800; + /// + /// 801 + /// + const uint BDirectoryLineSelected = 801; + /// + /// 801 when selected entry is a contact + /// + const uint BDirectoryEntryIsContact = 801; + /// + /// 802 To show/hide back button + /// + const uint BDirectoryIsRoot = 802; + /// + /// 803 Pulse from system to inform us when directory is ready + /// + const uint DDirectoryHasChanged = 803; + /// + /// 804 + /// + const uint BDirectoryRoot = 804; + /// + /// 805 + /// + const uint BDirectoryFolderBack = 805; + /// + /// 806 + /// + const uint BDirectoryDialSelectedLine = 806; + /// + /// 811 + /// + const uint BCameraControlUp = 811; + /// + /// 812 + /// + const uint BCameraControlDown = 812; + /// + /// 813 + /// + const uint BCameraControlLeft = 813; + /// + /// 814 + /// + const uint BCameraControlRight = 814; + /// + /// 815 + /// + const uint BCameraControlZoomIn = 815; + /// + /// 816 + /// + const uint BCameraControlZoomOut = 816; + /// + /// 821 - 826 + /// + const uint BCameraPresetStart = 821; + + /// + /// 831 + /// + const uint BCameraModeAuto = 831; + /// + /// 832 + /// + const uint BCameraModeManual = 832; + /// + /// 833 + /// + const uint BCameraModeOff = 833; + + + + /********* Ushorts *********/ + /// + /// 760 + /// + const uint UCameraNumberSelect = 760; + /// + /// 801 + /// + const uint UDirectorySelectRow = 801; + /// + /// 801 + /// + const uint UDirectoryRowCount = 801; + + + + /********* Strings *********/ + /// + /// 701 + /// + const uint SCurrentDialString = 701; + /// + /// 702 + /// + const uint SCurrentCallName = 702; + /// + /// 703 + /// + const uint SCurrentCallNumber = 703; + /// + /// 731 + /// + const uint SHookState = 731; + /// + /// 722 + /// + const uint SCallDirection = 722; + /// + /// 751 + /// + const uint SIncomingCallName = 751; + /// + /// 752 + /// + const uint SIncomingCallNumber = 752; + + /// + /// 800 + /// + const uint SDirectorySearchString = 800; + /// + /// 801-1055 + /// + const uint SDirectoryEntriesStart = 801; + /// + /// 1056 + /// + const uint SDirectoryEntrySelectedName = 1056; + /// + /// 1057 + /// + const uint SDirectoryEntrySelectedNumber = 1057; + /// + /// 1058 + /// + const uint SDirectorySelectedFolderName = 1058; + + + /// + /// 701-712 0-9*# + /// + Dictionary DTMFMap = new Dictionary + { + { "1", 701 }, + { "2", 702 }, + { "3", 703 }, + { "4", 704 }, + { "5", 705 }, + { "6", 706 }, + { "7", 707 }, + { "8", 708 }, + { "9", 709 }, + { "0", 710 }, + { "*", 711 }, + { "#", 712 }, + }; + + CodecActiveCallItem CurrentCallItem; + CodecActiveCallItem IncomingCallItem; + + ushort PreviousDirectoryLength = 0; + + /// + /// + /// + /// + /// + public Ddvc01VtcMessenger(string key, BasicTriList eisc, string messagePath) + : base(key, messagePath) + { + EISC = eisc; + + CurrentCallItem = new CodecActiveCallItem(); + CurrentCallItem.Type = eCodecCallType.Video; + CurrentCallItem.Id = "-video-"; + } + + /// + /// + /// + /// + protected override void CustomRegisterWithAppServer(CotijaSystemController appServerController) + { + var asc = appServerController; + EISC.SetStringSigAction(SHookState, s => + { + CurrentCallItem.Status = (eCodecCallStatus)Enum.Parse(typeof(eCodecCallStatus), s, true); + PostFullStatus(); // SendCallsList(); + }); + + EISC.SetStringSigAction(SCurrentCallNumber, s => + { + CurrentCallItem.Number = s; + PostCallsList(); + }); + + EISC.SetStringSigAction(SCurrentCallName, s => + { + CurrentCallItem.Name = s; + PostCallsList(); + }); + + EISC.SetStringSigAction(SCallDirection, s => + { + CurrentCallItem.Direction = (eCodecCallDirection)Enum.Parse(typeof(eCodecCallDirection), s, true); + PostCallsList(); + }); + + EISC.SetBoolSigAction(BCallIncoming, b => + { + if (b) + { + var ica = new CodecActiveCallItem() + { + Direction = eCodecCallDirection.Incoming, + Id = "-video-incoming", + Name = EISC.GetString(SIncomingCallName), + Number = EISC.GetString(SIncomingCallNumber), + Status = eCodecCallStatus.Ringing, + Type = eCodecCallType.Video + }; + IncomingCallItem = ica; + } + else + { + IncomingCallItem = null; + } + PostCallsList(); + }); + + // Directory insanity + EISC.SetUShortSigAction(UDirectoryRowCount, u => + { + // The length of the list comes in before the list does. + // Splice the sig change operation onto the last string sig that will be changing + // when the directory entries make it through. + if (PreviousDirectoryLength > 0) + { + EISC.ClearStringSigAction(SDirectoryEntriesStart + PreviousDirectoryLength - 1); + } + EISC.SetStringSigAction(SDirectoryEntriesStart + u - 1, s => PostDirectory()); + PreviousDirectoryLength = u; + }); + + EISC.SetStringSigAction(SDirectoryEntrySelectedName, s => + { + PostStatusMessage(new + { + directoryContactSelected = new + { + name = EISC.GetString(SDirectoryEntrySelectedName), + } + }); + }); + + EISC.SetStringSigAction(SDirectoryEntrySelectedNumber, s => + { + PostStatusMessage(new + { + directoryContactSelected = new + { + number = EISC.GetString(SDirectoryEntrySelectedNumber), + } + }); + }); + + EISC.SetStringSigAction(SDirectorySelectedFolderName, s => PostStatusMessage(new + { + directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName) + })); + + EISC.SetSigTrueAction(BCameraModeAuto, () => PostCameraMode()); + EISC.SetSigTrueAction(BCameraModeManual, () => PostCameraMode()); + EISC.SetSigTrueAction(BCameraModeOff, () => PostCameraMode()); + + EISC.SetUShortSigAction(UCameraNumberSelect, (u) => PostSelectedCamera()); + + + // Add press and holds using helper action + Action addPHAction = (s, u) => + AppServerController.AddAction(MessagePath + s, new PressAndHoldAction(b => EISC.SetBool(u, b))); + addPHAction("/cameraUp", BCameraControlUp); + addPHAction("/cameraDown", BCameraControlDown); + addPHAction("/cameraLeft", BCameraControlLeft); + addPHAction("/cameraRight", BCameraControlRight); + addPHAction("/cameraZoomIn", BCameraControlZoomIn); + addPHAction("/cameraZoomOut", BCameraControlZoomOut); + + // Add straight pulse calls using helper action + Action addAction = (s, u) => + AppServerController.AddAction(MessagePath + s, new Action(() => EISC.PulseBool(u, 100))); + addAction("/endCallById", BDialHangup); + addAction("/acceptById", BIncomingAnswer); + addAction("/rejectById", BIncomingReject); + addAction("/speedDial1", BSpeedDial1); + addAction("/speedDial2", BSpeedDial2); + addAction("/speedDial3", BSpeedDial3); + addAction("/speedDial4", BSpeedDial4); + addAction("/cameraModeAuto", BCameraModeAuto); + addAction("/cameraModeManual", BCameraModeManual); + addAction("/cameraModeOff", BCameraModeOff); + + asc.AddAction("/cameraSelect", new Action(SelectCamera)); + + // camera presets + for(uint i = 0; i < 6; i++) + { + addAction("/cameraPreset" + (i + 1), BCameraPresetStart + i); + } + + asc.AddAction(MessagePath + "/isReady", new Action(PostIsReady)); + // Get status + asc.AddAction(MessagePath + "/fullStatus", new Action(PostFullStatus)); + // Dial on string + asc.AddAction(MessagePath + "/dial", new Action(s => + EISC.SetString(SCurrentDialString, s))); + // Pulse DTMF + asc.AddAction(MessagePath + "/dtmf", new Action(s => + { + if (DTMFMap.ContainsKey(s)) + { + EISC.PulseBool(DTMFMap[s], 100); + } + })); + + // Directory madness + asc.AddAction(MessagePath + "/directoryRoot", new Action(() => EISC.PulseBool(BDirectoryRoot))); + asc.AddAction(MessagePath + "/directoryBack", new Action(() => EISC.PulseBool(BDirectoryFolderBack))); + asc.AddAction(MessagePath + "/directoryById", new Action(s => + { + // the id should contain the line number to forward to simpl + try + { + var u = ushort.Parse(s); + EISC.SetUshort(UDirectorySelectRow, u); + EISC.PulseBool(BDirectoryLineSelected); + } + catch (Exception) + { + Debug.Console(1, this, Debug.ErrorLogLevel.Warning, + "/directoryById request contains non-numeric ID incompatible with DDVC bridge"); + } + + })); + asc.AddAction(MessagePath + "/directorySelectContact", new Action(s => + { + try + { + var u = ushort.Parse(s); + EISC.SetUshort(UDirectorySelectRow, u); + EISC.PulseBool(BDirectoryLineSelected); + } + catch + { + + } + })); + asc.AddAction(MessagePath + "/directoryDialContact", new Action(() => { + EISC.PulseBool(BDirectoryDialSelectedLine); + })); + asc.AddAction(MessagePath + "/getDirectory", new Action(() => + { + if (EISC.GetUshort(UDirectoryRowCount) > 0) + { + PostDirectory(); + } + else + { + EISC.PulseBool(BDirectoryRoot); + } + })); + } + + /// + /// + /// + void PostFullStatus() + { + this.PostStatusMessage(new + { + calls = GetCurrentCallList(), + cameraMode = GetCameraMode(), + currentCallString = EISC.GetString(SCurrentCallNumber), + currentDialString = EISC.GetString(SCurrentDialString), + directoryContactSelected = new + { + name = EISC.GetString(SDirectoryEntrySelectedName), + number = EISC.GetString(SDirectoryEntrySelectedNumber) + }, + directorySelectedFolderName = EISC.GetString(SDirectorySelectedFolderName), + isInCall = EISC.GetString(SHookState) == "Connected", + hasDirectory = true, + hasDirectorySearch = false, + hasRecents = true, + hasCameras = true, + selectedCamera = GetSelectedCamera(), + }); + } + + /// + /// + /// + void PostDirectory() + { + var u = EISC.GetUshort(UDirectoryRowCount); + var items = new List(); + for (uint i = 0; i < u; i++) + { + var name = EISC.GetString(SDirectoryEntriesStart + i); + var id = (i + 1).ToString(); + // is folder or contact? + if (name.StartsWith("[+]")) + { + items.Add(new + { + folderId = id, + name = name + }); + } + else + { + items.Add(new + { + contactId = id, + name = name + }); + } + } + + var directoryMessage = new + { + currentDirectory = new + { + isRootDirectory = EISC.GetBool(BDirectoryIsRoot), + directoryResults = items + } + }; + PostStatusMessage(directoryMessage); + } + + /// + /// + /// + void PostCameraMode() + { + PostStatusMessage(new + { + cameraMode = GetCameraMode() + }); + } + + /// + /// + /// + /// + string GetCameraMode() + { + string m; + if (EISC.GetBool(BCameraModeAuto)) m = "auto"; + else if (EISC.GetBool(BCameraModeManual)) m = "manual"; + else m = "off"; + return m; + } + + void PostSelectedCamera() + { + PostStatusMessage(new + { + selectedCamera = GetSelectedCamera() + }); + } + + /// + /// + /// + string GetSelectedCamera() + { + var num = EISC.GetUshort(UCameraNumberSelect); + string m; + if (num == 100) + { + m = "cameraFar"; + } + else + { + m = "camera" + num; + } + return m; + } + + /// + /// + /// + void PostIsReady() + { + PostStatusMessage(new + { + isReady = true + }); + } + + /// + /// + /// + void PostCallsList() + { + PostStatusMessage(new + { + calls = GetCurrentCallList(), + }); + } + + /// + /// + /// + /// + void SelectCamera(string s) + { + var cam = s.Substring(6); + if (cam.ToLower() == "far") + { + EISC.SetUshort(UCameraNumberSelect, 100); + } + else + { + EISC.SetUshort(UCameraNumberSelect, UInt16.Parse(cam)); + } + } + + /// + /// Turns the + /// + /// + List GetCurrentCallList() + { + var list = new List(); + if (CurrentCallItem.Status != eCodecCallStatus.Disconnected) + { + list.Add(CurrentCallItem); + } + if (EISC.GetBool(BCallIncoming)) { + + } + return list; + } + } +} \ No newline at end of file diff --git a/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs b/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs index 7b56ab29..12107ff5 100644 --- a/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/SystemMonitorMessenger.cs @@ -40,8 +40,11 @@ namespace PepperDash.Essentials.AppServer.Messengers /// void ProgramInfoChanged(object sender, ProgramInfoEventArgs e) { - Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString()); - PostStatusMessage(e.ProgramInfo); + if (e.ProgramInfo != null) + { + //Debug.Console(1, "Posting Status Message: {0}", e.ProgramInfo.ToString()); + PostStatusMessage(e.ProgramInfo); + } } /// diff --git a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs index 5e545aac..b8ca2dac 100644 --- a/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs +++ b/PepperDashEssentials/AppServer/Messengers/VideoCodecBaseMessenger.cs @@ -40,6 +40,7 @@ namespace PepperDash.Essentials.AppServer.Messengers if (dirCodec != null) { dirCodec.DirectoryResultReturned += new EventHandler(dirCodec_DirectoryResultReturned); + } var recCodec = codec as IHasCallHistory; @@ -74,12 +75,73 @@ namespace PepperDash.Essentials.AppServer.Messengers /// void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e) { - PostStatusMessage(new - { - currentDirectory = e.Directory - }); + SendDirectory((Codec as IHasDirectory).CurrentDirectoryResult, e.DirectoryIsOnRoot); } + /// + /// Posts the current directory + /// + void SendDirectory(CodecDirectory directory, bool isRoot) + { + var dirCodec = Codec as IHasDirectory; + + if (dirCodec != null) + { + var prefixedDirectoryResults = PrefixDirectoryFolderItems(directory); + + var directoryMessage = new + { + currentDirectory = new + { + directoryResults = prefixedDirectoryResults, + isRootDirectory = isRoot + } + }; + PostStatusMessage(directoryMessage); + } + } + + /// + /// Iterates a directory object and prefixes any folder items with "[+] " + /// + /// + /// + List PrefixDirectoryFolderItems (CodecDirectory directory) + { + var tempDirectoryList = new List(); + + if (directory.CurrentDirectoryResults.Count > 0) + { + foreach (var item in directory.CurrentDirectoryResults) + { + if (item is DirectoryFolder) + { + var newFolder = new DirectoryFolder(); + + newFolder = (DirectoryFolder)item.Clone(); + + string prefixName = "[+] " + newFolder.Name; + + newFolder.Name = prefixName; + + tempDirectoryList.Add(newFolder); + } + else + { + tempDirectoryList.Add(item); + } + } + } + //else + //{ + // DirectoryItem noResults = new DirectoryItem() { Name = "No Results Found" }; + + // tempDirectoryList.Add(noResults); + //} + + return tempDirectoryList; + } + /// /// /// @@ -122,10 +184,24 @@ namespace PepperDash.Essentials.AppServer.Messengers if (call != null) Codec.AcceptCall(call); })); - appServerController.AddAction(MessagePath + "/directoryRoot", new Action(GetDirectoryRoot)); - appServerController.AddAction(MessagePath + "/directoryById", new Action(s => GetDirectory(s))); - appServerController.AddAction(MessagePath + "/directorySearch", new Action(s => DirectorySearch(s))); - appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory)); + + // Directory actions + var dirCodec = Codec as IHasDirectory; + if (dirCodec != null) + { + appServerController.AddAction(MessagePath + "/getDirectory", new Action(GetDirectoryRoot)); + appServerController.AddAction(MessagePath + "/directoryById", new Action(s => GetDirectory(s))); + appServerController.AddAction(MessagePath + "/directorySearch", new Action(s => DirectorySearch(s))); + appServerController.AddAction(MessagePath + "/directoryBack", new Action(GetPreviousDirectory)); + } + + // History actions + var recCodec = Codec as IHasCallHistory; + if (recCodec != null) + { + appServerController.AddAction(MessagePath + "/getCallHistory", new Action(GetCallHistory)); + } + appServerController.AddAction(MessagePath + "/privacyModeOn", new Action(Codec.PrivacyModeOn)); appServerController.AddAction(MessagePath + "/privacyModeOff", new Action(Codec.PrivacyModeOff)); appServerController.AddAction(MessagePath + "/privacyModeToggle", new Action(Codec.PrivacyModeToggle)); @@ -215,12 +291,28 @@ namespace PepperDash.Essentials.AppServer.Messengers return; } - PostStatusMessage(new - { - currentDirectory = dirCodec.DirectoryRoot - }); + dirCodec.SetCurrentDirectoryToRoot(); + + //PostStatusMessage(new + //{ + // currentDirectory = dirCodec.DirectoryRoot + //}); } + /// + /// Requests the parent folder contents + /// + void GetPreviousDirectory() + { + var dirCodec = Codec as IHasDirectory; + if (dirCodec == null) + { + return; + } + + dirCodec.GetDirectoryParentFolderContents(); + } + /// /// Handler for codec changes /// @@ -271,6 +363,7 @@ namespace PepperDash.Essentials.AppServer.Messengers }, showSelfViewByDefault = Codec.ShowSelfViewByDefault, hasDirectory = Codec is IHasDirectory, + hasDirectorySearch = true, hasRecents = Codec is IHasCallHistory, hasCameras = Codec is IHasCameraControl }); diff --git a/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs b/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs index 55c1f61b..fdd73989 100644 --- a/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs +++ b/PepperDashEssentials/AppServer/RoomBridges/CotijaDdvc01RoomBridge.cs @@ -56,7 +56,10 @@ namespace PepperDash.Essentials.Room.Cotija /// 1 /// public const uint MasterVolumeMuteToggle = 1; - + /// + /// 1 + /// + public const uint VolumeMutesJoinStart = 1; /// /// 61 /// @@ -72,7 +75,7 @@ namespace PepperDash.Essentials.Room.Cotija /// /// 72 /// - public const uint SourceHasChanged = 72; + public const uint SourceHasChanged = 71; /// /// 261 - The start of the range of speed dial visibles /// @@ -81,6 +84,11 @@ namespace PepperDash.Essentials.Room.Cotija /// 501 /// public const uint ConfigIsReady = 501; + /// + /// 601 + /// + public const uint SourceShareDisableStartJoin = 601; + } public class UshortJoin @@ -89,15 +97,26 @@ namespace PepperDash.Essentials.Room.Cotija /// 1 /// public const uint MasterVolumeLevel = 1; - + /// + /// 1 + /// + public const uint VolumeSlidersJoinStart = 1; /// /// 61 /// public const uint ShutdownPromptDuration = 61; + /// + /// 101 + /// + public const uint VolumeSliderCount = 101; } public class StringJoin { + /// + /// 1 + /// + public const uint VolumeSliderNamesJoinStart = 1; /// /// 71 /// @@ -141,6 +160,38 @@ namespace PepperDash.Essentials.Room.Cotija /// 402 /// public const uint ServerUrl = 402; + /// + /// 512 + /// + public const uint RoomSpeedDialNamesJoinStart = 512; + /// + /// 516 + /// + public const uint RoomSpeedDialNumberssJoinStart = 516; + /// + /// 601 + /// + public const uint SourceNameJoinStart = 601; + /// + /// 621 + /// + public const uint SourceIconJoinStart = 621; + /// + /// 641 + /// + public const uint SourceKeyJoinStart = 641; + /// + /// 661 + /// + public const uint SourceTypeJoinStart = 661; + /// + /// 761 + /// + public const uint CameraNearNameStart = 761; + /// + /// 770 - presence of this name on the input will cause the camera to be added + /// + public const uint CameraFarName = 770; } /// @@ -166,6 +217,7 @@ namespace PepperDash.Essentials.Room.Cotija CotijaDdvc01DeviceBridge SourceBridge; Ddvc01AtcMessenger AtcMessenger; + Ddvc01VtcMessenger VtcMessenger; /// @@ -204,10 +256,14 @@ namespace PepperDash.Essentials.Room.Cotija SetupFunctions(); SetupFeedbacks(); - var key = this.Key + "-" + Parent.Key; - AtcMessenger = new Ddvc01AtcMessenger(key, EISC, "/device/audioCodec"); + var atcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key); + AtcMessenger = new Ddvc01AtcMessenger(atcKey, EISC, "/device/audioCodec"); AtcMessenger.RegisterWithAppServer(Parent); + var vtcKey = string.Format("atc-{0}-{1}", this.Key, Parent.Key); + VtcMessenger = new Ddvc01VtcMessenger(vtcKey, EISC, "/device/videoCodec"); + VtcMessenger.RegisterWithAppServer(Parent); + EISC.SigChange += EISC_SigChange; EISC.OnlineStatusChange += (o, a) => { @@ -251,7 +307,6 @@ namespace PepperDash.Essentials.Room.Cotija /// void SetupFunctions() { -#warning need join numbers for these Parent.AddAction(@"/room/room1/promptForCode", new Action(() => EISC.PulseBool(BoolJoin.PromptForCode))); Parent.AddAction(@"/room/room1/clientJoined", new Action(() => EISC.PulseBool(BoolJoin.ClientJoined))); @@ -397,7 +452,7 @@ namespace PepperDash.Essentials.Room.Cotija Debug.Console(0, this, "Replacing Room[0] in config"); co.Rooms[0] = rm; } - rm.Name = EISC.StringOutput[501].StringValue; + rm.Name = EISC.StringOutput[StringJoin.ConfigRoomName].StringValue; rm.Key = "room1"; rm.Type = "ddvc01"; @@ -408,15 +463,17 @@ namespace PepperDash.Essentials.Room.Cotija rmProps = JsonConvert.DeserializeObject(rm.Properties.ToString()); rmProps.Help = new EssentialsHelpPropertiesConfig(); - rmProps.Help.CallButtonText = EISC.StringOutput[503].StringValue; - rmProps.Help.Message = EISC.StringOutput[502].StringValue; + rmProps.Help.CallButtonText = EISC.StringOutput[StringJoin.ConfigHelpNumber].StringValue; + rmProps.Help.Message = EISC.StringOutput[StringJoin.ConfigHelpMessage].StringValue; rmProps.Environment = new EssentialsEnvironmentPropertiesConfig(); // enabled defaults to false - rmProps.RoomPhoneNumber = EISC.StringOutput[504].StringValue; - rmProps.RoomURI = EISC.StringOutput[505].StringValue; + rmProps.RoomPhoneNumber = EISC.StringOutput[StringJoin.ConfigRoomPhoneNumber].StringValue; + rmProps.RoomURI = EISC.StringOutput[StringJoin.ConfigRoomURI].StringValue; rmProps.SpeedDials = new List(); // add speed dials as long as there are more - up to 4 + +#warning fix speed dials - 512-515 names, 516-519 numbers for (uint i = 512; i <= 519; i = i + 2) { var num = EISC.StringOutput[i].StringValue; @@ -428,10 +485,10 @@ namespace PepperDash.Essentials.Room.Cotija // This MAY need a check rmProps.AudioCodecKey = "audioCodec"; - rmProps.VideoCodecKey = null; // "videoCodec"; + rmProps.VideoCodecKey = "videoCodec"; // volume control names - var volCount = EISC.UShortOutput[701].UShortValue; + var volCount = EISC.UShortOutput[UshortJoin.VolumeSliderCount].UShortValue; //// use Volumes object or? //rmProps.VolumeSliderNames = new List(); @@ -459,24 +516,39 @@ namespace PepperDash.Essentials.Room.Cotija co.SourceLists = new Dictionary>(); var newSl = new Dictionary(); - // add sources... - for (uint i = 0; i<= 19; i++) + // add "none" source if VTC present + + if (!string.IsNullOrEmpty(rmProps.VideoCodecKey)) { - var name = EISC.StringOutput[601 + i].StringValue; + var codecOsd = new SourceListItem() + { + Name = "None", + IncludeInSourceList = true, + Order = 1, + Type = eSourceListItemType.Route, + SourceKey = "" + }; + newSl.Add("Source-None", codecOsd); + } + // add sources... + for (uint i = 0; i <= 19; i++) + { + var name = EISC.StringOutput[StringJoin.SourceNameJoinStart + i].StringValue; if(string.IsNullOrEmpty(name)) break; - var icon = EISC.StringOutput[651 + i].StringValue; - var key = EISC.StringOutput[671 + i].StringValue; - - var type = EISC.StringOutput[701 + i].StringValue; + var icon = EISC.StringOutput[StringJoin.SourceIconJoinStart + i].StringValue; + var key = EISC.StringOutput[StringJoin.SourceKeyJoinStart + i].StringValue; + var type = EISC.StringOutput[StringJoin.SourceTypeJoinStart + i].StringValue; + var disableShare = EISC.BooleanOutput[BoolJoin.SourceShareDisableStartJoin + i].BoolValue; Debug.Console(0, this, "Adding source {0} '{1}'", key, name); var newSLI = new SourceListItem{ Icon = icon, Name = name, - Order = (int)i + 1, + Order = (int)i + 10, SourceKey = key, - Type = eSourceListItemType.Route + Type = eSourceListItemType.Route, + DisableCodecSharing = disableShare, }; newSl.Add(key, newSLI); @@ -536,7 +608,68 @@ namespace PepperDash.Essentials.Room.Cotija Properties = JToken.FromObject(acProps) }; co.Devices.Add(acConf); - } + } + + if (!string.IsNullOrEmpty(rmProps.VideoCodecKey)) + { +#warning Break out these video codec favs + var favs = new List(); + for (uint i = 0; i < 4; i++) + { + if (!EISC.GetBool(BoolJoin.SpeedDialVisibleStartJoin + i)) + { + break; + } + favs.Add(new PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem() + { + Name = EISC.GetString(StringJoin.SpeedDialNameStartJoin + i), + Number = EISC.GetString(StringJoin.SpeedDialNumberStartJoin + i), + Type = PepperDash.Essentials.Devices.Common.Codec.eCodecCallType.Audio + }); + } + + + + // cameras + var camsProps = new List(); + for (uint i = 0; i < 9; i++) + { + var name = EISC.GetString(i + StringJoin.CameraNearNameStart); + if (!string.IsNullOrEmpty(name)) + { + camsProps.Add(new + { + name = name, + selector = "camera" + (i + 1), + }); + } + } + var farName = EISC.GetString(StringJoin.CameraFarName); + if (!string.IsNullOrEmpty(farName)) + { + camsProps.Add(new + { + name = farName, + selector = "cameraFar", + }); + } + + var props = new + { + favorites = favs, + cameras = camsProps, + }; + var str = "videoCodec"; + var conf = new DeviceConfig() + { + Group = str, + Key = str, + Name = str, + Type = str, + Properties = JToken.FromObject(props) + }; + co.Devices.Add(conf); + } Debug.Console(0, this, "******* CONFIG FROM DDVC: \r{0}", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented)); diff --git a/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs b/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs index 976cb484..eef8e167 100644 --- a/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs +++ b/PepperDashEssentials/AppServer/RoomBridges/CotijaEssentialsHuddleSpaceRoomBridge.cs @@ -25,6 +25,7 @@ namespace PepperDash.Essentials public AudioCodecBaseMessenger ACMessenger { get; private set; } + /// /// /// diff --git a/PepperDashEssentials/Bridges/BridgeBase.cs b/PepperDashEssentials/Bridges/BridgeBase.cs index 537b5d59..79f96c71 100644 --- a/PepperDashEssentials/Bridges/BridgeBase.cs +++ b/PepperDashEssentials/Bridges/BridgeBase.cs @@ -15,7 +15,7 @@ using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.CrestronIO; using PepperDash.Essentials.DM; -using PepperDash.Essentials.Devices.Common.Cameras; +//using PepperDash.Essentials.Devices.Common.Cameras; namespace PepperDash.Essentials.Bridges { @@ -88,16 +88,16 @@ namespace PepperDash.Essentials.Bridges (device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); continue; } - else if (device is CameraBase) - { - (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); - continue; - } - else if (device is PepperDash.Essentials.Core.TwoWayDisplayBase) - { - (device as TwoWayDisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); - continue; - } + //else if (device is CameraBase) + //{ + // (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); + // continue; + //} + //else if (device is PepperDash.Essentials.Core.TwoWayDisplayBase) + //{ + // (device as TwoWayDisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); + // continue; + //} else if (device is DmChassisController) { (device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); @@ -124,16 +124,16 @@ namespace PepperDash.Essentials.Bridges (device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); continue; } - else if (device is LightingBase) - { - (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); - continue; - } - else if (device is DigitalLogger) - { - (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); - continue; - } + //else if (device is LightingBase) + //{ + // (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); + // continue; + //} + //else if (device is DigitalLogger) + //{ + // (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey); + // continue; + //} } } diff --git a/PepperDashEssentials/Bridges/CameraControllerBridge.cs b/PepperDashEssentials/Bridges/CameraControllerBridge.cs index 05b67287..a0bdfdd2 100644 --- a/PepperDashEssentials/Bridges/CameraControllerBridge.cs +++ b/PepperDashEssentials/Bridges/CameraControllerBridge.cs @@ -1,187 +1,187 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharpPro.DeviceSupport; -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Devices.Common; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using Crestron.SimplSharp; +//using Crestron.SimplSharpPro.DeviceSupport; +//using PepperDash.Core; +//using PepperDash.Essentials.Core; +//using PepperDash.Essentials.Devices.Common; -namespace PepperDash.Essentials.Bridges -{ - public static class CameraControllerApiExtensions - { +//namespace PepperDash.Essentials.Bridges +//{ +// public static class CameraControllerApiExtensions +// { - public static BasicTriList _TriList; - public static CameraControllerJoinMap JoinMap; - public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey) - { - JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as CameraControllerJoinMap; +// public static BasicTriList _TriList; +// public static CameraControllerJoinMap JoinMap; +// public static void LinkToApi(this PepperDash.Essentials.Devices.Common.Cameras.CameraBase cameraDevice, BasicTriList trilist, uint joinStart, string joinMapKey) +// { +// JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as CameraControllerJoinMap; - _TriList = trilist; - if (JoinMap == null) - { - JoinMap = new CameraControllerJoinMap(); - } +// _TriList = trilist; +// if (JoinMap == null) +// { +// JoinMap = new CameraControllerJoinMap(); +// } - JoinMap.OffsetJoinNumbers(joinStart); - Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); - Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString()); +// JoinMap.OffsetJoinNumbers(joinStart); +// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); +// Debug.Console(0, "Linking to Bridge Type {0}", cameraDevice.GetType().Name.ToString()); - var commMonitor = cameraDevice as ICommunicationMonitor; - commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]); +// var commMonitor = cameraDevice as ICommunicationMonitor; +// commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]); - trilist.SetBoolSigAction(JoinMap.Left, (b) => - { - if (b) - { - cameraDevice.PanLeft(); - } - else - { - cameraDevice.Stop(); - } - }); - trilist.SetBoolSigAction(JoinMap.Right, (b) => - { - if (b) - { - cameraDevice.PanRight(); - } - else - { - cameraDevice.Stop(); - } - }); +// trilist.SetBoolSigAction(JoinMap.Left, (b) => +// { +// if (b) +// { +// cameraDevice.PanLeft(); +// } +// else +// { +// cameraDevice.Stop(); +// } +// }); +// trilist.SetBoolSigAction(JoinMap.Right, (b) => +// { +// if (b) +// { +// cameraDevice.PanRight(); +// } +// else +// { +// cameraDevice.Stop(); +// } +// }); - trilist.SetBoolSigAction(JoinMap.Up, (b) => - { - if (b) - { - cameraDevice.TiltUp(); - } - else - { - cameraDevice.Stop(); - } - }); - trilist.SetBoolSigAction(JoinMap.Down, (b) => - { - if (b) - { - cameraDevice.TiltDown(); - } - else - { - cameraDevice.Stop(); - } - }); +// trilist.SetBoolSigAction(JoinMap.Up, (b) => +// { +// if (b) +// { +// cameraDevice.TiltUp(); +// } +// else +// { +// cameraDevice.Stop(); +// } +// }); +// trilist.SetBoolSigAction(JoinMap.Down, (b) => +// { +// if (b) +// { +// cameraDevice.TiltDown(); +// } +// else +// { +// cameraDevice.Stop(); +// } +// }); - trilist.SetBoolSigAction(JoinMap.ZoomIn, (b) => - { - if (b) - { - cameraDevice.ZoomIn(); - } - else - { - cameraDevice.Stop(); - } - }); +// trilist.SetBoolSigAction(JoinMap.ZoomIn, (b) => +// { +// if (b) +// { +// cameraDevice.ZoomIn(); +// } +// else +// { +// cameraDevice.Stop(); +// } +// }); - trilist.SetBoolSigAction(JoinMap.ZoomOut, (b) => - { - if (b) - { - cameraDevice.ZoomOut(); - } - else - { - cameraDevice.Stop(); - } - }); +// trilist.SetBoolSigAction(JoinMap.ZoomOut, (b) => +// { +// if (b) +// { +// cameraDevice.ZoomOut(); +// } +// else +// { +// cameraDevice.Stop(); +// } +// }); - if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca") - { - var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca; - trilist.SetSigTrueAction(JoinMap.PowerOn, () => viscaCamera.PowerOn()); - trilist.SetSigTrueAction(JoinMap.PowerOff, () => viscaCamera.PowerOff()); +// if (cameraDevice.GetType().Name.ToString().ToLower() == "cameravisca") +// { +// var viscaCamera = cameraDevice as PepperDash.Essentials.Devices.Common.Cameras.CameraVisca; +// trilist.SetSigTrueAction(JoinMap.PowerOn, () => viscaCamera.PowerOn()); +// trilist.SetSigTrueAction(JoinMap.PowerOff, () => viscaCamera.PowerOff()); - viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]); - viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]); +// viscaCamera.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]); +// viscaCamera.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]); - viscaCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]); - for (int i = 0; i < JoinMap.NumberOfPresets; i++) - { - int tempNum = i; - trilist.SetSigTrueAction((ushort)(JoinMap.PresetRecallOffset + tempNum), () => - { - viscaCamera.RecallPreset(tempNum); - }); - trilist.SetSigTrueAction((ushort)(JoinMap.PresetSaveOffset + tempNum), () => - { - viscaCamera.SavePreset(tempNum); - }); - } - } +// viscaCamera.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]); +// for (int i = 0; i < JoinMap.NumberOfPresets; i++) +// { +// int tempNum = i; +// trilist.SetSigTrueAction((ushort)(JoinMap.PresetRecallOffset + tempNum), () => +// { +// viscaCamera.RecallPreset(tempNum); +// }); +// trilist.SetSigTrueAction((ushort)(JoinMap.PresetSaveOffset + tempNum), () => +// { +// viscaCamera.SavePreset(tempNum); +// }); +// } +// } - } +// } - } - public class CameraControllerJoinMap : JoinMapBase - { - public uint IsOnline { get; set; } - public uint PowerOff { get; set; } - public uint PowerOn { get; set; } - public uint Up { get; set; } - public uint Down { get; set; } - public uint Left { get; set; } - public uint Right { get; set; } - public uint ZoomIn { get; set; } - public uint ZoomOut { get; set; } - public uint PresetRecallOffset { get; set; } - public uint PresetSaveOffset { get; set; } - public uint NumberOfPresets { get; set; } +// } +// public class CameraControllerJoinMap : JoinMapBase +// { +// public uint IsOnline { get; set; } +// public uint PowerOff { get; set; } +// public uint PowerOn { get; set; } +// public uint Up { get; set; } +// public uint Down { get; set; } +// public uint Left { get; set; } +// public uint Right { get; set; } +// public uint ZoomIn { get; set; } +// public uint ZoomOut { get; set; } +// public uint PresetRecallOffset { get; set; } +// public uint PresetSaveOffset { get; set; } +// public uint NumberOfPresets { get; set; } - public CameraControllerJoinMap() - { - // Digital - IsOnline = 9; - PowerOff = 8; - PowerOn = 7; - Up = 1; - Down = 2; - Left = 3; - Right = 4; - ZoomIn = 5; - ZoomOut = 6; - PresetRecallOffset = 10; - PresetSaveOffset = 30; - NumberOfPresets = 5; - // Analog - } +// public CameraControllerJoinMap() +// { +// // Digital +// IsOnline = 9; +// PowerOff = 8; +// PowerOn = 7; +// Up = 1; +// Down = 2; +// Left = 3; +// Right = 4; +// ZoomIn = 5; +// ZoomOut = 6; +// PresetRecallOffset = 10; +// PresetSaveOffset = 30; +// NumberOfPresets = 5; +// // Analog +// } - public override void OffsetJoinNumbers(uint joinStart) - { - var joinOffset = joinStart - 1; +// public override void OffsetJoinNumbers(uint joinStart) +// { +// var joinOffset = joinStart - 1; - IsOnline = IsOnline + joinOffset; - PowerOff = PowerOff + joinOffset; - PowerOn = PowerOn + joinOffset; - Up = Up + joinOffset; - Down = Down + joinOffset; - Left = Left + joinOffset; - Right = Right + joinOffset; - ZoomIn = ZoomIn + joinOffset; - ZoomOut = ZoomOut + joinOffset; - PresetRecallOffset = PresetRecallOffset + joinOffset; - PresetSaveOffset = PresetSaveOffset + joinOffset; - } - } -} \ No newline at end of file +// IsOnline = IsOnline + joinOffset; +// PowerOff = PowerOff + joinOffset; +// PowerOn = PowerOn + joinOffset; +// Up = Up + joinOffset; +// Down = Down + joinOffset; +// Left = Left + joinOffset; +// Right = Right + joinOffset; +// ZoomIn = ZoomIn + joinOffset; +// ZoomOut = ZoomOut + joinOffset; +// PresetRecallOffset = PresetRecallOffset + joinOffset; +// PresetSaveOffset = PresetSaveOffset + joinOffset; +// } +// } +//} \ No newline at end of file diff --git a/PepperDashEssentials/Bridges/DigitalLoggerBridge.cs b/PepperDashEssentials/Bridges/DigitalLoggerBridge.cs index 1c78b5a0..ef529165 100644 --- a/PepperDashEssentials/Bridges/DigitalLoggerBridge.cs +++ b/PepperDashEssentials/Bridges/DigitalLoggerBridge.cs @@ -1,77 +1,77 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharpPro.DeviceSupport; -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Devices.Common; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using Crestron.SimplSharp; +//using Crestron.SimplSharpPro.DeviceSupport; +//using PepperDash.Core; +//using PepperDash.Essentials.Core; +//using PepperDash.Essentials.Devices.Common; -namespace PepperDash.Essentials.Bridges -{ - public static class DigitalLoggerApiExtensions - { - public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey) - { - var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DigitalLoggerJoinMap; +//namespace PepperDash.Essentials.Bridges +//{ +// public static class DigitalLoggerApiExtensions +// { +// public static void LinkToApi(this DigitalLogger DigitalLogger, BasicTriList trilist, uint joinStart, string joinMapKey) +// { +// var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DigitalLoggerJoinMap; - if (joinMap == null) - joinMap = new DigitalLoggerJoinMap(); +// if (joinMap == null) +// joinMap = new DigitalLoggerJoinMap(); - joinMap.OffsetJoinNumbers(joinStart); - Debug.Console(1, DigitalLogger, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); - for (uint i = 1; i <= DigitalLogger.CircuitCount; i++) - { - var circuit = i; - DigitalLogger.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]); - DigitalLogger.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]); - DigitalLogger.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]); - trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => DigitalLogger.CycleCircuit(circuit - 1)); - trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => DigitalLogger.TurnOnCircuit(circuit - 1)); - trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => DigitalLogger.TurnOffCircuit(circuit - 1)); +// joinMap.OffsetJoinNumbers(joinStart); +// Debug.Console(1, DigitalLogger, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); +// for (uint i = 1; i <= DigitalLogger.CircuitCount; i++) +// { +// var circuit = i; +// DigitalLogger.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]); +// DigitalLogger.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]); +// DigitalLogger.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]); +// trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => DigitalLogger.CycleCircuit(circuit - 1)); +// trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => DigitalLogger.TurnOnCircuit(circuit - 1)); +// trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => DigitalLogger.TurnOffCircuit(circuit - 1)); - } - } - } - public class DigitalLoggerJoinMap : JoinMapBase - { - public uint IsOnline { get; set; } - public uint CircuitNames { get; set; } - public uint CircuitState { get; set; } - public uint CircuitCycle { get; set; } - public uint CircuitIsCritical { get; set; } - public uint CircuitOnCmd { get; set; } - public uint CircuitOffCmd { get; set; } - public DigitalLoggerJoinMap() - { - // Digital - IsOnline = 9; - CircuitState = 0; - CircuitCycle = 0; - CircuitIsCritical = 10; - CircuitOnCmd = 10; - CircuitOffCmd = 20; - // Serial - CircuitNames = 0; - // Analog - } +// } +// } +// } +// public class DigitalLoggerJoinMap : JoinMapBase +// { +// public uint IsOnline { get; set; } +// public uint CircuitNames { get; set; } +// public uint CircuitState { get; set; } +// public uint CircuitCycle { get; set; } +// public uint CircuitIsCritical { get; set; } +// public uint CircuitOnCmd { get; set; } +// public uint CircuitOffCmd { get; set; } +// public DigitalLoggerJoinMap() +// { +// // Digital +// IsOnline = 9; +// CircuitState = 0; +// CircuitCycle = 0; +// CircuitIsCritical = 10; +// CircuitOnCmd = 10; +// CircuitOffCmd = 20; +// // Serial +// CircuitNames = 0; +// // Analog +// } - public override void OffsetJoinNumbers(uint joinStart) - { - var joinOffset = joinStart - 1; +// public override void OffsetJoinNumbers(uint joinStart) +// { +// var joinOffset = joinStart - 1; - IsOnline = IsOnline + joinOffset; - CircuitNames = CircuitNames + joinOffset; - CircuitState = CircuitState + joinOffset; - CircuitCycle = CircuitCycle + joinOffset; - CircuitIsCritical = CircuitIsCritical + joinOffset; - CircuitOnCmd = CircuitOnCmd + joinOffset; - CircuitOffCmd = CircuitOffCmd + joinOffset; +// IsOnline = IsOnline + joinOffset; +// CircuitNames = CircuitNames + joinOffset; +// CircuitState = CircuitState + joinOffset; +// CircuitCycle = CircuitCycle + joinOffset; +// CircuitIsCritical = CircuitIsCritical + joinOffset; +// CircuitOnCmd = CircuitOnCmd + joinOffset; +// CircuitOffCmd = CircuitOffCmd + joinOffset; - } - } +// } +// } -} \ No newline at end of file +//} \ No newline at end of file diff --git a/PepperDashEssentials/Bridges/DisplayControllerBridge.cs b/PepperDashEssentials/Bridges/DisplayControllerBridge.cs index 8c266589..da91ee87 100644 --- a/PepperDashEssentials/Bridges/DisplayControllerBridge.cs +++ b/PepperDashEssentials/Bridges/DisplayControllerBridge.cs @@ -1,171 +1,171 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharpPro.DeviceSupport; -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Devices.Common; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using Crestron.SimplSharp; +//using Crestron.SimplSharpPro.DeviceSupport; +//using PepperDash.Core; +//using PepperDash.Essentials.Core; +//using PepperDash.Essentials.Devices.Common; -namespace PepperDash.Essentials.Bridges -{ - public static class DisplayControllerApiExtensions - { +//namespace PepperDash.Essentials.Bridges +//{ +// public static class DisplayControllerApiExtensions +// { - public static BasicTriList _TriList; - public static DisplayControllerJoinMap JoinMap; - public static int InputNumber; - public static IntFeedback InputNumberFeedback; - public static List InputKeys = new List(); - public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey) - { - JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap; - _TriList = trilist; +// public static BasicTriList _TriList; +// public static DisplayControllerJoinMap JoinMap; +// public static int InputNumber; +// public static IntFeedback InputNumberFeedback; +// public static List InputKeys = new List(); +// public static void LinkToApi(this PepperDash.Essentials.Core.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey) +// { +// JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap; +// _TriList = trilist; - if (JoinMap == null) - { - JoinMap = new DisplayControllerJoinMap(); - } +// if (JoinMap == null) +// { +// JoinMap = new DisplayControllerJoinMap(); +// } - JoinMap.OffsetJoinNumbers(joinStart); - Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); - Debug.Console(0, "Linking to Bridge Type {0}", displayDevice.GetType().Name.ToString()); +// JoinMap.OffsetJoinNumbers(joinStart); +// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); +// Debug.Console(0, "Linking to Bridge Type {0}", displayDevice.GetType().Name.ToString()); - trilist.StringInput[JoinMap.Name].StringValue = displayDevice.GetType().Name.ToString(); +// trilist.StringInput[JoinMap.Name].StringValue = displayDevice.GetType().Name.ToString(); - InputNumberFeedback = new IntFeedback(() => { return InputNumber;}); - InputNumberFeedback.LinkInputSig(trilist.UShortInput[JoinMap.InputSelect]); - var commMonitor = displayDevice as ICommunicationMonitor; - commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]); +// InputNumberFeedback = new IntFeedback(() => { return InputNumber;}); +// InputNumberFeedback.LinkInputSig(trilist.UShortInput[JoinMap.InputSelect]); +// var commMonitor = displayDevice as ICommunicationMonitor; +// commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]); - // Poewer Off - trilist.SetSigTrueAction(JoinMap.PowerOff, () => - { - InputNumber = 102; - InputNumberFeedback.FireUpdate(); - displayDevice.PowerOff(); - }); +// // Poewer Off +// trilist.SetSigTrueAction(JoinMap.PowerOff, () => +// { +// InputNumber = 102; +// InputNumberFeedback.FireUpdate(); +// displayDevice.PowerOff(); +// }); - displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler(PowerIsOnFeedback_OutputChange); - displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]); +// displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler(PowerIsOnFeedback_OutputChange); +// displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]); - // Poewer On - trilist.SetSigTrueAction(JoinMap.PowerOn, () => - { - InputNumber = 0; - InputNumberFeedback.FireUpdate(); - displayDevice.PowerOn(); - }); +// // Poewer On +// trilist.SetSigTrueAction(JoinMap.PowerOn, () => +// { +// InputNumber = 0; +// InputNumberFeedback.FireUpdate(); +// displayDevice.PowerOn(); +// }); - displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]); +// displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.PowerOn]); - int count = 1; - foreach (var input in displayDevice.InputPorts) - { - InputKeys.Add(input.Key.ToString()); - var tempKey = InputKeys.ElementAt(count - 1); - trilist.SetSigTrueAction((ushort)(JoinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); }); - trilist.StringInput[(ushort)(JoinMap.InputNamesOffset + count)].StringValue = input.Key.ToString(); - count++; - } +// int count = 1; +// foreach (var input in displayDevice.InputPorts) +// { +// InputKeys.Add(input.Key.ToString()); +// var tempKey = InputKeys.ElementAt(count - 1); +// trilist.SetSigTrueAction((ushort)(JoinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); }); +// trilist.StringInput[(ushort)(JoinMap.InputNamesOffset + count)].StringValue = input.Key.ToString(); +// count++; +// } - displayDevice.CurrentInputFeedback.OutputChange += new EventHandler(CurrentInputFeedback_OutputChange); - trilist.SetUShortSigAction(JoinMap.InputSelect, (a) => - { - if (a == 0) - { - displayDevice.PowerOff(); - InputNumber = 0; - } - else if (a > 0 && a < displayDevice.InputPorts.Count && a != InputNumber) - { - displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector); - InputNumber = a; - } - else if (a == 102) - { - displayDevice.PowerToggle(); +// displayDevice.CurrentInputFeedback.OutputChange += new EventHandler(CurrentInputFeedback_OutputChange); +// trilist.SetUShortSigAction(JoinMap.InputSelect, (a) => +// { +// if (a == 0) +// { +// displayDevice.PowerOff(); +// InputNumber = 0; +// } +// else if (a > 0 && a < displayDevice.InputPorts.Count && a != InputNumber) +// { +// displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector); +// InputNumber = a; +// } +// else if (a == 102) +// { +// displayDevice.PowerToggle(); - } - InputNumberFeedback.FireUpdate(); - }); +// } +// InputNumberFeedback.FireUpdate(); +// }); - } +// } - static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e) - { +// static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e) +// { - Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", e.StringValue); +// Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", e.StringValue); - } +// } - static void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e) - { +// static void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e) +// { - // Debug.Console(0, "PowerIsOnFeedback_OutputChange {0}", e.BoolValue); - if (!e.BoolValue) - { - InputNumber = 102; - InputNumberFeedback.FireUpdate(); +// // Debug.Console(0, "PowerIsOnFeedback_OutputChange {0}", e.BoolValue); +// if (!e.BoolValue) +// { +// InputNumber = 102; +// InputNumberFeedback.FireUpdate(); - } - else - { - InputNumber = 0; - InputNumberFeedback.FireUpdate(); - } - } +// } +// else +// { +// InputNumber = 0; +// InputNumberFeedback.FireUpdate(); +// } +// } - } - public class DisplayControllerJoinMap : JoinMapBase - { - public uint Name { get; set; } - public uint InputNamesOffset { get; set; } - public uint InputSelectOffset { get; set; } - public uint IsOnline { get; set; } - public uint PowerOff { get; set; } - public uint InputSelect { get; set; } - public uint PowerOn { get; set; } - public uint SelectScene { get; set; } - public uint LightingSceneOffset { get; set; } - public uint ButtonVisibilityOffset { get; set; } - public uint IntegrationIdSet { get; set; } +// } +// public class DisplayControllerJoinMap : JoinMapBase +// { +// public uint Name { get; set; } +// public uint InputNamesOffset { get; set; } +// public uint InputSelectOffset { get; set; } +// public uint IsOnline { get; set; } +// public uint PowerOff { get; set; } +// public uint InputSelect { get; set; } +// public uint PowerOn { get; set; } +// public uint SelectScene { get; set; } +// public uint LightingSceneOffset { get; set; } +// public uint ButtonVisibilityOffset { get; set; } +// public uint IntegrationIdSet { get; set; } - public DisplayControllerJoinMap() - { - // Digital - IsOnline = 50; - PowerOff = 1; - PowerOn = 2; - InputSelect = 4; - IntegrationIdSet = 1; - LightingSceneOffset = 10; - ButtonVisibilityOffset = 40; - Name = 1; - InputNamesOffset = 10; - InputSelectOffset = 4; - // Analog - } +// public DisplayControllerJoinMap() +// { +// // Digital +// IsOnline = 50; +// PowerOff = 1; +// PowerOn = 2; +// InputSelect = 4; +// IntegrationIdSet = 1; +// LightingSceneOffset = 10; +// ButtonVisibilityOffset = 40; +// Name = 1; +// InputNamesOffset = 10; +// InputSelectOffset = 4; +// // Analog +// } - public override void OffsetJoinNumbers(uint joinStart) - { - var joinOffset = joinStart - 1; +// public override void OffsetJoinNumbers(uint joinStart) +// { +// var joinOffset = joinStart - 1; - IsOnline = IsOnline + joinOffset; - PowerOff = PowerOff + joinOffset; - PowerOn = PowerOn + joinOffset; - SelectScene = SelectScene + joinOffset; - LightingSceneOffset = LightingSceneOffset + joinOffset; - ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset; - Name = Name + joinOffset; - InputNamesOffset = InputNamesOffset + joinOffset; - InputSelectOffset = InputSelectOffset + joinOffset; +// IsOnline = IsOnline + joinOffset; +// PowerOff = PowerOff + joinOffset; +// PowerOn = PowerOn + joinOffset; +// SelectScene = SelectScene + joinOffset; +// LightingSceneOffset = LightingSceneOffset + joinOffset; +// ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset; +// Name = Name + joinOffset; +// InputNamesOffset = InputNamesOffset + joinOffset; +// InputSelectOffset = InputSelectOffset + joinOffset; - } - } -} \ No newline at end of file +// } +// } +//} \ No newline at end of file diff --git a/PepperDashEssentials/Bridges/GenericLightingBridge.cs b/PepperDashEssentials/Bridges/GenericLightingBridge.cs index c93a14fd..be7d88b3 100644 --- a/PepperDashEssentials/Bridges/GenericLightingBridge.cs +++ b/PepperDashEssentials/Bridges/GenericLightingBridge.cs @@ -1,103 +1,103 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Crestron.SimplSharp; -using Crestron.SimplSharpPro.DeviceSupport; -using PepperDash.Core; -using PepperDash.Essentials.Core; -using PepperDash.Essentials.Devices.Common; +//using System; +//using System.Collections.Generic; +//using System.Linq; +//using System.Text; +//using Crestron.SimplSharp; +//using Crestron.SimplSharpPro.DeviceSupport; +//using PepperDash.Core; +//using PepperDash.Essentials.Core; +//using PepperDash.Essentials.Devices.Common; -namespace PepperDash.Essentials.Bridges -{ - public static class GenericLightingApiExtensions - { - public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey) - { - var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericLightingJoinMap; +//namespace PepperDash.Essentials.Bridges +//{ +// public static class GenericLightingApiExtensions +// { +// public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey) +// { +// var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericLightingJoinMap; - if (joinMap == null) - joinMap = new GenericLightingJoinMap(); +// if (joinMap == null) +// joinMap = new GenericLightingJoinMap(); - joinMap.OffsetJoinNumbers(joinStart); - Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); +// joinMap.OffsetJoinNumbers(joinStart); +// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); - Debug.Console(0, "Linking to lighting Type {0}", lightingDevice.GetType().Name.ToString()); +// Debug.Console(0, "Linking to lighting Type {0}", lightingDevice.GetType().Name.ToString()); - // GenericLighitng Actions & FeedBack - trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u])); +// // GenericLighitng Actions & FeedBack +// trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u])); - int sceneIndex = 1; - foreach (var scene in lightingDevice.LightingScenes) - { - var tempIndex = sceneIndex - 1; - trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex])); - scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]); - trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name; - trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true; - sceneIndex++; - } +// int sceneIndex = 1; +// foreach (var scene in lightingDevice.LightingScenes) +// { +// var tempIndex = sceneIndex - 1; +// trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex])); +// scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]); +// trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name; +// trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true; +// sceneIndex++; +// } - if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea") - { - var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea; - lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]); - trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s); - } +// if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea") +// { +// var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea; +// lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]); +// trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s); +// } - //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; }); +// //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; }); - /* - var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea; +// /* +// var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea; - for (uint i = 1; i <= lightingBase.CircuitCount; i++) - { - var circuit = i; - lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]); - lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]); - lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]); - trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1)); - trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1)); - trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1)); +// for (uint i = 1; i <= lightingBase.CircuitCount; i++) +// { +// var circuit = i; +// lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]); +// lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]); +// lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]); +// trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1)); +// trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1)); +// trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1)); - } - */ - } - } - public class GenericLightingJoinMap : JoinMapBase - { - public uint IsOnline { get; set; } - public uint SelectScene { get; set; } - public uint LightingSceneOffset { get; set; } - public uint ButtonVisibilityOffset { get; set; } - public uint IntegrationIdSet { get; set; } +// } +// */ +// } +// } +// public class GenericLightingJoinMap : JoinMapBase +// { +// public uint IsOnline { get; set; } +// public uint SelectScene { get; set; } +// public uint LightingSceneOffset { get; set; } +// public uint ButtonVisibilityOffset { get; set; } +// public uint IntegrationIdSet { get; set; } - public GenericLightingJoinMap() - { - // Digital - IsOnline = 1; - SelectScene = 1; - IntegrationIdSet = 1; - LightingSceneOffset = 10; - ButtonVisibilityOffset = 40; - // Analog - } +// public GenericLightingJoinMap() +// { +// // Digital +// IsOnline = 1; +// SelectScene = 1; +// IntegrationIdSet = 1; +// LightingSceneOffset = 10; +// ButtonVisibilityOffset = 40; +// // Analog +// } - public override void OffsetJoinNumbers(uint joinStart) - { - var joinOffset = joinStart - 1; +// public override void OffsetJoinNumbers(uint joinStart) +// { +// var joinOffset = joinStart - 1; - IsOnline = IsOnline + joinOffset; - SelectScene = SelectScene + joinOffset; - LightingSceneOffset = LightingSceneOffset + joinOffset; - ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset; +// IsOnline = IsOnline + joinOffset; +// SelectScene = SelectScene + joinOffset; +// LightingSceneOffset = LightingSceneOffset + joinOffset; +// ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset; - } - } -} \ No newline at end of file +// } +// } +//} \ No newline at end of file diff --git a/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs b/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs index 8eeed161..d2072a91 100644 --- a/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs +++ b/PepperDashEssentials/Bridges/IBasicCommunicationBridge.cs @@ -30,7 +30,11 @@ namespace PepperDash.Essentials.Bridges Debug.Console(1, comm, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); // this is a permanent event handler. This cannot be -= from event - comm.CommPort.TextReceived += (s, a) => trilist.SetString(joinMap.TextReceived, a.Text); + comm.CommPort.TextReceived += (s, a) => + { + Debug.Console(2, comm, "RX: {0}", a.Text); + trilist.SetString(joinMap.TextReceived, a.Text); + }; trilist.SetStringSigAction(joinMap.SendText, new Action(s => comm.CommPort.SendText(s))); trilist.SetStringSigAction(joinMap.SetPortConfig + 1, new Action(s => comm.SetPortConfig(s))); diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs index bd33a276..4b75f046 100644 --- a/PepperDashEssentials/ControlSystem.cs +++ b/PepperDashEssentials/ControlSystem.cs @@ -34,8 +34,6 @@ namespace PepperDash.Essentials /// public override void InitializeSystem() { - SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true; - DeterminePlatform(); //CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file", @@ -73,7 +71,7 @@ namespace PepperDash.Essentials } /// - /// Determines if the program is running on a processor (appliance) or server (XiO Edge). + /// Determines if the program is running on a processor (appliance) or server (VC-4). /// /// Sets Global.FilePathPrefix based on platform /// @@ -93,20 +91,40 @@ namespace PepperDash.Essentials directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory(); - //directoryPrefix = ""; - - if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) + if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows OS { - filePathPrefix = directoryPrefix + dirSeparator + "NVRAM" - + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator; - Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", versionString); - } - else - { - filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator; + // Check if User/ProgramX exists + if(Directory.Exists(directoryPrefix + dirSeparator + "User" + + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber))) + { + Debug.Console(0, @"User/program{0} directory found", InitialParametersClass.ApplicationNumber); + filePathPrefix = directoryPrefix + dirSeparator + "User" + + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator; + } + // Check if Nvram/Programx exists + else if (Directory.Exists(directoryPrefix + dirSeparator + "Nvram" + + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber))) + { + Debug.Console(0, @"Nvram/program{0} directory found", InitialParametersClass.ApplicationNumber); + filePathPrefix = directoryPrefix + dirSeparator + "Nvram" + + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator; + } + // If neither exists, set path to User/ProgramX + else + { + Debug.Console(0, @"No previous directory found. Using User/program{0}", InitialParametersClass.ApplicationNumber); + filePathPrefix = directoryPrefix + dirSeparator + "User" + + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator; + } + } + else // Handles Linux OS (Virtual Control) + { Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", versionString); + + // Set path to User/ + filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator; } Global.SetFilePathPrefix(filePathPrefix); @@ -158,13 +176,13 @@ namespace PepperDash.Essentials } - // Notify the + // Notify the OS that the program intitialization has completed SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true; } /// - /// Verifies filesystem is set up. IR, SGD, and program1 folders + /// Verifies filesystem is set up. IR, SGD, and programX folders /// bool SetupFilesystem() { @@ -245,9 +263,8 @@ namespace PepperDash.Essentials /// public void LoadDevices() { -# warning Missing PepperDash.Essentials.Core.Devices.CrestronProcessor("processor")); // Build the processor wrapper class - // DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor")); + DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor")); // Add global System Monitor device DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor")); diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj index ac74c6c0..a4072766 100644 --- a/PepperDashEssentials/PepperDashEssentials.csproj +++ b/PepperDashEssentials/PepperDashEssentials.csproj @@ -108,8 +108,10 @@ - + + + diff --git a/PepperDashEssentials/Properties/AssemblyInfo.cs b/PepperDashEssentials/Properties/AssemblyInfo.cs index 1f037bfb..97d14f56 100644 --- a/PepperDashEssentials/Properties/AssemblyInfo.cs +++ b/PepperDashEssentials/Properties/AssemblyInfo.cs @@ -4,5 +4,5 @@ [assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: AssemblyProduct("PepperDashEssentials")] [assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")] -[assembly: AssemblyVersion("1.3.1.*")] +[assembly: AssemblyVersion("1.3.2.*")] diff --git a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs index 4ceb481d..7b7718eb 100644 --- a/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs +++ b/PepperDashEssentials/Room/Config/EssentialsRoomConfig.cs @@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Room.Config var microphonePrivacy = props.MicrophonePrivacy; if (microphonePrivacy == null) { - Debug.Console(0, "ERROR: Cannot create microphone privacy with null properties"); + Debug.Console(0, "Cannot create microphone privacy with null properties"); return null; } // Get the MicrophonePrivacy device from the device manager diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs index c1db1bee..63f0bb29 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleSpaceRoom.cs @@ -13,7 +13,7 @@ using PepperDash.Essentials.Room.Config; namespace PepperDash.Essentials { - public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute + public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasCurrentVolumeControls { public event EventHandler CurrentVolumeDeviceChange; public event SourceInfoChangeHandler CurrentSingleSourceChange; diff --git a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs index 62b11e49..d83c8e9a 100644 --- a/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs +++ b/PepperDashEssentials/Room/Types/EssentialsHuddleVtc1Room.cs @@ -266,6 +266,16 @@ namespace PepperDash.Essentials { IsCoolingDownFeedback.FireUpdate(); }; + + // Get Microphone Privacy object, if any + this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this); + + Debug.Console(2, this, "Microphone Privacy Config evaluated."); + + // Get emergency object, if any + this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this); + + Debug.Console(2, this, "Emergency Config evaluated."); } @@ -279,7 +289,7 @@ namespace PepperDash.Essentials inAudioCall = AudioCodec.IsInCall; if(VideoCodec != null) - inVideoCall = AudioCodec.IsInCall; + inVideoCall = VideoCodec.IsInCall; if (inAudioCall || inVideoCall) return true; @@ -327,12 +337,6 @@ namespace PepperDash.Essentials this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem; this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100); - // Get Microphone Privacy object, if any - this.MicrophonePrivacy = EssentialsRoomConfigHelper.GetMicrophonePrivacy(PropertiesConfig, this); - - // Get emergency object, if any - this.Emergency = EssentialsRoomConfigHelper.GetEmergency(PropertiesConfig, this); - return base.CustomActivate(); } diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs index 4b1f2188..be51a4aa 100644 --- a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs +++ b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs @@ -927,7 +927,10 @@ namespace PepperDash.Essentials _CurrentRoom.CurrentSingleSourceChange += CurrentRoom_SourceInfoChange; RefreshSourceInfo(); - (_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged; + if (_CurrentRoom.VideoCodec is IHasScheduleAwareness) + { + (_CurrentRoom.VideoCodec as IHasScheduleAwareness).CodecSchedule.MeetingsListHasChanged += CodecSchedule_MeetingsListHasChanged; + } CallSharingInfoVisibleFeedback = new BoolFeedback(() => _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.BoolValue); _CurrentRoom.VideoCodec.SharingContentIsOnFeedback.OutputChange += SharingContentIsOnFeedback_OutputChange; diff --git a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs index 13bf6a85..704a42d3 100644 --- a/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs +++ b/PepperDashEssentials/UIDrivers/VC/EssentialsVideoCodecUiDriver.cs @@ -58,16 +58,7 @@ namespace PepperDash.Essentials.UIDrivers.VC SmartObjectDynamicList RecentCallsList; SmartObjectDynamicList DirectoryList; - - CodecDirectory CurrentDirectoryResult; - - /// - /// Tracks the directory browse history when browsing beyond the root directory - /// - List DirectoryBrowseHistory; - bool NextDirectoryResultIsFolderContents; - BoolFeedback DirectoryBackButtonVisibleFeedback; // These are likely temp until we get a keyboard built @@ -111,7 +102,6 @@ namespace PepperDash.Essentials.UIDrivers.VC SetupCallStagingPopover(); SetupDialKeypad(); ActiveCallsSRL = new SubpageReferenceList(triList, UISmartObjectJoin.CodecActiveCallsHeaderList, 5,5,5); - SetupDirectoryList(); SetupRecentCallsList(); SetupFavorites(); SetupLayoutControls(); @@ -169,12 +159,14 @@ namespace PepperDash.Essentials.UIDrivers.VC }); SearchStringFeedback.LinkInputSig(triList.StringInput[UIStringJoin.CodecDirectorySearchEntryText]); + SetupDirectoryList(); + SearchStringBackspaceVisibleFeedback = new BoolFeedback(() => SearchStringBuilder.Length > 0); SearchStringBackspaceVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackspaceVisible]); triList.SetSigFalseAction(UIBoolJoin.VCDirectoryBackPress, GetDirectoryParentFolderContents); - DirectoryBackButtonVisibleFeedback = new BoolFeedback(() => CurrentDirectoryResult != (codec as IHasDirectory).DirectoryRoot); + DirectoryBackButtonVisibleFeedback = (codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot; DirectoryBackButtonVisibleFeedback .LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackVisible]); @@ -532,8 +524,6 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void SetupDirectoryList() { - DirectoryBrowseHistory = new List(); - var codec = Codec as IHasDirectory; if (codec != null) { @@ -548,28 +538,20 @@ namespace PepperDash.Essentials.UIDrivers.VC codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler(PhonebookSyncState_InitialSyncCompleted); } - - // If there is something here now, show it otherwise wait for the event - if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0) - { - RefreshDirectory(); - } + RefreshDirectory(); + } } /// - /// Sets the current directory resutls to the DirectorRoot and updates Back Button visibiltiy + /// Sets the current directory results to the DirectoryRoot and updates Back Button visibiltiy /// void SetCurrentDirectoryToRoot() { - DirectoryBrowseHistory.Clear(); - - CurrentDirectoryResult = (Codec as IHasDirectory).DirectoryRoot; + (Codec as IHasDirectory).SetCurrentDirectoryToRoot(); SearchKeypadClear(); - DirectoryBackButtonVisibleFeedback.FireUpdate(); - RefreshDirectory(); } @@ -584,10 +566,8 @@ namespace PepperDash.Essentials.UIDrivers.VC SetCurrentDirectoryToRoot(); - if (CurrentDirectoryResult != null && codec.DirectoryRoot.DirectoryResults.Count > 0) - { - RefreshDirectory(); - } + RefreshDirectory(); + } /// @@ -597,13 +577,7 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void dir_DirectoryResultReturned(object sender, DirectoryEventArgs e) { - if (NextDirectoryResultIsFolderContents) - { - NextDirectoryResultIsFolderContents = false; - DirectoryBrowseHistory.Add(e.Directory); - } - CurrentDirectoryResult = e.Directory; - DirectoryBackButtonVisibleFeedback.FireUpdate(); + RefreshDirectory(); } @@ -615,7 +589,6 @@ namespace PepperDash.Essentials.UIDrivers.VC { (Codec as IHasDirectory).GetDirectoryFolderContents(folder.FolderId); - NextDirectoryResultIsFolderContents = true; } /// @@ -625,18 +598,13 @@ namespace PepperDash.Essentials.UIDrivers.VC { var codec = Codec as IHasDirectory; - if (DirectoryBrowseHistory.Count > 0) + if (codec != null) { - var lastItemIndex = DirectoryBrowseHistory.Count - 1; - CurrentDirectoryResult = DirectoryBrowseHistory[lastItemIndex]; - DirectoryBrowseHistory.Remove(DirectoryBrowseHistory[lastItemIndex]); + codec.GetDirectoryParentFolderContents(); - RefreshDirectory(); - } - else - { - SetCurrentDirectoryToRoot(); + //RefreshDirectory(); } + } /// @@ -645,10 +613,10 @@ namespace PepperDash.Essentials.UIDrivers.VC /// void RefreshDirectory() { - if (CurrentDirectoryResult.DirectoryResults.Count > 0) + if ((Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults.Count > 0) { ushort i = 0; - foreach (var r in CurrentDirectoryResult.DirectoryResults) + foreach (var r in (Codec as IHasDirectory).CurrentDirectoryResult.CurrentDirectoryResults) { if (i == DirectoryList.MaxCount) { @@ -725,13 +693,13 @@ namespace PepperDash.Essentials.UIDrivers.VC Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 4).StringValue = ""; Parent.MeetingOrContactMethodModalSrl.StringInputSig(i, 5).StringValue = "Connect"; Parent.MeetingOrContactMethodModalSrl.BoolInputSig(i, 2).BoolValue = true; - var cc = c; // lambda scope + var cc = c; // to maintian lambda scope Parent.MeetingOrContactMethodModalSrl.GetBoolFeedbackSig(i, 1).SetSigFalseAction(() => { Parent.PopupInterlock.Hide(); var codec = Codec as VideoCodecBase; if (codec != null) - codec.Dial(c.Number); + codec.Dial(cc.Number); }); } Parent.MeetingOrContactMethodModalSrl.Count = i; @@ -1102,7 +1070,7 @@ namespace PepperDash.Essentials.UIDrivers.VC SearchStringFeedback.FireUpdate(); SearchStringKeypadCheckEnables(); - if(CurrentDirectoryResult != (Codec as IHasDirectory).DirectoryRoot) + if ((Codec as IHasDirectory).CurrentDirectoryResultIsNotDirectoryRoot.BoolValue) SetCurrentDirectoryToRoot(); } diff --git a/devjson commands.json b/devjson commands.json index 6b042a92..4f0aa69e 100644 --- a/devjson commands.json +++ b/devjson commands.json @@ -30,4 +30,8 @@ devjson:1 {"deviceKey":"room1.InCallFeedback","methodName":"SetTestValue", "para devjson:1 {"deviceKey":"room1.InCallFeedback","methodName":"ClearTestValue", "params": []} -devjson:3 {"deviceKey":"room1.RoomOccupancy.RoomIsOccupiedFeedback","methodName":"SetTestValue", "params": [ true ]} \ No newline at end of file +devjson:3 {"deviceKey":"room1.RoomOccupancy.RoomIsOccupiedFeedback","methodName":"SetTestValue", "params": [ true ]} + +devjson:2 {"deviceKey":"codec-comms-ssh", "methodName":"SendText", "params": ["xcommand dial number: 10.11.50.211\r"]} + +devjson:2 {"deviceKey":"codec-comms-ssh", "methodName":"Connect", "params": []} \ No newline at end of file diff --git a/essentials-framework b/essentials-framework index 4cfd0abf..d2326163 160000 --- a/essentials-framework +++ b/essentials-framework @@ -1 +1 @@ -Subproject commit 4cfd0abff1e43577366ad9546eed1600c5303a68 +Subproject commit d23261633943f87c4f8c7568f285f5de2a839667