mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-12 03:54:51 +00:00
Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b599ff863 | ||
|
|
ae23e48fd0 | ||
|
|
8585977f71 | ||
|
|
288c9bb04c | ||
|
|
31b0683cdf | ||
|
|
04194da31c | ||
|
|
09bdc49c15 | ||
|
|
e36b2b97d2 | ||
|
|
d705525a45 | ||
|
|
ecce6e2be9 | ||
|
|
95c0f57000 | ||
|
|
697b9109a3 | ||
|
|
727367c061 | ||
|
|
f26ff0b767 | ||
|
|
44b72dcfe5 | ||
|
|
937f3f3dc0 | ||
|
|
17bf6e3f0a | ||
|
|
e7253b4acc | ||
|
|
71a27027e7 | ||
|
|
2655b8f7b8 | ||
|
|
3adee8bc30 | ||
|
|
e3a3a2cd2d | ||
|
|
6235b44d89 | ||
|
|
90bbd65fdc | ||
|
|
43fd263ea1 | ||
|
|
038e23289e | ||
|
|
2121456d50 | ||
|
|
3a99c3bb30 | ||
|
|
52ac57c080 | ||
|
|
84ee743ff5 | ||
|
|
24fb74701a | ||
|
|
1c9aa1eaf6 | ||
|
|
7c88843f50 | ||
|
|
7a3ce5fcf1 | ||
|
|
3049e5a041 | ||
|
|
59234274dc | ||
|
|
120dae2e63 | ||
|
|
e4317825d3 | ||
|
|
bf6971a52d | ||
|
|
ef0a8dd3b9 | ||
|
|
ca42d744cf | ||
|
|
ffa4de49e9 | ||
|
|
3c5c157a70 | ||
|
|
8ef58359e7 | ||
|
|
530e1ebcb8 | ||
|
|
8d03bef34f | ||
|
|
a870418f96 | ||
|
|
37e2dfd11f | ||
|
|
47675f12b4 |
@@ -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<string, CTimer> PushedActions = new Dictionary<string, CTimer>();
|
||||
|
||||
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<CotijaBridgeBase> RoomBridges = new List<CotijaBridgeBase>();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -138,7 +147,9 @@ namespace PepperDash.Essentials
|
||||
/// <param name="programEventType"></param>
|
||||
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.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -666,13 +679,14 @@ namespace PepperDash.Essentials
|
||||
if(string.IsNullOrEmpty(message))
|
||||
return;
|
||||
|
||||
if (!message.Contains("/system/heartbeat"))
|
||||
Debug.Console(1, this, "Message RX: {0}", message);
|
||||
else
|
||||
{
|
||||
LastAckMessage = DateTime.Now;
|
||||
//Debug.Console(1, this, "RX message contains /system/heartbeat");
|
||||
}
|
||||
if (!message.Contains("/system/heartbeat"))
|
||||
{
|
||||
Debug.Console(1, this, "Message RX: {0}", message);
|
||||
}
|
||||
else
|
||||
{
|
||||
LastAckMessage = DateTime.Now;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -689,6 +703,11 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
HandleHeartBeat(messageObj["content"]);
|
||||
}
|
||||
else if (type == "raw")
|
||||
{
|
||||
var wrapper = messageObj["content"].ToObject<DeviceActionWrapper>();
|
||||
DeviceJsonApi.DoDeviceAction(wrapper);
|
||||
}
|
||||
else if (type == "close")
|
||||
{
|
||||
Debug.Console(1, this, "Received close message from server.");
|
||||
|
||||
75
PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
Normal file
75
PepperDashEssentials/AppServer/Messengers/ConfigMessenger.cs
Normal file
@@ -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
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Handles interactions with the app server to update the config
|
||||
/// </summary>
|
||||
public class ConfigMessenger : MessengerBase
|
||||
{
|
||||
public ConfigMessenger(string key, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
ConfigUpdater.ConfigStatusChanged -= ConfigUpdater_ConfigStatusChanged;
|
||||
ConfigUpdater.ConfigStatusChanged += new EventHandler<ConfigStatusEventArgs>(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<string>(s => GetConfigFile(s)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generates or passes the URL to make the request to GET the config from a server
|
||||
/// </summary>
|
||||
/// <param name="url"></param>
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Posts a message with the current status of the config update
|
||||
/// </summary>
|
||||
/// <param name="status"></param>
|
||||
void PostUpdateStatus(string status)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
updateStatus = status
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -16,12 +16,33 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{
|
||||
BasicTriList EISC;
|
||||
|
||||
/// <summary>
|
||||
/// 221
|
||||
/// </summary>
|
||||
const uint BDialHangup = 221;
|
||||
/// <summary>
|
||||
/// 251
|
||||
/// </summary>
|
||||
const uint BIncomingAnswer = 251;
|
||||
/// <summary>
|
||||
/// 252
|
||||
/// </summary>
|
||||
const uint BIncomingReject = 252;
|
||||
/// <summary>
|
||||
/// 241
|
||||
/// </summary>
|
||||
const uint BSpeedDial1 = 241;
|
||||
/// <summary>
|
||||
/// 242
|
||||
/// </summary>
|
||||
const uint BSpeedDial2 = 242;
|
||||
/// <summary>
|
||||
/// 243
|
||||
/// </summary>
|
||||
const uint BSpeedDial3 = 243;
|
||||
/// <summary>
|
||||
/// 244
|
||||
/// </summary>
|
||||
const uint BSpeedDial4 = 244;
|
||||
|
||||
/// <summary>
|
||||
@@ -46,7 +67,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
const uint SCallDirection = 222;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// 201-212 0-9*#
|
||||
/// </summary>
|
||||
Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
{
|
||||
@@ -64,6 +85,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
{ "#", 212 },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
CodecActiveCallItem CurrentCallItem;
|
||||
|
||||
|
||||
@@ -160,6 +184,9 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void SendCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
604
PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs
Normal file
604
PepperDashEssentials/AppServer/Messengers/Ddvc01VtcMessenger.cs
Normal file
@@ -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 *********/
|
||||
/// <summary>
|
||||
/// 724
|
||||
/// </summary>
|
||||
const uint BDialHangup = 724;
|
||||
/// <summary>
|
||||
/// 750
|
||||
/// </summary>
|
||||
const uint BCallIncoming = 750;
|
||||
/// <summary>
|
||||
/// 751
|
||||
/// </summary>
|
||||
const uint BIncomingAnswer = 751;
|
||||
/// <summary>
|
||||
/// 752
|
||||
/// </summary>
|
||||
const uint BIncomingReject = 752;
|
||||
/// <summary>
|
||||
/// 741
|
||||
/// </summary>
|
||||
const uint BSpeedDial1 = 741;
|
||||
/// <summary>
|
||||
/// 742
|
||||
/// </summary>
|
||||
const uint BSpeedDial2 = 742;
|
||||
/// <summary>
|
||||
/// 743
|
||||
/// </summary>
|
||||
const uint BSpeedDial3 = 743;
|
||||
/// <summary>
|
||||
/// 744
|
||||
/// </summary>
|
||||
const uint BSpeedDial4 = 744;
|
||||
/// <summary>
|
||||
/// 800
|
||||
/// </summary>
|
||||
const uint BDirectorySearchBusy = 800;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint BDirectoryLineSelected = 801;
|
||||
/// <summary>
|
||||
/// 801 when selected entry is a contact
|
||||
/// </summary>
|
||||
const uint BDirectoryEntryIsContact = 801;
|
||||
/// <summary>
|
||||
/// 802 To show/hide back button
|
||||
/// </summary>
|
||||
const uint BDirectoryIsRoot = 802;
|
||||
/// <summary>
|
||||
/// 803 Pulse from system to inform us when directory is ready
|
||||
/// </summary>
|
||||
const uint DDirectoryHasChanged = 803;
|
||||
/// <summary>
|
||||
/// 804
|
||||
/// </summary>
|
||||
const uint BDirectoryRoot = 804;
|
||||
/// <summary>
|
||||
/// 805
|
||||
/// </summary>
|
||||
const uint BDirectoryFolderBack = 805;
|
||||
/// <summary>
|
||||
/// 806
|
||||
/// </summary>
|
||||
const uint BDirectoryDialSelectedLine = 806;
|
||||
/// <summary>
|
||||
/// 811
|
||||
/// </summary>
|
||||
const uint BCameraControlUp = 811;
|
||||
/// <summary>
|
||||
/// 812
|
||||
/// </summary>
|
||||
const uint BCameraControlDown = 812;
|
||||
/// <summary>
|
||||
/// 813
|
||||
/// </summary>
|
||||
const uint BCameraControlLeft = 813;
|
||||
/// <summary>
|
||||
/// 814
|
||||
/// </summary>
|
||||
const uint BCameraControlRight = 814;
|
||||
/// <summary>
|
||||
/// 815
|
||||
/// </summary>
|
||||
const uint BCameraControlZoomIn = 815;
|
||||
/// <summary>
|
||||
/// 816
|
||||
/// </summary>
|
||||
const uint BCameraControlZoomOut = 816;
|
||||
/// <summary>
|
||||
/// 821 - 826
|
||||
/// </summary>
|
||||
const uint BCameraPresetStart = 821;
|
||||
|
||||
/// <summary>
|
||||
/// 831
|
||||
/// </summary>
|
||||
const uint BCameraModeAuto = 831;
|
||||
/// <summary>
|
||||
/// 832
|
||||
/// </summary>
|
||||
const uint BCameraModeManual = 832;
|
||||
/// <summary>
|
||||
/// 833
|
||||
/// </summary>
|
||||
const uint BCameraModeOff = 833;
|
||||
|
||||
|
||||
|
||||
/********* Ushorts *********/
|
||||
/// <summary>
|
||||
/// 760
|
||||
/// </summary>
|
||||
const uint UCameraNumberSelect = 760;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint UDirectorySelectRow = 801;
|
||||
/// <summary>
|
||||
/// 801
|
||||
/// </summary>
|
||||
const uint UDirectoryRowCount = 801;
|
||||
|
||||
|
||||
|
||||
/********* Strings *********/
|
||||
/// <summary>
|
||||
/// 701
|
||||
/// </summary>
|
||||
const uint SCurrentDialString = 701;
|
||||
/// <summary>
|
||||
/// 702
|
||||
/// </summary>
|
||||
const uint SCurrentCallName = 702;
|
||||
/// <summary>
|
||||
/// 703
|
||||
/// </summary>
|
||||
const uint SCurrentCallNumber = 703;
|
||||
/// <summary>
|
||||
/// 731
|
||||
/// </summary>
|
||||
const uint SHookState = 731;
|
||||
/// <summary>
|
||||
/// 722
|
||||
/// </summary>
|
||||
const uint SCallDirection = 722;
|
||||
/// <summary>
|
||||
/// 751
|
||||
/// </summary>
|
||||
const uint SIncomingCallName = 751;
|
||||
/// <summary>
|
||||
/// 752
|
||||
/// </summary>
|
||||
const uint SIncomingCallNumber = 752;
|
||||
|
||||
/// <summary>
|
||||
/// 800
|
||||
/// </summary>
|
||||
const uint SDirectorySearchString = 800;
|
||||
/// <summary>
|
||||
/// 801-1055
|
||||
/// </summary>
|
||||
const uint SDirectoryEntriesStart = 801;
|
||||
/// <summary>
|
||||
/// 1056
|
||||
/// </summary>
|
||||
const uint SDirectoryEntrySelectedName = 1056;
|
||||
/// <summary>
|
||||
/// 1057
|
||||
/// </summary>
|
||||
const uint SDirectoryEntrySelectedNumber = 1057;
|
||||
/// <summary>
|
||||
/// 1058
|
||||
/// </summary>
|
||||
const uint SDirectorySelectedFolderName = 1058;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 701-712 0-9*#
|
||||
/// </summary>
|
||||
Dictionary<string, uint> DTMFMap = new Dictionary<string, uint>
|
||||
{
|
||||
{ "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;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="eisc"></param>
|
||||
/// <param name="messagePath"></param>
|
||||
public Ddvc01VtcMessenger(string key, BasicTriList eisc, string messagePath)
|
||||
: base(key, messagePath)
|
||||
{
|
||||
EISC = eisc;
|
||||
|
||||
CurrentCallItem = new CodecActiveCallItem();
|
||||
CurrentCallItem.Type = eCodecCallType.Video;
|
||||
CurrentCallItem.Id = "-video-";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="appServerController"></param>
|
||||
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<string, uint> 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<string, uint> 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<string>(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<string>(s =>
|
||||
EISC.SetString(SCurrentDialString, s)));
|
||||
// Pulse DTMF
|
||||
asc.AddAction(MessagePath + "/dtmf", new Action<string>(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<string>(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<string>(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);
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
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(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostDirectory()
|
||||
{
|
||||
var u = EISC.GetUshort(UDirectoryRowCount);
|
||||
var items = new List<object>();
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCameraMode()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
cameraMode = GetCameraMode()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="mode"></param>
|
||||
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()
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
string GetSelectedCamera()
|
||||
{
|
||||
var num = EISC.GetUshort(UCameraNumberSelect);
|
||||
string m;
|
||||
if (num == 100)
|
||||
{
|
||||
m = "cameraFar";
|
||||
}
|
||||
else
|
||||
{
|
||||
m = "camera" + num;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostIsReady()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
isReady = true
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void PostCallsList()
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
calls = GetCurrentCallList(),
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="s"></param>
|
||||
void SelectCamera(string s)
|
||||
{
|
||||
var cam = s.Substring(6);
|
||||
if (cam.ToLower() == "far")
|
||||
{
|
||||
EISC.SetUshort(UCameraNumberSelect, 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
EISC.SetUshort(UCameraNumberSelect, UInt16.Parse(cam));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Turns the
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
List<CodecActiveCallItem> GetCurrentCallList()
|
||||
{
|
||||
var list = new List<CodecActiveCallItem>();
|
||||
if (CurrentCallItem.Status != eCodecCallStatus.Disconnected)
|
||||
{
|
||||
list.Add(CurrentCallItem);
|
||||
}
|
||||
if (EISC.GetBool(BCallIncoming)) {
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -40,8 +40,11 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <param name="e"></param>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
if (dirCodec != null)
|
||||
{
|
||||
dirCodec.DirectoryResultReturned += new EventHandler<DirectoryEventArgs>(dirCodec_DirectoryResultReturned);
|
||||
|
||||
}
|
||||
|
||||
var recCodec = codec as IHasCallHistory;
|
||||
@@ -74,12 +75,73 @@ namespace PepperDash.Essentials.AppServer.Messengers
|
||||
/// <param name="e"></param>
|
||||
void dirCodec_DirectoryResultReturned(object sender, DirectoryEventArgs e)
|
||||
{
|
||||
PostStatusMessage(new
|
||||
{
|
||||
currentDirectory = e.Directory
|
||||
});
|
||||
SendDirectory((Codec as IHasDirectory).CurrentDirectoryResult, e.DirectoryIsOnRoot);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Posts the current directory
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Iterates a directory object and prefixes any folder items with "[+] "
|
||||
/// </summary>
|
||||
/// <param name="directory"></param>
|
||||
/// <returns></returns>
|
||||
List<DirectoryItem> PrefixDirectoryFolderItems (CodecDirectory directory)
|
||||
{
|
||||
var tempDirectoryList = new List<DirectoryItem>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -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<string>(s => GetDirectory(s)));
|
||||
appServerController.AddAction(MessagePath + "/directorySearch", new Action<string>(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<string>(s => GetDirectory(s)));
|
||||
appServerController.AddAction(MessagePath + "/directorySearch", new Action<string>(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
|
||||
//});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Requests the parent folder contents
|
||||
/// </summary>
|
||||
void GetPreviousDirectory()
|
||||
{
|
||||
var dirCodec = Codec as IHasDirectory;
|
||||
if (dirCodec == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
dirCodec.GetDirectoryParentFolderContents();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handler for codec changes
|
||||
/// </summary>
|
||||
@@ -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
|
||||
});
|
||||
|
||||
@@ -56,7 +56,10 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeMuteToggle = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeMutesJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 61
|
||||
/// </summary>
|
||||
@@ -72,7 +75,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// <summary>
|
||||
/// 72
|
||||
/// </summary>
|
||||
public const uint SourceHasChanged = 72;
|
||||
public const uint SourceHasChanged = 71;
|
||||
/// <summary>
|
||||
/// 261 - The start of the range of speed dial visibles
|
||||
/// </summary>
|
||||
@@ -81,6 +84,11 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// 501
|
||||
/// </summary>
|
||||
public const uint ConfigIsReady = 501;
|
||||
/// <summary>
|
||||
/// 601
|
||||
/// </summary>
|
||||
public const uint SourceShareDisableStartJoin = 601;
|
||||
|
||||
}
|
||||
|
||||
public class UshortJoin
|
||||
@@ -89,15 +97,26 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint MasterVolumeLevel = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeSlidersJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 61
|
||||
/// </summary>
|
||||
public const uint ShutdownPromptDuration = 61;
|
||||
/// <summary>
|
||||
/// 101
|
||||
/// </summary>
|
||||
public const uint VolumeSliderCount = 101;
|
||||
}
|
||||
|
||||
public class StringJoin
|
||||
{
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint VolumeSliderNamesJoinStart = 1;
|
||||
/// <summary>
|
||||
/// 71
|
||||
/// </summary>
|
||||
@@ -141,6 +160,38 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
/// 402
|
||||
/// </summary>
|
||||
public const uint ServerUrl = 402;
|
||||
/// <summary>
|
||||
/// 512
|
||||
/// </summary>
|
||||
public const uint RoomSpeedDialNamesJoinStart = 512;
|
||||
/// <summary>
|
||||
/// 516
|
||||
/// </summary>
|
||||
public const uint RoomSpeedDialNumberssJoinStart = 516;
|
||||
/// <summary>
|
||||
/// 601
|
||||
/// </summary>
|
||||
public const uint SourceNameJoinStart = 601;
|
||||
/// <summary>
|
||||
/// 621
|
||||
/// </summary>
|
||||
public const uint SourceIconJoinStart = 621;
|
||||
/// <summary>
|
||||
/// 641
|
||||
/// </summary>
|
||||
public const uint SourceKeyJoinStart = 641;
|
||||
/// <summary>
|
||||
/// 661
|
||||
/// </summary>
|
||||
public const uint SourceTypeJoinStart = 661;
|
||||
/// <summary>
|
||||
/// 761
|
||||
/// </summary>
|
||||
public const uint CameraNearNameStart = 761;
|
||||
/// <summary>
|
||||
/// 770 - presence of this name on the input will cause the camera to be added
|
||||
/// </summary>
|
||||
public const uint CameraFarName = 770;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -166,6 +217,7 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
CotijaDdvc01DeviceBridge SourceBridge;
|
||||
|
||||
Ddvc01AtcMessenger AtcMessenger;
|
||||
Ddvc01VtcMessenger VtcMessenger;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -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
|
||||
/// </summary>
|
||||
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<DDVC01RoomPropertiesConfig>(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<DDVC01SpeedDial>();
|
||||
// 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<string>();
|
||||
@@ -459,24 +516,39 @@ namespace PepperDash.Essentials.Room.Cotija
|
||||
|
||||
co.SourceLists = new Dictionary<string,Dictionary<string,SourceListItem>>();
|
||||
var newSl = new Dictionary<string, SourceListItem>();
|
||||
// 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<PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem>();
|
||||
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<object>();
|
||||
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));
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
public AudioCodecBaseMessenger ACMessenger { get; private set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -416,7 +417,7 @@ namespace PepperDash.Essentials
|
||||
if (rmVc != null)
|
||||
{
|
||||
var vc = rmVc.CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
if (rmVc != null)
|
||||
if (vc != null)
|
||||
{
|
||||
volumes.Master = new Volume("master", vc.VolumeLevelFeedback.UShortValue, vc.MuteFeedback.BoolValue, "Volume", true, "");
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,8 +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.DSP;
|
||||
//using PepperDash.Essentials.Devices.Common.Cameras;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
@@ -89,11 +88,11 @@ 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 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);
|
||||
@@ -125,26 +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 TVOneCorio)
|
||||
{
|
||||
(device as TVOneCorio).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is QscDsp)
|
||||
{
|
||||
(device as QscDsp).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;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
//}
|
||||
@@ -20,80 +20,83 @@ namespace PepperDash.Essentials.Bridges
|
||||
public static List<string> InputKeys = new List<string>();
|
||||
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();
|
||||
}
|
||||
|
||||
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();
|
||||
JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
||||
_TriList = trilist;
|
||||
|
||||
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, () =>
|
||||
if (JoinMap == null)
|
||||
{
|
||||
InputNumber = 102;
|
||||
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());
|
||||
|
||||
_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]);
|
||||
|
||||
// Poewer Off
|
||||
trilist.SetSigTrueAction(JoinMap.PowerOff, () =>
|
||||
{
|
||||
InputNumber = 102;
|
||||
InputNumberFeedback.FireUpdate();
|
||||
displayDevice.PowerOff();
|
||||
});
|
||||
|
||||
displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(PowerIsOnFeedback_OutputChange);
|
||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]);
|
||||
|
||||
// PowerOn
|
||||
trilist.SetSigTrueAction(JoinMap.PowerOn, () =>
|
||||
{
|
||||
InputNumber = 0;
|
||||
InputNumberFeedback.FireUpdate();
|
||||
displayDevice.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++;
|
||||
}
|
||||
|
||||
displayDevice.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(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();
|
||||
displayDevice.PowerOff();
|
||||
});
|
||||
|
||||
|
||||
displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(PowerIsOnFeedback_OutputChange);
|
||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[JoinMap.PowerOff]);
|
||||
|
||||
// Poewer On
|
||||
trilist.SetSigTrueAction(JoinMap.PowerOn, () =>
|
||||
{
|
||||
InputNumber = 0;
|
||||
InputNumberFeedback.FireUpdate();
|
||||
displayDevice.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++;
|
||||
}
|
||||
|
||||
displayDevice.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(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();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
|
||||
@@ -126,7 +129,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public uint Name { get; set; }
|
||||
public uint InputNamesOffset { get; set; }
|
||||
public uint InputSelectOffset { get; set; }
|
||||
public uint InputSelectOffset { get; set; }
|
||||
public uint IsOnline { get; set; }
|
||||
public uint PowerOff { get; set; }
|
||||
public uint InputSelect { get; set; }
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
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.DM;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmChassisControllerApiExtentions
|
||||
{
|
||||
public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmChassisControllerJoinMap;
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new DmChassisControllerJoinMap();
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
// Link up outputs
|
||||
for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs - 1; i++)
|
||||
{
|
||||
var ioSlot = i;
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||
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.DM;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmChassisControllerApiExtentions
|
||||
{
|
||||
public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DmChassisControllerJoinMap;
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new DmChassisControllerJoinMap();
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, dmChassis, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
dmChassis.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
// Link up outputs
|
||||
for (uint i = 1; i <= dmChassis.Chassis.NumberOfOutputs - 1; i++)
|
||||
{
|
||||
var ioSlot = i;
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)));
|
||||
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, new Action<ushort>(o => dmChassis.ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)));
|
||||
if (dmChassis.TxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
@@ -55,76 +55,76 @@ namespace PepperDash.Essentials.Bridges
|
||||
var RxKey = dmChassis.RxDictionary[ioSlot];
|
||||
var RxDevice = DeviceManager.GetDeviceForKey(RxKey) as DmRmcControllerBase;
|
||||
RxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
// Feedback
|
||||
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||
dmChassis.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
|
||||
|
||||
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||
dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
|
||||
// dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
// dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class DmChassisControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint OutputVideo { get; set; }
|
||||
public uint OutputAudio { get; set; }
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
public uint InputNames { get; set; }
|
||||
public uint OutputNames { get; set; }
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
public uint OutputCurrentAudioInputNames { get; set; }
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
//public uint HdcpSupport { get; set; }
|
||||
//public uint HdcpSupportCapability { get; set; }
|
||||
|
||||
|
||||
public DmChassisControllerJoinMap()
|
||||
{
|
||||
IsOnline = 11;
|
||||
OutputVideo = 100; //101-299
|
||||
OutputAudio = 300; //301-499
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
InputEndpointOnline = 500;
|
||||
OutputEndpointOnline = 700;
|
||||
//HdcpSupport = 1000; //1001-1199
|
||||
//HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
OutputAudio = OutputAudio + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
//HdcpSupport = HdcpSupport + joinOffset;
|
||||
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Feedback
|
||||
dmChassis.VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
|
||||
dmChassis.AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
|
||||
|
||||
dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
|
||||
|
||||
dmChassis.OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
|
||||
dmChassis.InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
|
||||
dmChassis.OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
|
||||
dmChassis.OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
|
||||
// dmChassis.InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
|
||||
// dmChassis.OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class DmChassisControllerJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint OutputVideo { get; set; }
|
||||
public uint OutputAudio { get; set; }
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
public uint InputNames { get; set; }
|
||||
public uint OutputNames { get; set; }
|
||||
public uint OutputCurrentVideoInputNames { get; set; }
|
||||
public uint OutputCurrentAudioInputNames { get; set; }
|
||||
public uint InputCurrentResolution { get; set; }
|
||||
public uint InputEndpointOnline { get; set; }
|
||||
public uint OutputEndpointOnline { get; set; }
|
||||
//public uint HdcpSupport { get; set; }
|
||||
//public uint HdcpSupportCapability { get; set; }
|
||||
|
||||
|
||||
public DmChassisControllerJoinMap()
|
||||
{
|
||||
IsOnline = 11;
|
||||
OutputVideo = 100; //101-299
|
||||
OutputAudio = 300; //301-499
|
||||
VideoSyncStatus = 100; //101-299
|
||||
InputNames = 100; //101-299
|
||||
OutputNames = 300; //301-499
|
||||
OutputCurrentVideoInputNames = 2000; //2001-2199
|
||||
OutputCurrentAudioInputNames = 2200; //2201-2399
|
||||
InputCurrentResolution = 2400; // 2401-2599
|
||||
InputEndpointOnline = 500;
|
||||
OutputEndpointOnline = 700;
|
||||
//HdcpSupport = 1000; //1001-1199
|
||||
//HdcpSupportCapability = 1200; //1201-1399
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
OutputVideo = OutputVideo + joinOffset;
|
||||
OutputAudio = OutputAudio + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
InputNames = InputNames + joinOffset;
|
||||
OutputNames = OutputNames + joinOffset;
|
||||
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
|
||||
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
|
||||
InputCurrentResolution = InputCurrentResolution + joinOffset;
|
||||
InputEndpointOnline = InputEndpointOnline + joinOffset;
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
//HdcpSupport = HdcpSupport + joinOffset;
|
||||
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,104 +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 => {if(u > 0) { lightingDevice.SelectScene(lightingDevice.LightingScenes[u-1]);}});
|
||||
// // 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;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -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<string>(s => comm.CommPort.SendText(s)));
|
||||
trilist.SetStringSigAction(joinMap.SetPortConfig + 1, new Action<string>(s => comm.SetPortConfig(s)));
|
||||
|
||||
|
||||
@@ -1,224 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices.Common;
|
||||
using PepperDash.Essentials.Devices.Common.DSP;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class QscDspDeviceApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this QscDsp DspDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as QscDspDeviceJoinMap;
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new QscDspDeviceJoinMap();
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
Debug.Console(1, DspDevice, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
ushort x = 1;
|
||||
var comm = DspDevice as ICommunicationMonitor;
|
||||
DspDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
foreach (var channel in DspDevice.LevelControlPoints)
|
||||
{
|
||||
//var QscChannel = channel.Value as PepperDash.Essentials.Devices.Common.DSP.QscDspLevelControl;
|
||||
Debug.Console(2, "QscChannel {0} connect", x);
|
||||
|
||||
var genericChannel = channel.Value as IBasicVolumeWithFeedback;
|
||||
if (channel.Value.Enabled)
|
||||
{
|
||||
trilist.StringInput[joinMap.ChannelName + x].StringValue = channel.Value.LevelCustomName;
|
||||
trilist.UShortInput[joinMap.ChannelType + x].UShortValue = (ushort)channel.Value.Type;
|
||||
|
||||
genericChannel.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.ChannelMuteToggle + x]);
|
||||
genericChannel.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.ChannelVolume + x]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.ChannelMuteToggle + x, () => genericChannel.MuteToggle());
|
||||
trilist.SetSigTrueAction(joinMap.ChannelMuteOn + x, () => genericChannel.MuteOn());
|
||||
trilist.SetSigTrueAction(joinMap.ChannelMuteOff + x, () => genericChannel.MuteOff());
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.ChannelVolumeUp + x, b => genericChannel.VolumeUp(b));
|
||||
trilist.SetBoolSigAction(joinMap.ChannelVolumeDown + x, b => genericChannel.VolumeDown(b));
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.ChannelVolume + x, u => genericChannel.SetVolume(u));
|
||||
|
||||
}
|
||||
x++;
|
||||
}
|
||||
x = 1;
|
||||
trilist.SetStringSigAction(joinMap.PresetStringCmd, s => DspDevice.RunPreset(s));
|
||||
foreach (var preset in DspDevice.PresetList)
|
||||
{
|
||||
trilist.StringInput[joinMap.Presets + x].StringValue = preset.label;
|
||||
trilist.SetSigTrueAction(joinMap.Presets + x, () => DspDevice.RunPresetNumber(x));
|
||||
x++;
|
||||
}
|
||||
foreach (var dialer in DspDevice.Dialers)
|
||||
{
|
||||
trilist.SetSigTrueAction(joinMap.Keypad0, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num0));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad1, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num1));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad2, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num2));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad3, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num3));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad4, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num4));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad5, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num5));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad6, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num6));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad7, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num7));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad8, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num8));
|
||||
trilist.SetSigTrueAction(joinMap.Keypad9, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Num9));
|
||||
trilist.SetSigTrueAction(joinMap.KeypadStar, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Star));
|
||||
trilist.SetSigTrueAction(joinMap.KeypadPound, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Pound));
|
||||
trilist.SetSigTrueAction(joinMap.KeypadClear, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Clear));
|
||||
trilist.SetSigTrueAction(joinMap.KeypadBackspace, () => dialer.Value.SendKeypad(PepperDash.Essentials.Devices.Common.DSP.QscDspDialer.eKeypadKeys.Backspace));
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.Dial, () => dialer.Value.Dial());
|
||||
trilist.SetSigTrueAction(joinMap.DoNotDisturbToggle, () => dialer.Value.DoNotDisturbToggle());
|
||||
trilist.SetSigTrueAction(joinMap.DoNotDisturbOn, () => dialer.Value.DoNotDisturbOn());
|
||||
trilist.SetSigTrueAction(joinMap.DoNotDisturbOff, () => dialer.Value.DoNotDisturbOff());
|
||||
trilist.SetSigTrueAction(joinMap.AutoAnswerToggle, () => dialer.Value.AutoAnswerToggle());
|
||||
trilist.SetSigTrueAction(joinMap.AutoAnswerOn, () => dialer.Value.AutoAnswerOn());
|
||||
trilist.SetSigTrueAction(joinMap.AutoAnswerOff, () => dialer.Value.AutoAnswerOff());
|
||||
|
||||
dialer.Value.DoNotDisturbFeedback.LinkInputSig(trilist.BooleanInput[joinMap.DoNotDisturbToggle]);
|
||||
dialer.Value.DoNotDisturbFeedback.LinkInputSig(trilist.BooleanInput[joinMap.DoNotDisturbOn]);
|
||||
dialer.Value.DoNotDisturbFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.DoNotDisturbOff]);
|
||||
|
||||
dialer.Value.AutoAnswerFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoAnswerToggle]);
|
||||
dialer.Value.AutoAnswerFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoAnswerOn]);
|
||||
dialer.Value.AutoAnswerFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoAnswerOff]);
|
||||
|
||||
dialer.Value.OffHookFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Dial]);
|
||||
dialer.Value.DialStringFeedback.LinkInputSig(trilist.StringInput[joinMap.DialStringCmd]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
public class QscDspDeviceJoinMap : JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint PresetStringCmd { get; set; }
|
||||
public uint ChannelMuteToggle { get; set; }
|
||||
public uint ChannelMuteOn { get; set; }
|
||||
public uint ChannelMuteOff { get; set; }
|
||||
public uint ChannelVolume { get; set; }
|
||||
public uint ChannelType { get; set; }
|
||||
public uint ChannelName { get; set; }
|
||||
public uint ChannelVolumeUp { get; set; }
|
||||
public uint ChannelVolumeDown { get; set; }
|
||||
public uint Presets { get; set; }
|
||||
public uint DialStringCmd { get; set; }
|
||||
public uint Keypad0 { get; set; }
|
||||
public uint Keypad1 { get; set; }
|
||||
public uint Keypad2 { get; set; }
|
||||
public uint Keypad3 { get; set; }
|
||||
public uint Keypad4 { get; set; }
|
||||
public uint Keypad5 { get; set; }
|
||||
public uint Keypad6 { get; set; }
|
||||
public uint Keypad7 { get; set; }
|
||||
public uint Keypad8 { get; set; }
|
||||
public uint Keypad9 { get; set; }
|
||||
public uint KeypadStar { get; set; }
|
||||
public uint KeypadPound { get; set; }
|
||||
public uint KeypadClear { get; set; }
|
||||
public uint KeypadBackspace { get; set; }
|
||||
public uint Dial { get; set; }
|
||||
public uint DoNotDisturbToggle { get; set; }
|
||||
public uint DoNotDisturbOn { get; set; }
|
||||
public uint DoNotDisturbOff { get; set; }
|
||||
public uint AutoAnswerToggle { get; set; }
|
||||
public uint AutoAnswerOn { get; set; }
|
||||
public uint AutoAnswerOff { get; set; }
|
||||
|
||||
public uint CallPreset { get; set; }
|
||||
public uint PresetFeedback { get; set; }
|
||||
|
||||
public QscDspDeviceJoinMap()
|
||||
{
|
||||
// Arrays
|
||||
ChannelName = 200;
|
||||
ChannelMuteToggle = 400;
|
||||
ChannelMuteOn = 600;
|
||||
ChannelMuteOff = 800;
|
||||
ChannelVolume = 200;
|
||||
ChannelVolumeUp = 1000;
|
||||
ChannelVolumeDown = 1200;
|
||||
ChannelType = 400;
|
||||
Presets = 100;
|
||||
|
||||
// SIngleJoins
|
||||
IsOnline = 1;
|
||||
PresetStringCmd = 2000;
|
||||
DialStringCmd = 3100;
|
||||
Keypad0 = 3110;
|
||||
Keypad1 = 3111;
|
||||
Keypad2 = 3112;
|
||||
Keypad3 = 3113;
|
||||
Keypad4 = 3114;
|
||||
Keypad5 = 3115;
|
||||
Keypad6 = 3116;
|
||||
Keypad7 = 3117;
|
||||
Keypad8 = 3118;
|
||||
Keypad9 = 3119;
|
||||
KeypadStar = 3120;
|
||||
KeypadPound = 3121;
|
||||
KeypadClear = 3122;
|
||||
KeypadBackspace = 3123;
|
||||
DoNotDisturbToggle = 3132;
|
||||
DoNotDisturbOn = 3133;
|
||||
DoNotDisturbOff = 3134;
|
||||
AutoAnswerToggle = 3127;
|
||||
AutoAnswerOn = 3125;
|
||||
AutoAnswerOff = 3126;
|
||||
Dial = 3124;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
ChannelName = ChannelName + joinOffset;
|
||||
ChannelMuteToggle = ChannelMuteToggle + joinOffset;
|
||||
ChannelMuteOn = ChannelMuteOn + joinOffset;
|
||||
ChannelMuteOff = ChannelMuteOff + joinOffset;
|
||||
ChannelVolume = ChannelVolume + joinOffset;
|
||||
ChannelVolumeUp = ChannelVolumeUp + joinOffset;
|
||||
ChannelVolumeDown = ChannelVolumeDown + joinOffset;
|
||||
ChannelType = ChannelType + joinOffset;
|
||||
Presets = Presets + joinOffset;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
PresetStringCmd = PresetStringCmd + joinOffset;
|
||||
DialStringCmd = DialStringCmd + joinOffset;
|
||||
Keypad0 = Keypad0 + joinOffset;
|
||||
Keypad1 = Keypad1 + joinOffset;
|
||||
Keypad2 = Keypad2 + joinOffset;
|
||||
Keypad3 = Keypad3 + joinOffset;
|
||||
Keypad4 = Keypad4 + joinOffset;
|
||||
Keypad5 = Keypad5 + joinOffset;
|
||||
Keypad6 = Keypad6 + joinOffset;
|
||||
Keypad7 = Keypad7 + joinOffset;
|
||||
Keypad8 = Keypad8 + joinOffset;
|
||||
Keypad9 = Keypad9 + joinOffset;
|
||||
KeypadStar = KeypadStar + joinOffset;
|
||||
KeypadPound = KeypadPound + joinOffset;
|
||||
KeypadClear = KeypadClear + joinOffset;
|
||||
KeypadBackspace = KeypadBackspace + joinOffset;
|
||||
DoNotDisturbToggle = DoNotDisturbToggle + joinOffset;
|
||||
DoNotDisturbOn = DoNotDisturbOn + joinOffset;
|
||||
DoNotDisturbOff = DoNotDisturbOff + joinOffset;
|
||||
AutoAnswerToggle = AutoAnswerToggle + joinOffset;
|
||||
AutoAnswerOn = AutoAnswerOn + joinOffset;
|
||||
AutoAnswerOff = AutoAnswerOff + joinOffset;
|
||||
Dial = Dial + joinOffset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
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 TvOneApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this TVOneCorio TvOne, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as TvOneJoinMap;
|
||||
|
||||
if (joinMap == null)
|
||||
joinMap = new TvOneJoinMap();
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
Debug.Console(1, TvOne, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
TvOne.OnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
trilist.SetUShortSigAction(joinMap.CallPreset, u => TvOne.CallPreset(u));
|
||||
TvOne.PresetFeedback.LinkInputSig(trilist.UShortInput[joinMap.PresetFeedback]);
|
||||
}
|
||||
}
|
||||
public class TvOneJoinMap : JoinMapBase
|
||||
{
|
||||
public uint CallPreset { get; set; }
|
||||
public uint PresetFeedback { get; set; }
|
||||
public uint IsOnline { get; set; }
|
||||
public TvOneJoinMap()
|
||||
{
|
||||
// Digital
|
||||
CallPreset = 1;
|
||||
PresetFeedback = 1;
|
||||
IsOnline = 1;
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
CallPreset = CallPreset + joinOffset;
|
||||
PresetFeedback = PresetFeedback + joinOffset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
@@ -21,6 +23,8 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
HttpLogoServer LogoServer;
|
||||
|
||||
List<object> FactoryObjects = new List<object>();
|
||||
|
||||
public ControlSystem()
|
||||
: base()
|
||||
{
|
||||
@@ -34,8 +38,6 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
public override void InitializeSystem()
|
||||
{
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
|
||||
|
||||
DeterminePlatform();
|
||||
|
||||
//CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
|
||||
@@ -73,7 +75,7 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </summary>
|
||||
@@ -93,20 +95,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);
|
||||
@@ -119,15 +141,14 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
try
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(EnablePortalSync, "portalsync", "Loads Portal Sync",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
//PortalSync = new PepperDashPortalSyncClient();
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
|
||||
|
||||
var filesReady = SetupFilesystem();
|
||||
if (filesReady)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Checking for plugins");
|
||||
LoadPlugins();
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
|
||||
if (!ConfigReader.LoadConfig2())
|
||||
return;
|
||||
@@ -158,13 +179,58 @@ namespace PepperDash.Essentials
|
||||
|
||||
}
|
||||
|
||||
// Notify the
|
||||
// Notify the OS that the program intitialization has completed
|
||||
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies filesystem is set up. IR, SGD, and program1 folders
|
||||
/// Initial simple implementation. Reads user/programN/plugins folder and
|
||||
/// use
|
||||
/// </summary>
|
||||
void LoadPlugins()
|
||||
{
|
||||
var dir = Global.FilePathPrefix + "plugins";
|
||||
if (Directory.Exists(dir))
|
||||
{
|
||||
// TODO Clear out or create localPlugins folder (maybe in program slot folder)
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Plugins directory found, checking for factory plugins");
|
||||
var di = new DirectoryInfo(dir);
|
||||
var files = di.GetFiles("*.dll");
|
||||
foreach (FileInfo fi in files)
|
||||
{
|
||||
// TODO COPY plugin to loadedPlugins folder
|
||||
|
||||
// TODO LOAD that loadedPlugins dll file
|
||||
|
||||
var assy = Assembly.LoadFrom(fi.FullName);
|
||||
var ver = assy.GetName().Version;
|
||||
var verStr = string.Format("{0}.{1}.{2}.{3}", ver.Major, ver.Minor, ver.Build, ver.Revision);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loaded plugin file '{0}', version {1}", fi.FullName, verStr);
|
||||
|
||||
// iteratate this assembly's classes, looking for "LoadPlugin()" methods
|
||||
var types = assy.GetTypes();
|
||||
foreach (var type in types)
|
||||
{
|
||||
var methods = type.GetMethods(BindingFlags.Public | BindingFlags.Static);
|
||||
var loadPlugin = methods.FirstOrDefault(m => m.Name.Equals("LoadPlugin"));
|
||||
if (loadPlugin != null)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding type {0}", fi.FullName, type.FullName);
|
||||
loadPlugin.Invoke(null, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// plugin dll will be loaded. Any classes in plugin should have a static constructor
|
||||
// that registers that class with the Core.DeviceFactory
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies filesystem is set up. IR, SGD, and programX folders
|
||||
/// </summary>
|
||||
bool SetupFilesystem()
|
||||
{
|
||||
@@ -185,14 +251,21 @@ namespace PepperDash.Essentials
|
||||
return configExists;
|
||||
}
|
||||
|
||||
public void EnablePortalSync(string s)
|
||||
{
|
||||
if (s.ToLower() == "enable")
|
||||
{
|
||||
CrestronConsole.ConsoleCommandResponse("Portal Sync features enabled");
|
||||
}
|
||||
}
|
||||
///// <summary>
|
||||
/////
|
||||
///// </summary>
|
||||
///// <param name="s"></param>
|
||||
//public void EnablePortalSync(string s)
|
||||
//{
|
||||
// if (s.ToLower() == "enable")
|
||||
// {
|
||||
// CrestronConsole.ConsoleCommandResponse("Portal Sync features enabled");
|
||||
// }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public void TearDown()
|
||||
{
|
||||
Debug.Console(0, "Tearing down existing system");
|
||||
@@ -245,9 +318,8 @@ namespace PepperDash.Essentials
|
||||
/// </summary>
|
||||
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"));
|
||||
@@ -257,7 +329,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
try
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}'", devConf.Key);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}', type '{1}'", devConf.Key, devConf.Type);
|
||||
// Skip this to prevent unnecessary warnings
|
||||
if (devConf.Key == "processor")
|
||||
{
|
||||
@@ -284,8 +356,20 @@ namespace PepperDash.Essentials
|
||||
newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf);
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
|
||||
if (newDev == null)
|
||||
newDev = PepperDash.Essentials.BridgeFactory.GetDevice(devConf);
|
||||
|
||||
//if (newDev == null) // might want to consider the ability to override an essentials "type"
|
||||
//{
|
||||
// // iterate plugin factories
|
||||
// foreach (var f in FactoryObjects)
|
||||
// {
|
||||
// var cresFactory = f as IGetCrestronDevice;
|
||||
// if (cresFactory != null)
|
||||
// {
|
||||
// newDev = cresFactory.GetDevice(devConf, this);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
if (newDev != null)
|
||||
DeviceManager.AddDevice(newDev);
|
||||
else
|
||||
|
||||
@@ -48,27 +48,27 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib" />
|
||||
<Reference Include="PepperDash_Core, Version=1.0.3.27452, Culture=neutral, processorArchitecture=MSIL">
|
||||
@@ -81,35 +81,37 @@
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpPro, Version=1.5.2.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AppServer\Messengers\AtcDdvc01Messenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\ConfigMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\Ddvc01AtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\AudioCodecBaseMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\Ddvc01VtcMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\MessengerBase.cs" />
|
||||
<Compile Include="AppServer\Messengers\SystemMonitorMessenger.cs" />
|
||||
<Compile Include="AppServer\Messengers\VideoCodecBaseMessenger.cs" />
|
||||
@@ -117,8 +119,6 @@
|
||||
<Compile Include="Bridges\BridgeBase.cs" />
|
||||
<Compile Include="Bridges\BridgeFactory.cs" />
|
||||
<Compile Include="Bridges\CameraControllerBridge.cs" />
|
||||
<Compile Include="Bridges\QscDspBridge.cs" />
|
||||
<Compile Include="Bridges\TvOneBridge.cs" />
|
||||
<Compile Include="Bridges\DisplayControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DigitalLoggerBridge.cs" />
|
||||
<Compile Include="Bridges\DmChassisControllerBridge.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.4.6.*")]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
public event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -58,16 +58,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
SmartObjectDynamicList RecentCallsList;
|
||||
|
||||
SmartObjectDynamicList DirectoryList;
|
||||
|
||||
CodecDirectory CurrentDirectoryResult;
|
||||
|
||||
/// <summary>
|
||||
/// Tracks the directory browse history when browsing beyond the root directory
|
||||
/// </summary>
|
||||
List<CodecDirectory> 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
|
||||
/// </summary>
|
||||
void SetupDirectoryList()
|
||||
{
|
||||
DirectoryBrowseHistory = new List<CodecDirectory>();
|
||||
|
||||
var codec = Codec as IHasDirectory;
|
||||
if (codec != null)
|
||||
{
|
||||
@@ -548,28 +538,20 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
codec.PhonebookSyncState.InitialSyncCompleted += new EventHandler<EventArgs>(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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
/// </summary>
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -597,13 +577,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
/// <param name="e"></param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -645,10 +613,10 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
/// <param name="dir"></param>
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,4 +30,11 @@ 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 ]}
|
||||
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": []}
|
||||
|
||||
|
||||
devjson:2 {"deviceKey":"display01Comm-com", "methodName":"SendText", "params": [ "I'M GETTING TIRED OF THIS" ]}
|
||||
Submodule essentials-framework updated: f3c18df713...11f52e170e
Reference in New Issue
Block a user