mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-01-12 12:05:00 +00:00
Compare commits
349 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05dadbe8ee | ||
|
|
c39fd231bf | ||
|
|
0df587071d | ||
|
|
cd4f2d5edd | ||
|
|
59b18d713b | ||
|
|
a7db15d9fd | ||
|
|
b8442e7048 | ||
|
|
1e65c961c6 | ||
|
|
bdc4f0ae28 | ||
|
|
82ac34d3b6 | ||
|
|
23555e5174 | ||
|
|
7c892b4f71 | ||
|
|
1abe54fa48 | ||
|
|
309605ee38 | ||
|
|
e2b8e356ff | ||
|
|
832102f4bb | ||
|
|
b23b7cb813 | ||
|
|
b42d487c4c | ||
|
|
5f668c7173 | ||
|
|
6db5a9b2ca | ||
|
|
89dd098ea6 | ||
|
|
787c8eb954 | ||
|
|
97b9ed5016 | ||
|
|
06fdee313a | ||
|
|
b3f7568469 | ||
|
|
55ab593d73 | ||
|
|
a06652ee61 | ||
|
|
4f26df3149 | ||
|
|
428edad38a | ||
|
|
f3431f287c | ||
|
|
80b5fb6c7f | ||
|
|
6df594dd7f | ||
|
|
e39c76001a | ||
|
|
d88a454499 | ||
|
|
b0e3fddec7 | ||
|
|
0e5cecbfc3 | ||
|
|
57dac392da | ||
|
|
348981d8cb | ||
|
|
bee3f0caf3 | ||
|
|
79a3a8ed7e | ||
|
|
cb3c80ff8f | ||
|
|
0bb4b6edd4 | ||
|
|
e4a4564bbc | ||
|
|
b0288951eb | ||
|
|
bfdc882eb6 | ||
|
|
7a2e99f145 | ||
|
|
db67f97a1f | ||
|
|
102ae3ad4f | ||
|
|
7dd6b3a9b6 | ||
|
|
e24965eb54 | ||
|
|
9d80954214 | ||
|
|
70c5df9040 | ||
|
|
89a7f2aa80 | ||
|
|
90023621dc | ||
|
|
adbce916ba | ||
|
|
b97783603b | ||
|
|
db526cdd40 | ||
|
|
db982f4490 | ||
|
|
c84525ddef | ||
|
|
a3b078d327 | ||
|
|
b9c07b01e9 | ||
|
|
d0097089e6 | ||
|
|
582390c7c7 | ||
|
|
faabdde3f7 | ||
|
|
402754b69e | ||
|
|
84b39a959e | ||
|
|
93bfcc7baa | ||
|
|
64352811c5 | ||
|
|
3a74abd061 | ||
|
|
08aa8fb2e6 | ||
|
|
b5589364ff | ||
|
|
6cd1a03ee0 | ||
|
|
e19b0ba530 | ||
|
|
7b2498ac6b | ||
|
|
d9181c780f | ||
|
|
bc826c9e17 | ||
|
|
c6023ad700 | ||
|
|
742ff4bc1b | ||
|
|
2502947df8 | ||
|
|
7075da5b68 | ||
|
|
abdd1b38f8 | ||
|
|
455d85e8f9 | ||
|
|
d1509fe94b | ||
|
|
9d87c76ab2 | ||
|
|
c87048a221 | ||
|
|
eef5503a5a | ||
|
|
793e46718d | ||
|
|
699d7aa9a2 | ||
|
|
554a16dc8f | ||
|
|
4dc4565e69 | ||
|
|
fb6021424e | ||
|
|
bb8761d710 | ||
|
|
3198f5d876 | ||
|
|
5d5dee2e5e | ||
|
|
05aece772f | ||
|
|
8393ae3ded | ||
|
|
4eace11943 | ||
|
|
89bd988391 | ||
|
|
8bfd3ffd51 | ||
|
|
56fa88a956 | ||
|
|
a21b6fe3f6 | ||
|
|
cc0ec3f8d3 | ||
|
|
a5e2e65116 | ||
|
|
eea59d682a | ||
|
|
c717f61b42 | ||
|
|
4a2b15b0c6 | ||
|
|
379498aea1 | ||
|
|
d320b2ca07 | ||
|
|
dba60cfd76 | ||
|
|
52c589b56b | ||
|
|
482bef435a | ||
|
|
99580ae8b5 | ||
|
|
60ed2ea537 | ||
|
|
7d89f51dcf | ||
|
|
1623ee1d9e | ||
|
|
0d4d86e0e6 | ||
|
|
2d64e49f8e | ||
|
|
acdd9bb674 | ||
|
|
c8b1808513 | ||
|
|
ce785ceb25 | ||
|
|
8e46d575e4 | ||
|
|
4650d17695 | ||
|
|
5816c3cafe | ||
|
|
e275d747f8 | ||
|
|
98ad7f315f | ||
|
|
d11389d110 | ||
|
|
0547bb07fd | ||
|
|
f27b0a1b59 | ||
|
|
5d1c5c9e99 | ||
|
|
458de1aaa6 | ||
|
|
661bf41de5 | ||
|
|
5d1bc88b28 | ||
|
|
156d58f42f | ||
|
|
68d71b1bab | ||
|
|
436674a708 | ||
|
|
5fd8e4bc2b | ||
|
|
41bf98a5a7 | ||
|
|
75e62eac33 | ||
|
|
cee9bd6af8 | ||
|
|
82121dc55c | ||
|
|
72a5491309 | ||
|
|
d12a2a19a8 | ||
|
|
0745f30177 | ||
|
|
a6e4efd64f | ||
|
|
611f0bec2e | ||
|
|
90e22e9136 | ||
|
|
4552a15cbb | ||
|
|
2f901b9fc4 | ||
|
|
3cf85f99ce | ||
|
|
c48f697b7e | ||
|
|
2e1195431f | ||
|
|
cf88e3b36d | ||
|
|
bceb7115ed | ||
|
|
1d2eb42c46 | ||
|
|
ef12650f9c | ||
|
|
176d4675da | ||
|
|
ae10e560f0 | ||
|
|
e152250363 | ||
|
|
8945398cd7 | ||
|
|
37a7886ec2 | ||
|
|
c685608f67 | ||
|
|
cdafaf1bcb | ||
|
|
fffaa1e5e6 | ||
|
|
d8aef1a0da | ||
|
|
6310001e18 | ||
|
|
b21495d624 | ||
|
|
2dbc3aa8db | ||
|
|
0ff29695e7 | ||
|
|
237d163ce3 | ||
|
|
f9c03d8d15 | ||
|
|
ff773b6ddc | ||
|
|
3a4c661e5d | ||
|
|
03f01b2f78 | ||
|
|
8aae23db9e | ||
|
|
fa89a73c4b | ||
|
|
a043309bb1 | ||
|
|
dc53ce42e7 | ||
|
|
6dd882b1a0 | ||
|
|
da8c2c4357 | ||
|
|
446bae4dd3 | ||
|
|
e7d1d560ee | ||
|
|
d3f30d8b71 | ||
|
|
2e5b7cad64 | ||
|
|
5171385b5b | ||
|
|
3ee44bcf6e | ||
|
|
949a04647b | ||
|
|
31f976d719 | ||
|
|
11ffc5130f | ||
|
|
59bfa354e4 | ||
|
|
536e82ef22 | ||
|
|
99d60af7cd | ||
|
|
63cd322fd0 | ||
|
|
489ba2da04 | ||
|
|
8087aa7a75 | ||
|
|
e7ca32207c | ||
|
|
cd186aa3a3 | ||
|
|
a212387c49 | ||
|
|
847d39bc2f | ||
|
|
b343101886 | ||
|
|
7dabe161a7 | ||
|
|
3de2ba03c1 | ||
|
|
39e85d5311 | ||
|
|
62bdddf4c1 | ||
|
|
2969458afe | ||
|
|
4196d50b4c | ||
|
|
a8d0dfb327 | ||
|
|
8d7c93a6e5 | ||
|
|
e593f1c281 | ||
|
|
369bdf5c66 | ||
|
|
3077b3f865 | ||
|
|
313b336d56 | ||
|
|
0ecf593e44 | ||
|
|
cef9e0a9a6 | ||
|
|
16369e31cf | ||
|
|
38959414ff | ||
|
|
6fcb47e0ef | ||
|
|
25423f0caa | ||
|
|
3a162ee9dd | ||
|
|
033f6e12f1 | ||
|
|
bc3247297e | ||
|
|
f7bf728263 | ||
|
|
32443a2102 | ||
|
|
c296ef9e21 | ||
|
|
c65616a426 | ||
|
|
d67a161e32 | ||
|
|
493b391d6f | ||
|
|
805022631b | ||
|
|
5442a1db48 | ||
|
|
5bf5d17ea8 | ||
|
|
d444b8a7ba | ||
|
|
61be312826 | ||
|
|
fb624ef20c | ||
|
|
e855359f61 | ||
|
|
5f50f14a71 | ||
|
|
1e9139f38e | ||
|
|
c521a1d551 | ||
|
|
d22c1bf344 | ||
|
|
fd232beae1 | ||
|
|
35edbeacfc | ||
|
|
b5cabfc644 | ||
|
|
bead782bd5 | ||
|
|
1e98484082 | ||
|
|
e7915b1e99 | ||
|
|
23600d8bc9 | ||
|
|
a165ba911f | ||
|
|
16db2663a6 | ||
|
|
8d1f187643 | ||
|
|
a6741e47e4 | ||
|
|
5a81ce9137 | ||
|
|
149c1dd22d | ||
|
|
79f9d09558 | ||
|
|
c7d9789ffb | ||
|
|
9c4c1d99b8 | ||
|
|
d06c73e994 | ||
|
|
54697e0eaf | ||
|
|
3d543dfd09 | ||
|
|
9c22c4cb5f | ||
|
|
f0942a3932 | ||
|
|
c0cdb09544 | ||
|
|
8c2c58d756 | ||
|
|
44e5753138 | ||
|
|
c71805cfc4 | ||
|
|
5d177104d8 | ||
|
|
d6878df267 | ||
|
|
a379641595 | ||
|
|
50aafb088e | ||
|
|
b853e8ed37 | ||
|
|
60c2d4df01 | ||
|
|
acd2be3679 | ||
|
|
e7cfe1143d | ||
|
|
55766b21ba | ||
|
|
21bc6a05de | ||
|
|
3c352bbd20 | ||
|
|
8ab3e45d96 | ||
|
|
11e5123fdf | ||
|
|
26bf7d8f73 | ||
|
|
c6d10ba87e | ||
|
|
12e8dca47e | ||
|
|
5c02d72ed1 | ||
|
|
115a20d8e6 | ||
|
|
c298d37b9f | ||
|
|
f3ab364a4d | ||
|
|
538f81c18e | ||
|
|
5f5ded74fc | ||
|
|
002cc07b52 | ||
|
|
16f993852c | ||
|
|
9ac1d77c2a | ||
|
|
2dd0c53a08 | ||
|
|
fab1219146 | ||
|
|
60d0f50cd2 | ||
|
|
c26d7d73f8 | ||
|
|
854a0691d3 | ||
|
|
61c638452b | ||
|
|
072411e4f6 | ||
|
|
1bf828b8a9 | ||
|
|
7dc9afa119 | ||
|
|
6f0bfedac1 | ||
|
|
71881addab | ||
|
|
397a5b1794 | ||
|
|
0867d08c5a | ||
|
|
5c3e1ca915 | ||
|
|
1de42b9e97 | ||
|
|
3aab807631 | ||
|
|
9ec090397f | ||
|
|
86916c4357 | ||
|
|
40151c5f8f | ||
|
|
4210df693a | ||
|
|
56bb872d2b | ||
|
|
0e41cafdad | ||
|
|
864e0675ea | ||
|
|
77672237e6 | ||
|
|
8ae03a8187 | ||
|
|
7114e60c04 | ||
|
|
c306e2c1a1 | ||
|
|
82af1366df | ||
|
|
56492a00cd | ||
|
|
28bac18667 | ||
|
|
ea254ef983 | ||
|
|
76e4d4a82d | ||
|
|
6542c062b9 | ||
|
|
4bd777f6b9 | ||
|
|
f607394ee7 | ||
|
|
085a64c87b | ||
|
|
2db397b474 | ||
|
|
bfa48091d9 | ||
|
|
c4752b2ac2 | ||
|
|
152dcbe81e | ||
|
|
56f9a29c61 | ||
|
|
290e887903 | ||
|
|
de7a74eaff | ||
|
|
88e5c49663 | ||
|
|
1415999d86 | ||
|
|
61d8370329 | ||
|
|
c8b0c7dd01 | ||
|
|
5f6b650dba | ||
|
|
94c0e92f6b | ||
|
|
a5046df671 | ||
|
|
5a4f7b6a28 | ||
|
|
dfaaa3f6bc | ||
|
|
377cccf912 | ||
|
|
9795637d75 | ||
|
|
6f6ca50c37 | ||
|
|
7b7ec53355 | ||
|
|
e3920132bf | ||
|
|
c2e5bd290a | ||
|
|
7fd52814a0 | ||
|
|
06a3dda2e4 | ||
|
|
d97ca6d5a4 | ||
|
|
4c50d6980f |
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@@ -22,7 +22,7 @@ env:
|
||||
RELEASE_BRANCH: main
|
||||
jobs:
|
||||
Build_Project:
|
||||
runs-on: windows-latest
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
# First we checkout the source repo
|
||||
- name: Checkout repo
|
||||
@@ -98,7 +98,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Push_Nuget_Package:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
|
||||
4
.github/workflows/main.yml
vendored
4
.github/workflows/main.yml
vendored
@@ -19,7 +19,7 @@ env:
|
||||
RELEASE_BRANCH: main
|
||||
jobs:
|
||||
Build_Project:
|
||||
runs-on: windows-latest
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
# First we checkout the source repo
|
||||
- name: Checkout repo
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Push_Nuget_Package:
|
||||
needs: Build_Project
|
||||
runs-on: windows-latest
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- name: Download Build Version Info
|
||||
uses: actions/download-artifact@v1
|
||||
|
||||
BIN
IR Drivers/Apple_AppleTV_4th_Gen_Essentials.ir
Normal file
BIN
IR Drivers/Apple_AppleTV_4th_Gen_Essentials.ir
Normal file
Binary file not shown.
@@ -28,6 +28,7 @@ namespace PepperDash.Essentials
|
||||
HttpLogoServer LogoServer;
|
||||
|
||||
private CTimer _startTimer;
|
||||
private CEvent _initializeEvent;
|
||||
private const long StartupTime = 500;
|
||||
|
||||
public ControlSystem()
|
||||
@@ -46,6 +47,24 @@ namespace PepperDash.Essentials
|
||||
public override void InitializeSystem()
|
||||
{
|
||||
_startTimer = new CTimer(StartSystem,StartupTime);
|
||||
|
||||
|
||||
// If the control system is a DMPS type, we need to wait to exit this method until all devices have had time to activate
|
||||
// to allow any HD-BaseT DM endpoints to register first.
|
||||
if (Global.ControlSystemIsDmpsType)
|
||||
{
|
||||
Debug.Console(2, "******************* InitializeSystem() Entering **********************");
|
||||
|
||||
_initializeEvent = new CEvent();
|
||||
|
||||
DeviceManager.AllDevicesActivated += (o, a) =>
|
||||
{
|
||||
_initializeEvent.Set();
|
||||
Debug.Console(2, "******************* InitializeSystem() Exiting **********************");
|
||||
};
|
||||
|
||||
_initializeEvent.Wait(30000);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartSystem(object obj)
|
||||
@@ -343,7 +362,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
var prompt = Global.ControlSystem.ControllerPrompt;
|
||||
|
||||
var typeMatch = String.Equals(devConf.Type, prompt, StringComparison.OrdinalIgnoreCase) &&
|
||||
var typeMatch = String.Equals(devConf.Type, prompt, StringComparison.OrdinalIgnoreCase) ||
|
||||
String.Equals(devConf.Type, prompt.Replace("-", ""), StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (!typeMatch)
|
||||
@@ -361,9 +380,7 @@ namespace PepperDash.Essentials
|
||||
if(propertiesConfig == null)
|
||||
propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
|
||||
|
||||
var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig);
|
||||
|
||||
DeviceManager.AddDevice(dmpsRoutingController);
|
||||
DeviceManager.AddDevice(DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig));
|
||||
}
|
||||
else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
|
||||
{
|
||||
@@ -450,14 +467,13 @@ namespace PepperDash.Essentials
|
||||
return;
|
||||
}
|
||||
|
||||
uint fusionIpId = 0xf1;
|
||||
|
||||
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
|
||||
{
|
||||
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as IEssentialsRoom;
|
||||
if (room != null)
|
||||
{
|
||||
// default IPID
|
||||
uint fusionIpId = 0xf1;
|
||||
|
||||
// default to no join map key
|
||||
string fusionJoinMapKey = string.Empty;
|
||||
|
||||
@@ -478,7 +494,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
DeviceManager.AddDevice(room);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
|
||||
DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase(room, fusionIpId, fusionJoinMapKey));
|
||||
|
||||
|
||||
@@ -490,8 +506,11 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
DeviceManager.AddDevice(room);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
||||
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((IEssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey));
|
||||
if (!(room is EssentialsCombinedHuddleVtc1Room))
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
|
||||
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((IEssentialsHuddleVtc1Room)room, fusionIpId, fusionJoinMapKey));
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||
|
||||
@@ -502,7 +521,7 @@ namespace PepperDash.Essentials
|
||||
DeviceManager.AddDevice(room);
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
||||
"Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion");
|
||||
"Room is EssentialsTechRoom, Attempting to add to DeviceManager with Fusion with IP-ID {0:X2}", fusionIpId);
|
||||
DeviceManager.AddDevice(new EssentialsTechRoomFusionSystemController((EssentialsTechRoom)room, fusionIpId, fusionJoinMapKey));
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge");
|
||||
@@ -515,9 +534,13 @@ namespace PepperDash.Essentials
|
||||
DeviceManager.AddDevice(room);
|
||||
}
|
||||
|
||||
fusionIpId += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
{
|
||||
"name": "Wireless Video",
|
||||
"key": "wePresent-1",
|
||||
"type": "wePresent",
|
||||
"type": "genericSource",
|
||||
"group": "genericSource",
|
||||
"uid": 9,
|
||||
"properties": {
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
{
|
||||
"name": "Wireless Video",
|
||||
"key": "wePresent-1",
|
||||
"type": "wePresent",
|
||||
"type": "genericSource",
|
||||
"properties": {},
|
||||
"group": "genericSource",
|
||||
"uid": 3
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace PepperDash.Essentials.Fusion
|
||||
|
||||
protected override void CreateSymbolAndBasicSigs(uint ipId)
|
||||
{
|
||||
Debug.Console(1, this, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
|
||||
Debug.Console(0, this, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
|
||||
|
||||
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
||||
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
||||
|
||||
@@ -144,12 +144,14 @@
|
||||
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
|
||||
<Compile Include="Room\Config\EssentialsTechRoomConfig.cs" />
|
||||
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
|
||||
<Compile Include="Room\Types\EssentialsCombinedHuddleVtc1Room.cs" />
|
||||
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
|
||||
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
||||
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
|
||||
<Compile Include="Room\Config\EssentialsRoomConfig.cs" />
|
||||
<Compile Include="Room\Types\EssentialsTechRoom.cs" />
|
||||
<Compile Include="Room\Types\IEssentialsHuddleSpaceRoom.cs" />
|
||||
<Compile Include="Room\Types\Interfaces\IEssentialsHuddleSpaceRoom.cs" />
|
||||
<Compile Include="Room\Types\Interfaces\IEssentialsHuddleVtc1Room.cs" />
|
||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
|
||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
|
||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ControlSystem>
|
||||
<Name>192.168.10.1</Name>
|
||||
<Address>auto 192.168.10.1</Address>
|
||||
<Name>Test RMC3</Name>
|
||||
<Address>auto 192.168.1.40;username crestron</Address>
|
||||
<ProgramSlot>Program01</ProgramSlot>
|
||||
<Storage>Internal Flash</Storage>
|
||||
</ControlSystem>
|
||||
@@ -39,6 +39,10 @@ namespace PepperDash.Essentials.Room.Config
|
||||
{
|
||||
return new EssentialsDualDisplayRoom(roomConfig);
|
||||
}
|
||||
if (typeName == "combinedhuddlevtc1")
|
||||
{
|
||||
return new EssentialsCombinedHuddleVtc1Room(roomConfig);
|
||||
}
|
||||
|
||||
return typeName != "techroom" ? null : new EssentialsTechRoom(roomConfig);
|
||||
}
|
||||
@@ -147,6 +151,24 @@ namespace PepperDash.Essentials.Room.Config
|
||||
[JsonProperty("helpMessage")]
|
||||
public string HelpMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Read this value to get the help message. It checks for the old and new config format.
|
||||
/// </summary>
|
||||
public string HelpMessageForDisplay
|
||||
{
|
||||
get
|
||||
{
|
||||
if(Help != null && !string.IsNullOrEmpty(Help.Message))
|
||||
{
|
||||
return Help.Message;
|
||||
}
|
||||
else
|
||||
{
|
||||
return HelpMessage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("environment")]
|
||||
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
|
||||
|
||||
@@ -183,6 +205,12 @@ namespace PepperDash.Essentials.Room.Config
|
||||
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
|
||||
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates if this room represents a combination of other rooms
|
||||
/// </summary>
|
||||
[JsonProperty("isRoomCombinationScenario")]
|
||||
public bool IsRoomCombinationScenario { get; set; }
|
||||
|
||||
public EssentialsRoomPropertiesConfig()
|
||||
{
|
||||
LogoLight = new EssentialsLogoPropertiesConfig();
|
||||
|
||||
@@ -56,6 +56,9 @@ namespace PepperDash.Essentials.Room.Config
|
||||
[JsonProperty("mirroredTuners")]
|
||||
public Dictionary<uint, string> MirroredTuners { get; set; }
|
||||
|
||||
[JsonProperty("helpMessage")]
|
||||
public string HelpMessage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the room
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,821 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsCombinedHuddleVtc1Room : EssentialsRoomBase, IEssentialsHuddleVtc1Room
|
||||
{
|
||||
private bool _codecExternalSourceChange;
|
||||
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
public event SourceInfoChangeHandler CurrentSourceChange;
|
||||
|
||||
|
||||
//************************
|
||||
// Call-related stuff
|
||||
|
||||
public BoolFeedback InCallFeedback { get; private set; }
|
||||
|
||||
///// <summary>
|
||||
///// Make this more specific
|
||||
///// </summary>
|
||||
//public List<CodecActiveCallItem> ActiveCalls { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// States: 0 for on hook, 1 for video, 2 for audio, 3 for telekenesis
|
||||
/// </summary>
|
||||
public IntFeedback CallTypeFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public BoolFeedback PrivacyModeIsOnFeedback { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// When something in the room is sharing with the far end or through other means
|
||||
/// </summary>
|
||||
public BoolFeedback IsSharingFeedback { get; private set; }
|
||||
|
||||
//************************
|
||||
|
||||
protected override Func<bool> OnFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () =>
|
||||
{
|
||||
|
||||
var displays = Displays.OfType<DisplayBase>().ToList();
|
||||
|
||||
var val = CurrentSourceInfo != null
|
||||
&& CurrentSourceInfo.Type == eSourceListItemType.Route
|
||||
&& displays.Count > 0;
|
||||
//&& disp.PowerIsOnFeedback.BoolValue;
|
||||
return val;
|
||||
};
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected override Func<bool> IsWarmingFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () => Displays.OfType<TwoWayDisplayBase>().Any((d) => d.IsWarmingUpFeedback.BoolValue);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected override Func<bool> IsCoolingFeedbackFunc
|
||||
{
|
||||
get
|
||||
{
|
||||
return () => Displays.OfType<TwoWayDisplayBase>().Any((d) => d.IsCoolingDownFeedback.BoolValue);
|
||||
}
|
||||
}
|
||||
|
||||
public EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
private List<IRoutingSinkWithSwitching> Displays;
|
||||
|
||||
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
|
||||
|
||||
public IBasicVolumeControls DefaultAudioDevice { get; private set; }
|
||||
public IBasicVolumeControls DefaultVolumeControls { get; private set; }
|
||||
|
||||
public VideoCodecBase VideoCodec { get; private set; }
|
||||
|
||||
public AudioCodecBase AudioCodec { get; private set; }
|
||||
|
||||
public bool ExcludeFromGlobalFunctions { get; set; }
|
||||
|
||||
public string DefaultSourceItem { get; set; }
|
||||
|
||||
public ushort DefaultVolume { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If room is off, enables power on to last source. Default true
|
||||
/// </summary>
|
||||
public bool EnablePowerOnToLastSource { get; set; }
|
||||
string LastSourceKey;
|
||||
|
||||
/// <summary>
|
||||
/// Sets the volume control device, and attaches/removes InUseTrackers with "audio"
|
||||
/// tag to device.
|
||||
/// </summary>
|
||||
public IBasicVolumeControls CurrentVolumeControls
|
||||
{
|
||||
get { return _CurrentAudioDevice; }
|
||||
set
|
||||
{
|
||||
if (value == _CurrentAudioDevice) return;
|
||||
|
||||
var oldDev = _CurrentAudioDevice;
|
||||
// derigister this room from the device, if it can
|
||||
if (oldDev is IInUseTracking)
|
||||
(oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
|
||||
var handler = CurrentVolumeDeviceChange;
|
||||
if (handler != null)
|
||||
CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
|
||||
_CurrentAudioDevice = value;
|
||||
if (handler != null)
|
||||
CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
|
||||
// register this room with new device, if it can
|
||||
if (_CurrentAudioDevice is IInUseTracking)
|
||||
(_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
|
||||
}
|
||||
}
|
||||
IBasicVolumeControls _CurrentAudioDevice;
|
||||
|
||||
/// <summary>
|
||||
/// The SourceListItem last run - containing names and icons
|
||||
/// </summary>
|
||||
public SourceListItem CurrentSourceInfo
|
||||
{
|
||||
get { return _CurrentSourceInfo; }
|
||||
set
|
||||
{
|
||||
if (value == _CurrentSourceInfo) return;
|
||||
|
||||
var handler = CurrentSourceChange;
|
||||
// remove from in-use tracker, if so equipped
|
||||
if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
|
||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
|
||||
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.WillChange);
|
||||
|
||||
_CurrentSourceInfo = value;
|
||||
|
||||
// add to in-use tracking
|
||||
if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
|
||||
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
||||
if (handler != null)
|
||||
handler(_CurrentSourceInfo, ChangeType.DidChange);
|
||||
|
||||
var vc = VideoCodec as IHasExternalSourceSwitching;
|
||||
if (vc != null && !_codecExternalSourceChange)
|
||||
{
|
||||
vc.SetSelectedSource(CurrentSourceInfoKey);
|
||||
}
|
||||
|
||||
_codecExternalSourceChange = false;
|
||||
}
|
||||
}
|
||||
SourceListItem _CurrentSourceInfo;
|
||||
|
||||
public string CurrentSourceInfoKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// "codecOsd"
|
||||
/// </summary>
|
||||
public string DefaultCodecRouteString { get { return "codecOsd"; } }
|
||||
|
||||
/// <summary>
|
||||
/// Temporary implementation. Returns the schedule-ready object or null if none. Fow now,
|
||||
/// always returns the VideoCodec if it is capable
|
||||
/// </summary>
|
||||
public IHasScheduleAwareness ScheduleSource { get { return VideoCodec as IHasScheduleAwareness; } }
|
||||
|
||||
CCriticalSection SourceSelectLock = new CCriticalSection();
|
||||
|
||||
public EssentialsCombinedHuddleVtc1Room(DeviceConfig config)
|
||||
: base(config)
|
||||
{
|
||||
try
|
||||
{
|
||||
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>
|
||||
(config.Properties.ToString());
|
||||
|
||||
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
|
||||
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
|
||||
|
||||
|
||||
if (VideoCodec == null)
|
||||
throw new ArgumentNullException("codec cannot be null");
|
||||
|
||||
AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
|
||||
PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
|
||||
if (AudioCodec == null)
|
||||
Debug.Console(0, this, "No Audio Codec Found");
|
||||
|
||||
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
|
||||
|
||||
Displays = new List<IRoutingSinkWithSwitching>();
|
||||
|
||||
Initialize();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "Error building room: \n{0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (DefaultAudioDevice is IBasicVolumeControls)
|
||||
DefaultVolumeControls = DefaultAudioDevice as IBasicVolumeControls;
|
||||
else if (DefaultAudioDevice is IHasVolumeDevice)
|
||||
DefaultVolumeControls = (DefaultAudioDevice as IHasVolumeDevice).VolumeDevice;
|
||||
CurrentVolumeControls = DefaultVolumeControls;
|
||||
|
||||
|
||||
// Combines call feedback from both codecs if available
|
||||
InCallFeedback = new BoolFeedback(() =>
|
||||
{
|
||||
bool inAudioCall = false;
|
||||
bool inVideoCall = false;
|
||||
|
||||
if (AudioCodec != null)
|
||||
inAudioCall = AudioCodec.IsInCall;
|
||||
|
||||
if (VideoCodec != null)
|
||||
inVideoCall = VideoCodec.IsInCall;
|
||||
|
||||
if (inAudioCall || inVideoCall)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
});
|
||||
|
||||
SetupDisplays();
|
||||
|
||||
// Get Microphone Privacy object, if any MUST HAPPEN AFTER setting InCallFeedback
|
||||
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.");
|
||||
|
||||
|
||||
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
VideoCodec.IsReadyChange += (o, a) => { this.SetCodecExternalSources(); SetCodecBranding(); };
|
||||
|
||||
if (AudioCodec != null)
|
||||
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
|
||||
|
||||
IsSharingFeedback = new BoolFeedback(() => VideoCodec.SharingContentIsOnFeedback.BoolValue);
|
||||
VideoCodec.SharingContentIsOnFeedback.OutputChange += (o, a) => this.IsSharingFeedback.FireUpdate();
|
||||
|
||||
// link privacy to VC (for now?)
|
||||
PrivacyModeIsOnFeedback = new BoolFeedback(() => VideoCodec.PrivacyModeIsOnFeedback.BoolValue);
|
||||
VideoCodec.PrivacyModeIsOnFeedback.OutputChange += (o, a) => this.PrivacyModeIsOnFeedback.FireUpdate();
|
||||
|
||||
CallTypeFeedback = new IntFeedback(() => 0);
|
||||
|
||||
SetSourceListKey();
|
||||
|
||||
EnablePowerOnToLastSource = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, this, "Error Initializing Room: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupDisplays()
|
||||
{
|
||||
//DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
|
||||
|
||||
var destinationList = ConfigReader.ConfigObject.DestinationLists[PropertiesConfig.DestinationListKey];
|
||||
|
||||
foreach (var destination in destinationList)
|
||||
{
|
||||
var dest = destination.Value.SinkDevice as IRoutingSinkWithSwitching;
|
||||
|
||||
if (dest != null)
|
||||
{
|
||||
Displays.Add(dest);
|
||||
}
|
||||
|
||||
var display = dest as DisplayBase;
|
||||
if (display != null)
|
||||
{
|
||||
// Link power, warming, cooling to display
|
||||
var dispTwoWay = display as IHasPowerControlWithFeedback;
|
||||
if (dispTwoWay != null)
|
||||
{
|
||||
dispTwoWay.PowerIsOnFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
if (dispTwoWay.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
|
||||
{
|
||||
//if (!dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||
// CurrentSourceInfo = null;
|
||||
OnFeedback.FireUpdate();
|
||||
}
|
||||
if (dispTwoWay.PowerIsOnFeedback.BoolValue)
|
||||
{
|
||||
SetDefaultLevels();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
display.IsWarmingUpFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
IsWarmingUpFeedback.FireUpdate();
|
||||
if (!IsWarmingUpFeedback.BoolValue)
|
||||
(CurrentVolumeControls as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
|
||||
};
|
||||
display.IsCoolingDownFeedback.OutputChange += (o, a) =>
|
||||
{
|
||||
IsCoolingDownFeedback.FireUpdate();
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetSourceListKey()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
|
||||
{
|
||||
SetSourceListKey(PropertiesConfig.SourceListKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetSourceListKey(Key);
|
||||
}
|
||||
|
||||
SetCodecExternalSources();
|
||||
}
|
||||
|
||||
protected override void CustomSetConfig(DeviceConfig config)
|
||||
{
|
||||
var newPropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>(config.Properties.ToString());
|
||||
|
||||
if (newPropertiesConfig != null)
|
||||
PropertiesConfig = newPropertiesConfig;
|
||||
|
||||
ConfigWriter.UpdateRoomConfig(config);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
// Add Occupancy object from config
|
||||
if (PropertiesConfig.Occupancy != null)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Setting Occupancy Provider for room");
|
||||
this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
|
||||
IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
|
||||
}
|
||||
|
||||
this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
|
||||
this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
|
||||
|
||||
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
|
||||
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
|
||||
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
protected override void EndShutdown()
|
||||
{
|
||||
VideoCodec.EndAllCalls();
|
||||
|
||||
SetDefaultLevels();
|
||||
|
||||
RunDefaultPresentRoute();
|
||||
|
||||
CrestronEnvironment.Sleep(1000);
|
||||
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Shutting down room");
|
||||
|
||||
RunRouteAction("roomOff");
|
||||
VideoCodec.StopSharing();
|
||||
VideoCodec.StandbyActivate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Routes the default source item, if any. Returns true when default route exists
|
||||
/// </summary>
|
||||
public override bool RunDefaultPresentRoute()
|
||||
{
|
||||
if (DefaultSourceItem != null)
|
||||
RunRouteAction(DefaultSourceItem);
|
||||
|
||||
return DefaultSourceItem != null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets up the room when started into call mode without presenting a source
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public bool RunDefaultCallRoute()
|
||||
{
|
||||
RunRouteAction(DefaultCodecRouteString);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void RunRouteActionCodec(string routeKey, string sourceListKey)
|
||||
{
|
||||
_codecExternalSourceChange = true;
|
||||
RunRouteAction(routeKey, sourceListKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
public void RunRouteAction(string routeKey)
|
||||
{
|
||||
RunRouteAction(routeKey, new Action(() => { }));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="souceListKey"></param>
|
||||
/// <param name="successCallback"></param>
|
||||
public void RunRouteAction(string routeKey, string sourceListKey)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sourceListKey))
|
||||
{
|
||||
Debug.Console(1, this, "No sourceListKey present. RunRouteAction assumes default source list.");
|
||||
RunRouteAction(routeKey, new Action(() => { }));
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "sourceListKey present but not yet implemented");
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="routeKey"></param>
|
||||
/// <param name="souceListKey"></param>
|
||||
/// <param name="successCallback"></param>
|
||||
public void RunRouteAction(string routeKey, string sourceListKey, Action successCallback)
|
||||
{
|
||||
if (string.IsNullOrEmpty(sourceListKey))
|
||||
{
|
||||
RunRouteAction(routeKey, successCallback);
|
||||
}
|
||||
else
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets a source from config list SourceListKey and dynamically build and executes the
|
||||
/// route or commands
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
public void RunRouteAction(string routeKey, Action successCallback)
|
||||
{
|
||||
// Run this on a separate thread
|
||||
new CTimer(o =>
|
||||
{
|
||||
// try to prevent multiple simultaneous selections
|
||||
SourceSelectLock.TryEnter();
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Run route action '{0}'", routeKey);
|
||||
var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
|
||||
if (dict == null)
|
||||
{
|
||||
Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
|
||||
return;
|
||||
}
|
||||
|
||||
// Try to get the list item by it's string key
|
||||
if (!dict.ContainsKey(routeKey))
|
||||
{
|
||||
Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
|
||||
routeKey, SourceListKey);
|
||||
return;
|
||||
}
|
||||
|
||||
// End usage timer on last source
|
||||
if (!string.IsNullOrEmpty(LastSourceKey))
|
||||
{
|
||||
var usageLastSource = dict[LastSourceKey].SourceDevice as IUsageTracking;
|
||||
if (usageLastSource != null && usageLastSource.UsageTracker != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
// There MAY have been failures in here. Protect
|
||||
usageLastSource.UsageTracker.EndDeviceUsage();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "*#* EXCEPTION in end usage tracking:\r{0}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Let's run it
|
||||
var item = dict[routeKey];
|
||||
if (routeKey.ToLower() != "roomoff")
|
||||
{
|
||||
|
||||
LastSourceKey = routeKey;
|
||||
}
|
||||
else
|
||||
CurrentSourceInfoKey = null;
|
||||
|
||||
// hand off the individual routes to this helper
|
||||
foreach (var route in item.RouteList)
|
||||
DoRouteItem(route);
|
||||
|
||||
// Start usage timer on routed source
|
||||
var usageNewSource = item.SourceDevice as IUsageTracking;
|
||||
if (usageNewSource != null && usageNewSource.UsageTracker != null) // Have to make sure there is a usage tracker!
|
||||
{
|
||||
(item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
|
||||
}
|
||||
|
||||
// See if this can be moved into common, base-class method -------------
|
||||
|
||||
|
||||
// Set volume control, using default if non provided
|
||||
IBasicVolumeControls volDev = null;
|
||||
// Handle special cases for volume control
|
||||
if (string.IsNullOrEmpty(item.VolumeControlKey)
|
||||
|| item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
|
||||
volDev = DefaultVolumeControls;
|
||||
//else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
|
||||
// volDev = DefaultDisplay as IBasicVolumeControls;
|
||||
// Or a specific device, probably rarely used.
|
||||
else
|
||||
{
|
||||
var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
|
||||
if (dev is IBasicVolumeControls)
|
||||
volDev = dev as IBasicVolumeControls;
|
||||
else if (dev is IHasVolumeDevice)
|
||||
volDev = (dev as IHasVolumeDevice).VolumeDevice;
|
||||
}
|
||||
|
||||
if (volDev != CurrentVolumeControls)
|
||||
{
|
||||
// zero the volume on the device we are leaving.
|
||||
// Set the volume to default on device we are entering
|
||||
if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
|
||||
{
|
||||
var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
SavedVolumeLevels[vd] = (uint)vd.VolumeLevelFeedback.IntValue;
|
||||
vd.SetVolume(0);
|
||||
}
|
||||
|
||||
CurrentVolumeControls = volDev;
|
||||
if (ZeroVolumeWhenSwtichingVolumeDevices && CurrentVolumeControls is IBasicVolumeWithFeedback)
|
||||
{
|
||||
var vd = CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
ushort vol = (SavedVolumeLevels.ContainsKey(vd) ? (ushort)SavedVolumeLevels[vd] : DefaultVolume);
|
||||
vd.SetVolume(vol);
|
||||
}
|
||||
}
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
// store the name and UI info for routes
|
||||
if (item.SourceKey == "$off")
|
||||
{
|
||||
CurrentSourceInfoKey = routeKey;
|
||||
CurrentSourceInfo = null;
|
||||
}
|
||||
else if (item.SourceKey != null)
|
||||
{
|
||||
CurrentSourceInfoKey = routeKey;
|
||||
CurrentSourceInfo = item;
|
||||
}
|
||||
|
||||
OnFeedback.FireUpdate();
|
||||
|
||||
if (OnFeedback.BoolValue)
|
||||
{
|
||||
if (VideoCodec.UsageTracker.InUseTracker.InUseFeedback.BoolValue)
|
||||
{
|
||||
Debug.Console(1, this, "Video Codec in use, deactivating standby on codec");
|
||||
VideoCodec.StandbyDeactivate();
|
||||
}
|
||||
|
||||
if (VideoCodec.StandbyIsOnFeedback.BoolValue)
|
||||
{
|
||||
VideoCodec.StandbyDeactivate();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Video codec not in standby. No need to wake.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Room OnFeedback state: {0}", OnFeedback.BoolValue);
|
||||
}
|
||||
|
||||
// report back when done
|
||||
if (successCallback != null)
|
||||
successCallback();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(1, this, "ERROR in routing: {0}", e);
|
||||
}
|
||||
|
||||
SourceSelectLock.Leave();
|
||||
}, 0); // end of CTimer
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="route"></param>
|
||||
void DoRouteItem(SourceRouteListItem route)
|
||||
{
|
||||
// if there is a $defaultAll on route, run two separate
|
||||
if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
foreach (var display in Displays)
|
||||
{
|
||||
var tempVideo = new SourceRouteListItem
|
||||
{
|
||||
DestinationKey = display.Key,
|
||||
SourceKey = route.SourceKey,
|
||||
Type = eRoutingSignalType.Video
|
||||
};
|
||||
DoRoute(tempVideo);
|
||||
}
|
||||
}
|
||||
else
|
||||
DoRoute(route);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="route"></param>
|
||||
/// <returns></returns>
|
||||
bool DoRoute(SourceRouteListItem route)
|
||||
{
|
||||
IRoutingSink dest = null;
|
||||
|
||||
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
||||
dest = DefaultAudioDevice as IRoutingSink;
|
||||
//else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
|
||||
// dest = DefaultDisplay;
|
||||
else
|
||||
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSink;
|
||||
|
||||
if (dest == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
dest.ReleaseRoute();
|
||||
if (dest is IHasPowerControl)
|
||||
(dest as IHasPowerControl).PowerOff();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
|
||||
if (source == null)
|
||||
{
|
||||
Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
|
||||
return false;
|
||||
}
|
||||
dest.ReleaseAndMakeRoute(source, route.Type);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void RoomVacatedForTimeoutPeriod(object o)
|
||||
{
|
||||
//Implement this
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does what it says
|
||||
/// </summary>
|
||||
public override void SetDefaultLevels()
|
||||
{
|
||||
Debug.Console(1, this, "Restoring default levels");
|
||||
var vc = CurrentVolumeControls as IBasicVolumeWithFeedback;
|
||||
if (vc != null)
|
||||
vc.SetVolume(DefaultVolume);
|
||||
}
|
||||
/// <summary>
|
||||
/// Will power the room on with the last-used source
|
||||
/// </summary>
|
||||
public override void PowerOnToDefaultOrLastSource()
|
||||
{
|
||||
if (!EnablePowerOnToLastSource || LastSourceKey == null)
|
||||
return;
|
||||
RunRouteAction(LastSourceKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
|
||||
/// </summary>
|
||||
public static void AllRoomsOff()
|
||||
{
|
||||
var allRooms = DeviceManager.AllDevices.Where(d =>
|
||||
d is IEssentialsRoom && !(d as IEssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
|
||||
foreach (var room in allRooms)
|
||||
(room as IEssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Setup the external sources for the Cisco Touch 10 devices that support IHasExternalSourceSwitch
|
||||
/// </summary>
|
||||
private void SetCodecExternalSources()
|
||||
{
|
||||
var videoCodecWithExternalSwitching = VideoCodec as IHasExternalSourceSwitching;
|
||||
|
||||
if (videoCodecWithExternalSwitching == null || !videoCodecWithExternalSwitching.ExternalSourceListEnabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Get the tie line that the external switcher is connected to
|
||||
string codecInputConnectorName = ConfigReader.ConfigObject.TieLines.SingleOrDefault(
|
||||
x => x.DestinationKey == VideoCodec.Key && x.DestinationPort == videoCodecWithExternalSwitching.ExternalSourceInputPort).DestinationPort;
|
||||
|
||||
videoCodecWithExternalSwitching.ClearExternalSources();
|
||||
videoCodecWithExternalSwitching.RunRouteAction = RunRouteActionCodec;
|
||||
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
|
||||
|
||||
foreach (var kvp in srcList)
|
||||
{
|
||||
var srcConfig = kvp.Value;
|
||||
|
||||
if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
|
||||
{
|
||||
videoCodecWithExternalSwitching.AddExternalSource(codecInputConnectorName, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
|
||||
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(2, this, "Error setting codec external sources: {0}", e);
|
||||
}
|
||||
}
|
||||
|
||||
private void SetCodecBranding()
|
||||
{
|
||||
var vcWithBranding = VideoCodec as IHasBranding;
|
||||
|
||||
if (vcWithBranding == null) return;
|
||||
|
||||
Debug.Console(1, this, "Setting Codec Branding");
|
||||
vcWithBranding.InitializeBranding(Key);
|
||||
}
|
||||
|
||||
#region IPrivacy Members
|
||||
|
||||
|
||||
public void PrivacyModeOff()
|
||||
{
|
||||
VideoCodec.PrivacyModeOff();
|
||||
}
|
||||
|
||||
public void PrivacyModeOn()
|
||||
{
|
||||
VideoCodec.PrivacyModeOn();
|
||||
}
|
||||
|
||||
public void PrivacyModeToggle()
|
||||
{
|
||||
VideoCodec.PrivacyModeToggle();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -202,11 +202,28 @@ namespace PepperDash.Essentials
|
||||
};
|
||||
}
|
||||
|
||||
SetupEnvironmentalControlDevices();
|
||||
|
||||
SetSourceListKey();
|
||||
|
||||
EnablePowerOnToLastSource = true;
|
||||
}
|
||||
|
||||
private void SetupEnvironmentalControlDevices()
|
||||
{
|
||||
if (PropertiesConfig.Environment != null)
|
||||
{
|
||||
if (PropertiesConfig.Environment.Enabled)
|
||||
{
|
||||
foreach (var d in PropertiesConfig.Environment.DeviceKeys)
|
||||
{
|
||||
var envDevice = DeviceManager.GetDeviceForKey(d) as EssentialsDevice;
|
||||
EnvironmentalControlDevices.Add(envDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SetSourceListKey()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(PropertiesConfig.SourceListKey))
|
||||
|
||||
@@ -210,21 +210,29 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>
|
||||
(config.Properties.ToString());
|
||||
DefaultDisplay = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultDisplayKey) as IRoutingSinkWithSwitching;
|
||||
DefaultDisplay = DeviceManager.GetDeviceForKey((PropertiesConfig as EssentialsHuddleVtc1PropertiesConfig).DefaultDisplayKey) as IRoutingSinkWithSwitching;
|
||||
|
||||
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
|
||||
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
|
||||
|
||||
|
||||
|
||||
if (VideoCodec == null)
|
||||
throw new ArgumentNullException("codec cannot be null");
|
||||
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "No Video Codec set. Please check 'videoCodecKey' property in room config");
|
||||
throw new ArgumentNullException("VideoCodec cannot be null");
|
||||
}
|
||||
|
||||
AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
|
||||
PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
|
||||
if (AudioCodec == null)
|
||||
Debug.Console(0, this, "No Audio Codec Found");
|
||||
|
||||
DefaultAudioDevice = DeviceManager.GetDeviceForKey(PropertiesConfig.DefaultAudioKey) as IBasicVolumeControls;
|
||||
if (DefaultAudioDevice == null)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "No Default Audio Device set. Please check 'defaultAudioKey' property in room config");
|
||||
throw new ArgumentNullException("DefaultAudioDevice cannot be null");
|
||||
}
|
||||
|
||||
InitializeRoom();
|
||||
}
|
||||
@@ -326,6 +334,8 @@ namespace PepperDash.Essentials
|
||||
|
||||
CallTypeFeedback = new IntFeedback(() => 0);
|
||||
|
||||
SetupEnvironmentalControlDevices();
|
||||
|
||||
SetSourceListKey();
|
||||
|
||||
EnablePowerOnToLastSource = true;
|
||||
@@ -336,6 +346,21 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupEnvironmentalControlDevices()
|
||||
{
|
||||
if (PropertiesConfig.Environment != null)
|
||||
{
|
||||
if (PropertiesConfig.Environment.Enabled)
|
||||
{
|
||||
foreach (var d in PropertiesConfig.Environment.DeviceKeys)
|
||||
{
|
||||
var envDevice = DeviceManager.GetDeviceForKey(d) as EssentialsDevice;
|
||||
EnvironmentalControlDevices.Add(envDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void SetSourceListKey()
|
||||
{
|
||||
@@ -419,6 +444,14 @@ namespace PepperDash.Essentials
|
||||
/// <returns></returns>
|
||||
public bool RunDefaultCallRoute()
|
||||
{
|
||||
Debug.Console(2, this, "RunDefaultCallRoute() Currently Sharing Content: {0}", VideoCodec.SharingContentIsOnFeedback.BoolValue);
|
||||
|
||||
if (VideoCodec.SharingContentIsOnFeedback.BoolValue)
|
||||
{
|
||||
Debug.Console(2, this, "Currently sharing content. Ignoring request to run default call route.");
|
||||
return false;
|
||||
}
|
||||
|
||||
RunRouteAction(DefaultCodecRouteString);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsTechRoom : EssentialsRoomBase, ITvPresetsProvider, IBridgeAdvanced, IRunDirectRouteAction
|
||||
{
|
||||
private readonly EssentialsTechRoomConfig _config;
|
||||
public EssentialsTechRoomConfig PropertiesConfig { get; private set; }
|
||||
private readonly Dictionary<string, TwoWayDisplayBase> _displays;
|
||||
|
||||
private readonly DevicePresetsModel _tunerPresets;
|
||||
@@ -57,16 +57,16 @@ namespace PepperDash.Essentials
|
||||
|
||||
public EssentialsTechRoom(DeviceConfig config) : base(config)
|
||||
{
|
||||
_config = config.Properties.ToObject<EssentialsTechRoomConfig>();
|
||||
PropertiesConfig = config.Properties.ToObject<EssentialsTechRoomConfig>();
|
||||
|
||||
_tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), _config.PresetsFileName);
|
||||
_tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), PropertiesConfig.PresetsFileName);
|
||||
|
||||
_tunerPresets.SetFileName(_config.PresetsFileName);
|
||||
_tunerPresets.SetFileName(PropertiesConfig.PresetsFileName);
|
||||
|
||||
_tunerPresets.PresetRecalled += TunerPresetsOnPresetRecalled;
|
||||
|
||||
_tuners = GetDevices<IRSetTopBoxBase>(_config.Tuners);
|
||||
_displays = GetDevices<TwoWayDisplayBase>(_config.Displays);
|
||||
_tuners = GetDevices<IRSetTopBoxBase>(PropertiesConfig.Tuners);
|
||||
_displays = GetDevices<TwoWayDisplayBase>(PropertiesConfig.Displays);
|
||||
|
||||
RoomPowerIsOnFeedback = new BoolFeedback(() => RoomPowerIsOn);
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
private void CreateOrUpdateScheduledEvents()
|
||||
{
|
||||
var eventsConfig = _config.ScheduledEvents;
|
||||
var eventsConfig = PropertiesConfig.ScheduledEvents;
|
||||
|
||||
GetOrCreateScheduleGroup();
|
||||
|
||||
@@ -207,21 +207,21 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
//update config based on key of scheduleEvent
|
||||
GetOrCreateScheduleGroup();
|
||||
var existingEventIndex = _config.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key);
|
||||
var existingEventIndex = PropertiesConfig.ScheduledEvents.FindIndex((e) => e.Key == scheduledEvent.Key);
|
||||
|
||||
if (existingEventIndex < 0)
|
||||
{
|
||||
_config.ScheduledEvents.Add(scheduledEvent);
|
||||
PropertiesConfig.ScheduledEvents.Add(scheduledEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
_config.ScheduledEvents[existingEventIndex] = scheduledEvent;
|
||||
PropertiesConfig.ScheduledEvents[existingEventIndex] = scheduledEvent;
|
||||
}
|
||||
|
||||
//create or update event based on config
|
||||
CreateOrUpdateSingleEvent(scheduledEvent);
|
||||
//save config
|
||||
Config.Properties = JToken.FromObject(_config);
|
||||
Config.Properties = JToken.FromObject(PropertiesConfig);
|
||||
|
||||
CustomSetConfig(Config);
|
||||
//Fire Event
|
||||
@@ -230,7 +230,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
public List<ScheduledEventConfig> GetScheduledEvents()
|
||||
{
|
||||
return _config.ScheduledEvents ?? new List<ScheduledEventConfig>();
|
||||
return PropertiesConfig.ScheduledEvents ?? new List<ScheduledEventConfig>();
|
||||
}
|
||||
|
||||
private void OnScheduledEventUpdate()
|
||||
@@ -242,14 +242,14 @@ namespace PepperDash.Essentials
|
||||
return;
|
||||
}
|
||||
|
||||
handler(this, new ScheduledEventEventArgs {ScheduledEvents = _config.ScheduledEvents});
|
||||
handler(this, new ScheduledEventEventArgs {ScheduledEvents = PropertiesConfig.ScheduledEvents});
|
||||
}
|
||||
|
||||
public event EventHandler<ScheduledEventEventArgs> ScheduledEventsChanged;
|
||||
|
||||
private void HandleScheduledEvent(ScheduledEvent schevent, ScheduledEventCommon.eCallbackReason type)
|
||||
{
|
||||
var eventConfig = _config.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name);
|
||||
var eventConfig = PropertiesConfig.ScheduledEvents.FirstOrDefault(e => e.Key == schevent.Name);
|
||||
|
||||
if (eventConfig == null)
|
||||
{
|
||||
@@ -286,11 +286,11 @@ Params: {2}"
|
||||
{
|
||||
Debug.Console(2, this, "Room Powering On");
|
||||
|
||||
var dummySource = DeviceManager.GetDeviceForKey(_config.DummySourceKey) as IRoutingOutputs;
|
||||
var dummySource = DeviceManager.GetDeviceForKey(PropertiesConfig.DummySourceKey) as IRoutingOutputs;
|
||||
|
||||
if (dummySource == null)
|
||||
{
|
||||
Debug.Console(1, this, "Unable to get source with key: {0}", _config.DummySourceKey);
|
||||
Debug.Console(1, this, "Unable to get source with key: {0}", PropertiesConfig.DummySourceKey);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -375,13 +375,13 @@ Params: {2}"
|
||||
{
|
||||
bridge.AddJoinMap(Key, joinMap);
|
||||
}
|
||||
uint i;
|
||||
if (_config.IsPrimary)
|
||||
|
||||
if (PropertiesConfig.IsPrimary)
|
||||
{
|
||||
Debug.Console(1, this, "Linking Primary system Tuner Preset Mirroring");
|
||||
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||
if (PropertiesConfig.MirroredTuners != null && PropertiesConfig.MirroredTuners.Count > 0)
|
||||
{
|
||||
foreach (var tuner in _config.MirroredTuners)
|
||||
foreach (var tuner in PropertiesConfig.MirroredTuners)
|
||||
{
|
||||
var f = CurrentPresetsFeedbacks[tuner.Value];
|
||||
|
||||
@@ -423,9 +423,9 @@ Params: {2}"
|
||||
{
|
||||
Debug.Console(1, this, "Linking Secondary system Tuner Preset Mirroring");
|
||||
|
||||
if (_config.MirroredTuners != null && _config.MirroredTuners.Count > 0)
|
||||
if (PropertiesConfig.MirroredTuners != null && PropertiesConfig.MirroredTuners.Count > 0)
|
||||
{
|
||||
foreach (var tuner in _config.MirroredTuners)
|
||||
foreach (var tuner in PropertiesConfig.MirroredTuners)
|
||||
{
|
||||
var t = _tuners[tuner.Value];
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public interface IEssentialsHuddleSpaceRoom : IEssentialsRoom, IHasCurrentSourceInfoChange, IRunRouteAction, IRunDefaultPresentRoute, IHasDefaultDisplay
|
||||
{
|
||||
bool ExcludeFromGlobalFunctions { get; }
|
||||
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
EssentialsHuddleRoomPropertiesConfig PropertiesConfig { get; }
|
||||
|
||||
IBasicVolumeControls CurrentVolumeControls { get; }
|
||||
|
||||
event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
using PepperDash.Essentials.Devices.Common.Codec;
|
||||
using PepperDash.Essentials.Devices.Common.VideoCodec;
|
||||
using PepperDash.Essentials.Devices.Common.AudioCodec;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public interface IEssentialsHuddleVtc1Room : IEssentialsRoom, IHasCurrentSourceInfoChange,
|
||||
IPrivacy, IHasCurrentVolumeControls, IRunRouteAction, IRunDefaultCallRoute, IHasVideoCodec, IHasAudioCodec, IHasDefaultDisplay, IHasInCallFeedback
|
||||
{
|
||||
EssentialsHuddleVtc1PropertiesConfig PropertiesConfig { get; }
|
||||
|
||||
bool ExcludeFromGlobalFunctions { get; }
|
||||
|
||||
void RunRouteAction(string routeKey);
|
||||
|
||||
IHasScheduleAwareness ScheduleSource { get; }
|
||||
|
||||
new BoolFeedback InCallFeedback { get; }
|
||||
|
||||
new BoolFeedback PrivacyModeIsOnFeedback { get; }
|
||||
|
||||
string DefaultCodecRouteString { get; }
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
public class EssentialsTouchpanelController : EssentialsDevice, IHasBasicTriListWithSmartObject
|
||||
{
|
||||
private CrestronTouchpanelPropertiesConfig _propertiesConfig;
|
||||
|
||||
public BasicTriListWithSmartObject Panel { get; private set; }
|
||||
|
||||
public PanelDriverBase PanelDriver { get; private set; }
|
||||
@@ -27,7 +29,14 @@ namespace PepperDash.Essentials
|
||||
: base(key, name)
|
||||
{
|
||||
Panel = tsw;
|
||||
tsw.LoadSmartObjects(sgdPath);
|
||||
|
||||
if (!string.IsNullOrEmpty(sgdPath))
|
||||
Panel.LoadSmartObjects(sgdPath);
|
||||
else
|
||||
Debug.Console(1, this, "No SGD file path defined");
|
||||
|
||||
|
||||
|
||||
tsw.SigChange += Panel_SigChange;
|
||||
}
|
||||
|
||||
@@ -37,7 +46,7 @@ namespace PepperDash.Essentials
|
||||
Panel = dge;
|
||||
|
||||
if (!string.IsNullOrEmpty(sgdPath))
|
||||
dge.LoadSmartObjects(sgdPath);
|
||||
Panel.LoadSmartObjects(sgdPath);
|
||||
else
|
||||
Debug.Console(1, this, "No SGD file path defined");
|
||||
|
||||
@@ -50,6 +59,7 @@ namespace PepperDash.Essentials
|
||||
public EssentialsTouchpanelController(string key, string name, string type, CrestronTouchpanelPropertiesConfig props, uint id)
|
||||
: base(key, name)
|
||||
{
|
||||
_propertiesConfig = props;
|
||||
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating touchpanel hardware...");
|
||||
type = type.ToLower();
|
||||
@@ -61,6 +71,8 @@ namespace PepperDash.Essentials
|
||||
app.ParameterProjectName.Value = props.ProjectName;
|
||||
Panel = app;
|
||||
}
|
||||
else if (type == "xpanel")
|
||||
Panel = new XpanelForSmartGraphics(id, Global.ControlSystem);
|
||||
else if (type == "tsw550")
|
||||
Panel = new Tsw550(id, Global.ControlSystem);
|
||||
else if (type == "tsw552")
|
||||
@@ -134,10 +146,194 @@ namespace PepperDash.Essentials
|
||||
Panel.LoadSmartObjects(sgdName);
|
||||
Panel.SigChange += Panel_SigChange;
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
// Check for IEssentialsRoomCombiner in DeviceManager and if found, subscribe to its event
|
||||
var roomCombiner = DeviceManager.AllDevices.FirstOrDefault((d) => d is IEssentialsRoomCombiner) as IEssentialsRoomCombiner;
|
||||
|
||||
if (roomCombiner != null)
|
||||
{
|
||||
// Subscribe to the even
|
||||
roomCombiner.RoomCombinationScenarioChanged += new EventHandler<EventArgs>(roomCombiner_RoomCombinationScenarioChanged);
|
||||
|
||||
// Connect to the initial roomKey
|
||||
if (roomCombiner.CurrentScenario != null)
|
||||
{
|
||||
// Use the current scenario
|
||||
DetermineRoomKeyFromScenario(roomCombiner.CurrentScenario);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Current Scenario not yet set. Use default
|
||||
SetupPanelDrivers(_propertiesConfig.DefaultRoomKey);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No room combiner, use the default key
|
||||
SetupPanelDrivers(_propertiesConfig.DefaultRoomKey);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void roomCombiner_RoomCombinationScenarioChanged(object sender, EventArgs e)
|
||||
{
|
||||
var roomCombiner = sender as IEssentialsRoomCombiner;
|
||||
|
||||
DetermineRoomKeyFromScenario(roomCombiner.CurrentScenario);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines the room key to use based on the scenario
|
||||
/// </summary>
|
||||
/// <param name="scenario"></param>
|
||||
void DetermineRoomKeyFromScenario(IRoomCombinationScenario scenario)
|
||||
{
|
||||
string newRoomKey = null;
|
||||
|
||||
if (scenario.UiMap.ContainsKey(Key))
|
||||
{
|
||||
newRoomKey = scenario.UiMap[Key];
|
||||
}
|
||||
else if (scenario.UiMap.ContainsKey(_propertiesConfig.DefaultRoomKey))
|
||||
{
|
||||
newRoomKey = scenario.UiMap[_propertiesConfig.DefaultRoomKey];
|
||||
}
|
||||
|
||||
SetupPanelDrivers(newRoomKey);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets up drivers and links them to the room specified
|
||||
/// </summary>
|
||||
/// <param name="roomKey">key of room to link the drivers to</param>
|
||||
void SetupPanelDrivers(string roomKey)
|
||||
{
|
||||
// Clear out any existing actions
|
||||
Panel.ClearAllSigActions();
|
||||
|
||||
Debug.Console(0, this, "Linking TP '{0}' to Room '{1}'", Key, roomKey);
|
||||
|
||||
var mainDriver = new EssentialsPanelMainInterfaceDriver(Panel, _propertiesConfig);
|
||||
// Then the sub drivers
|
||||
|
||||
// spin up different room drivers depending on room type
|
||||
var room = DeviceManager.GetDeviceForKey(roomKey);
|
||||
if (room is IEssentialsHuddleSpaceRoom)
|
||||
{
|
||||
// Screen Saver Driver
|
||||
|
||||
mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, _propertiesConfig);
|
||||
|
||||
// Header Driver
|
||||
Debug.Console(0, this, "Adding header driver");
|
||||
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, _propertiesConfig);
|
||||
|
||||
// AV Driver
|
||||
Debug.Console(0, this, "Adding huddle space AV driver");
|
||||
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, _propertiesConfig);
|
||||
avDriver.DefaultRoomKey = roomKey;
|
||||
mainDriver.AvDriver = avDriver;
|
||||
avDriver.CurrentRoom = room as IEssentialsHuddleSpaceRoom;
|
||||
|
||||
// Environment Driver
|
||||
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||
{
|
||||
Debug.Console(0, this, "Adding environment driver");
|
||||
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, _propertiesConfig);
|
||||
|
||||
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||
}
|
||||
|
||||
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||
|
||||
if (Panel is TswFt5ButtonSystem)
|
||||
{
|
||||
var tsw = Panel as TswFt5ButtonSystem;
|
||||
// Wire up hard keys
|
||||
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
|
||||
if (mainDriver.EnvironmentDriver != null)
|
||||
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
if (!b)
|
||||
{
|
||||
mainDriver.EnvironmentDriver.Toggle();
|
||||
}
|
||||
});
|
||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||
}
|
||||
}
|
||||
else if (room is IEssentialsHuddleVtc1Room)
|
||||
{
|
||||
Debug.Console(0, this, "Adding huddle space VTC AV driver");
|
||||
|
||||
// Screen Saver Driver
|
||||
mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, _propertiesConfig);
|
||||
|
||||
// Header Driver
|
||||
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, _propertiesConfig);
|
||||
|
||||
// AV Driver
|
||||
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, _propertiesConfig);
|
||||
|
||||
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(Panel, avDriver,
|
||||
(room as IEssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
|
||||
avDriver.SetVideoCodecDriver(codecDriver);
|
||||
avDriver.DefaultRoomKey = roomKey;
|
||||
mainDriver.AvDriver = avDriver;
|
||||
avDriver.CurrentRoom = room as IEssentialsHuddleVtc1Room;
|
||||
|
||||
// Environment Driver
|
||||
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||
{
|
||||
Debug.Console(0, this, "Adding environment driver");
|
||||
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, _propertiesConfig);
|
||||
|
||||
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||
}
|
||||
|
||||
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||
|
||||
|
||||
if (Panel is TswFt5ButtonSystem)
|
||||
{
|
||||
var tsw = Panel as TswFt5ButtonSystem;
|
||||
// Wire up hard keys
|
||||
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.EndMeetingPress(); });
|
||||
if (mainDriver.EnvironmentDriver != null)
|
||||
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
if (!b)
|
||||
{
|
||||
mainDriver.EnvironmentDriver.Toggle();
|
||||
}
|
||||
});
|
||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||
}
|
||||
|
||||
LoadAndShowDriver(mainDriver);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", roomKey);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void LoadAndShowDriver(PanelDriverBase driver)
|
||||
{
|
||||
if (PanelDriver != null)
|
||||
{
|
||||
var mainDriver = PanelDriver as EssentialsPanelMainInterfaceDriver;
|
||||
if (mainDriver != null)
|
||||
{
|
||||
mainDriver.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
PanelDriver = driver;
|
||||
driver.Show();
|
||||
}
|
||||
@@ -148,7 +344,6 @@ namespace PepperDash.Essentials
|
||||
PanelDriver.BackButtonPressed();
|
||||
}
|
||||
|
||||
|
||||
void ExtenderSystemReservedSigs_DeviceExtenderSigChange(DeviceExtender currentDeviceExtender, SigEventArgs args)
|
||||
{
|
||||
// If the sig is transitioning on, mark it in case it was home button that transitioned it
|
||||
@@ -213,7 +408,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
public EssentialsTouchpanelControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "tsw550", "tsw750", "tsw1050", "tsw560", "tsw760", "tsw1060", "tsw570", "tsw770", "ts770", "tsw1070", "ts1070", "xpanel" };
|
||||
TypeNames = new List<string>() { "crestronapp", "tsw550", "tsw750", "tsw1050", "tsw560", "tsw760", "tsw1060", "tsw570", "tsw770", "ts770", "tsw1070", "ts1070", "xpanel" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
@@ -225,119 +420,6 @@ namespace PepperDash.Essentials
|
||||
|
||||
var panelController = new EssentialsTouchpanelController(dc.Key, dc.Name, dc.Type, props, comm.IpIdInt);
|
||||
|
||||
panelController.AddPostActivationAction(() =>
|
||||
{
|
||||
var mainDriver = new EssentialsPanelMainInterfaceDriver(panelController.Panel, props);
|
||||
// Then the sub drivers
|
||||
|
||||
// spin up different room drivers depending on room type
|
||||
var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
|
||||
if (room is IEssentialsHuddleSpaceRoom)
|
||||
{
|
||||
// Screen Saver Driver
|
||||
mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, props);
|
||||
|
||||
// Header Driver
|
||||
Debug.Console(0, panelController, "Adding header driver");
|
||||
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
||||
|
||||
// AV Driver
|
||||
Debug.Console(0, panelController, "Adding huddle space AV driver");
|
||||
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
|
||||
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
||||
mainDriver.AvDriver = avDriver;
|
||||
avDriver.CurrentRoom = room as IEssentialsHuddleSpaceRoom;
|
||||
|
||||
// Environment Driver
|
||||
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||
{
|
||||
Debug.Console(0, panelController, "Adding environment driver");
|
||||
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
||||
|
||||
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||
}
|
||||
|
||||
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||
|
||||
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
||||
|
||||
if (panelController.Panel is TswFt5ButtonSystem)
|
||||
{
|
||||
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
||||
// Wire up hard keys
|
||||
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
|
||||
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
||||
if (mainDriver.EnvironmentDriver != null)
|
||||
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
if (!b)
|
||||
{
|
||||
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
||||
mainDriver.EnvironmentDriver.Toggle();
|
||||
}
|
||||
});
|
||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||
}
|
||||
}
|
||||
else if (room is IEssentialsHuddleVtc1Room)
|
||||
{
|
||||
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
|
||||
|
||||
// Screen Saver Driver
|
||||
mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, props);
|
||||
|
||||
// Header Driver
|
||||
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
||||
|
||||
// AV Driver
|
||||
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
|
||||
|
||||
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
|
||||
(room as IEssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
|
||||
avDriver.SetVideoCodecDriver(codecDriver);
|
||||
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
||||
mainDriver.AvDriver = avDriver;
|
||||
avDriver.CurrentRoom = room as IEssentialsHuddleVtc1Room;
|
||||
|
||||
// Environment Driver
|
||||
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||
{
|
||||
Debug.Console(0, panelController, "Adding environment driver");
|
||||
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
||||
|
||||
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||
}
|
||||
|
||||
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||
|
||||
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
||||
|
||||
if (panelController.Panel is TswFt5ButtonSystem)
|
||||
{
|
||||
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
||||
// Wire up hard keys
|
||||
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.EndMeetingPress(); });
|
||||
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
||||
if (mainDriver.EnvironmentDriver != null)
|
||||
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||
{
|
||||
if (!b)
|
||||
{
|
||||
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
||||
mainDriver.EnvironmentDriver.Toggle();
|
||||
}
|
||||
});
|
||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, panelController, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", props.DefaultRoomKey);
|
||||
}
|
||||
});
|
||||
|
||||
return panelController;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
public SourceListItem SourceItem { get; private set; }
|
||||
|
||||
private IHasCurrentSourceInfoChange _room;
|
||||
|
||||
public SubpageReferenceListSourceItem(uint index, SubpageReferenceList owner,
|
||||
SourceListItem sourceItem, Action<bool> routeAction)
|
||||
: base(index, owner)
|
||||
@@ -25,6 +27,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
public void RegisterForSourceChange(IHasCurrentSourceInfoChange room)
|
||||
{
|
||||
_room = room;
|
||||
room.CurrentSourceChange -= room_CurrentSourceInfoChange;
|
||||
room.CurrentSourceChange += room_CurrentSourceInfoChange;
|
||||
}
|
||||
@@ -44,6 +47,9 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
Owner.BoolInputSig(Index, 1).UserObject = null;
|
||||
Owner.StringInputSig(Index, 1).StringValue = "";
|
||||
|
||||
if(_room != null)
|
||||
_room.CurrentSourceChange -= room_CurrentSourceInfoChange;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EssentialsPanelMainInterfaceDriver : PanelDriverBase, IHasScreenSaverController
|
||||
public class EssentialsPanelMainInterfaceDriver : PanelDriverBase, IHasScreenSaverController, IDisposable
|
||||
{
|
||||
CTimer InactivityTimer;
|
||||
|
||||
@@ -69,6 +69,35 @@ namespace PepperDash.Essentials
|
||||
}
|
||||
}
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
var avDriver = AvDriver as PanelDriverBase;
|
||||
if (avDriver != null)
|
||||
{
|
||||
avDriver.Hide();
|
||||
}
|
||||
if (ScreenSaverController != null)
|
||||
{
|
||||
ScreenSaverController.Dispose();
|
||||
}
|
||||
if (HeaderDriver != null)
|
||||
{
|
||||
HeaderDriver.Hide();
|
||||
}
|
||||
if (EnvironmentDriver != null)
|
||||
{
|
||||
EnvironmentDriver.Hide();
|
||||
}
|
||||
if (CurrentChildDriver != null)
|
||||
{
|
||||
CurrentChildDriver.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args)
|
||||
{
|
||||
|
||||
@@ -130,7 +159,7 @@ namespace PepperDash.Essentials
|
||||
if(CurrentChildDriver != null)
|
||||
CurrentChildDriver.BackButtonPressed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface IHasScreenSaverController
|
||||
{
|
||||
|
||||
@@ -306,7 +306,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
||||
{
|
||||
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
|
||||
if (CurrentRoom != null && CurrentRoom.DefaultDisplay != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
|
||||
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
|
||||
});
|
||||
|
||||
|
||||
@@ -1,326 +1,326 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
|
||||
using PepperDash.Essentials.Devices.Displays;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials.UIDrivers
|
||||
{
|
||||
public class EssentialsHuddleTechPageDriver : PanelDriverBase
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
SmartObjectDynamicList MenuList;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
SubpageReferenceList StatusList;
|
||||
/// <summary>
|
||||
/// The list of display controls
|
||||
/// </summary>
|
||||
SubpageReferenceList DisplayList;
|
||||
/// <summary>
|
||||
/// References lines in the list against device instances
|
||||
/// </summary>
|
||||
Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
JoinedSigInterlock PagesInterlock;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint JoinText = 1;
|
||||
|
||||
CTimer PinAuthorizedTimer;
|
||||
|
||||
EssentialsRoomTechConfig Config;
|
||||
|
||||
StringBuilder PinEntryBuilder = new StringBuilder(4);
|
||||
|
||||
bool IsAuthorized;
|
||||
|
||||
SmartObjectNumeric PinKeypad;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="trilist"></param>
|
||||
/// <param name="parent"></param>
|
||||
public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, EssentialsRoomTechConfig config)
|
||||
: base(trilist)
|
||||
{
|
||||
Config = config;
|
||||
|
||||
PagesInterlock = new JoinedSigInterlock(trilist);
|
||||
PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible);
|
||||
|
||||
trilist.SetSigFalseAction(UIBoolJoin.TechExitButton, Hide);
|
||||
|
||||
MenuList = new SmartObjectDynamicList(trilist.SmartObjects[UISmartObjectJoin.TechMenuList],
|
||||
true, 3100);
|
||||
|
||||
MenuList.SetFeedback(1, true); // initial fb
|
||||
ushort count = 0;
|
||||
|
||||
MenuList.SetItemMainText(1, "System Status");
|
||||
MenuList.SetItemButtonAction(1, b => {
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechSystemStatusVisible);
|
||||
MenuList.SetFeedback(1, true);
|
||||
});
|
||||
|
||||
MenuList.SetItemMainText(2, "Display Controls");
|
||||
MenuList.SetItemButtonAction(2, b => {
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible);
|
||||
MenuList.SetFeedback(2, true);
|
||||
});
|
||||
|
||||
count = 2;
|
||||
|
||||
// Don't show panel setup on iPad or xpanel
|
||||
if (TriList is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button)
|
||||
{
|
||||
count++;
|
||||
MenuList.SetItemMainText(count, "Panel Setup");
|
||||
MenuList.SetItemButtonAction(count, b =>
|
||||
{
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible);
|
||||
MenuList.SetFeedback(count, true);
|
||||
});
|
||||
}
|
||||
|
||||
MenuList.Count = count;
|
||||
BuildStatusList();
|
||||
BuildDisplayList();
|
||||
SetupPinModal();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public override void Show()
|
||||
{
|
||||
// divert to PIN if we need auth
|
||||
if (IsAuthorized)
|
||||
{
|
||||
// Cancel the auth timer so we don't deauth after coming back in
|
||||
if (PinAuthorizedTimer != null)
|
||||
PinAuthorizedTimer.Stop();
|
||||
|
||||
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, true);
|
||||
PagesInterlock.Show();
|
||||
base.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public override void Hide()
|
||||
{
|
||||
// Leave it authorized for 60 seconds.
|
||||
if (IsAuthorized)
|
||||
PinAuthorizedTimer = new CTimer(o => {
|
||||
IsAuthorized = false;
|
||||
PinAuthorizedTimer = null;
|
||||
}, 60000);
|
||||
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, false);
|
||||
PagesInterlock.Hide();
|
||||
base.Hide();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wire up the keypad and buttons
|
||||
/// </summary>
|
||||
void SetupPinModal()
|
||||
{
|
||||
TriList.SetSigFalseAction(UIBoolJoin.PinDialogCancelPress, CancelPinDialog);
|
||||
PinKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.TechPinDialogKeypad], true);
|
||||
PinKeypad.Digit0.UserObject = new Action<bool>(b => { if (b)DialPinDigit('0'); });
|
||||
PinKeypad.Digit1.UserObject = new Action<bool>(b => { if (b)DialPinDigit('1'); });
|
||||
PinKeypad.Digit2.UserObject = new Action<bool>(b => { if (b)DialPinDigit('2'); });
|
||||
PinKeypad.Digit3.UserObject = new Action<bool>(b => { if (b)DialPinDigit('3'); });
|
||||
PinKeypad.Digit4.UserObject = new Action<bool>(b => { if (b)DialPinDigit('4'); });
|
||||
PinKeypad.Digit5.UserObject = new Action<bool>(b => { if (b)DialPinDigit('5'); });
|
||||
PinKeypad.Digit6.UserObject = new Action<bool>(b => { if (b)DialPinDigit('6'); });
|
||||
PinKeypad.Digit7.UserObject = new Action<bool>(b => { if (b)DialPinDigit('7'); });
|
||||
PinKeypad.Digit8.UserObject = new Action<bool>(b => { if (b)DialPinDigit('8'); });
|
||||
PinKeypad.Digit9.UserObject = new Action<bool>(b => { if (b)DialPinDigit('9'); });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="d"></param>
|
||||
void DialPinDigit(char d)
|
||||
{
|
||||
PinEntryBuilder.Append(d);
|
||||
var len = PinEntryBuilder.Length;
|
||||
SetPinDotsFeedback(len);
|
||||
|
||||
// check it!
|
||||
if (len == 4)
|
||||
{
|
||||
if (Config.Password == PinEntryBuilder.ToString())
|
||||
{
|
||||
IsAuthorized = true;
|
||||
SetPinDotsFeedback(0);
|
||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
|
||||
Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetPinDotsFeedback(0);
|
||||
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, true);
|
||||
new CTimer(o =>
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, false);
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
PinEntryBuilder.Remove(0, len); // clear it either way
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the dots as pin is entered
|
||||
/// </summary>
|
||||
/// <param name="len"></param>
|
||||
void SetPinDotsFeedback(int len)
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.PinDialogDot1, len >= 1);
|
||||
TriList.SetBool(UIBoolJoin.PinDialogDot2, len >= 2);
|
||||
TriList.SetBool(UIBoolJoin.PinDialogDot3, len >= 3);
|
||||
TriList.SetBool(UIBoolJoin.PinDialogDot4, len == 4);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does what it says
|
||||
/// </summary>
|
||||
void CancelPinDialog()
|
||||
{
|
||||
PinEntryBuilder.Remove(0, PinEntryBuilder.Length);
|
||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void BuildStatusList()
|
||||
{
|
||||
StatusList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechStatusList, 3, 3, 3);
|
||||
StatusListDeviceIndexes = new Dictionary<ICommunicationMonitor, uint>();
|
||||
uint i = 0;
|
||||
foreach (var d in DeviceManager.AllDevices)
|
||||
{
|
||||
// make sure it is both ICommunicationMonitor and a Device
|
||||
var sd = d as ICommunicationMonitor;
|
||||
if (sd == null)
|
||||
continue;
|
||||
var dd = sd as Device;
|
||||
if(dd == null)
|
||||
continue;
|
||||
i++;
|
||||
StatusList.StringInputSig(i, 1).StringValue = dd.Name;
|
||||
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)sd.CommunicationMonitor.Status;
|
||||
StatusListDeviceIndexes.Add(sd, i);
|
||||
sd.CommunicationMonitor.StatusChange += CommunicationMonitor_StatusChange ;
|
||||
}
|
||||
StatusList.Count = (ushort)i;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds the list of display controls
|
||||
/// </summary>
|
||||
void BuildDisplayList()
|
||||
{
|
||||
DisplayList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechDisplayControlsList, 10, 3, 3);
|
||||
|
||||
var devKeys = ConfigReader.ConfigObject.Devices.Where(d =>
|
||||
d.Group.Equals("display", StringComparison.OrdinalIgnoreCase)
|
||||
|| d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase))
|
||||
.Select(dd => dd.Key);
|
||||
var disps = DeviceManager.AllDevices.Where(d =>
|
||||
devKeys.Contains(d.Key));
|
||||
ushort i = 0;
|
||||
foreach (var disp in disps)
|
||||
{
|
||||
var display = disp as DisplayBase;
|
||||
if (display != null)
|
||||
{
|
||||
i++;
|
||||
DisplayList.StringInputSig(i, 1).StringValue = display.Name;
|
||||
DisplayList.GetBoolFeedbackSig(i, 1).SetSigFalseAction(display.PowerOn);
|
||||
DisplayList.GetBoolFeedbackSig(i, 2).SetSigFalseAction(display.PowerOff);
|
||||
if (display is TwoWayDisplayBase)
|
||||
{
|
||||
var powerOnSig = DisplayList.BoolInputSig(i, 1);
|
||||
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkInputSig(powerOnSig);
|
||||
|
||||
var powerOffSig = DisplayList.BoolInputSig(1, 2);
|
||||
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkComplementInputSig(powerOffSig);
|
||||
}
|
||||
DisplayList.GetBoolFeedbackSig(i, 3).SetSigFalseAction(() =>
|
||||
{ if (display is IInputHdmi1) (display as IInputHdmi1).InputHdmi1(); });
|
||||
DisplayList.GetBoolFeedbackSig(i, 4).SetSigFalseAction(() =>
|
||||
{ if (display is IInputHdmi2) (display as IInputHdmi2).InputHdmi2(); });
|
||||
DisplayList.GetBoolFeedbackSig(i, 5).SetSigFalseAction(() =>
|
||||
{ if (display is IInputHdmi3) (display as IInputHdmi3).InputHdmi3(); });
|
||||
//DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
||||
//{ if (display is IInputHdmi4) (display as IInputHdmi4).InputHdmi4(); });
|
||||
DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
||||
{ if (display is IInputDisplayPort1) (display as IInputDisplayPort1).InputDisplayPort1(); });
|
||||
|
||||
|
||||
// Figure out some way to provide current input feedback
|
||||
if (display is TwoWayDisplayBase)
|
||||
{
|
||||
(display as TwoWayDisplayBase).CurrentInputFeedback.OutputChange += CurrentInputFeedback_OutputChange;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
DisplayList.Count = i;
|
||||
}
|
||||
|
||||
|
||||
void CurrentInputFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
|
||||
{
|
||||
var c = sender as ICommunicationMonitor;
|
||||
if (c != null && StatusListDeviceIndexes.ContainsKey(c))
|
||||
{
|
||||
var i = StatusListDeviceIndexes[c];
|
||||
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.SmartObjects;
|
||||
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
|
||||
using PepperDash.Essentials.Devices.Displays;
|
||||
using PepperDash.Essentials.Room.Config;
|
||||
|
||||
namespace PepperDash.Essentials.UIDrivers
|
||||
{
|
||||
public class EssentialsHuddleTechPageDriver : PanelDriverBase
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
SmartObjectDynamicList MenuList;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
SubpageReferenceList StatusList;
|
||||
/// <summary>
|
||||
/// The list of display controls
|
||||
/// </summary>
|
||||
SubpageReferenceList DisplayList;
|
||||
/// <summary>
|
||||
/// References lines in the list against device instances
|
||||
/// </summary>
|
||||
Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
JoinedSigInterlock PagesInterlock;
|
||||
|
||||
/// <summary>
|
||||
/// 1
|
||||
/// </summary>
|
||||
public const uint JoinText = 1;
|
||||
|
||||
CTimer PinAuthorizedTimer;
|
||||
|
||||
EssentialsRoomTechConfig Config;
|
||||
|
||||
StringBuilder PinEntryBuilder = new StringBuilder(4);
|
||||
|
||||
bool IsAuthorized;
|
||||
|
||||
SmartObjectNumeric PinKeypad;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="trilist"></param>
|
||||
/// <param name="parent"></param>
|
||||
public EssentialsHuddleTechPageDriver(BasicTriListWithSmartObject trilist, EssentialsRoomTechConfig config)
|
||||
: base(trilist)
|
||||
{
|
||||
Config = config;
|
||||
|
||||
PagesInterlock = new JoinedSigInterlock(trilist);
|
||||
PagesInterlock.SetButDontShow(UIBoolJoin.TechSystemStatusVisible);
|
||||
|
||||
trilist.SetSigFalseAction(UIBoolJoin.TechExitButton, Hide);
|
||||
|
||||
MenuList = new SmartObjectDynamicList(trilist.SmartObjects[UISmartObjectJoin.TechMenuList],
|
||||
true, 3100);
|
||||
|
||||
MenuList.SetFeedback(1, true); // initial fb
|
||||
ushort count = 0;
|
||||
|
||||
MenuList.SetItemMainText(1, "System Status");
|
||||
MenuList.SetItemButtonAction(1, b => {
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechSystemStatusVisible);
|
||||
MenuList.SetFeedback(1, true);
|
||||
});
|
||||
|
||||
MenuList.SetItemMainText(2, "Display Controls");
|
||||
MenuList.SetItemButtonAction(2, b => {
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechDisplayControlsVisible);
|
||||
MenuList.SetFeedback(2, true);
|
||||
});
|
||||
|
||||
count = 2;
|
||||
|
||||
// Don't show panel setup on iPad or xpanel
|
||||
if (TriList is Crestron.SimplSharpPro.DeviceSupport.TswFt5Button)
|
||||
{
|
||||
count++;
|
||||
MenuList.SetItemMainText(count, "Panel Setup");
|
||||
MenuList.SetItemButtonAction(count, b =>
|
||||
{
|
||||
if (b) PagesInterlock.ShowInterlocked(UIBoolJoin.TechPanelSetupVisible);
|
||||
MenuList.SetFeedback(count, true);
|
||||
});
|
||||
}
|
||||
|
||||
MenuList.Count = count;
|
||||
BuildStatusList();
|
||||
BuildDisplayList();
|
||||
SetupPinModal();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public override void Show()
|
||||
{
|
||||
// divert to PIN if we need auth
|
||||
if (IsAuthorized)
|
||||
{
|
||||
// Cancel the auth timer so we don't deauth after coming back in
|
||||
if (PinAuthorizedTimer != null)
|
||||
PinAuthorizedTimer.Stop();
|
||||
|
||||
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, true);
|
||||
PagesInterlock.Show();
|
||||
base.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public override void Hide()
|
||||
{
|
||||
// Leave it authorized for 60 seconds.
|
||||
if (IsAuthorized)
|
||||
PinAuthorizedTimer = new CTimer(o => {
|
||||
IsAuthorized = false;
|
||||
PinAuthorizedTimer = null;
|
||||
}, 60000);
|
||||
TriList.SetBool(UIBoolJoin.TechCommonItemsVisbible, false);
|
||||
PagesInterlock.Hide();
|
||||
base.Hide();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wire up the keypad and buttons
|
||||
/// </summary>
|
||||
void SetupPinModal()
|
||||
{
|
||||
TriList.SetSigFalseAction(UIBoolJoin.PinDialogCancelPress, CancelPinDialog);
|
||||
PinKeypad = new SmartObjectNumeric(TriList.SmartObjects[UISmartObjectJoin.TechPinDialogKeypad], true);
|
||||
PinKeypad.Digit0.UserObject = new Action<bool>(b => { if (b)DialPinDigit('0'); });
|
||||
PinKeypad.Digit1.UserObject = new Action<bool>(b => { if (b)DialPinDigit('1'); });
|
||||
PinKeypad.Digit2.UserObject = new Action<bool>(b => { if (b)DialPinDigit('2'); });
|
||||
PinKeypad.Digit3.UserObject = new Action<bool>(b => { if (b)DialPinDigit('3'); });
|
||||
PinKeypad.Digit4.UserObject = new Action<bool>(b => { if (b)DialPinDigit('4'); });
|
||||
PinKeypad.Digit5.UserObject = new Action<bool>(b => { if (b)DialPinDigit('5'); });
|
||||
PinKeypad.Digit6.UserObject = new Action<bool>(b => { if (b)DialPinDigit('6'); });
|
||||
PinKeypad.Digit7.UserObject = new Action<bool>(b => { if (b)DialPinDigit('7'); });
|
||||
PinKeypad.Digit8.UserObject = new Action<bool>(b => { if (b)DialPinDigit('8'); });
|
||||
PinKeypad.Digit9.UserObject = new Action<bool>(b => { if (b)DialPinDigit('9'); });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="d"></param>
|
||||
void DialPinDigit(char d)
|
||||
{
|
||||
PinEntryBuilder.Append(d);
|
||||
var len = PinEntryBuilder.Length;
|
||||
SetPinDotsFeedback(len);
|
||||
|
||||
// check it!
|
||||
if (len == 4)
|
||||
{
|
||||
if (Config.Password == PinEntryBuilder.ToString())
|
||||
{
|
||||
IsAuthorized = true;
|
||||
SetPinDotsFeedback(0);
|
||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
|
||||
Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetPinDotsFeedback(0);
|
||||
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, true);
|
||||
new CTimer(o =>
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.PinDialogErrorVisible, false);
|
||||
}, 1500);
|
||||
}
|
||||
|
||||
PinEntryBuilder.Remove(0, len); // clear it either way
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draws the dots as pin is entered
|
||||
/// </summary>
|
||||
/// <param name="len"></param>
|
||||
void SetPinDotsFeedback(int len)
|
||||
{
|
||||
TriList.SetBool(UIBoolJoin.PinDialogDot1, len >= 1);
|
||||
TriList.SetBool(UIBoolJoin.PinDialogDot2, len >= 2);
|
||||
TriList.SetBool(UIBoolJoin.PinDialogDot3, len >= 3);
|
||||
TriList.SetBool(UIBoolJoin.PinDialogDot4, len == 4);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does what it says
|
||||
/// </summary>
|
||||
void CancelPinDialog()
|
||||
{
|
||||
PinEntryBuilder.Remove(0, PinEntryBuilder.Length);
|
||||
TriList.SetBool(UIBoolJoin.PinDialog4DigitVisible, false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void BuildStatusList()
|
||||
{
|
||||
StatusList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechStatusList, 3, 3, 3);
|
||||
StatusListDeviceIndexes = new Dictionary<ICommunicationMonitor, uint>();
|
||||
uint i = 0;
|
||||
foreach (var d in DeviceManager.AllDevices)
|
||||
{
|
||||
// make sure it is both ICommunicationMonitor and a Device
|
||||
var sd = d as ICommunicationMonitor;
|
||||
if (sd == null)
|
||||
continue;
|
||||
var dd = sd as Device;
|
||||
if(dd == null)
|
||||
continue;
|
||||
i++;
|
||||
StatusList.StringInputSig(i, 1).StringValue = dd.Name;
|
||||
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)sd.CommunicationMonitor.Status;
|
||||
StatusListDeviceIndexes.Add(sd, i);
|
||||
sd.CommunicationMonitor.StatusChange += CommunicationMonitor_StatusChange ;
|
||||
}
|
||||
StatusList.Count = (ushort)i;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds the list of display controls
|
||||
/// </summary>
|
||||
void BuildDisplayList()
|
||||
{
|
||||
DisplayList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechDisplayControlsList, 10, 3, 3);
|
||||
|
||||
var devKeys = ConfigReader.ConfigObject.Devices.Where(d =>
|
||||
d.Group.Equals("display", StringComparison.OrdinalIgnoreCase)
|
||||
|| d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase))
|
||||
.Select(dd => dd.Key);
|
||||
var disps = DeviceManager.AllDevices.Where(d =>
|
||||
devKeys.Contains(d.Key));
|
||||
ushort i = 0;
|
||||
foreach (var disp in disps)
|
||||
{
|
||||
var display = disp as DisplayBase;
|
||||
if (display != null)
|
||||
{
|
||||
i++;
|
||||
DisplayList.StringInputSig(i, 1).StringValue = display.Name;
|
||||
DisplayList.GetBoolFeedbackSig(i, 1).SetSigFalseAction(display.PowerOn);
|
||||
DisplayList.GetBoolFeedbackSig(i, 2).SetSigFalseAction(display.PowerOff);
|
||||
if (display is TwoWayDisplayBase)
|
||||
{
|
||||
var powerOnSig = DisplayList.BoolInputSig(i, 1);
|
||||
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkInputSig(powerOnSig);
|
||||
|
||||
var powerOffSig = DisplayList.BoolInputSig(1, 2);
|
||||
(display as TwoWayDisplayBase).PowerIsOnFeedback.LinkComplementInputSig(powerOffSig);
|
||||
}
|
||||
DisplayList.GetBoolFeedbackSig(i, 3).SetSigFalseAction(() =>
|
||||
{ if (display is IInputHdmi1) (display as IInputHdmi1).InputHdmi1(); });
|
||||
DisplayList.GetBoolFeedbackSig(i, 4).SetSigFalseAction(() =>
|
||||
{ if (display is IInputHdmi2) (display as IInputHdmi2).InputHdmi2(); });
|
||||
DisplayList.GetBoolFeedbackSig(i, 5).SetSigFalseAction(() =>
|
||||
{ if (display is IInputHdmi3) (display as IInputHdmi3).InputHdmi3(); });
|
||||
//DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
||||
//{ if (display is IInputHdmi4) (display as IInputHdmi4).InputHdmi4(); });
|
||||
DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
||||
{ if (display is IInputDisplayPort1) (display as IInputDisplayPort1).InputDisplayPort1(); });
|
||||
|
||||
|
||||
// Figure out some way to provide current input feedback
|
||||
if (display is TwoWayDisplayBase)
|
||||
{
|
||||
(display as TwoWayDisplayBase).CurrentInputFeedback.OutputChange += CurrentInputFeedback_OutputChange;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
DisplayList.Count = i;
|
||||
}
|
||||
|
||||
|
||||
void CurrentInputFeedback_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void CommunicationMonitor_StatusChange(object sender, MonitorStatusChangeEventArgs e)
|
||||
{
|
||||
var c = sender as ICommunicationMonitor;
|
||||
if (c != null && StatusListDeviceIndexes.ContainsKey(c))
|
||||
{
|
||||
var i = StatusListDeviceIndexes[c];
|
||||
StatusList.UShortInputSig(i, 1).UShortValue = (ushort)e.Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,7 +354,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
TriList.SetSigFalseAction(UIBoolJoin.DisplayPowerTogglePress, () =>
|
||||
{
|
||||
if (CurrentRoom != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
|
||||
if (CurrentRoom != null && CurrentRoom.DefaultDisplay != null && CurrentRoom.DefaultDisplay is IHasPowerControl)
|
||||
(CurrentRoom.DefaultDisplay as IHasPowerControl).PowerToggle();
|
||||
});
|
||||
|
||||
@@ -493,10 +493,10 @@ namespace PepperDash.Essentials
|
||||
// and the LastMeetingDismissed != this meeting
|
||||
|
||||
var lastMeetingDismissed = meetings.FirstOrDefault(m => m.Id == LastMeetingDismissedId);
|
||||
Debug.Console(0, "*#* Room on: {0}, lastMeetingDismissedId: {1} {2} *#*",
|
||||
CurrentRoom.OnFeedback.BoolValue,
|
||||
LastMeetingDismissedId,
|
||||
lastMeetingDismissed != null ? lastMeetingDismissed.StartTime.ToString("t", Global.Culture) : "");
|
||||
//Debug.Console(0, "*#* Room on: {0}, lastMeetingDismissedId: {1} {2} *#*",
|
||||
// CurrentRoom.OnFeedback.BoolValue,
|
||||
// LastMeetingDismissedId,
|
||||
// lastMeetingDismissed != null ? lastMeetingDismissed.StartTime.ToString("t", Global.Culture) : "");
|
||||
|
||||
var meeting = meetings.LastOrDefault(m => m.Joinable);
|
||||
if (CurrentRoom.OnFeedback.BoolValue
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
var prevJoin = CurrentJoin;
|
||||
var wasShown = _IsShown;
|
||||
Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
|
||||
//Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
|
||||
if (CurrentJoin == join && TriList.BooleanInput[join].BoolValue)
|
||||
return;
|
||||
SetButDontShow(join);
|
||||
@@ -71,7 +71,7 @@ namespace PepperDash.Essentials
|
||||
var prevJoin = CurrentJoin;
|
||||
var wasShown = IsShown;
|
||||
|
||||
Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
|
||||
//Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
|
||||
if (CurrentJoin == join)
|
||||
HideAndClear();
|
||||
else
|
||||
@@ -92,7 +92,7 @@ namespace PepperDash.Essentials
|
||||
{
|
||||
var prevJoin = CurrentJoin;
|
||||
var wasShown = IsShown;
|
||||
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
|
||||
//Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
|
||||
Hide();
|
||||
CurrentJoin = 0;
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace PepperDash.Essentials
|
||||
var prevJoin = CurrentJoin;
|
||||
var wasShown = IsShown;
|
||||
|
||||
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
|
||||
//Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
|
||||
if (CurrentJoin > 0)
|
||||
{
|
||||
TriList.BooleanInput[CurrentJoin].BoolValue = false;
|
||||
@@ -125,7 +125,7 @@ namespace PepperDash.Essentials
|
||||
var prevJoin = CurrentJoin;
|
||||
var wasShown = IsShown;
|
||||
|
||||
Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin);
|
||||
//Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin);
|
||||
if (CurrentJoin > 0)
|
||||
{
|
||||
TriList.BooleanInput[CurrentJoin].BoolValue = true;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace PepperDash.Essentials
|
||||
/// <summary>
|
||||
/// Driver responsible for controlling the screenshaver showing the client logo, MC connection information and QR Code. Moves the elements around to prevent screen burn in
|
||||
/// </summary>
|
||||
public class ScreenSaverController : PanelDriverBase
|
||||
public class ScreenSaverController : PanelDriverBase, IDisposable
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -42,7 +42,7 @@ namespace PepperDash.Essentials
|
||||
|
||||
PositionInterlock = new JoinedSigInterlock(parent.TriList);
|
||||
|
||||
var cmdName = String.Format("shwscrsvr-{0}", parent.TriList.ID);
|
||||
var cmdName = String.Format("shwscrsvr-{0:X2}", parent.TriList.ID);
|
||||
|
||||
CrestronConsole.AddNewConsoleCommand((o) => Show(), cmdName, "Shows Panel Screensaver", ConsoleAccessLevelEnum.AccessOperator);
|
||||
|
||||
@@ -51,6 +51,8 @@ namespace PepperDash.Essentials
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
//Debug.Console(2, "Showing ScreenSaverController: {0:X2}", TriList.ID);
|
||||
|
||||
if (_parent.AvDriver != null)
|
||||
{
|
||||
_parent.AvDriver.PopupInterlock.ShowInterlocked(UIBoolJoin.MCScreenSaverVisible);
|
||||
@@ -65,10 +67,11 @@ namespace PepperDash.Essentials
|
||||
|
||||
public override void Hide()
|
||||
{
|
||||
Debug.Console(1, "Hiding ScreenSaverController");
|
||||
//Debug.Console(2, "Hiding ScreenSaverController: {0:X2}", TriList.ID);
|
||||
|
||||
if (PositionTimer != null)
|
||||
{
|
||||
//Debug.Console(2, "Stopping PositionTimer: {0:X2}", TriList.ID);
|
||||
PositionTimer.Stop();
|
||||
PositionTimer.Dispose();
|
||||
PositionTimer = null;
|
||||
@@ -86,6 +89,8 @@ namespace PepperDash.Essentials
|
||||
|
||||
void StartPositionTimer()
|
||||
{
|
||||
//Debug.Console(2, "Starting Position Timer: {0:X2}", TriList.ID);
|
||||
|
||||
if (PositionTimer == null)
|
||||
{
|
||||
PositionTimer = new CTimer((o) => PositionTimerExpired(), PositionTimeoutMs);
|
||||
@@ -117,7 +122,7 @@ namespace PepperDash.Essentials
|
||||
CurrentPositionIndex = 0;
|
||||
}
|
||||
|
||||
Debug.Console(1, "ScreenSaver Position Timer Expired: Setting new position: {0}", CurrentPositionIndex);
|
||||
//Debug.Console(2, "ScreenSaver Position Timer Expired: Setting new position: {0} ID: {1:X2}", CurrentPositionIndex, TriList.ID);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -129,9 +134,19 @@ namespace PepperDash.Essentials
|
||||
|
||||
void ClearAllPositions()
|
||||
{
|
||||
Debug.Console(1, "Hiding all screensaver positions");
|
||||
//Debug.Console(2, "Hiding all screensaver positions: {0:X2}", TriList.ID);
|
||||
|
||||
PositionInterlock.HideAndClear();
|
||||
}
|
||||
|
||||
#region IDisposable Members
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Hide();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -632,7 +632,6 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
|
||||
VCControlsInterlock.StatusChanged += new EventHandler<StatusChangedEventArgs>(VCControlsInterlock_StatusChanged);
|
||||
|
||||
|
||||
var codecOffCameras = Codec as IHasCameraOff;
|
||||
|
||||
var supportsCameraOffMode = Codec.SupportsCameraOff;
|
||||
@@ -643,6 +642,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
|
||||
if (codecAutoCameras != null && supportsAutoCameraMode)
|
||||
{
|
||||
|
||||
CameraModeList.SetItemButtonAction(1,(b) => codecAutoCameras.CameraAutoModeOn());
|
||||
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 1 Visible"].BoolValue = true;
|
||||
codecAutoCameras.CameraAutoModeIsOnFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 1 Selected"]);
|
||||
@@ -672,6 +672,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// Manual button always visible
|
||||
@@ -683,6 +684,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
|
||||
if (codecOffCameras != null && supportsCameraOffMode)
|
||||
{
|
||||
|
||||
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 3 Visible"].BoolValue = true;
|
||||
codecOffCameras.CameraIsOffFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 3 Selected"]);
|
||||
CameraModeList.SetItemButtonAction(3, (b) => codecOffCameras.CameraOff());
|
||||
@@ -710,6 +712,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,10 @@ Utilization of Essentials Framework falls into the following categories:
|
||||
|
||||
For detailed documentation, see the [Wiki](https://github.com/PepperDash/EssentialsFramework/wiki).
|
||||
|
||||
## Support
|
||||
|
||||
* Check out our [Discord Server](https://discord.gg/rWyeRH3K)
|
||||
|
||||
## How-To (Getting Started)
|
||||
|
||||
See [Getting Started](https://github.com/PepperDash/Essentials/wiki/Get-started#how-to-get-started)
|
||||
|
||||
@@ -42,3 +42,6 @@ devjson:2 {"deviceKey":"display01Comm-com", "methodName":"SendText", "params": [
|
||||
|
||||
devjson:10 {"deviceKey":"dmLink-ssh", "methodName":"Connect", "params": []}
|
||||
|
||||
devjson:2 {"deviceKey":"roomCombiner", "methodName":"SetRoomCombinationScenario", "params": ["combined"]}
|
||||
|
||||
devjson:2 {"deviceKey":"roomCombiner", "methodName":"SetRoomCombinationScenario", "params": ["divided"]}
|
||||
@@ -46,6 +46,14 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData { JoinNumber = 7, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Raw Occupancy Us Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("IdentityModeOn")]
|
||||
public JoinDataComplete IdentityMode = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Enable Identity Mode", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("IdentityModeFeedback")]
|
||||
public JoinDataComplete IdentityModeFeedback = new JoinDataComplete(new JoinData { JoinNumber = 8, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Identity Mode Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("EnableLedFlash")]
|
||||
public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Enable Led Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "DM Chassis enable audio breakaway routing",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "DM Chassis enable USB breakaway routing",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
@@ -84,6 +84,10 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public JoinDataComplete OutputStreamCardState = new JoinDataComplete(new JoinData { JoinNumber = 1601, JoinSpan = 32 },
|
||||
new JoinMetadata { Description = "DM Chassis Stream Output Start (1), Stop (2), Pause (3) with Feedback", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("NoRouteName")]
|
||||
public JoinDataComplete NoRouteName = new JoinDataComplete(new JoinData { JoinNumber = 100, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("InputNames")]
|
||||
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
||||
new JoinMetadata { Description = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
@@ -96,7 +100,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
new JoinDataComplete(new JoinData {JoinNumber = 501, JoinSpan = 200},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Video Input Name",
|
||||
Description = "DM Chassis Video Input Names",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
@@ -106,7 +110,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 701, JoinSpan = 200 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Video Input Name",
|
||||
Description = "DM Chassis Audio Input Names",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
@@ -115,7 +119,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 901, JoinSpan = 200 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Video Input Name",
|
||||
Description = "DM Chassis Video Output Names",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
@@ -124,7 +128,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 1101, JoinSpan = 200 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Video Input Name",
|
||||
Description = "DM Chassis Audio Output Names",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
@@ -28,6 +28,10 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public JoinDataComplete EdidSerialNumber = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM RMC EDID Serial Number", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("Name")]
|
||||
public JoinDataComplete Name = new JoinDataComplete(new JoinData { JoinNumber = 6, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM RMC Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("AudioVideoSource")]
|
||||
public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
@@ -32,6 +32,10 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public JoinDataComplete CurrentInputResolution = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM TX Current Input Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("Name")]
|
||||
public JoinDataComplete Name = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM TX Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("VideoInput")]
|
||||
public JoinDataComplete VideoInput = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM TX Video Input Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
@@ -42,7 +46,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
[JoinName("HdcpSupportCapability")]
|
||||
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DM TX HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||
new JoinMetadata { Description = "DM TX HDCP Support Capability", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("Port1HdcpState")]
|
||||
public JoinDataComplete Port1HdcpState = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
|
||||
|
||||
@@ -7,7 +7,15 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
[JoinName("MasterVolumeLevel")]
|
||||
public JoinDataComplete MasterVolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Master Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
new JoinMetadata { Description = "Master Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("MasterVolumeLevelScaled")]
|
||||
public JoinDataComplete MasterVolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Master Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("MixerPresetRecall")]
|
||||
public JoinDataComplete MixerPresetRecall = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Mixer Preset Recall Set", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("MasterVolumeMuteOn")]
|
||||
public JoinDataComplete MasterVolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
@@ -23,11 +31,19 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
[JoinName("MasterVolumeDown")]
|
||||
public JoinDataComplete MasterVolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Master Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
new JoinMetadata { Description = "Master Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MasterVolumeLevelScaledSend")]
|
||||
public JoinDataComplete MasterVolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Master Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("SourceVolumeLevel")]
|
||||
public JoinDataComplete SourceVolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Source Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
new JoinMetadata { Description = "Source Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("SourceVolumeLevelScaled")]
|
||||
public JoinDataComplete SourceVolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 12, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Source Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("SourceVolumeMuteOn")]
|
||||
public JoinDataComplete SourceVolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 11, JoinSpan = 1 },
|
||||
@@ -43,11 +59,19 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
[JoinName("SourceVolumeDown")]
|
||||
public JoinDataComplete SourceVolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 14, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Source Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
new JoinMetadata { Description = "Source Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("SourceVolumeLevelScaledSend")]
|
||||
public JoinDataComplete SourceVolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 15, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Source Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("Codec1VolumeLevel")]
|
||||
public JoinDataComplete Codec1VolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 21, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Codec1 Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
new JoinMetadata { Description = "Codec1 Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("Codec1VolumeLevelScaled")]
|
||||
public JoinDataComplete Codec1VolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 22, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Codec1 Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("Codec1VolumeMuteOn")]
|
||||
public JoinDataComplete Codec1VolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 21, JoinSpan = 1 },
|
||||
@@ -63,11 +87,19 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
[JoinName("Codec1VolumeDown")]
|
||||
public JoinDataComplete Codec1VolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 24, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Codec1 Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
new JoinMetadata { Description = "Codec1 Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("Codec1VolumeLevelScaledSend")]
|
||||
public JoinDataComplete Codec1VolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 25, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Codec1 Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("Codec2VolumeLevel")]
|
||||
public JoinDataComplete Codec2VolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 31, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Codec2 Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
new JoinMetadata { Description = "Codec2 Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("Codec2VolumeLevelScaled")]
|
||||
public JoinDataComplete Codec2VolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 32, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Codec2 Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("Codec2VolumeMuteOn")]
|
||||
public JoinDataComplete Codec2VolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 31, JoinSpan = 1 },
|
||||
@@ -83,8 +115,39 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
|
||||
[JoinName("Codec2VolumeDown")]
|
||||
public JoinDataComplete Codec2VolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 34, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Codec2 Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
new JoinMetadata { Description = "Codec2 Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("Codec2VolumeLevelScaledSend")]
|
||||
public JoinDataComplete Codec2VolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 35, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Codec2 Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MicsMasterVolumeLevel")]
|
||||
public JoinDataComplete MicsMasterVolumeLevel = new JoinDataComplete(new JoinData { JoinNumber = 41, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "MicsMaster Volume Signed dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("MicsMasterVolumeLevelScaled")]
|
||||
public JoinDataComplete MicsMasterVolumeLevelScaled = new JoinDataComplete(new JoinData { JoinNumber = 42, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "MicsMaster Volume 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("MicsMasterVolumeMuteOn")]
|
||||
public JoinDataComplete MicsMasterVolumeMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 41, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "MicsMaster Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MicsMasterVolumeMuteOff")]
|
||||
public JoinDataComplete MicsMasterVolumeMuteOff = new JoinDataComplete(new JoinData { JoinNumber = 42, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "MicsMaster Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MicsMasterVolumeUp")]
|
||||
public JoinDataComplete MicsMasterVolumeUp = new JoinDataComplete(new JoinData { JoinNumber = 43, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "MicsMaster Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MicsMasterVolumeDown")]
|
||||
public JoinDataComplete MicsMasterVolumeDown = new JoinDataComplete(new JoinData { JoinNumber = 44, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "MicsMaster Volume Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MicsMasterVolumeLevelScaledSend")]
|
||||
public JoinDataComplete MicsMasterVolumeLevelScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 45, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Mics Master Volume Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public class DmpsMicrophoneControllerJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("MicGain")]
|
||||
public JoinDataComplete MicGain = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Mic Gain dB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("MicGainScaled")]
|
||||
public JoinDataComplete MicGainScaled = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Mic Gain 16bit Scaled Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||
|
||||
[JoinName("MicMuteOn")]
|
||||
public JoinDataComplete MicMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Mic Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MicMuteOff")]
|
||||
public JoinDataComplete MicMuteOff = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Mic Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MicGainScaledSend")]
|
||||
public JoinDataComplete MicGainScaledSend = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Mic Gain Scaled Send Enable/Disable", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("MicName")]
|
||||
public JoinDataComplete MicName = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "Mic Name Get", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
public DmpsMicrophoneControllerJoinMap(uint joinStart)
|
||||
: this(joinStart, typeof(DmpsMicrophoneControllerJoinMap))
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when extending this Join map
|
||||
/// </summary>
|
||||
/// <param name="joinStart">Join this join map will start at</param>
|
||||
/// <param name="type">Type of the child join map</param>
|
||||
protected DmpsMicrophoneControllerJoinMap(uint joinStart, Type type)
|
||||
: base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,29 @@
|
||||
using System;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
namespace PepperDash.Essentials.Core.Bridges
|
||||
{
|
||||
public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
[JoinName("EnableRouting")]
|
||||
public JoinDataComplete EnableRouting = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DMPS Enable Audio and Video Routing", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("SystemPowerOn")]
|
||||
public JoinDataComplete SystemPowerOn = new JoinDataComplete(new JoinData { JoinNumber = 12, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DMPS System Power On Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("SystemPowerOff")]
|
||||
public JoinDataComplete SystemPowerOff = new JoinDataComplete(new JoinData { JoinNumber = 13, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DMPS System Power Off Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("FrontPanelLockOn")]
|
||||
public JoinDataComplete FrontPanelLockOn = new JoinDataComplete(new JoinData { JoinNumber = 14, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DMPS Front Panel Lock On Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("FrontPanelLockOff")]
|
||||
public JoinDataComplete FrontPanelLockOff = new JoinDataComplete(new JoinData { JoinNumber = 15, JoinSpan = 1 },
|
||||
new JoinMetadata { Description = "DMPS Front Panel Lock Off Get/Set", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||
|
||||
[JoinName("VideoSyncStatus")]
|
||||
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData { JoinNumber = 101, JoinSpan = 32 },
|
||||
new JoinMetadata { Description = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||
@@ -32,6 +52,44 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData { JoinNumber = 301, JoinSpan = 32 },
|
||||
new JoinMetadata { Description = "DM Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("InputVideoNames")]
|
||||
public JoinDataComplete InputVideoNames =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 501, JoinSpan = 32 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Video Input Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
[JoinName("InputAudioNames")]
|
||||
public JoinDataComplete InputAudioNames =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 701, JoinSpan = 32 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Audio Input Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
[JoinName("OutputVideoNames")]
|
||||
public JoinDataComplete OutputVideoNames =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 901, JoinSpan = 32 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Video Output Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
[JoinName("OutputAudioNames")]
|
||||
public JoinDataComplete OutputAudioNames =
|
||||
new JoinDataComplete(new JoinData { JoinNumber = 1101, JoinSpan = 32 },
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Audio Output Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
[JoinName("OutputCurrentVideoInputNames")]
|
||||
public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData { JoinNumber = 2001, JoinSpan = 32 },
|
||||
new JoinMetadata { Description = "DM Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
@@ -61,5 +119,5 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
protected DmpsRoutingControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,9 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
||||
{
|
||||
public class GlsPartitionSensorJoinMap : JoinMapBaseAdvanced
|
||||
{
|
||||
|
||||
#region Digital
|
||||
|
||||
[JoinName("IsOnline")]
|
||||
public JoinDataComplete IsOnline = new JoinDataComplete(
|
||||
new JoinData
|
||||
@@ -19,20 +22,7 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("Name")]
|
||||
public JoinDataComplete Name = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 1,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
|
||||
[JoinName("Enable")]
|
||||
public JoinDataComplete Enable = new JoinDataComplete(
|
||||
new JoinData
|
||||
@@ -101,7 +91,11 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
||||
Description = "Sensor Decrease Sensitivity",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
#region Analog
|
||||
|
||||
[JoinName("Sensitivity")]
|
||||
public JoinDataComplete Sensitivity = new JoinDataComplete(
|
||||
@@ -117,6 +111,28 @@ namespace PepperDash.Essentials.Core.Bridges.JoinMaps
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Serial
|
||||
|
||||
[JoinName("Name")]
|
||||
public JoinDataComplete Name = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 1,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sensor Name",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||
/// </summary>
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
||||
new JoinMetadata { Description = "Processor Last Boot", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||
|
||||
[JoinName("ProgramOffsetJoin")]
|
||||
public JoinDataComplete ProgramOffsetJoin = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||
public JoinDataComplete ProgramOffsetJoin = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 5 },
|
||||
new JoinMetadata { Description = "All Program Data is offset between slots by 5 - First Joins Start at 11", JoinCapabilities = eJoinCapabilities.None, JoinType = eJoinType.None });
|
||||
|
||||
[JoinName("ProgramStart")]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -66,7 +66,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class C2NIoControllerFactory : EssentialsDeviceFactory<C2nRthsController>
|
||||
public class C2NIoControllerFactory : EssentialsDeviceFactory<C2NIoController>
|
||||
{
|
||||
public C2NIoControllerFactory()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
using System.Collections.Generic;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper class for CEN-IO-RY-104 relay module
|
||||
/// </summary>
|
||||
[Description("Wrapper class for the CEN-IO-RY-104 relay module")]
|
||||
public class CenIoRy104Controller : EssentialsDevice, IRelayPorts
|
||||
{
|
||||
private readonly CenIoRy104 _ry104;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="ry104"></param>
|
||||
public CenIoRy104Controller(string key, string name, CenIoRy104 ry104)
|
||||
: base(key, name)
|
||||
{
|
||||
_ry104 = ry104;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relay port collection
|
||||
/// </summary>
|
||||
public CrestronCollection<Relay> RelayPorts
|
||||
{
|
||||
get { return _ry104.RelayPorts; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Number of relay ports property
|
||||
/// </summary>
|
||||
public int NumberOfRelayPorts
|
||||
{
|
||||
get { return _ry104.NumberOfRelayPorts; }
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CEN-IO-RY Controller factory
|
||||
/// </summary>
|
||||
public class CenIoRy104ControllerFactory : EssentialsDeviceFactory<CenIoRy104Controller>
|
||||
{
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
public CenIoRy104ControllerFactory()
|
||||
{
|
||||
TypeNames = new List<string>() { "ceniory104" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create a new CEN-IO-RY-104 Device");
|
||||
|
||||
var controlPropertiesConfig = CommFactory.GetControlPropertiesConfig(dc);
|
||||
if (controlPropertiesConfig == null)
|
||||
{
|
||||
Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device");
|
||||
return null;
|
||||
}
|
||||
|
||||
var ipid = controlPropertiesConfig.IpIdInt;
|
||||
if (ipid != 0) return new CenIoRy104Controller(dc.Key, dc.Name, new CenIoRy104(ipid, Global.ControlSystem));
|
||||
|
||||
Debug.Console(1, "Factory failed to create a new CEN-IO-RY-104 Device using IP-ID-{0}", ipid);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,12 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
RelayOutput = postActivationFunc(config);
|
||||
|
||||
if (RelayOutput == null)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "Unable to get parent relay device for device key {0} and port {1}", config.PortDeviceKey, config.PortNumber);
|
||||
return;
|
||||
}
|
||||
|
||||
RelayOutput.Register();
|
||||
|
||||
RelayOutput.StateChange += RelayOutput_StateChange;
|
||||
@@ -61,33 +67,36 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
if (!Global.ControlSystem.SupportsRelay)
|
||||
{
|
||||
Debug.Console(0, "GetRelayDevice: Processor does not support relays");
|
||||
Debug.Console(0, "Processor does not support relays");
|
||||
return null;
|
||||
}
|
||||
relayDevice = Global.ControlSystem;
|
||||
|
||||
return relayDevice.RelayPorts[dc.PortNumber];
|
||||
}
|
||||
else
|
||||
|
||||
var essentialsDevice = DeviceManager.GetDeviceForKey(dc.PortDeviceKey);
|
||||
if (essentialsDevice == null)
|
||||
{
|
||||
var relayDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IRelayPorts;
|
||||
if (relayDev == null)
|
||||
{
|
||||
Debug.Console(0, "GetRelayDevice: Device {0} is not a valid device", dc.PortDeviceKey);
|
||||
return null;
|
||||
}
|
||||
relayDevice = relayDev;
|
||||
}
|
||||
if (relayDevice == null)
|
||||
{
|
||||
Debug.Console(0, "GetRelayDevice: Device '0' is not a valid IRelayPorts Device", dc.PortDeviceKey);
|
||||
Debug.Console(0, "Device {0} was not found in Device Manager. Check configuration or for errors with device.", dc.PortDeviceKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (dc.PortNumber > relayDevice.NumberOfRelayPorts)
|
||||
{
|
||||
Debug.Console(0, "GetRelayDevice: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||
}
|
||||
relayDevice = essentialsDevice as IRelayPorts;
|
||||
|
||||
return relayDevice.RelayPorts[dc.PortNumber];
|
||||
if (relayDevice == null)
|
||||
{
|
||||
Debug.Console(0, "Device {0} is not a valid relay parent. Please check configuration.", dc.PortDeviceKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (dc.PortNumber <= relayDevice.NumberOfRelayPorts)
|
||||
{
|
||||
return relayDevice.RelayPorts[dc.PortNumber];
|
||||
}
|
||||
|
||||
Debug.Console(0, "Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -200,58 +209,6 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
||||
var portDevice = new GenericRelayDevice(dc.Key, dc.Name, GetRelay, props);
|
||||
|
||||
return portDevice;
|
||||
|
||||
|
||||
/*
|
||||
if (props.PortDeviceKey == "processor")
|
||||
portDevice = Global.ControlSystem as IRelayPorts;
|
||||
else
|
||||
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IRelayPorts;
|
||||
|
||||
if (portDevice == null)
|
||||
Debug.Console(0, "Unable to add relay device with key '{0}'. Port Device does not support relays", key);
|
||||
else
|
||||
{
|
||||
var cs = (portDevice as CrestronControlSystem);
|
||||
|
||||
if (cs != null)
|
||||
{
|
||||
// The relay is on a control system processor
|
||||
if (!cs.SupportsRelay || props.PortNumber > cs.NumberOfRelayPorts)
|
||||
{
|
||||
Debug.Console(0, "Port Device: {0} does not support relays or does not have enough relays");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The relay is on another device type
|
||||
|
||||
if (props.PortNumber > portDevice.NumberOfRelayPorts)
|
||||
{
|
||||
Debug.Console(0, "Port Device: {0} does not have enough relays");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Relay relay = portDevice.RelayPorts[props.PortNumber];
|
||||
|
||||
if (!relay.Registered)
|
||||
{
|
||||
if (relay.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
return new GenericRelayDevice(key, relay);
|
||||
else
|
||||
Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new GenericRelayDevice(key, relay);
|
||||
}
|
||||
|
||||
// Future: Check if portDevice is 3-series card or other non control system that supports versiports
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -69,19 +69,28 @@ namespace PepperDash.Essentials.Core
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
Debug.Console(0, this, "Activating");
|
||||
if (!PreventRegistration)
|
||||
{
|
||||
if (!PreventRegistration)
|
||||
{
|
||||
//Debug.Console(1, this, " Does not require registration. Skipping");
|
||||
|
||||
var response = Hardware.RegisterWithLogging(Key);
|
||||
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
|
||||
return false;
|
||||
}
|
||||
var response = Hardware.RegisterWithLogging(Key);
|
||||
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
|
||||
return false;
|
||||
}
|
||||
|
||||
IsRegistered.FireUpdate();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
var response = Hardware.RegisterWithLogging(Key);
|
||||
|
||||
IsRegistered.FireUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var f in Feedbacks)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
|
||||
/// </summary>
|
||||
public interface IMobileControl : IKeyed
|
||||
{
|
||||
void CreateMobileControlRoomBridge(EssentialsRoomBase room, IMobileControl parent);
|
||||
void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent);
|
||||
|
||||
void LinkSystemMonitorToAppServer();
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ namespace PepperDash.Essentials.Core
|
||||
DeviceCriticalSection.Enter();
|
||||
AddDeviceEnabled = false;
|
||||
// PreActivate all devices
|
||||
Debug.Console(0,"****PreActivation starting...****");
|
||||
foreach (var d in Devices.Values)
|
||||
{
|
||||
try
|
||||
@@ -69,9 +70,12 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, d, "ERROR: Device PreActivation failure:\r{0}", e);
|
||||
Debug.Console(0, d, "ERROR: Device {1} PreActivation failure: {0}", e.Message, d.Key);
|
||||
Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
|
||||
}
|
||||
}
|
||||
Debug.Console(0, "****PreActivation complete****");
|
||||
Debug.Console(0, "****Activation starting...****");
|
||||
|
||||
// Activate all devices
|
||||
foreach (var d in Devices.Values)
|
||||
@@ -83,10 +87,14 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, d, "ERROR: Device Activation failure:\r{0}", e);
|
||||
Debug.Console(0, d, "ERROR: Device {1} Activation failure: {0}", e.Message, d.Key);
|
||||
Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Console(0, "****Activation complete****");
|
||||
Debug.Console(0, "****PostActivation starting...****");
|
||||
|
||||
// PostActivate all devices
|
||||
foreach (var d in Devices.Values)
|
||||
{
|
||||
@@ -97,10 +105,13 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
|
||||
Debug.Console(0, d, "ERROR: Device {1} PostActivation failure: {0}", e.Message, d.Key);
|
||||
Debug.Console(1, d, "Stack Trace: {0}", e.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Console(0, "****PostActivation complete****");
|
||||
|
||||
OnAllDevicesActivated();
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public DescriptionAttribute(string description)
|
||||
{
|
||||
Debug.Console(2, "Setting Description: {0}", description);
|
||||
//Debug.Console(2, "Setting Description: {0}", description);
|
||||
_Description = description;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public ConfigSnippetAttribute(string configSnippet)
|
||||
{
|
||||
Debug.Console(2, "Setting Config Snippet {0}", configSnippet);
|
||||
//Debug.Console(2, "Setting Config Snippet {0}", configSnippet);
|
||||
_ConfigSnippet = configSnippet;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
foreach (var typeName in TypeNames)
|
||||
{
|
||||
Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
|
||||
//Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
|
||||
var descriptionAttribute = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
|
||||
string description = descriptionAttribute[0].Description;
|
||||
var snippetAttribute = typeof(T).GetCustomAttributes(typeof(ConfigSnippetAttribute), true) as ConfigSnippetAttribute[];
|
||||
|
||||
@@ -111,7 +111,12 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public override void ExecuteSwitch(object selector)
|
||||
{
|
||||
Debug.Console(2, this, "ExecuteSwitch: {0}", selector);
|
||||
Debug.Console(2, this, "ExecuteSwitch: {0}", selector);
|
||||
|
||||
if (!_PowerIsOn)
|
||||
{
|
||||
PowerOn();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -69,13 +69,13 @@ namespace PepperDash.Essentials.Core
|
||||
/// <returns></returns>
|
||||
public static void AddFactoryForType(string typeName, Func<DeviceConfig, IKeyed> method)
|
||||
{
|
||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||
//Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||
DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
|
||||
}
|
||||
|
||||
public static void AddFactoryForType(string typeName, string description, CType cType, Func<DeviceConfig, IKeyed> method)
|
||||
{
|
||||
Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||
//Debug.Console(1, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
|
||||
|
||||
if(FactoryMethods.ContainsKey(typeName))
|
||||
{
|
||||
|
||||
@@ -62,6 +62,11 @@ namespace PepperDash.Essentials.Core
|
||||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
public void SetValueFunc(Func<bool> newFunc)
|
||||
{
|
||||
ValueFunc = newFunc;
|
||||
}
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
bool newValue = InTestMode ? TestValue : ValueFunc.Invoke();
|
||||
|
||||
@@ -51,6 +51,12 @@ namespace PepperDash.Essentials.Core
|
||||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
public void SetValueFunc(Func<int> newFunc)
|
||||
{
|
||||
ValueFunc = newFunc;
|
||||
}
|
||||
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
var newValue = InTestMode ? TestValue : ValueFunc.Invoke();
|
||||
|
||||
@@ -52,7 +52,10 @@ namespace PepperDash.Essentials.Core
|
||||
ValueFunc = valueFunc;
|
||||
}
|
||||
|
||||
|
||||
public void SetValueFunc(Func<string> newFunc)
|
||||
{
|
||||
ValueFunc = newFunc;
|
||||
}
|
||||
|
||||
public override void FireUpdate()
|
||||
{
|
||||
|
||||
@@ -119,9 +119,21 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
var slot = Global.ControlSystem.ProgramNumber;
|
||||
|
||||
var guidFilePath = Global.FilePathPrefix +
|
||||
string.Format(@"{0}-FusionGuids.json", InitialParametersClass.ProgramIDTag);
|
||||
string.Format(@"{0}-FusionGuids-{1:X2}.json", InitialParametersClass.ProgramIDTag, _ipId);
|
||||
|
||||
_guidFileExists = File.Exists(guidFilePath);
|
||||
var oldGuidFilePath = Global.FilePathPrefix +
|
||||
string.Format(@"{0}-FusionGuids.json", InitialParametersClass.ProgramIDTag);
|
||||
|
||||
if (File.Exists(oldGuidFilePath))
|
||||
{
|
||||
Debug.Console(0, this, "Migrating from old Fusion GUID file to new Fusion GUID File");
|
||||
|
||||
File.Copy(oldGuidFilePath, guidFilePath);
|
||||
|
||||
File.Delete(oldGuidFilePath);
|
||||
}
|
||||
|
||||
_guidFileExists = File.Exists(guidFilePath);
|
||||
|
||||
// Check if file exists
|
||||
if (!_guidFileExists)
|
||||
@@ -149,19 +161,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
}
|
||||
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
CreateSymbolAndBasicSigs(_ipId);
|
||||
SetUpSources();
|
||||
SetUpCommunitcationMonitors();
|
||||
SetUpDisplay();
|
||||
SetUpError();
|
||||
ExecuteCustomSteps();
|
||||
|
||||
FusionRVI.GenerateFileForAllFusionDevices();
|
||||
|
||||
GenerateGuidFile(guidFilePath);
|
||||
});
|
||||
AddPostActivationAction(() => PostActivate(guidFilePath));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -169,6 +169,20 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
}
|
||||
}
|
||||
|
||||
private void PostActivate(string guidFilePath)
|
||||
{
|
||||
CreateSymbolAndBasicSigs(_ipId);
|
||||
SetUpSources();
|
||||
SetUpCommunitcationMonitors();
|
||||
SetUpDisplay();
|
||||
SetUpError();
|
||||
ExecuteCustomSteps();
|
||||
|
||||
FusionRVI.GenerateFileForAllFusionDevices();
|
||||
|
||||
GenerateGuidFile(guidFilePath);
|
||||
}
|
||||
|
||||
protected string RoomGuid
|
||||
{
|
||||
get { return _guiDs.RoomGuid; }
|
||||
@@ -314,7 +328,7 @@ namespace PepperDash.Essentials.Core.Fusion
|
||||
|
||||
protected virtual void CreateSymbolAndBasicSigs(uint ipId)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "Creating Fusion Room symbol with GUID: {0} and IP-ID {1:X2}", RoomGuid, ipId);
|
||||
|
||||
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
|
||||
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
|
||||
|
||||
@@ -32,6 +32,27 @@ namespace PepperDash.Essentials.Core
|
||||
// TODO: consider making this configurable later
|
||||
public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US");
|
||||
|
||||
/// <summary>
|
||||
/// True when the processor type is a DMPS variant
|
||||
/// </summary>
|
||||
public static bool ControlSystemIsDmpsType
|
||||
{
|
||||
get
|
||||
{
|
||||
return ControlSystem.ControllerPrompt.ToLower().IndexOf("dmps") > -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// True when the processor type is a DMPS 4K variant
|
||||
/// </summary>
|
||||
public static bool ControlSystemIsDmps4kType
|
||||
{
|
||||
get
|
||||
{
|
||||
return ControlSystemIsDmpsType && ControlSystem.ControllerPrompt.ToLower().IndexOf("4k") > -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The file path prefix to the folder containing configuration files
|
||||
|
||||
@@ -1,83 +1,83 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Lighting
|
||||
{
|
||||
public abstract class LightingBase : EssentialsBridgeableDevice, ILightingScenes
|
||||
{
|
||||
#region ILightingScenes Members
|
||||
|
||||
public event EventHandler<LightingSceneChangeEventArgs> LightingSceneChange;
|
||||
|
||||
public List<LightingScene> LightingScenes { get; protected set; }
|
||||
|
||||
public LightingScene CurrentLightingScene { get; protected set; }
|
||||
|
||||
public IntFeedback CurrentLightingSceneFeedback { get; protected set; }
|
||||
|
||||
#endregion
|
||||
|
||||
protected LightingBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
LightingScenes = new List<LightingScene>();
|
||||
|
||||
CurrentLightingScene = new LightingScene();
|
||||
//CurrentLightingSceneFeedback = new IntFeedback(() => { return int.Parse(this.CurrentLightingScene.ID); });
|
||||
}
|
||||
|
||||
public abstract void SelectScene(LightingScene scene);
|
||||
|
||||
public void SimulateSceneSelect(string sceneName)
|
||||
{
|
||||
Debug.Console(1, this, "Simulating selection of scene '{0}'", sceneName);
|
||||
|
||||
var scene = LightingScenes.FirstOrDefault(s => s.Name.Equals(sceneName));
|
||||
|
||||
if (scene != null)
|
||||
{
|
||||
CurrentLightingScene = scene;
|
||||
OnLightingSceneChange();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the IsActive property on each scene and fires the LightingSceneChange event
|
||||
/// </summary>
|
||||
protected void OnLightingSceneChange()
|
||||
{
|
||||
foreach (var scene in LightingScenes)
|
||||
{
|
||||
if (scene == CurrentLightingScene)
|
||||
scene.IsActive = true;
|
||||
|
||||
else
|
||||
scene.IsActive = false;
|
||||
}
|
||||
|
||||
var handler = LightingSceneChange;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new LightingSceneChangeEventArgs(CurrentLightingScene));
|
||||
}
|
||||
}
|
||||
|
||||
protected GenericLightingJoinMap LinkLightingToApi(LightingBase lightingDevice, BasicTriList trilist, uint joinStart,
|
||||
string joinMapKey, EiscApiAdvanced bridge)
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Lighting
|
||||
{
|
||||
public abstract class LightingBase : EssentialsBridgeableDevice, ILightingScenes
|
||||
{
|
||||
#region ILightingScenes Members
|
||||
|
||||
public event EventHandler<LightingSceneChangeEventArgs> LightingSceneChange;
|
||||
|
||||
public List<LightingScene> LightingScenes { get; protected set; }
|
||||
|
||||
public LightingScene CurrentLightingScene { get; protected set; }
|
||||
|
||||
public IntFeedback CurrentLightingSceneFeedback { get; protected set; }
|
||||
|
||||
#endregion
|
||||
|
||||
protected LightingBase(string key, string name)
|
||||
: base(key, name)
|
||||
{
|
||||
var joinMap = new GenericLightingJoinMap(joinStart);
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
LightingScenes = new List<LightingScene>();
|
||||
|
||||
CurrentLightingScene = new LightingScene();
|
||||
//CurrentLightingSceneFeedback = new IntFeedback(() => { return int.Parse(this.CurrentLightingScene.ID); });
|
||||
}
|
||||
|
||||
public abstract void SelectScene(LightingScene scene);
|
||||
|
||||
public void SimulateSceneSelect(string sceneName)
|
||||
{
|
||||
Debug.Console(1, this, "Simulating selection of scene '{0}'", sceneName);
|
||||
|
||||
var scene = LightingScenes.FirstOrDefault(s => s.Name.Equals(sceneName));
|
||||
|
||||
if (scene != null)
|
||||
{
|
||||
CurrentLightingScene = scene;
|
||||
OnLightingSceneChange();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the IsActive property on each scene and fires the LightingSceneChange event
|
||||
/// </summary>
|
||||
protected void OnLightingSceneChange()
|
||||
{
|
||||
foreach (var scene in LightingScenes)
|
||||
{
|
||||
if (scene == CurrentLightingScene)
|
||||
scene.IsActive = true;
|
||||
|
||||
else
|
||||
scene.IsActive = false;
|
||||
}
|
||||
|
||||
var handler = LightingSceneChange;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new LightingSceneChangeEventArgs(CurrentLightingScene));
|
||||
}
|
||||
}
|
||||
|
||||
protected GenericLightingJoinMap LinkLightingToApi(LightingBase lightingDevice, BasicTriList trilist, uint joinStart,
|
||||
string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = new GenericLightingJoinMap(joinStart);
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
|
||||
|
||||
if (bridge != null)
|
||||
@@ -87,52 +87,57 @@ namespace PepperDash.Essentials.Core.Lighting
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||
}
|
||||
|
||||
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(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||
|
||||
// GenericLighitng Actions & FeedBack
|
||||
trilist.SetUShortSigAction(joinMap.SelectScene.JoinNumber, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||
|
||||
var sceneIndex = 0;
|
||||
foreach (var scene in lightingDevice.LightingScenes)
|
||||
trilist.SetUShortSigAction(joinMap.SelectScene.JoinNumber, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||
|
||||
var sceneIndex = 0;
|
||||
foreach (var scene in lightingDevice.LightingScenes)
|
||||
{
|
||||
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex]));
|
||||
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex]));
|
||||
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]);
|
||||
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
|
||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
|
||||
sceneIndex++;
|
||||
}
|
||||
|
||||
return joinMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class LightingScene
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string ID { get; set; }
|
||||
bool _IsActive;
|
||||
public bool IsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
return _IsActive;
|
||||
}
|
||||
set
|
||||
{
|
||||
_IsActive = value;
|
||||
IsActiveFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
public BoolFeedback IsActiveFeedback { get; set; }
|
||||
|
||||
public LightingScene()
|
||||
{
|
||||
IsActiveFeedback = new BoolFeedback(new Func<bool>(() => IsActive));
|
||||
}
|
||||
}
|
||||
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
|
||||
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
|
||||
sceneIndex++;
|
||||
}
|
||||
|
||||
return joinMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class LightingScene
|
||||
{
|
||||
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string ID { get; set; }
|
||||
bool _IsActive;
|
||||
[JsonProperty("isActive", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool IsActive
|
||||
{
|
||||
get
|
||||
{
|
||||
return _IsActive;
|
||||
}
|
||||
set
|
||||
{
|
||||
_IsActive = value;
|
||||
IsActiveFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public BoolFeedback IsActiveFeedback { get; set; }
|
||||
|
||||
public LightingScene()
|
||||
{
|
||||
IsActiveFeedback = new BoolFeedback(new Func<bool>(() => IsActive));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,11 +16,28 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// Used for monitoring comms that are IBasicCommunication. Will send a poll string and provide an event when
|
||||
/// statuses change.
|
||||
/// Default monitoring uses TextReceived event on Client.
|
||||
/// </summary>
|
||||
public class GenericCommunicationMonitor : StatusMonitorBase
|
||||
{
|
||||
public IBasicCommunication Client { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Will monitor Client.BytesReceived if set to true. Otherwise the default is to monitor Client.TextReceived
|
||||
/// </summary>
|
||||
public bool MonitorBytesReceived { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Return true if the Client is ISocketStatus
|
||||
/// </summary>
|
||||
public bool IsSocket
|
||||
{
|
||||
get
|
||||
{
|
||||
return Client is ISocketStatus;
|
||||
}
|
||||
}
|
||||
|
||||
long PollTime;
|
||||
CTimer PollTimer;
|
||||
string PollString;
|
||||
@@ -46,8 +63,20 @@ namespace PepperDash.Essentials.Core
|
||||
Client = client;
|
||||
PollTime = pollTime;
|
||||
PollString = pollString;
|
||||
|
||||
if (IsSocket)
|
||||
{
|
||||
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
||||
}
|
||||
}
|
||||
|
||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
||||
long warningTime, long errorTime, string pollString, bool monitorBytesReceived) :
|
||||
this(parent, client, pollTime, warningTime, errorTime, pollString)
|
||||
{
|
||||
SetMonitorBytesReceived(monitorBytesReceived);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Poll is a provided action instead of string
|
||||
/// </summary>
|
||||
@@ -69,6 +98,19 @@ namespace PepperDash.Essentials.Core
|
||||
Client = client;
|
||||
PollTime = pollTime;
|
||||
PollAction = pollAction;
|
||||
|
||||
if (IsSocket)
|
||||
{
|
||||
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
|
||||
long warningTime, long errorTime, Action pollAction, bool monitorBytesReceived) :
|
||||
this(parent, client, pollTime, warningTime, errorTime, pollAction)
|
||||
{
|
||||
SetMonitorBytesReceived(monitorBytesReceived);
|
||||
}
|
||||
|
||||
|
||||
@@ -79,23 +121,96 @@ namespace PepperDash.Essentials.Core
|
||||
CommunicationMonitorConfig props) :
|
||||
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
||||
{
|
||||
if (IsSocket)
|
||||
{
|
||||
(Client as ISocketStatus).ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds the monitor from a config object and takes a bool to specify whether to monitor BytesReceived
|
||||
/// Default is to monitor TextReceived
|
||||
/// </summary>
|
||||
/// <param name="parent"></param>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="props"></param>
|
||||
/// <param name="monitorBytesReceived"></param>
|
||||
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, CommunicationMonitorConfig props, bool monitorBytesReceived) :
|
||||
this(parent, client, props.PollInterval, props.TimeToWarning, props.TimeToError, props.PollString)
|
||||
{
|
||||
SetMonitorBytesReceived(monitorBytesReceived);
|
||||
}
|
||||
|
||||
void SetMonitorBytesReceived(bool monitorBytesReceived)
|
||||
{
|
||||
MonitorBytesReceived = monitorBytesReceived;
|
||||
}
|
||||
|
||||
public override void Start()
|
||||
{
|
||||
Client.BytesReceived += Client_BytesReceived;
|
||||
Poll();
|
||||
PollTimer = new CTimer(o => Poll(), null, PollTime, PollTime);
|
||||
if (MonitorBytesReceived)
|
||||
{
|
||||
Client.BytesReceived += Client_BytesReceived;
|
||||
}
|
||||
else
|
||||
{
|
||||
Client.TextReceived += Client_TextReceived;
|
||||
}
|
||||
|
||||
if (!IsSocket)
|
||||
{
|
||||
BeginPolling();
|
||||
}
|
||||
}
|
||||
|
||||
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
|
||||
{
|
||||
if (!e.Client.IsConnected)
|
||||
{
|
||||
// Immediately stop polling and notify that device is offline
|
||||
Stop();
|
||||
Status = MonitorStatus.InError;
|
||||
ResetErrorTimers();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Start polling and set status to unknow and let poll result update the status to IsOk when a response is received
|
||||
Status = MonitorStatus.StatusUnknown;
|
||||
Start();
|
||||
BeginPolling();
|
||||
}
|
||||
}
|
||||
|
||||
void BeginPolling()
|
||||
{
|
||||
Poll();
|
||||
PollTimer = new CTimer(o => Poll(), null, PollTime, PollTime);
|
||||
}
|
||||
|
||||
public override void Stop()
|
||||
{
|
||||
Client.BytesReceived -= this.Client_BytesReceived;
|
||||
PollTimer.Stop();
|
||||
PollTimer = null;
|
||||
StopErrorTimers();
|
||||
if(MonitorBytesReceived)
|
||||
{
|
||||
Client.BytesReceived -= this.Client_BytesReceived;
|
||||
}
|
||||
else
|
||||
{
|
||||
Client.TextReceived -= Client_TextReceived;
|
||||
}
|
||||
|
||||
if (PollTimer != null)
|
||||
{
|
||||
PollTimer.Stop();
|
||||
PollTimer = null;
|
||||
StopErrorTimers();
|
||||
}
|
||||
}
|
||||
|
||||
void Client_TextReceived(object sender, GenericCommMethodReceiveTextArgs e)
|
||||
{
|
||||
DataReceived();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upon any receipt of data, set everything to ok!
|
||||
/// </summary>
|
||||
@@ -103,10 +218,14 @@ namespace PepperDash.Essentials.Core
|
||||
/// <param name="e"></param>
|
||||
void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||
{
|
||||
Status = MonitorStatus.IsOk;
|
||||
ResetErrorTimers();
|
||||
//
|
||||
}
|
||||
DataReceived();
|
||||
}
|
||||
|
||||
void DataReceived()
|
||||
{
|
||||
Status = MonitorStatus.IsOk;
|
||||
ResetErrorTimers();
|
||||
}
|
||||
|
||||
void Poll()
|
||||
{
|
||||
@@ -124,19 +243,6 @@ namespace PepperDash.Essentials.Core
|
||||
Debug.Console(2, this, "Comm not connected");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When the client connects, and we're waiting for it, respond and disconect from event
|
||||
/// </summary>
|
||||
void OneTimeConnectHandler(object o, EventArgs a)
|
||||
{
|
||||
if (Client.IsConnected)
|
||||
{
|
||||
//Client.IsConnected -= OneTimeConnectHandler;
|
||||
Debug.Console(2, this, "Comm connected");
|
||||
Poll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace PepperDash.Essentials.Core.Monitoring
|
||||
p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
|
||||
trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo.JoinNumber]);
|
||||
|
||||
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin.JoinNumber;
|
||||
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin.JoinSpan;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Resources;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
@@ -61,6 +62,8 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public BoolFeedback RawOccupancyUsFeedback { get; private set; }
|
||||
|
||||
public BoolFeedback IdentityModeFeedback { get; private set; }
|
||||
|
||||
// Debug properties
|
||||
public bool InTestMode { get; private set; }
|
||||
|
||||
@@ -117,6 +120,8 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyDetectedByUltrasonicSensorFeedback.BoolValue);
|
||||
|
||||
IdentityModeFeedback = new BoolFeedback(()=>OccSensor.IdentityModeOnFeedback.BoolValue);
|
||||
|
||||
UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInVacantStateFeedback);
|
||||
|
||||
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => (int)OccSensor.UltrasonicSensorSensitivityInOccupiedStateFeedback);
|
||||
@@ -199,6 +204,27 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
SetAndWhenVacatedState((bool)PropertiesConfig.AndWhenVacatedState);
|
||||
}
|
||||
|
||||
// TODO [ ] feature/cenoodtcpoe-sensor-sensitivity-configuration
|
||||
if (PropertiesConfig.UsSensitivityOccupied != null)
|
||||
{
|
||||
SetUsSensitivityOccupied((ushort)PropertiesConfig.UsSensitivityOccupied);
|
||||
}
|
||||
|
||||
if (PropertiesConfig.UsSensitivityVacant != null)
|
||||
{
|
||||
SetUsSensitivityVacant((ushort)PropertiesConfig.UsSensitivityVacant);
|
||||
}
|
||||
|
||||
if (PropertiesConfig.PirSensitivityOccupied != null)
|
||||
{
|
||||
SetPirSensitivityOccupied((ushort)PropertiesConfig.PirSensitivityOccupied);
|
||||
}
|
||||
|
||||
if (PropertiesConfig.PirSensitivityVacant != null)
|
||||
{
|
||||
SetPirSensitivityVacant((ushort)PropertiesConfig.PirSensitivityVacant);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -279,7 +305,21 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Sets the identity mode on or off
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
public void SetIdentityMode(bool state)
|
||||
{
|
||||
if (state)
|
||||
OccSensor.IdentityModeOn();
|
||||
else
|
||||
OccSensor.IdentityModeOff();
|
||||
|
||||
Debug.Console(1, this, "Identity Mode: {0}", OccSensor.IdentityModeOnFeedback.BoolValue ? "On" : "Off");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables the PIR sensor
|
||||
/// </summary>
|
||||
/// <param name="state"></param>
|
||||
@@ -506,6 +546,54 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the US sensor sensitivity for occupied state
|
||||
/// </summary>
|
||||
/// <param name="sensitivity"></param>
|
||||
public void SetUsSensitivityOccupied(ushort sensitivity)
|
||||
{
|
||||
var level = (eSensitivityLevel) sensitivity;
|
||||
if (level == 0) return;
|
||||
|
||||
OccSensor.UltrasonicSensorSensitivityInOccupiedState = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the US sensor sensitivity for vacant state
|
||||
/// </summary>
|
||||
/// <param name="sensitivity"></param>
|
||||
public void SetUsSensitivityVacant(ushort sensitivity)
|
||||
{
|
||||
var level = (eSensitivityLevel)sensitivity;
|
||||
if (level == 0) return;
|
||||
|
||||
OccSensor.UltrasonicSensorSensitivityInVacantState = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the PIR sensor sensitivity for occupied state
|
||||
/// </summary>
|
||||
/// <param name="sensitivity"></param>
|
||||
public void SetPirSensitivityOccupied(ushort sensitivity)
|
||||
{
|
||||
var level = (eSensitivityLevel)sensitivity;
|
||||
if (level == 0) return;
|
||||
|
||||
OccSensor.PassiveInfraredSensorSensitivityInOccupiedState = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the PIR sensor sensitivity for vacant state
|
||||
/// </summary>
|
||||
/// <param name="sensitivity"></param>
|
||||
public void SetPirSensitivityVacant(ushort sensitivity)
|
||||
{
|
||||
var level = (eSensitivityLevel)sensitivity;
|
||||
if (level == 0) return;
|
||||
|
||||
OccSensor.PassiveInfraredSensorSensitivityInVacantState = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method to print current settings to console
|
||||
/// </summary>
|
||||
@@ -647,8 +735,11 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
//Sensor Raw States
|
||||
occController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback.JoinNumber]);
|
||||
occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
|
||||
|
||||
occController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback.JoinNumber]);
|
||||
|
||||
// Identity mode
|
||||
trilist.SetBoolSigAction(joinMap.IdentityMode.JoinNumber, occController.SetIdentityMode);
|
||||
occController.IdentityModeFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IdentityModeFeedback.JoinNumber]);
|
||||
}
|
||||
|
||||
public class CenOdtOccupancySensorBaseControllerFactory : EssentialsDeviceFactory<CenOdtOccupancySensorBaseController>
|
||||
|
||||
@@ -47,5 +47,35 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
[JsonProperty("andWhenVacatedState")]
|
||||
public bool? AndWhenVacatedState { get; set; }
|
||||
|
||||
// PoE Sensors: CenOdtCPoe
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sensitivity level for US while sensor is in occupied state
|
||||
/// 1 = low; 2 = medium; 3 = high; 4 = xlow; 5 = 2xlow; 6 = 3xlow
|
||||
/// </summary>
|
||||
[JsonProperty("usSensitivityOccupied")]
|
||||
public ushort? UsSensitivityOccupied { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sensitivity level for US while sensor is in vacant state
|
||||
/// 1 = low; 2 = medium; 3 = high; 4 = xlow; 5 = 2xlow; 6 = 3xlow
|
||||
/// </summary>
|
||||
[JsonProperty("usSensitivityVacant")]
|
||||
public ushort? UsSensitivityVacant { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sensitivity level for PIR while sensor is in occupied state
|
||||
/// 1 = low; 2 = medium; 3 = high
|
||||
/// </summary>
|
||||
[JsonProperty("pirSensitivityOccupied")]
|
||||
public ushort? PirSensitivityOccupied { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets the sensitivity level for PIR while sensor is in vacant state
|
||||
/// 1 = low; 2 = medium; 3 = high
|
||||
/// </summary>
|
||||
[JsonProperty("pirSensitivityVacant")]
|
||||
public ushort? PirSensitivityVacant { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an abstract controller device for a partition dividing rooms that are combinable
|
||||
///
|
||||
/// In Auto mode, it can use a partition sensor to automatically determine whether the partition is present.
|
||||
///
|
||||
/// In Manual mode it accepts user input to tell it whether the partition is present.
|
||||
/// </summary>
|
||||
public class EssentialsPartitionController : IPartitionController
|
||||
{
|
||||
private IPartitionStateProvider _partitionSensor;
|
||||
|
||||
private bool isInAutoMode;
|
||||
|
||||
private bool partitionPresent;
|
||||
|
||||
public EssentialsPartitionController(string key, string name, IPartitionStateProvider sensor, bool defaultToManualMode, List<string> adjacentRoomKeys)
|
||||
{
|
||||
Key = key;
|
||||
|
||||
Name = name;
|
||||
|
||||
AdjacentRoomKeys = adjacentRoomKeys;
|
||||
|
||||
if (sensor != null)
|
||||
{
|
||||
_partitionSensor = sensor;
|
||||
|
||||
if (!defaultToManualMode)
|
||||
{
|
||||
SetAutoMode();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetManualMode();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetManualMode();
|
||||
}
|
||||
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
if (isInAutoMode)
|
||||
{
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
#region IPartitionController Members
|
||||
|
||||
public List<string> AdjacentRoomKeys { get; private set; }
|
||||
|
||||
public void SetAutoMode()
|
||||
{
|
||||
isInAutoMode = true;
|
||||
if (PartitionPresentFeedback != null)
|
||||
{
|
||||
PartitionPresentFeedback.SetValueFunc(() => _partitionSensor.PartitionPresentFeedback.BoolValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
PartitionPresentFeedback = new BoolFeedback(() => _partitionSensor.PartitionPresentFeedback.BoolValue);
|
||||
}
|
||||
|
||||
if (_partitionSensor != null)
|
||||
{
|
||||
_partitionSensor.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetManualMode()
|
||||
{
|
||||
isInAutoMode = false;
|
||||
if (PartitionPresentFeedback != null)
|
||||
{
|
||||
PartitionPresentFeedback.SetValueFunc(() => partitionPresent);
|
||||
}
|
||||
else
|
||||
{
|
||||
PartitionPresentFeedback = new BoolFeedback(() => partitionPresent);
|
||||
}
|
||||
|
||||
if (_partitionSensor != null)
|
||||
{
|
||||
_partitionSensor.PartitionPresentFeedback.OutputChange -= PartitionPresentFeedback_OutputChange;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetPartitionStatePresent()
|
||||
{
|
||||
if (!isInAutoMode)
|
||||
{
|
||||
partitionPresent = true;
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetPartitionStateNotPresent()
|
||||
{
|
||||
if (!isInAutoMode)
|
||||
{
|
||||
partitionPresent = false;
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void ToggglePartitionState()
|
||||
{
|
||||
if (!isInAutoMode)
|
||||
{
|
||||
partitionPresent = !partitionPresent;
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IPartitionStateProvider Members
|
||||
|
||||
public BoolFeedback PartitionPresentFeedback { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region IKeyName Members
|
||||
|
||||
public string Name { get; private set; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region IKeyed Members
|
||||
|
||||
public string Key { get; private set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using Newtonsoft.Json;
|
||||
@@ -9,17 +10,20 @@ using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash_Essentials_Core.PartitionSensor;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
[Description("Wrapper class for GLS Cresnet Partition Sensor")]
|
||||
public class GlsPartitionSensorController : CrestronGenericBridgeableBaseDevice
|
||||
public class GlsPartitionSensorController : CrestronGenericBridgeableBaseDevice, IPartitionStateProvider
|
||||
{
|
||||
private GlsPartCn _partitionSensor;
|
||||
|
||||
public StringFeedback NameFeedback { get; private set; }
|
||||
public GlsPartitionSensorPropertiesConfig PropertiesConfig { get; private set; }
|
||||
|
||||
private GlsPartCn _partitionSensor;
|
||||
|
||||
public BoolFeedback EnableFeedback { get; private set; }
|
||||
public BoolFeedback PartitionSensedFeedback { get; private set; }
|
||||
public BoolFeedback PartitionPresentFeedback { get; private set; }
|
||||
public BoolFeedback PartitionNotSensedFeedback { get; private set; }
|
||||
public IntFeedback SensitivityFeedback { get; private set; }
|
||||
|
||||
@@ -32,23 +36,71 @@ namespace PepperDash.Essentials.Core
|
||||
public GlsPartitionSensorController(string key, Func<DeviceConfig, GlsPartCn> preActivationFunc, DeviceConfig config)
|
||||
: base(key, config.Name)
|
||||
{
|
||||
|
||||
var props = config.Properties.ToObject<GlsPartitionSensorPropertiesConfig>();
|
||||
if (props != null)
|
||||
{
|
||||
PropertiesConfig = props;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "props are null. Unable to deserialize into GlsPartSensorPropertiesConfig");
|
||||
}
|
||||
|
||||
AddPreActivationAction(() =>
|
||||
{
|
||||
_partitionSensor = preActivationFunc(config);
|
||||
|
||||
|
||||
RegisterCrestronGenericBase(_partitionSensor);
|
||||
|
||||
EnableFeedback = new BoolFeedback(() => InTestMode ? TestEnableFeedback : _partitionSensor.EnableFeedback.BoolValue);
|
||||
PartitionPresentFeedback = new BoolFeedback(() => InTestMode ? TestPartitionSensedFeedback : _partitionSensor.PartitionSensedFeedback.BoolValue);
|
||||
PartitionNotSensedFeedback = new BoolFeedback(() => InTestMode ? !TestPartitionSensedFeedback : _partitionSensor.PartitionNotSensedFeedback.BoolValue);
|
||||
SensitivityFeedback = new IntFeedback(() => InTestMode ? TestSensitivityFeedback : _partitionSensor.SensitivityFeedback.UShortValue);
|
||||
|
||||
NameFeedback = new StringFeedback(() => Name);
|
||||
EnableFeedback = new BoolFeedback(() => _partitionSensor.EnableFeedback.BoolValue);
|
||||
PartitionSensedFeedback = new BoolFeedback(() => _partitionSensor.PartitionSensedFeedback.BoolValue);
|
||||
PartitionNotSensedFeedback = new BoolFeedback(() => _partitionSensor.PartitionNotSensedFeedback.BoolValue);
|
||||
SensitivityFeedback = new IntFeedback(() => _partitionSensor.SensitivityFeedback.UShortValue);
|
||||
|
||||
if (_partitionSensor != null) _partitionSensor.BaseEvent += PartitionSensor_BaseEvent;
|
||||
if (_partitionSensor != null)
|
||||
{
|
||||
_partitionSensor.BaseEvent += PartitionSensor_BaseEvent;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void PartitionSensor_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
_partitionSensor.OnlineStatusChange += (o, a) =>
|
||||
{
|
||||
if (a.DeviceOnLine)
|
||||
{
|
||||
ApplySettingsToSensorFromConfig();
|
||||
}
|
||||
};
|
||||
|
||||
if (_partitionSensor.IsOnline)
|
||||
{
|
||||
ApplySettingsToSensorFromConfig();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void ApplySettingsToSensorFromConfig()
|
||||
{
|
||||
if (_partitionSensor.IsOnline == false) return;
|
||||
|
||||
Debug.Console(1, this, "Attempting to apply settings to sensor from config");
|
||||
|
||||
if (PropertiesConfig.Sensitivity != null)
|
||||
{
|
||||
Debug.Console(1, this, "Sensitivity found, attempting to set value '{0}' from config",
|
||||
PropertiesConfig.Sensitivity);
|
||||
_partitionSensor.Sensitivity.UShortValue = (ushort) PropertiesConfig.Sensitivity;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Sensitivity null, no value specified in config");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void PartitionSensor_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
Debug.Console(2, this, "EventId: {0}, Index: {1}", args.EventId, args.Index);
|
||||
|
||||
@@ -61,11 +113,13 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
case (GlsPartCn.PartitionSensedFeedbackEventId):
|
||||
{
|
||||
PartitionSensedFeedback.FireUpdate();
|
||||
Debug.Console(1, this, "Partition Sensed State: {0}", _partitionSensor.PartitionSensedFeedback.BoolValue);
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case (GlsPartCn.PartitionNotSensedFeedbackEventId):
|
||||
{
|
||||
Debug.Console(1, this, "Partition Not Sensed State: {0}", _partitionSensor.PartitionNotSensedFeedback.BoolValue);
|
||||
PartitionNotSensedFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
@@ -73,7 +127,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
SensitivityFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug.Console(2, this, "Unhandled args.EventId: {0}", args.EventId);
|
||||
@@ -93,6 +147,9 @@ namespace PepperDash.Essentials.Core
|
||||
if (InTestMode)
|
||||
{
|
||||
TestEnableFeedback = state;
|
||||
|
||||
EnableFeedback.FireUpdate();
|
||||
|
||||
Debug.Console(1, this, "TestEnableFeedback: {0}", TestEnableFeedback.ToString());
|
||||
return;
|
||||
}
|
||||
@@ -105,6 +162,10 @@ namespace PepperDash.Essentials.Core
|
||||
if (InTestMode)
|
||||
{
|
||||
TestPartitionSensedFeedback = state;
|
||||
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
PartitionNotSensedFeedback.FireUpdate();
|
||||
|
||||
Debug.Console(1, this, "TestPartitionSensedFeedback: {0}", TestPartitionSensedFeedback.ToString());
|
||||
return;
|
||||
}
|
||||
@@ -117,6 +178,8 @@ namespace PepperDash.Essentials.Core
|
||||
if (InTestMode)
|
||||
{
|
||||
TestSensitivityFeedback = value;
|
||||
|
||||
SensitivityFeedback.FireUpdate();
|
||||
Debug.Console(1, this, "TestSensitivityFeedback: {0}", TestSensitivityFeedback);
|
||||
return;
|
||||
}
|
||||
@@ -124,7 +187,22 @@ namespace PepperDash.Essentials.Core
|
||||
Debug.Console(1, this, "InTestMode: {0}, unable to set sensitivity value: {1}", InTestMode.ToString(), value);
|
||||
}
|
||||
|
||||
public void SetEnableState(bool state)
|
||||
public void GetSettings()
|
||||
{
|
||||
var dash = new string('*', 50);
|
||||
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||
|
||||
Debug.Console(0, this, "Enabled State: {0}", _partitionSensor.EnableFeedback.BoolValue);
|
||||
|
||||
Debug.Console(0, this, "Partition Sensed State: {0}", _partitionSensor.PartitionSensedFeedback.BoolValue);
|
||||
Debug.Console(0, this, "Partition Not Sensed State: {0}", _partitionSensor.PartitionNotSensedFeedback.BoolValue);
|
||||
|
||||
Debug.Console(0, this, "Sensitivity Value: {0}", _partitionSensor.SensitivityFeedback.UShortValue);
|
||||
|
||||
CrestronConsole.PrintLine(string.Format("{0}\n", dash));
|
||||
}
|
||||
|
||||
public void SetEnableState(bool state)
|
||||
{
|
||||
Debug.Console(2, this, "Sensor is {0}, SetEnableState: {1}", _partitionSensor == null ? "null" : "not null", state);
|
||||
if (_partitionSensor == null)
|
||||
@@ -180,18 +258,20 @@ namespace PepperDash.Essentials.Core
|
||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
Debug.Console(0, this, "Linking to Bridge Type {0}", GetType().Name);
|
||||
|
||||
// link input from simpl
|
||||
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = _partitionSensor.Name;
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.Enable.JoinNumber, SetEnableState);
|
||||
EnableFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Enable.JoinNumber]);
|
||||
|
||||
PartitionPresentFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionSensed.JoinNumber]);
|
||||
PartitionNotSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionNotSensed.JoinNumber]);
|
||||
|
||||
trilist.SetSigTrueAction(joinMap.IncreaseSensitivity.JoinNumber, IncreaseSensitivity);
|
||||
trilist.SetSigTrueAction(joinMap.DecreaseSensitivity.JoinNumber, DecreaseSensitivity);
|
||||
trilist.SetUShortSigAction(joinMap.Sensitivity.JoinNumber, SetSensitivity);
|
||||
|
||||
// link output to simpl
|
||||
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
EnableFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Enable.JoinNumber]);
|
||||
PartitionSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionSensed.JoinNumber]);
|
||||
PartitionNotSensedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PartitionNotSensed.JoinNumber]);
|
||||
SensitivityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Sensitivity.JoinNumber]);
|
||||
SensitivityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Sensitivity.JoinNumber]);
|
||||
trilist.SetUShortSigAction(joinMap.Sensitivity.JoinNumber, SetSensitivity);
|
||||
|
||||
FeedbacksFireUpdates();
|
||||
|
||||
@@ -209,6 +289,7 @@ namespace PepperDash.Essentials.Core
|
||||
{
|
||||
if (a.DeviceOnLine)
|
||||
{
|
||||
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = _partitionSensor.Name;
|
||||
FeedbacksFireUpdates();
|
||||
}
|
||||
};
|
||||
@@ -216,10 +297,9 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
private void FeedbacksFireUpdates()
|
||||
{
|
||||
IsOnline.FireUpdate();
|
||||
NameFeedback.FireUpdate();
|
||||
IsOnline.FireUpdate();
|
||||
EnableFeedback.FireUpdate();
|
||||
PartitionSensedFeedback.FireUpdate();
|
||||
PartitionPresentFeedback.FireUpdate();
|
||||
PartitionNotSensedFeedback.FireUpdate();
|
||||
SensitivityFeedback.FireUpdate();
|
||||
}
|
||||
@@ -260,7 +340,7 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new C2N-RTHS Device");
|
||||
Debug.Console(1, "Factory Attempting to create new GlsPartitionSensorController Device");
|
||||
|
||||
return new GlsPartitionSensorController(dc.Key, GetGlsPartCnDevice, dc);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash_Essentials_Core.PartitionSensor
|
||||
{
|
||||
public class GlsPartitionSensorPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the sensor sensitivity
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The sensitivity range shall be between 1(lowest) to 10 (highest).
|
||||
/// </remarks>
|
||||
[JsonProperty("sensitivity")]
|
||||
public ushort? Sensitivity { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes the functionality of a device that senses and provides partition state
|
||||
/// </summary>
|
||||
public interface IPartitionStateProvider : IKeyName
|
||||
{
|
||||
BoolFeedback PartitionPresentFeedback { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes the functionality of a device that can provide partition state either manually via user input or optionally via a sensor state
|
||||
/// </summary>
|
||||
public interface IPartitionController : IPartitionStateProvider
|
||||
{
|
||||
List<string> AdjacentRoomKeys { get; }
|
||||
|
||||
void SetPartitionStatePresent();
|
||||
|
||||
void SetPartitionStateNotPresent();
|
||||
|
||||
void ToggglePartitionState();
|
||||
|
||||
void SetManualMode();
|
||||
|
||||
void SetAutoMode();
|
||||
}
|
||||
}
|
||||
@@ -131,6 +131,7 @@
|
||||
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmChassisControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmpsAudioOutputControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmpsMicrophoneControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmpsRoutingControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmRmcControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmTxControllerJoinMap.cs" />
|
||||
@@ -182,6 +183,7 @@
|
||||
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
||||
<Compile Include="Crestron IO\IOPortConfig.cs" />
|
||||
<Compile Include="Crestron IO\Relay\CenIoRy104Controller.cs" />
|
||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
||||
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
||||
@@ -235,6 +237,9 @@
|
||||
<Compile Include="Interfaces\ILogStringsWithLevel.cs" />
|
||||
<Compile Include="Occupancy\GlsOccupancySensorPropertiesConfig.cs" />
|
||||
<Compile Include="Occupancy\GlsOirOccupancySensorController.cs" />
|
||||
<Compile Include="PartitionSensor\EssentialsPartitionController.cs" />
|
||||
<Compile Include="PartitionSensor\GlsPartitionSensorPropertiesConfig.cs" />
|
||||
<Compile Include="PartitionSensor\IPartitionStateProvider.cs" />
|
||||
<Compile Include="Occupancy\OccupancyAggregatorConfig.cs" />
|
||||
<Compile Include="Queues\ComsMessage.cs" />
|
||||
<Compile Include="Queues\ProcessStringMessage.cs" />
|
||||
@@ -290,6 +295,10 @@
|
||||
<Compile Include="Remotes\CrestronRemotePropertiesConfig.cs" />
|
||||
<Compile Include="Remotes\Hrxx0WirelessRemoteController.cs" />
|
||||
<Compile Include="Room\Behaviours\RoomOnToDefaultSourceWhenOccupied.cs" />
|
||||
<Compile Include="Room\Combining\EssentialsRoomCombiner.cs" />
|
||||
<Compile Include="Room\Combining\EssentialsRoomCombinerPropertiesConfig.cs" />
|
||||
<Compile Include="Room\Combining\IEssentialsRoomCombiner.cs" />
|
||||
<Compile Include="Room\Combining\RoomCombinationScenario.cs" />
|
||||
<Compile Include="Room\EssentialsRoomBase.cs" />
|
||||
<Compile Include="Room\Config\EssentialsRoomScheduledEventsConfig.cs" />
|
||||
<Compile Include="Room\IEssentialsRoom.cs" />
|
||||
|
||||
@@ -123,7 +123,7 @@ namespace PepperDash.Essentials
|
||||
/// <param name="fileName"></param>
|
||||
static LoadedAssembly LoadAssembly(string filePath)
|
||||
{
|
||||
Debug.Console(2, "Attempting to load {0}", filePath);
|
||||
//Debug.Console(2, "Attempting to load {0}", filePath);
|
||||
var assembly = Assembly.LoadFrom(filePath);
|
||||
if (assembly != null)
|
||||
{
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
/// <param name="capacity"></param>
|
||||
public GenericQueue(string key, int pacing, Thread.eThreadPriority priority, int capacity)
|
||||
: this(key, priority, capacity, pacing)
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -139,7 +139,8 @@ namespace PepperDash.Essentials.Core.Queues
|
||||
_queue = new CrestronQueue<IQueueMessage>(cap);
|
||||
_worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running)
|
||||
{
|
||||
Priority = priority
|
||||
Priority = priority,
|
||||
Name = _key
|
||||
};
|
||||
|
||||
SetDelayValues(pacing);
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class EssentialsRoomCombiner : EssentialsDevice, IEssentialsRoomCombiner
|
||||
{
|
||||
private EssentialsRoomCombinerPropertiesConfig _propertiesConfig;
|
||||
|
||||
private IRoomCombinationScenario _currentScenario;
|
||||
|
||||
private List<IEssentialsRoom> _rooms;
|
||||
|
||||
private bool isInAutoMode;
|
||||
|
||||
private CTimer _scenarioChangeDebounceTimer;
|
||||
|
||||
private int _scenarioChangeDebounceTimeSeconds = 10; // default to 10s
|
||||
|
||||
public EssentialsRoomCombiner(string key, EssentialsRoomCombinerPropertiesConfig props)
|
||||
: base(key)
|
||||
{
|
||||
_propertiesConfig = props;
|
||||
|
||||
Partitions = new List<IPartitionController>();
|
||||
RoomCombinationScenarios = new List<IRoomCombinationScenario>();
|
||||
|
||||
if (_propertiesConfig.ScenarioChangeDebounceTimeSeconds > 0)
|
||||
{
|
||||
_scenarioChangeDebounceTimeSeconds = _propertiesConfig.ScenarioChangeDebounceTimeSeconds;
|
||||
}
|
||||
|
||||
IsInAutoModeFeedback = new BoolFeedback(() => isInAutoMode);
|
||||
|
||||
// default to auto mode
|
||||
isInAutoMode = true;
|
||||
|
||||
if (_propertiesConfig.defaultToManualMode)
|
||||
{
|
||||
isInAutoMode = false;
|
||||
}
|
||||
|
||||
IsInAutoModeFeedback.FireUpdate();
|
||||
|
||||
CreateScenarios();
|
||||
|
||||
AddPostActivationAction(() =>
|
||||
{
|
||||
SetupPartitionStateProviders();
|
||||
|
||||
SetRooms();
|
||||
|
||||
if (isInAutoMode)
|
||||
{
|
||||
DetermineRoomCombinationScenario();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRoomCombinationScenario(_propertiesConfig.defaultScenarioKey);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void CreateScenarios()
|
||||
{
|
||||
foreach (var scenarioConfig in _propertiesConfig.Scenarios)
|
||||
{
|
||||
var scenario = new RoomCombinationScenario(scenarioConfig);
|
||||
RoomCombinationScenarios.Add(scenario);
|
||||
}
|
||||
}
|
||||
|
||||
void SetRooms()
|
||||
{
|
||||
_rooms = new List<IEssentialsRoom>();
|
||||
|
||||
foreach (var roomKey in _propertiesConfig.RoomKeys)
|
||||
{
|
||||
var room = DeviceManager.GetDeviceForKey(roomKey) as IEssentialsRoom;
|
||||
if (room != null)
|
||||
{
|
||||
_rooms.Add(room);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SetupPartitionStateProviders()
|
||||
{
|
||||
foreach (var pConfig in _propertiesConfig.Partitions)
|
||||
{
|
||||
var sensor = DeviceManager.GetDeviceForKey(pConfig.DeviceKey) as IPartitionStateProvider;
|
||||
|
||||
var partition = new EssentialsPartitionController(pConfig.Key, pConfig.Name, sensor, _propertiesConfig.defaultToManualMode, pConfig.AdjacentRoomKeys);
|
||||
|
||||
partition.PartitionPresentFeedback.OutputChange += PartitionPresentFeedback_OutputChange;
|
||||
|
||||
Partitions.Add(partition);
|
||||
}
|
||||
}
|
||||
|
||||
void PartitionPresentFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
||||
{
|
||||
StartDebounceTimer();
|
||||
}
|
||||
|
||||
void StartDebounceTimer()
|
||||
{
|
||||
var time = _scenarioChangeDebounceTimeSeconds * 1000;
|
||||
|
||||
if (_scenarioChangeDebounceTimer == null)
|
||||
{
|
||||
_scenarioChangeDebounceTimer = new CTimer((o) => DetermineRoomCombinationScenario(), time);
|
||||
}
|
||||
else
|
||||
{
|
||||
_scenarioChangeDebounceTimer.Reset(time);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines the current room combination scenario based on the state of the partition sensors
|
||||
/// </summary>
|
||||
void DetermineRoomCombinationScenario()
|
||||
{
|
||||
if (_scenarioChangeDebounceTimer != null)
|
||||
{
|
||||
_scenarioChangeDebounceTimer.Dispose();
|
||||
_scenarioChangeDebounceTimer = null;
|
||||
}
|
||||
|
||||
var currentScenario = RoomCombinationScenarios.FirstOrDefault((s) =>
|
||||
{
|
||||
// iterate the partition states
|
||||
foreach (var partitionState in s.PartitionStates)
|
||||
{
|
||||
// get the partition by key
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionState.PartitionKey));
|
||||
|
||||
if (partition != null && partitionState.PartitionPresent != partition.PartitionPresentFeedback.BoolValue)
|
||||
{
|
||||
// the partition can't be found or the state doesn't match
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// if it hasn't returned false by now we have the matching scenario
|
||||
return true;
|
||||
});
|
||||
|
||||
if (currentScenario != null)
|
||||
{
|
||||
CurrentScenario = currentScenario;
|
||||
}
|
||||
}
|
||||
|
||||
#region IEssentialsRoomCombiner Members
|
||||
|
||||
public event EventHandler<EventArgs> RoomCombinationScenarioChanged;
|
||||
|
||||
public IRoomCombinationScenario CurrentScenario
|
||||
{
|
||||
get
|
||||
{
|
||||
return _currentScenario;
|
||||
}
|
||||
private set
|
||||
{
|
||||
if (value != _currentScenario)
|
||||
{
|
||||
// Deactivate the old scenario first
|
||||
if (_currentScenario != null)
|
||||
{
|
||||
_currentScenario.Deactivate();
|
||||
}
|
||||
|
||||
_currentScenario = value;
|
||||
|
||||
// Activate the new scenario
|
||||
if (_currentScenario != null)
|
||||
{
|
||||
_currentScenario.Activate();
|
||||
|
||||
Debug.Console(1, this, "Current Scenario: {0}", _currentScenario.Name);
|
||||
}
|
||||
|
||||
var handler = RoomCombinationScenarioChanged;
|
||||
if (handler != null)
|
||||
{
|
||||
handler(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BoolFeedback IsInAutoModeFeedback { get; private set; }
|
||||
|
||||
public void SetAutoMode()
|
||||
{
|
||||
isInAutoMode = true;
|
||||
IsInAutoModeFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public void SetManualMode()
|
||||
{
|
||||
isInAutoMode = false;
|
||||
IsInAutoModeFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public void ToggleMode()
|
||||
{
|
||||
isInAutoMode = !isInAutoMode;
|
||||
IsInAutoModeFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public List<IRoomCombinationScenario> RoomCombinationScenarios { get; private set; }
|
||||
|
||||
public List<IPartitionController> Partitions { get; private set; }
|
||||
|
||||
public void TogglePartitionState(string partitionKey)
|
||||
{
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionKey)) as IPartitionController;
|
||||
|
||||
if (partition != null)
|
||||
{
|
||||
partition.ToggglePartitionState();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetRoomCombinationScenario(string scenarioKey)
|
||||
{
|
||||
if (isInAutoMode)
|
||||
{
|
||||
Debug.Console(0, this, "Cannot set room combination scenario when in auto mode. Set to auto mode first.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the scenario
|
||||
var scenario = RoomCombinationScenarios.FirstOrDefault((s) => s.Key.Equals(scenarioKey));
|
||||
|
||||
|
||||
// Set the parition states from the scenario manually
|
||||
if (scenario != null)
|
||||
{
|
||||
Debug.Console(0, this, "Manually setting scenario to '{0}'", scenario.Key);
|
||||
foreach (var partitionState in scenario.PartitionStates)
|
||||
{
|
||||
var partition = Partitions.FirstOrDefault((p) => p.Key.Equals(partitionState.PartitionKey));
|
||||
|
||||
if (partition != null)
|
||||
{
|
||||
if (partitionState.PartitionPresent)
|
||||
{
|
||||
Debug.Console(0, this, "Manually setting state to Present for: '{0}'", partition.Key);
|
||||
partition.SetPartitionStatePresent();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "Manually setting state to Not Present for: '{0}'", partition.Key);
|
||||
partition.SetPartitionStateNotPresent();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Unable to find partition with key: '{0}'", partitionState.PartitionKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(1, this, "Unable to find scenario with key: '{0}'", scenarioKey);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public class EssentialsRoomCombinerFactory : EssentialsDeviceFactory<EssentialsRoomCombiner>
|
||||
{
|
||||
public EssentialsRoomCombinerFactory()
|
||||
{
|
||||
TypeNames = new List<string> { "essentialsroomcombiner" };
|
||||
}
|
||||
|
||||
public override EssentialsDevice BuildDevice(PepperDash.Essentials.Core.Config.DeviceConfig dc)
|
||||
{
|
||||
Debug.Console(1, "Factory Attempting to create new EssentialsRoomCombiner Device");
|
||||
|
||||
var props = dc.Properties.ToObject<EssentialsRoomCombinerPropertiesConfig>();
|
||||
|
||||
return new EssentialsRoomCombiner(dc.Key, props);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Config properties for an EssentialsRoomCombiner device
|
||||
/// </summary>
|
||||
public class EssentialsRoomCombinerPropertiesConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// The list of partitions that device the rooms
|
||||
/// </summary>
|
||||
[JsonProperty("partitions")]
|
||||
public List<PartitionConfig> Partitions {get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// The list of combinations scenarios for the rooms
|
||||
/// </summary>
|
||||
[JsonProperty("scenarios")]
|
||||
public List<RoomCombinationScenarioConfig> Scenarios { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The list of rooms keys that can be combined
|
||||
/// </summary>
|
||||
[JsonProperty("roomKeys")]
|
||||
public List<string> RoomKeys {get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// Set to true to default to manual mode
|
||||
/// </summary>
|
||||
[JsonProperty("defaultToManualMode")]
|
||||
public bool defaultToManualMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The key of the scenario to default to at system startup if in manual mode
|
||||
/// </summary>
|
||||
[JsonProperty("defaultScenarioKey")]
|
||||
public string defaultScenarioKey { get; set; }
|
||||
|
||||
[JsonProperty("scenarioChangeDebounceTimeSeconds")]
|
||||
public int ScenarioChangeDebounceTimeSeconds { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Config properties for a partition that separates rooms
|
||||
/// </summary>
|
||||
public class PartitionConfig : IKeyName
|
||||
{
|
||||
[JsonProperty("key")]
|
||||
public string Key { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Key of the device that implements IPartitionStateProvider to provide the state of the partition
|
||||
/// </summary>
|
||||
[JsonProperty("deviceKey")]
|
||||
public string DeviceKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Keys of the rooms that this partion would be located between
|
||||
/// </summary>
|
||||
[JsonProperty("adjacentRoomKeys")]
|
||||
public List<string> AdjacentRoomKeys { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Config propeties for a room combination scenario
|
||||
/// </summary>
|
||||
public class RoomCombinationScenarioConfig : IKeyName
|
||||
{
|
||||
[JsonProperty("key")]
|
||||
public string Key { get; set; }
|
||||
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("partitionStates")]
|
||||
public List<PartitionState> PartitionStates { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines which UI devices get mapped to which room in this scenario. The Key should be the key of the UI device and the Value should be the key of the room to map to
|
||||
/// </summary>
|
||||
[JsonProperty("uiMap")]
|
||||
public Dictionary<string, string> UiMap { get; set; }
|
||||
|
||||
[JsonProperty("activationActions")]
|
||||
public List<DeviceActionWrapper> ActivationActions { get; set; }
|
||||
|
||||
[JsonProperty("deactivationActions")]
|
||||
public List<DeviceActionWrapper> DeactivationActions { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Config properties to represent the state of a partition sensor in a RoomCombinationScenario
|
||||
/// </summary>
|
||||
public class PartitionState
|
||||
{
|
||||
[JsonProperty("partitionKey")]
|
||||
public string PartitionKey { get; set; }
|
||||
|
||||
[JsonProperty("partitionSensedState")]
|
||||
public bool PartitionPresent { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes the functionality for an EssentailsRoomCombiner device
|
||||
/// </summary>
|
||||
public interface IEssentialsRoomCombiner : IKeyed
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates that the room combination scenario has changed
|
||||
/// </summary>
|
||||
event EventHandler<EventArgs> RoomCombinationScenarioChanged;
|
||||
|
||||
/// <summary>
|
||||
/// The current room combination scenario
|
||||
/// </summary>
|
||||
IRoomCombinationScenario CurrentScenario { get; }
|
||||
|
||||
/// <summary>
|
||||
/// When true, indicates the current mode is auto mode
|
||||
/// </summary>
|
||||
BoolFeedback IsInAutoModeFeedback {get;}
|
||||
|
||||
/// <summary>
|
||||
/// Sets auto mode
|
||||
/// </summary>
|
||||
void SetAutoMode();
|
||||
|
||||
/// <summary>
|
||||
/// Sets manual mode
|
||||
/// </summary>
|
||||
void SetManualMode();
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the current mode between auto and manual
|
||||
/// </summary>
|
||||
void ToggleMode();
|
||||
|
||||
/// <summary>
|
||||
/// The available room combinatino scenarios
|
||||
/// </summary>
|
||||
List<IRoomCombinationScenario> RoomCombinationScenarios { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The partition
|
||||
/// </summary>
|
||||
List<IPartitionController> Partitions { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Toggles the state of a manual partition sensor
|
||||
/// </summary>
|
||||
/// <param name="partitionKey"></param>
|
||||
void TogglePartitionState(string partitionKey);
|
||||
|
||||
/// <summary>
|
||||
/// Sets the room combination scenario (if in manual mode)
|
||||
/// </summary>
|
||||
/// <param name="scenarioKey"></param>
|
||||
void SetRoomCombinationScenario(string scenarioKey);
|
||||
}
|
||||
|
||||
public interface IRoomCombinationScenario : IKeyName
|
||||
{
|
||||
/// <summary>
|
||||
/// When true, indicates that this room combination scenario is active
|
||||
/// </summary>
|
||||
BoolFeedback IsActiveFeedback { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Activates this room combination scenario
|
||||
/// </summary>
|
||||
void Activate();
|
||||
|
||||
/// <summary>
|
||||
/// Deactivates this room combination scenario
|
||||
/// </summary>
|
||||
void Deactivate();
|
||||
|
||||
/// <summary>
|
||||
/// The state of the partitions that would activate this scenario
|
||||
/// </summary>
|
||||
List<PartitionState> PartitionStates { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The mapping of UIs by key to rooms by key
|
||||
/// </summary>
|
||||
Dictionary<string, string> UiMap { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a room combination scenario
|
||||
/// </summary>
|
||||
public class RoomCombinationScenario: IRoomCombinationScenario
|
||||
{
|
||||
private RoomCombinationScenarioConfig _config;
|
||||
|
||||
public string Key { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
public List<PartitionState> PartitionStates { get; private set; }
|
||||
|
||||
public Dictionary<string, string> UiMap { get; set; }
|
||||
|
||||
private bool _isActive;
|
||||
|
||||
public BoolFeedback IsActiveFeedback { get; private set; }
|
||||
|
||||
private List<DeviceActionWrapper> activationActions;
|
||||
|
||||
private List<DeviceActionWrapper> deactivationActions;
|
||||
|
||||
public RoomCombinationScenario(RoomCombinationScenarioConfig config)
|
||||
{
|
||||
Key = config.Key;
|
||||
|
||||
Name = config.Name;
|
||||
|
||||
PartitionStates = config.PartitionStates;
|
||||
|
||||
UiMap = config.UiMap;
|
||||
|
||||
activationActions = config.ActivationActions;
|
||||
|
||||
deactivationActions = config.DeactivationActions;
|
||||
|
||||
_config = config;
|
||||
|
||||
IsActiveFeedback = new BoolFeedback(() => _isActive);
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
Debug.Console(1, "Activating Scenario: '{0}' with {1} action(s) defined", Name, activationActions.Count);
|
||||
|
||||
if (activationActions != null)
|
||||
{
|
||||
foreach (var action in activationActions)
|
||||
{
|
||||
DeviceJsonApi.DoDeviceAction(action);
|
||||
}
|
||||
}
|
||||
|
||||
_isActive = true;
|
||||
IsActiveFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
Debug.Console(1, "Deactivating Scenario: '{0}' with {1} action(s) defined", Name, deactivationActions.Count);
|
||||
|
||||
if (deactivationActions != null)
|
||||
{
|
||||
foreach (var action in deactivationActions)
|
||||
{
|
||||
DeviceJsonApi.DoDeviceAction(action);
|
||||
}
|
||||
}
|
||||
|
||||
_isActive = false;
|
||||
IsActiveFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,8 @@ using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.Devices;
|
||||
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
/// <summary>
|
||||
@@ -18,6 +20,8 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public abstract class EssentialsRoomBase : ReconfigurableDevice, IEssentialsRoom
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -35,6 +39,16 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public bool OccupancyStatusProviderIsRemote { get; private set; }
|
||||
|
||||
public List<EssentialsDevice> EnvironmentalControlDevices { get; protected set; }
|
||||
|
||||
public bool HasEnvironmentalControlDevices
|
||||
{
|
||||
get
|
||||
{
|
||||
return EnvironmentalControlDevices != null && EnvironmentalControlDevices.Count > 0;
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
|
||||
protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
|
||||
|
||||
@@ -119,6 +133,8 @@ namespace PepperDash.Essentials.Core
|
||||
public EssentialsRoomBase(DeviceConfig config)
|
||||
: base(config)
|
||||
{
|
||||
EnvironmentalControlDevices = new List<EssentialsDevice>();
|
||||
|
||||
// Setup the ShutdownPromptTimer
|
||||
ShutdownPromptTimer = new SecondsCountdownTimer(Key + "-offTimer");
|
||||
ShutdownPromptTimer.IsRunningFeedback.OutputChange += (o, a) =>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace PepperDash.Essentials.Core
|
||||
/// <summary>
|
||||
/// Describes the basic functionality of an EssentialsRoom
|
||||
/// </summary>
|
||||
public interface IEssentialsRoom : IKeyName, IReconfigurableDevice, IRunDefaultPresentRoute
|
||||
public interface IEssentialsRoom : IKeyName, IReconfigurableDevice, IRunDefaultPresentRoute, IEnvironmentalControls
|
||||
{
|
||||
BoolFeedback OnFeedback { get; }
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
@@ -66,6 +68,14 @@ namespace PepperDash.Essentials.Core
|
||||
bool RunDefaultCallRoute();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes environmental controls available on a room such as lighting, shades, temperature, etc.
|
||||
/// </summary>
|
||||
public interface IEnvironmentalControls
|
||||
{
|
||||
List<EssentialsDevice> EnvironmentalControlDevices { get; }
|
||||
|
||||
bool HasEnvironmentalControlDevices { get; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -25,7 +25,7 @@ namespace PepperDash.Essentials.Core
|
||||
Type = type;
|
||||
ConnectionType = connType;
|
||||
Selector = selector;
|
||||
IsInternal = IsInternal;
|
||||
IsInternal = isInternal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace PepperDash.Essentials.Core.Shades
|
||||
public interface IShadesOpenCloseStop : IShadesOpenClose
|
||||
{
|
||||
void StopOrPreset();
|
||||
string StopOrPresetButtonLabel { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -206,6 +206,27 @@ namespace PepperDash.Essentials.Core
|
||||
return ClearSigAction(tl.StringOutput[sigNum]) as StringOutputSig;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clears all actions on all sigs
|
||||
/// </summary>
|
||||
public static void ClearAllSigActions(this BasicTriList t1)
|
||||
{
|
||||
foreach (var sig in t1.BooleanOutput)
|
||||
{
|
||||
ClearSigAction(sig);
|
||||
}
|
||||
|
||||
foreach (var sig in t1.UShortOutput)
|
||||
{
|
||||
ClearSigAction(sig);
|
||||
}
|
||||
|
||||
foreach (var sig in t1.StringOutput)
|
||||
{
|
||||
ClearSigAction(sig);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method to set the value of a bool Sig on TriList
|
||||
/// </summary>
|
||||
|
||||
@@ -16,7 +16,8 @@ using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
using PepperDash.Essentials.DM.Config;
|
||||
|
||||
namespace PepperDash.Essentials.DM {
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
|
||||
///
|
||||
@@ -75,8 +76,10 @@ namespace PepperDash.Essentials.DM {
|
||||
/// Factory method to create a new chassis controller from config data. Limited to 8x8 right now
|
||||
/// </summary>
|
||||
public static DmBladeChassisController GetDmChassisController(string key, string name,
|
||||
string type, DMChassisPropertiesConfig properties) {
|
||||
try {
|
||||
string type, DMChassisPropertiesConfig properties)
|
||||
{
|
||||
try
|
||||
{
|
||||
type = type.ToLower();
|
||||
uint ipid = properties.Control.IpIdInt;
|
||||
|
||||
@@ -85,7 +88,8 @@ namespace PepperDash.Essentials.DM {
|
||||
else if (type == "dmmd128x128") { chassis = new DmMd128x128(ipid, Global.ControlSystem); }
|
||||
|
||||
|
||||
if (chassis == null) {
|
||||
if (chassis == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -93,11 +97,13 @@ namespace PepperDash.Essentials.DM {
|
||||
// add the cards and port names
|
||||
foreach (var kvp in properties.InputSlots)
|
||||
controller.AddInputBlade(kvp.Value, kvp.Key);
|
||||
foreach (var kvp in properties.OutputSlots) {
|
||||
foreach (var kvp in properties.OutputSlots)
|
||||
{
|
||||
controller.AddOutputBlade(kvp.Value, kvp.Key);
|
||||
}
|
||||
|
||||
foreach (var kvp in properties.VolumeControls) {
|
||||
foreach (var kvp in properties.VolumeControls)
|
||||
{
|
||||
// get the card
|
||||
// check it for an audio-compatible type
|
||||
// make a something-something that will make it work
|
||||
@@ -123,7 +129,8 @@ namespace PepperDash.Essentials.DM {
|
||||
controller.PropertiesConfig = properties;
|
||||
return controller;
|
||||
}
|
||||
catch (System.Exception e) {
|
||||
catch (System.Exception e)
|
||||
{
|
||||
Debug.Console(0, "Error creating DM chassis:\r{0}", e);
|
||||
}
|
||||
return null;
|
||||
@@ -137,7 +144,8 @@ namespace PepperDash.Essentials.DM {
|
||||
/// <param name="name"></param>
|
||||
/// <param name="chassis"></param>
|
||||
public DmBladeChassisController(string key, string name, BladeSwitch chassis)
|
||||
: base(key, name, chassis) {
|
||||
: base(key, name, chassis)
|
||||
{
|
||||
Chassis = chassis;
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||
@@ -161,68 +169,87 @@ namespace PepperDash.Essentials.DM {
|
||||
InputCardHdcpCapabilityFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||
InputCardHdcpCapabilityTypes = new Dictionary<uint, eHdcpCapabilityType>();
|
||||
|
||||
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++) {
|
||||
for (uint x = 1; x <= Chassis.NumberOfOutputs; x++)
|
||||
{
|
||||
var tempX = x;
|
||||
|
||||
if (Chassis.Outputs[tempX] != null) {
|
||||
VideoOutputFeedbacks[tempX] = new IntFeedback(() => {
|
||||
if (Chassis.Outputs[tempX] != null)
|
||||
{
|
||||
VideoOutputFeedbacks[tempX] = new IntFeedback(() =>
|
||||
{
|
||||
if (Chassis.Outputs[tempX].VideoOutFeedback != null) { return (ushort)Chassis.Outputs[tempX].VideoOutFeedback.Number; }
|
||||
else { return 0; };
|
||||
});
|
||||
|
||||
OutputNameFeedbacks[tempX] = new StringFeedback(() => {
|
||||
if (Chassis.Outputs[tempX].NameFeedback != null) {
|
||||
OutputNameFeedbacks[tempX] = new StringFeedback(() =>
|
||||
{
|
||||
if (Chassis.Outputs[tempX].NameFeedback != null)
|
||||
{
|
||||
return Chassis.Outputs[tempX].NameFeedback.StringValue;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
});
|
||||
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() => {
|
||||
if (Chassis.Outputs[tempX].VideoOutFeedback != null) {
|
||||
OutputVideoRouteNameFeedbacks[tempX] = new StringFeedback(() =>
|
||||
{
|
||||
if (Chassis.Outputs[tempX].VideoOutFeedback != null)
|
||||
{
|
||||
return Chassis.Outputs[tempX].VideoOutFeedback.NameFeedback.StringValue;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
});
|
||||
|
||||
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => {
|
||||
OutputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() =>
|
||||
{
|
||||
//if (Chassis.Outputs[tempX].Endpoint != null)
|
||||
// return Chassis.Outputs[tempX].Endpoint.IsOnline;
|
||||
//else
|
||||
return Chassis.Outputs[tempX].EndpointOnlineFeedback;
|
||||
return Chassis.Outputs[tempX].EndpointOnlineFeedback;
|
||||
});
|
||||
}
|
||||
|
||||
if (Chassis.Inputs[tempX] != null) {
|
||||
UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() => {
|
||||
if (Chassis.Inputs[tempX] != null)
|
||||
{
|
||||
UsbInputRoutedToFeebacks[tempX] = new IntFeedback(() =>
|
||||
{
|
||||
if (Chassis.Inputs[tempX].USBRoutedToFeedback != null) { return (ushort)Chassis.Inputs[tempX].USBRoutedToFeedback.Number; }
|
||||
else { return 0; };
|
||||
});
|
||||
VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() => {
|
||||
VideoInputSyncFeedbacks[tempX] = new BoolFeedback(() =>
|
||||
{
|
||||
if (Chassis.Inputs[tempX].VideoDetectedFeedback != null)
|
||||
return Chassis.Inputs[tempX].VideoDetectedFeedback.BoolValue;
|
||||
else
|
||||
return false;
|
||||
});
|
||||
InputNameFeedbacks[tempX] = new StringFeedback(() => {
|
||||
if (Chassis.Inputs[tempX].NameFeedback != null) {
|
||||
InputNameFeedbacks[tempX] = new StringFeedback(() =>
|
||||
{
|
||||
if (Chassis.Inputs[tempX].NameFeedback != null)
|
||||
{
|
||||
return Chassis.Inputs[tempX].NameFeedback.StringValue;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
});
|
||||
|
||||
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => {
|
||||
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() =>
|
||||
{
|
||||
return Chassis.Inputs[tempX].EndpointOnlineFeedback;
|
||||
});
|
||||
|
||||
InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() => {
|
||||
InputCardHdcpCapabilityFeedbacks[tempX] = new IntFeedback(() =>
|
||||
{
|
||||
var inputCard = Chassis.Inputs[tempX];
|
||||
|
||||
if (inputCard.Card is DmHdmi4kInputBladeCard) {
|
||||
if (inputCard.Card is DmHdmi4kInputBladeCard)
|
||||
{
|
||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
||||
|
||||
if ((inputCard.Card as DmHdmi4kInputBladeCard).Hdmi4kInput.HdcpSupportOnFeedback.BoolValue)
|
||||
@@ -231,7 +258,8 @@ namespace PepperDash.Essentials.DM {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (inputCard.Card is DmC4kInputBladeCard) {
|
||||
if (inputCard.Card is DmC4kInputBladeCard)
|
||||
{
|
||||
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
|
||||
|
||||
if ((inputCard.Card as DmC4kInputBladeCard).DmInput.HdcpCapabilityFeedback.Equals(eHdcpCapabilityType.HdcpSupportOff))
|
||||
@@ -252,45 +280,56 @@ namespace PepperDash.Essentials.DM {
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="number"></param>
|
||||
public void AddInputBlade(string type, uint number) {
|
||||
public void AddInputBlade(string type, uint number)
|
||||
{
|
||||
Debug.Console(2, this, "Adding input blade '{0}', slot {1}", type, number);
|
||||
|
||||
type = type.ToLower();
|
||||
|
||||
if (type == "dmb4kihd") {
|
||||
if (type == "dmb4kihd")
|
||||
{
|
||||
var inputBlade = new Dmb4kIHd(number, this.Chassis);
|
||||
foreach (var item in inputBlade.Inputs) {
|
||||
foreach (var item in inputBlade.Inputs)
|
||||
{
|
||||
var card = (item.Card as DmHdmi4kInputBladeCard).Hdmi4kInput;
|
||||
var cecPort = card as ICec;
|
||||
AddHdmiInBladePorts(item.Number, cecPort);
|
||||
}
|
||||
}
|
||||
|
||||
else if (type == "dmb4kihddnt") {
|
||||
else if (type == "dmb4kihddnt")
|
||||
{
|
||||
var inputBlade = new Dmb4kIHd(number, this.Chassis);
|
||||
foreach (var item in inputBlade.Inputs) {
|
||||
foreach (var item in inputBlade.Inputs)
|
||||
{
|
||||
var card = (item.Card as DmHdmi4kInputBladeCard).Hdmi4kInput;
|
||||
var cecPort = card as ICec;
|
||||
AddHdmiInBladePorts(item.Number, cecPort);
|
||||
}
|
||||
}
|
||||
|
||||
else if (type == "dmb4kic") {
|
||||
else if (type == "dmb4kic")
|
||||
{
|
||||
var inputBlade = new Dmb4kIC(number, this.Chassis);
|
||||
foreach (var item in inputBlade.Inputs) {
|
||||
foreach (var item in inputBlade.Inputs)
|
||||
{
|
||||
AddDmInBladePorts(item.Number);
|
||||
}
|
||||
}
|
||||
|
||||
else if (type == "dmbis") {
|
||||
else if (type == "dmbis")
|
||||
{
|
||||
var inputBlade = new DmbIS(number, this.Chassis);
|
||||
foreach (var item in inputBlade.Inputs) {
|
||||
foreach (var item in inputBlade.Inputs)
|
||||
{
|
||||
AddDmInMmFiberPorts(item.Number);
|
||||
}
|
||||
}
|
||||
else if (type == "dmbis2") {
|
||||
else if (type == "dmbis2")
|
||||
{
|
||||
var inputBlade = new DmbIS2(number, this.Chassis);
|
||||
foreach (var item in inputBlade.Inputs) {
|
||||
foreach (var item in inputBlade.Inputs)
|
||||
{
|
||||
AddDmInSmFiberPorts(item.Number);
|
||||
}
|
||||
}
|
||||
@@ -304,22 +343,26 @@ namespace PepperDash.Essentials.DM {
|
||||
{
|
||||
var newEvent = NumericSwitchChange;
|
||||
if (newEvent != null) newEvent(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AddHdmiInBladePorts(uint number, ICec cecPort) {
|
||||
void AddHdmiInBladePorts(uint number, ICec cecPort)
|
||||
{
|
||||
AddInputPortWithDebug(number, "hdmiIn", eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, cecPort);
|
||||
}
|
||||
|
||||
void AddDmInBladePorts(uint number) {
|
||||
void AddDmInBladePorts(uint number)
|
||||
{
|
||||
AddInputPortWithDebug(number, "dmCIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat);
|
||||
}
|
||||
|
||||
void AddDmInMmFiberPorts(uint number) {
|
||||
void AddDmInMmFiberPorts(uint number)
|
||||
{
|
||||
AddInputPortWithDebug(number, "dmMmIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber);
|
||||
}
|
||||
|
||||
void AddDmInSmFiberPorts(uint number) {
|
||||
void AddDmInSmFiberPorts(uint number)
|
||||
{
|
||||
AddInputPortWithDebug(number, "dmSmIn", eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber);
|
||||
}
|
||||
|
||||
@@ -328,64 +371,81 @@ namespace PepperDash.Essentials.DM {
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="number"></param>
|
||||
public void AddOutputBlade(string type, uint number) {
|
||||
public void AddOutputBlade(string type, uint number)
|
||||
{
|
||||
type = type.ToLower();
|
||||
|
||||
Debug.Console(2, this, "Adding output blade '{0}', slot {1}", type, number);
|
||||
if (type == "dmb4kohd") {
|
||||
if (type == "dmb4kohd")
|
||||
{
|
||||
var outputBlade = new Dmb4KOHD(number, Chassis);
|
||||
foreach (var item in outputBlade.Outputs) {
|
||||
foreach (var item in outputBlade.Outputs)
|
||||
{
|
||||
AddHdmiOutBladePorts(item.Number);
|
||||
}
|
||||
}
|
||||
|
||||
else if (type == "dmb4kohddnt") {
|
||||
else if (type == "dmb4kohddnt")
|
||||
{
|
||||
var outputBlade = new Dmb4KOHD(number, Chassis);
|
||||
foreach (var item in outputBlade.Outputs) {
|
||||
foreach (var item in outputBlade.Outputs)
|
||||
{
|
||||
AddHdmiOutBladePorts(item.Number);
|
||||
}
|
||||
}
|
||||
|
||||
else if (type == "dmb4koc") {
|
||||
else if (type == "dmb4koc")
|
||||
{
|
||||
var outputBlade = new Dmb4KOC(number, Chassis);
|
||||
foreach (var item in outputBlade.Outputs) {
|
||||
foreach (var item in outputBlade.Outputs)
|
||||
{
|
||||
AddDmOutBladePorts(item.Number);
|
||||
}
|
||||
}
|
||||
else if (type == "dmb4koc") {
|
||||
else if (type == "dmb4koc")
|
||||
{
|
||||
var outputBlade = new Dmb4KOC(number, Chassis);
|
||||
foreach (var item in outputBlade.Outputs) {
|
||||
foreach (var item in outputBlade.Outputs)
|
||||
{
|
||||
AddDmOutBladePorts(item.Number);
|
||||
}
|
||||
}
|
||||
else if (type == "dmbos") {
|
||||
else if (type == "dmbos")
|
||||
{
|
||||
var outputBlade = new DmbOS(number, Chassis);
|
||||
foreach (var item in outputBlade.Outputs) {
|
||||
foreach (var item in outputBlade.Outputs)
|
||||
{
|
||||
AddDmOutMmFiberBladePorts(item.Number);
|
||||
}
|
||||
}
|
||||
else if (type == "dmbos2") {
|
||||
else if (type == "dmbos2")
|
||||
{
|
||||
var outputBlade = new DmbOS2(number, Chassis);
|
||||
foreach (var item in outputBlade.Outputs) {
|
||||
foreach (var item in outputBlade.Outputs)
|
||||
{
|
||||
AddDmOutSmFiberBladePorts(item.Number);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AddHdmiOutBladePorts(uint number) {
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("hdmiOut{0}", number) , eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, Chassis.Outputs[number]);
|
||||
void AddHdmiOutBladePorts(uint number)
|
||||
{
|
||||
AddOutputPortWithDebug(number, "hdmiOut", eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, Chassis.Outputs[number]);
|
||||
}
|
||||
|
||||
void AddDmOutBladePorts(uint number) {
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, Chassis.Outputs[number]);
|
||||
void AddDmOutBladePorts(uint number)
|
||||
{
|
||||
AddOutputPortWithDebug(number, "dmOut", eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, Chassis.Outputs[number]);
|
||||
}
|
||||
|
||||
void AddDmOutMmFiberBladePorts(uint number) {
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, Chassis.Outputs[number]);
|
||||
void AddDmOutMmFiberBladePorts(uint number)
|
||||
{
|
||||
AddOutputPortWithDebug(number, "dmMmOut", eRoutingSignalType.Video, eRoutingPortConnectionType.DmMmFiber, Chassis.Outputs[number]);
|
||||
}
|
||||
|
||||
void AddDmOutSmFiberBladePorts(uint number) {
|
||||
AddOutputPortWithDebug(String.Format("outputBlade{0}", (number / 8 > 0 ? 1 : number / 8)), String.Format("dmOut{0}", number), eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, Chassis.Outputs[number]);
|
||||
void AddDmOutSmFiberBladePorts(uint number)
|
||||
{
|
||||
AddOutputPortWithDebug(number, "dmSmOut", eRoutingSignalType.Video, eRoutingPortConnectionType.DmSmFiber, Chassis.Outputs[number]);
|
||||
}
|
||||
|
||||
|
||||
@@ -417,23 +477,44 @@ namespace PepperDash.Essentials.DM {
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Adds OutputPort
|
||||
/// </summary>
|
||||
void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
||||
|
||||
/*void AddOutputPortWithDebug(string cardName, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector) {
|
||||
var portKey = string.Format("{0}--{1}", cardName, portName);
|
||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||
OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||
{
|
||||
FeedbackMatchObject = Chassis.Outputs[(uint)selector]
|
||||
FeedbackMatchObject = selector
|
||||
});
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Adds OutputPort
|
||||
/// </summary>
|
||||
void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
|
||||
{
|
||||
try
|
||||
{
|
||||
var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);
|
||||
Debug.Console(2, this, "Adding output port '{0}'", portKey);
|
||||
var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this)
|
||||
{
|
||||
FeedbackMatchObject = Chassis.Outputs[cardNum]
|
||||
};
|
||||
OutputPorts.Add(outputPort);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Debug.Console(0, this, "Exception : {0}", ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
void AddVolumeControl(uint number, Audio.Output audio) {
|
||||
void AddVolumeControl(uint number, Audio.Output audio)
|
||||
{
|
||||
VolumeControls.Add(number, new DmCardAudioOutputController(audio));
|
||||
}
|
||||
|
||||
@@ -443,35 +524,43 @@ namespace PepperDash.Essentials.DM {
|
||||
//}
|
||||
|
||||
|
||||
void Chassis_DMInputChange(Switch device, DMInputEventArgs args) {
|
||||
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
|
||||
{
|
||||
|
||||
switch (args.EventId) {
|
||||
case DMInputEventIds.EndpointOnlineEventId: {
|
||||
switch (args.EventId)
|
||||
{
|
||||
case DMInputEventIds.EndpointOnlineEventId:
|
||||
{
|
||||
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMInputEventIds.OnlineFeedbackEventId: {
|
||||
case DMInputEventIds.OnlineFeedbackEventId:
|
||||
{
|
||||
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMInputEventIds.VideoDetectedEventId: {
|
||||
case DMInputEventIds.VideoDetectedEventId:
|
||||
{
|
||||
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
||||
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMInputEventIds.InputNameEventId: {
|
||||
case DMInputEventIds.InputNameEventId:
|
||||
{
|
||||
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
||||
InputNameFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMInputEventIds.HdcpCapabilityFeedbackEventId: {
|
||||
case DMInputEventIds.HdcpCapabilityFeedbackEventId:
|
||||
{
|
||||
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
|
||||
InputCardHdcpCapabilityFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
default:
|
||||
{
|
||||
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
|
||||
break;
|
||||
}
|
||||
@@ -487,74 +576,74 @@ namespace PepperDash.Essentials.DM {
|
||||
switch (args.EventId)
|
||||
{
|
||||
case DMOutputEventIds.VolumeEventId:
|
||||
{
|
||||
if (VolumeControls.ContainsKey(output))
|
||||
{
|
||||
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||
if (VolumeControls.ContainsKey(output))
|
||||
{
|
||||
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.EndpointOnlineEventId:
|
||||
{
|
||||
Debug.Console(2, this,
|
||||
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}",
|
||||
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||
if (Chassis.Outputs[output].Endpoint != null)
|
||||
{
|
||||
Debug.Console(2, this,
|
||||
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}",
|
||||
args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
||||
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. EndpointOnlineFeedback State: {1}",
|
||||
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||
if (Chassis.Outputs[output].Endpoint != null)
|
||||
Debug.Console(2, this,
|
||||
"Output {0} DMOutputEventIds.EndpointOnlineEventId fired. Endpoint.IsOnline State: {1}",
|
||||
args.Number, Chassis.Outputs[output].Endpoint.IsOnline);
|
||||
|
||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||
break;
|
||||
}
|
||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.OnlineFeedbackEventId:
|
||||
{
|
||||
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}",
|
||||
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
Debug.Console(2, this, "Output {0} DMInputEventIds.OnlineFeedbackEventId fired. State: {1}",
|
||||
args.Number, Chassis.Outputs[output].EndpointOnlineFeedback);
|
||||
OutputEndpointOnlineFeedbacks[output].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.VideoOutEventId:
|
||||
{
|
||||
|
||||
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.Outputs[output].VideoOutFeedback.Number;
|
||||
|
||||
Debug.Console(2, this, "DMSwitchAudioVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||
inputNumber, output);
|
||||
|
||||
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||
{
|
||||
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||
var localOutputPort =
|
||||
OutputPorts.FirstOrDefault(p => (DMOutput) p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||
|
||||
var inputNumber = Chassis.Outputs[output].VideoOutFeedback == null ? 0 : Chassis.Outputs[output].VideoOutFeedback.Number;
|
||||
|
||||
Debug.Console(2, this, "DMSwitchAudioVideo:{0} Routed Input:{1} Output:{2}'", this.Name,
|
||||
inputNumber, output);
|
||||
|
||||
if (VideoOutputFeedbacks.ContainsKey(output))
|
||||
{
|
||||
var localInputPort = InputPorts.FirstOrDefault(p => (DMInput)p.FeedbackMatchObject == Chassis.Outputs[output].VideoOutFeedback);
|
||||
var localOutputPort =
|
||||
OutputPorts.FirstOrDefault(p => (DMOutput)p.FeedbackMatchObject == Chassis.Outputs[output]);
|
||||
|
||||
|
||||
VideoOutputFeedbacks[output].FireUpdate();
|
||||
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||
inputNumber,
|
||||
localOutputPort,
|
||||
localInputPort,
|
||||
eRoutingSignalType.AudioVideo));
|
||||
VideoOutputFeedbacks[output].FireUpdate();
|
||||
OnSwitchChange(new RoutingNumericEventArgs(output,
|
||||
inputNumber,
|
||||
localOutputPort,
|
||||
localInputPort,
|
||||
eRoutingSignalType.AudioVideo));
|
||||
|
||||
}
|
||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||
{
|
||||
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (OutputVideoRouteNameFeedbacks.ContainsKey(output))
|
||||
{
|
||||
OutputVideoRouteNameFeedbacks[output].FireUpdate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.OutputNameEventId:
|
||||
{
|
||||
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
||||
OutputNameFeedbacks[output].FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
Debug.Console(2, this, "DM Output {0} NameFeedbackEventId", output);
|
||||
OutputNameFeedbacks[output].FireUpdate();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}",
|
||||
args.Number, args.EventId);
|
||||
break;
|
||||
}
|
||||
{
|
||||
Debug.Console(2, this, "DMOutputChange fired for Output {0} with Unhandled EventId: {1}",
|
||||
args.Number, args.EventId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -564,7 +653,8 @@ namespace PepperDash.Essentials.DM {
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="pnt"></param>
|
||||
void StartOffTimer(PortNumberType pnt) {
|
||||
void StartOffTimer(PortNumberType pnt)
|
||||
{
|
||||
if (RouteOffTimers.ContainsKey(pnt))
|
||||
return;
|
||||
RouteOffTimers[pnt] = new CTimer(o => ExecuteSwitch(null, pnt.Selector, pnt.Type), RouteOffTime);
|
||||
@@ -572,8 +662,10 @@ namespace PepperDash.Essentials.DM {
|
||||
|
||||
|
||||
// Send out sigs when coming online
|
||||
void IsOnline_OutputChange(object sender, EventArgs e) {
|
||||
if (IsOnline.BoolValue) {
|
||||
void IsOnline_OutputChange(object sender, EventArgs e)
|
||||
{
|
||||
if (IsOnline.BoolValue)
|
||||
{
|
||||
Chassis.EnableUSBBreakaway.BoolValue = true;
|
||||
|
||||
if (InputNames != null)
|
||||
@@ -587,12 +679,13 @@ namespace PepperDash.Essentials.DM {
|
||||
|
||||
#region IRouting Members
|
||||
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType) {
|
||||
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType sigType)
|
||||
{
|
||||
Debug.Console(2, this, "Making an awesome DM route from {0} to {1} {2}", inputSelector, outputSelector, sigType);
|
||||
|
||||
var input = inputSelector as DMInput; // Cast can sometimes fail
|
||||
var output = outputSelector as DMOutput;
|
||||
|
||||
|
||||
|
||||
if (output == null)
|
||||
{
|
||||
@@ -605,11 +698,14 @@ namespace PepperDash.Essentials.DM {
|
||||
// Check to see if there's an off timer waiting on this and if so, cancel
|
||||
var key = new PortNumberType(output, sigType);
|
||||
|
||||
if (input == null) {
|
||||
if (input == null)
|
||||
{
|
||||
StartOffTimer(key);
|
||||
}
|
||||
else {
|
||||
if (RouteOffTimers.ContainsKey(key)) {
|
||||
else
|
||||
{
|
||||
if (RouteOffTimers.ContainsKey(key))
|
||||
{
|
||||
Debug.Console(2, this, "{0} cancelling route off due to new source", output);
|
||||
RouteOffTimers[key].Stop();
|
||||
RouteOffTimers.Remove(key);
|
||||
@@ -671,7 +767,7 @@ namespace PepperDash.Essentials.DM {
|
||||
var ioSlotJoin = ioSlot - 1;
|
||||
|
||||
// Control
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteNumericSwitch(o, (ushort) ioSlot, eRoutingSignalType.Video));
|
||||
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteNumericSwitch(o, (ushort)ioSlot, eRoutingSignalType.Video));
|
||||
|
||||
if (TxDictionary.ContainsKey(ioSlot))
|
||||
{
|
||||
|
||||
@@ -1285,7 +1285,10 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
var output = outputSelector as DMOutput;
|
||||
|
||||
if (output == null)
|
||||
var isUsbInput = (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput;
|
||||
var isUsbOutput = (sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput;
|
||||
|
||||
if (output == null && !(isUsbOutput || isUsbInput))
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||
"Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
|
||||
@@ -1316,7 +1319,10 @@ namespace PepperDash.Essentials.DM
|
||||
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
{
|
||||
Chassis.VideoEnter.BoolValue = true;
|
||||
output.VideoOut = input; //Chassis.Outputs[output].VideoOut = inCard;
|
||||
if (output != null)
|
||||
{
|
||||
output.VideoOut = input; //Chassis.Outputs[output].VideoOut = inCard;
|
||||
}
|
||||
}
|
||||
|
||||
if ((sigType & eRoutingSignalType.Audio) == eRoutingSignalType.Audio)
|
||||
@@ -1326,17 +1332,66 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
dmMdMnxn.AudioEnter.BoolValue = true;
|
||||
}
|
||||
output.AudioOut = input;
|
||||
//Chassis.Outputs[output].AudioOut = inCard;
|
||||
if (output != null)
|
||||
{
|
||||
output.AudioOut = input;
|
||||
}
|
||||
}
|
||||
|
||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput || (sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||
|
||||
{
|
||||
Chassis.USBEnter.BoolValue = true;
|
||||
output.USBRoutedTo = input;
|
||||
Chassis.USBEnter.BoolValue = true;
|
||||
if (inputSelector == null && output != null)
|
||||
{
|
||||
//clearing the route is intended
|
||||
output.USBRoutedTo = null;
|
||||
return;
|
||||
}
|
||||
|
||||
if (inputSelector != null && input == null)
|
||||
{
|
||||
//input selector is DMOutput...we're doing a out to out route
|
||||
var tempInput = inputSelector as DMOutput;
|
||||
|
||||
if (tempInput == null || output == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
output.USBRoutedTo = tempInput;
|
||||
return;
|
||||
}
|
||||
|
||||
if (input != null & output != null)
|
||||
{
|
||||
output.USBRoutedTo = input;
|
||||
}
|
||||
}
|
||||
|
||||
if((sigType & eRoutingSignalType.UsbInput) != eRoutingSignalType.UsbInput)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Chassis.USBEnter.BoolValue = true;
|
||||
if (output != null)
|
||||
{
|
||||
output.USBRoutedTo = input;
|
||||
return;
|
||||
}
|
||||
var tempOutput = outputSelector as DMInput;
|
||||
|
||||
if (tempOutput == null)
|
||||
{
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Warning,
|
||||
"Unable to execute switch for inputSelector {0} to outputSelector {1}", inputSelector,
|
||||
outputSelector);
|
||||
return;
|
||||
}
|
||||
|
||||
tempOutput.USBRoutedTo = input;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRoutingNumeric Members
|
||||
@@ -1349,8 +1404,10 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
DMInputOutputBase dmCard;
|
||||
|
||||
//Routing Input to Input or Output to Input
|
||||
if ((sigType & eRoutingSignalType.UsbInput) == eRoutingSignalType.UsbInput)
|
||||
{
|
||||
Debug.Console(2, this, "Executing USB Input switch.\r\n in:{0} output: {1}", inputSelector, outputSelector);
|
||||
if (outputSelector > chassisSize)
|
||||
{
|
||||
uint outputIndex;
|
||||
@@ -1370,13 +1427,14 @@ namespace PepperDash.Essentials.DM
|
||||
dmCard = Chassis.Inputs[inputSelector];
|
||||
}
|
||||
|
||||
ExecuteSwitch(dmCard, Chassis.Outputs[outputSelector], sigType);
|
||||
ExecuteSwitch(dmCard, Chassis.Inputs[outputSelector], sigType);
|
||||
return;
|
||||
}
|
||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||
{
|
||||
Debug.Console(2, this, "Executing USB Output switch.\r\n in:{0} output: {1}", inputSelector, outputSelector);
|
||||
|
||||
//routing Output to Output or Input to Output
|
||||
if (inputSelector > chassisSize)
|
||||
{
|
||||
//wanting to route an output to an output. Subtract chassis size and get output, unless it's 8x8
|
||||
@@ -1843,6 +1901,8 @@ namespace PepperDash.Essentials.DM
|
||||
EnableAudioBreakawayFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableAudioBreakaway.JoinNumber]);
|
||||
EnableUsbBreakawayFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsbBreakaway.JoinNumber]);
|
||||
|
||||
trilist.SetString(joinMap.NoRouteName.JoinNumber, NoRouteText);
|
||||
|
||||
trilist.OnlineStatusChange += (o, a) =>
|
||||
{
|
||||
if (!a.DeviceOnLine)
|
||||
@@ -1854,6 +1914,8 @@ namespace PepperDash.Essentials.DM
|
||||
EnableUsbBreakawayFeedback.FireUpdate();
|
||||
SystemIdBusyFeedback.FireUpdate();
|
||||
SystemIdFeebdack.FireUpdate();
|
||||
|
||||
trilist.SetString(joinMap.NoRouteName.JoinNumber, NoRouteText);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,10 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
public DmpsAudioOutput MasterVolumeLevel { get; private set; }
|
||||
public DmpsAudioOutput SourceVolumeLevel { get; private set; }
|
||||
public DmpsAudioOutput MicsMasterVolumeLevel { get; private set; }
|
||||
public DmpsAudioOutput Codec1VolumeLevel { get; private set; }
|
||||
public DmpsAudioOutput Codec2VolumeLevel { get; private set; }
|
||||
|
||||
|
||||
public DmpsAudioOutputController(string key, string name, Card.Dmps3OutputBase card)
|
||||
: base(key, name)
|
||||
{
|
||||
@@ -36,88 +36,143 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
OutputCard.BaseDevice.DMOutputChange += new DMOutputEventHandler(BaseDevice_DMOutputChange);
|
||||
|
||||
MasterVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Master);
|
||||
SourceVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Source);
|
||||
|
||||
if (card is Card.Dmps3ProgramOutput)
|
||||
{
|
||||
//(card as Card.Dmps3ProgramOutput).OutputMixer.MicLevel
|
||||
//TODO: Hook up mic levels and mutes
|
||||
MasterVolumeLevel = new DmpsAudioOutputWithMixer(card, eDmpsLevelType.Master, (card as Card.Dmps3ProgramOutput).OutputMixer);
|
||||
SourceVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Source);
|
||||
MicsMasterVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.MicsMaster);
|
||||
Codec1VolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Codec1);
|
||||
Codec2VolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Codec2);
|
||||
}
|
||||
else if (card is Card.Dmps3Aux1Output)
|
||||
{
|
||||
MasterVolumeLevel = new DmpsAudioOutputWithMixer(card, eDmpsLevelType.Master, (card as Card.Dmps3Aux1Output).OutputMixer);
|
||||
SourceVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Source);
|
||||
MicsMasterVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.MicsMaster);
|
||||
Codec2VolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Codec2);
|
||||
}
|
||||
else if (card is Card.Dmps3Aux2Output)
|
||||
{
|
||||
MasterVolumeLevel = new DmpsAudioOutputWithMixer(card, eDmpsLevelType.Master, (card as Card.Dmps3Aux2Output).OutputMixer);
|
||||
SourceVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Source);
|
||||
MicsMasterVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.MicsMaster);
|
||||
Codec1VolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Codec1);
|
||||
}
|
||||
else //Digital Outputs
|
||||
{
|
||||
MasterVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Master);
|
||||
SourceVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.Source);
|
||||
MicsMasterVolumeLevel = new DmpsAudioOutput(card, eDmpsLevelType.MicsMaster);
|
||||
}
|
||||
}
|
||||
|
||||
void BaseDevice_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||
{
|
||||
Debug.Console(2, this, "Dmps Audio Controller Event Output: {0} EventId: {1}", args.Number, args.EventId.ToString());
|
||||
switch (args.EventId)
|
||||
{
|
||||
case DMOutputEventIds.OutputVuFeedBackEventId:
|
||||
{
|
||||
//Frequently called event that isn't needed
|
||||
return;
|
||||
}
|
||||
case DMOutputEventIds.MasterVolumeFeedBackEventId:
|
||||
{
|
||||
MasterVolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
MasterVolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
MasterVolumeLevel.VolumeLevelScaledFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.MasterMuteOnFeedBackEventId:
|
||||
{
|
||||
MasterVolumeLevel.MuteFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
MasterVolumeLevel.MuteFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.SourceLevelFeedBackEventId:
|
||||
{
|
||||
SourceVolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
SourceVolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
SourceVolumeLevel.VolumeLevelScaledFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.SourceMuteOnFeedBackEventId:
|
||||
{
|
||||
SourceVolumeLevel.MuteFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.MicMasterLevelFeedBackEventId:
|
||||
{
|
||||
MicsMasterVolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
MicsMasterVolumeLevel.VolumeLevelScaledFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.MicMasterMuteOnFeedBackEventId:
|
||||
{
|
||||
MicsMasterVolumeLevel.MuteFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.Codec1LevelFeedBackEventId:
|
||||
{
|
||||
if(Codec1VolumeLevel != null)
|
||||
Codec1VolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (Codec1VolumeLevel != null)
|
||||
{
|
||||
Codec1VolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
Codec1VolumeLevel.VolumeLevelScaledFeedback.FireUpdate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.Codec1MuteOnFeedBackEventId:
|
||||
{
|
||||
if (Codec1VolumeLevel != null)
|
||||
Codec1VolumeLevel.MuteFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (Codec1VolumeLevel != null)
|
||||
Codec1VolumeLevel.MuteFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.Codec2LevelFeedBackEventId:
|
||||
{
|
||||
if (Codec2VolumeLevel != null)
|
||||
Codec2VolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (Codec2VolumeLevel != null)
|
||||
{
|
||||
Codec2VolumeLevel.VolumeLevelFeedback.FireUpdate();
|
||||
Codec2VolumeLevel.VolumeLevelScaledFeedback.FireUpdate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.Codec2MuteOnFeedBackEventId:
|
||||
{
|
||||
if (Codec2VolumeLevel != null)
|
||||
Codec2VolumeLevel.MuteFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (Codec2VolumeLevel != null)
|
||||
Codec2VolumeLevel.MuteFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.MinVolumeFeedBackEventId:
|
||||
{
|
||||
Debug.Console(2, this, "MinVolumeFeedBackEventId: {0}", args.Index);
|
||||
var level = MasterVolumeLevel as DmpsAudioOutputWithMixer;
|
||||
if (level != null)
|
||||
{
|
||||
level.GetVolumeMin();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DMOutputEventIds.MaxVolumeFeedBackEventId:
|
||||
{
|
||||
Debug.Console(2, this, "MaxVolumeFeedBackEventId: {0}", args.Index);
|
||||
var level = MasterVolumeLevel as DmpsAudioOutputWithMixer;
|
||||
if (level != null)
|
||||
{
|
||||
level.GetVolumeMax();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
{
|
||||
var joinMap = new DmpsAudioOutputControllerJoinMap(joinStart);
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<DmpsAudioOutputControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
if (bridge != null)
|
||||
{
|
||||
bridge.AddJoinMap(Key, joinMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||
if (bridge != null)
|
||||
{
|
||||
bridge.AddJoinMap(Key, joinMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||
}
|
||||
|
||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
@@ -125,6 +180,11 @@ namespace PepperDash.Essentials.DM
|
||||
if (MasterVolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, MasterVolumeLevel, joinMap.MasterVolumeLevel.JoinNumber);
|
||||
var mixer = MasterVolumeLevel as DmpsAudioOutputWithMixer;
|
||||
if (mixer != null)
|
||||
{
|
||||
trilist.SetUShortSigAction(joinMap.MixerPresetRecall.JoinNumber, mixer.RecallPreset);
|
||||
}
|
||||
}
|
||||
|
||||
if (SourceVolumeLevel != null)
|
||||
@@ -132,6 +192,11 @@ namespace PepperDash.Essentials.DM
|
||||
SetUpDmpsAudioOutputJoins(trilist, SourceVolumeLevel, joinMap.SourceVolumeLevel.JoinNumber);
|
||||
}
|
||||
|
||||
if (MicsMasterVolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, MicsMasterVolumeLevel, joinMap.MicsMasterVolumeLevel.JoinNumber);
|
||||
}
|
||||
|
||||
if (Codec1VolumeLevel != null)
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, Codec1VolumeLevel, joinMap.Codec1VolumeLevel.JoinNumber);
|
||||
@@ -141,20 +206,20 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
SetUpDmpsAudioOutputJoins(trilist, Codec2VolumeLevel, joinMap.Codec2VolumeLevel.JoinNumber);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void SetUpDmpsAudioOutputJoins(BasicTriList trilist, DmpsAudioOutput output, uint joinStart)
|
||||
{
|
||||
var volumeLevelJoin = joinStart;
|
||||
var volumeLevelScaledJoin = joinStart + 1;
|
||||
var muteOnJoin = joinStart;
|
||||
var muteOffJoin = joinStart + 1;
|
||||
var volumeUpJoin = joinStart + 2;
|
||||
var volumeDownJoin = joinStart + 3;
|
||||
var sendScaledVolumeJoin = joinStart + 4;
|
||||
|
||||
|
||||
trilist.SetUShortSigAction(volumeLevelJoin, output.SetVolume);
|
||||
output.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[volumeLevelJoin]);
|
||||
output.VolumeLevelScaledFeedback.LinkInputSig(trilist.UShortInput[volumeLevelScaledJoin]);
|
||||
|
||||
trilist.SetSigTrueAction(muteOnJoin, output.MuteOn);
|
||||
output.MuteFeedback.LinkInputSig(trilist.BooleanInput[muteOnJoin]);
|
||||
@@ -163,30 +228,78 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
trilist.SetBoolSigAction(volumeUpJoin, output.VolumeUp);
|
||||
trilist.SetBoolSigAction(volumeDownJoin, output.VolumeDown);
|
||||
trilist.SetBoolSigAction(sendScaledVolumeJoin, output.SendScaledVolume);
|
||||
trilist.SetUShortSigAction(volumeLevelJoin, output.SetVolume);
|
||||
trilist.SetUShortSigAction(volumeLevelScaledJoin, output.SetVolumeScaled);
|
||||
}
|
||||
}
|
||||
|
||||
public class DmpsAudioOutputWithMixer : DmpsAudioOutput
|
||||
{
|
||||
CrestronControlSystem.Dmps3OutputMixerWithMonoAndStereo Mixer;
|
||||
|
||||
public DmpsAudioOutputWithMixer(Card.Dmps3OutputBase output, eDmpsLevelType type, CrestronControlSystem.Dmps3OutputMixerWithMonoAndStereo mixer)
|
||||
: base(output, type)
|
||||
{
|
||||
Mixer = mixer;
|
||||
GetVolumeMax();
|
||||
GetVolumeMin();
|
||||
}
|
||||
|
||||
public void GetVolumeMin()
|
||||
{
|
||||
MinLevel = (short)Mixer.MinVolumeFeedback.UShortValue;
|
||||
if (VolumeLevelScaledFeedback != null)
|
||||
{
|
||||
VolumeLevelScaledFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void GetVolumeMax()
|
||||
{
|
||||
MaxLevel = (short)Mixer.MaxVolumeFeedback.UShortValue;
|
||||
if (VolumeLevelScaledFeedback != null)
|
||||
{
|
||||
VolumeLevelScaledFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void RecallPreset(ushort preset)
|
||||
{
|
||||
Debug.Console(1, "DMPS Recalling Preset {0}", preset);
|
||||
Mixer.PresetNumber.UShortValue = preset;
|
||||
Mixer.RecallPreset();
|
||||
}
|
||||
}
|
||||
|
||||
public class DmpsAudioOutput : IBasicVolumeWithFeedback
|
||||
{
|
||||
Card.Dmps3OutputBase Output;
|
||||
|
||||
eDmpsLevelType Type;
|
||||
UShortInputSig Level;
|
||||
|
||||
eDmpsLevelType Type;
|
||||
private bool EnableVolumeSend;
|
||||
private ushort VolumeLevelInput;
|
||||
protected short MinLevel { get; set; }
|
||||
protected short MaxLevel { get; set; }
|
||||
|
||||
public BoolFeedback MuteFeedback { get; private set; }
|
||||
public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
public IntFeedback VolumeLevelScaledFeedback { get; private set; }
|
||||
|
||||
Action MuteOnAction;
|
||||
Action MuteOffAction;
|
||||
Action<bool> VolumeUpAction;
|
||||
Action<bool> VolumeDownAction;
|
||||
|
||||
|
||||
public DmpsAudioOutput(Card.Dmps3OutputBase output, eDmpsLevelType type)
|
||||
{
|
||||
Output = output;
|
||||
|
||||
VolumeLevelInput = 0;
|
||||
EnableVolumeSend = false;
|
||||
Type = type;
|
||||
MinLevel = -800;
|
||||
MaxLevel = 100;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -194,14 +307,12 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
Level = output.MasterVolume;
|
||||
|
||||
MuteFeedback = new BoolFeedback( new Func<bool> (() => Output.MasterMuteOnFeedBack.BoolValue));
|
||||
MuteFeedback = new BoolFeedback(new Func<bool>(() => Output.MasterMuteOnFeedBack.BoolValue));
|
||||
VolumeLevelFeedback = new IntFeedback(new Func<int>(() => Output.MasterVolumeFeedBack.UShortValue));
|
||||
MuteOnAction = new Action(Output.MasterMuteOn);
|
||||
MuteOffAction = new Action(Output.MasterMuteOff);
|
||||
VolumeUpAction = new Action<bool>((b) => Output.MasterVolumeUp.BoolValue = b);
|
||||
VolumeDownAction = new Action<bool>((b) => Output.MasterVolumeDown.BoolValue = b);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
case eDmpsLevelType.MicsMaster:
|
||||
@@ -214,7 +325,6 @@ namespace PepperDash.Essentials.DM
|
||||
MuteOffAction = new Action(Output.MicMasterMuteOff);
|
||||
VolumeUpAction = new Action<bool>((b) => Output.MicMasterLevelUp.BoolValue = b);
|
||||
VolumeDownAction = new Action<bool>((b) => Output.MicMasterLevelDown.BoolValue = b);
|
||||
|
||||
break;
|
||||
}
|
||||
case eDmpsLevelType.Source:
|
||||
@@ -243,7 +353,6 @@ namespace PepperDash.Essentials.DM
|
||||
MuteOffAction = new Action(programOutput.Codec1MuteOff);
|
||||
VolumeUpAction = new Action<bool>((b) => programOutput.Codec1LevelUp.BoolValue = b);
|
||||
VolumeDownAction = new Action<bool>((b) => programOutput.Codec1LevelDown.BoolValue = b);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -274,7 +383,6 @@ namespace PepperDash.Essentials.DM
|
||||
MuteOffAction = new Action(programOutput.Codec2MuteOff);
|
||||
VolumeUpAction = new Action<bool>((b) => programOutput.Codec2LevelUp.BoolValue = b);
|
||||
VolumeDownAction = new Action<bool>((b) => programOutput.Codec2LevelDown.BoolValue = b);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -292,7 +400,38 @@ namespace PepperDash.Essentials.DM
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (VolumeLevelFeedback != null)
|
||||
{
|
||||
VolumeLevelScaledFeedback = new IntFeedback(new Func<int>(() => ScaleVolumeFeedback(VolumeLevelFeedback.UShortValue)));
|
||||
VolumeLevelFeedback.FireUpdate();
|
||||
VolumeLevelScaledFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVolumeScaled(ushort level)
|
||||
{
|
||||
Debug.Console(2, Debug.ErrorLogLevel.None, "Scaling DMPS volume:{0} level:{1} min:{2} max:{3}", Output.Name, level.ToString(), MinLevel.ToString(), MaxLevel.ToString());
|
||||
VolumeLevelInput = (ushort)(level * (MaxLevel - MinLevel) / ushort.MaxValue + MinLevel);
|
||||
if (EnableVolumeSend == true)
|
||||
{
|
||||
Level.UShortValue = VolumeLevelInput;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort ScaleVolumeFeedback(ushort level)
|
||||
{
|
||||
short signedLevel = (short)level;
|
||||
Debug.Console(2, Debug.ErrorLogLevel.None, "Scaling DMPS volume:{0} feedback:{1} min:{2} max:{3}", Output.Name, signedLevel.ToString(), MinLevel.ToString(), MaxLevel.ToString());
|
||||
return (ushort)((signedLevel - MinLevel) * ushort.MaxValue / (MaxLevel - MinLevel));
|
||||
}
|
||||
|
||||
public void SendScaledVolume(bool pressRelease)
|
||||
{
|
||||
EnableVolumeSend = pressRelease;
|
||||
if (pressRelease == false)
|
||||
{
|
||||
SetVolumeScaled(VolumeLevelInput);
|
||||
}
|
||||
}
|
||||
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Exposes the volume levels for microphones DMPS3 chassis
|
||||
/// </summary>
|
||||
public class DmpsMicrophoneController
|
||||
{
|
||||
private Dictionary<uint, DmpsMicrophone> Mics;
|
||||
|
||||
public DmpsMicrophoneController(CrestronControlSystem dmps)
|
||||
{
|
||||
Debug.Console(2, "Creating Dmps Microphone Controller");
|
||||
Mics = new Dictionary<uint,DmpsMicrophone>();
|
||||
|
||||
foreach (var mic in dmps.Microphones)
|
||||
{
|
||||
Debug.Console(0, "Dmps Microphone Controller Adding Mic: {0} Name: {1}", mic.ID, mic.Name);
|
||||
var dmpsMic = new DmpsMicrophone("processor-microphone" + mic.ID, mic.Name, mic);
|
||||
|
||||
DeviceManager.AddDevice(dmpsMic);
|
||||
Mics.Add(mic.ID, dmpsMic);
|
||||
}
|
||||
|
||||
dmps.MicrophoneChange += new MicrophoneChangeEventHandler(Dmps_MicrophoneChange);
|
||||
}
|
||||
|
||||
void Dmps_MicrophoneChange(MicrophoneBase mic, GenericEventArgs args)
|
||||
{
|
||||
Debug.Console(2, "Dmps Microphone Controller Index: {0} EventId: {1}", mic.ID, args.EventId.ToString());
|
||||
|
||||
if(Mics.ContainsKey(mic.ID))
|
||||
{
|
||||
Mics[mic.ID].Event(args.EventId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class DmpsMicrophone : EssentialsBridgeableDevice, IBasicVolumeWithFeedback
|
||||
{
|
||||
MicrophoneBase Mic;
|
||||
|
||||
private bool EnableVolumeSend;
|
||||
private ushort VolumeLevelInput;
|
||||
protected short MinLevel { get; set; }
|
||||
protected short MaxLevel { get; set; }
|
||||
|
||||
public BoolFeedback MuteFeedback { get; private set; }
|
||||
public IntFeedback VolumeLevelFeedback { get; private set; }
|
||||
public IntFeedback VolumeLevelScaledFeedback { get; private set; }
|
||||
public StringFeedback NameFeedback { get; private set; }
|
||||
|
||||
Action MuteOnAction;
|
||||
Action MuteOffAction;
|
||||
|
||||
public DmpsMicrophone(string key, string name, MicrophoneBase mic) : base(key, name)
|
||||
{
|
||||
Mic = mic;
|
||||
VolumeLevelInput = 0;
|
||||
EnableVolumeSend = false;
|
||||
MinLevel = 0;
|
||||
MaxLevel = 600;
|
||||
|
||||
MuteFeedback = new BoolFeedback(new Func<bool>(() => Mic.MuteOnFeedBack.BoolValue));
|
||||
VolumeLevelFeedback = new IntFeedback(new Func<int>(() => Mic.GainFeedBack.UShortValue));
|
||||
VolumeLevelScaledFeedback = new IntFeedback(new Func<int>(() => ScaleVolumeFeedback(VolumeLevelFeedback.UShortValue)));
|
||||
NameFeedback = new StringFeedback(new Func<string>(() => "Microphone " + Mic.ID));
|
||||
MuteOnAction = new Action(Mic.MuteOn);
|
||||
MuteOffAction = new Action(Mic.MuteOff);
|
||||
|
||||
VolumeLevelFeedback.FireUpdate();
|
||||
VolumeLevelScaledFeedback.FireUpdate();
|
||||
NameFeedback.FireUpdate();
|
||||
MuteFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = new DmpsMicrophoneControllerJoinMap(joinStart);
|
||||
|
||||
if (bridge != null)
|
||||
{
|
||||
bridge.AddJoinMap(Key, joinMap);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||
}
|
||||
|
||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.MicGain.JoinNumber]);
|
||||
VolumeLevelScaledFeedback.LinkInputSig(trilist.UShortInput[joinMap.MicGainScaled.JoinNumber ]);
|
||||
MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.MicMuteOn.JoinNumber]);
|
||||
MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.MicMuteOff.JoinNumber]);
|
||||
NameFeedback.LinkInputSig(trilist.StringInput[joinMap.MicName.JoinNumber]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.MicGain.JoinNumber, SetVolume);
|
||||
trilist.SetUShortSigAction(joinMap.MicGainScaled.JoinNumber, SetVolumeScaled);
|
||||
trilist.SetBoolSigAction(joinMap.MicGainScaledSend.JoinNumber, SendScaledVolume);
|
||||
trilist.SetSigTrueAction(joinMap.MicMuteOn.JoinNumber, MuteOnAction);
|
||||
trilist.SetSigTrueAction(joinMap.MicMuteOff.JoinNumber, MuteOffAction);
|
||||
}
|
||||
|
||||
public void Event(int id)
|
||||
{
|
||||
if (id == MicrophoneEventIds.MuteOnFeedBackEventId)
|
||||
{
|
||||
MuteFeedback.FireUpdate();
|
||||
}
|
||||
else if (id == MicrophoneEventIds.GainFeedBackEventId)
|
||||
{
|
||||
VolumeLevelFeedback.FireUpdate();
|
||||
VolumeLevelScaledFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
public void SetVolumeScaled(ushort level)
|
||||
{
|
||||
VolumeLevelInput = (ushort)(level * (MaxLevel - MinLevel) / ushort.MaxValue + MinLevel);
|
||||
if (EnableVolumeSend == true)
|
||||
{
|
||||
Mic.Gain.UShortValue = VolumeLevelInput;
|
||||
}
|
||||
}
|
||||
|
||||
public ushort ScaleVolumeFeedback(ushort level)
|
||||
{
|
||||
short signedLevel = (short)level;
|
||||
return (ushort)((signedLevel - MinLevel) * ushort.MaxValue / (MaxLevel - MinLevel));
|
||||
}
|
||||
|
||||
public void SendScaledVolume(bool pressRelease)
|
||||
{
|
||||
EnableVolumeSend = pressRelease;
|
||||
if (pressRelease == false)
|
||||
{
|
||||
SetVolumeScaled(VolumeLevelInput);
|
||||
}
|
||||
}
|
||||
|
||||
#region IBasicVolumeWithFeedback Members
|
||||
|
||||
public void SetVolume(ushort level)
|
||||
{
|
||||
Mic.Gain.UShortValue = level;
|
||||
}
|
||||
|
||||
public void MuteOn()
|
||||
{
|
||||
MuteOnAction();
|
||||
}
|
||||
|
||||
public void MuteOff()
|
||||
{
|
||||
MuteOffAction();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IBasicVolumeControls Members
|
||||
|
||||
public void VolumeUp(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
public void VolumeDown(bool pressRelease)
|
||||
{
|
||||
}
|
||||
|
||||
public void MuteToggle()
|
||||
{
|
||||
if (MuteFeedback.BoolValue)
|
||||
MuteOff();
|
||||
else
|
||||
MuteOn();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -25,9 +25,19 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
public CrestronControlSystem Dmps { get; set; }
|
||||
public ISystemControl SystemControl { get; private set; }
|
||||
public bool? EnableRouting { get; private set; }
|
||||
|
||||
//Check if DMPS is a DMPS3-4K type for endpoint creation
|
||||
public bool Dmps4kType { get; private set; }
|
||||
|
||||
//IroutingNumericEvent
|
||||
public event EventHandler<RoutingNumericEventArgs> NumericSwitchChange;
|
||||
|
||||
//Feedback for DMPS System Control
|
||||
public BoolFeedback SystemPowerOnFeedback { get; private set; }
|
||||
public BoolFeedback SystemPowerOffFeedback { get; private set; }
|
||||
public BoolFeedback FrontPanelLockOnFeedback { get; private set; }
|
||||
public BoolFeedback FrontPanelLockOffFeedback { get; private set; }
|
||||
|
||||
// Feedbacks for EssentialDM
|
||||
public Dictionary<uint, IntFeedback> VideoOutputFeedbacks { get; private set; }
|
||||
@@ -52,6 +62,7 @@ namespace PepperDash.Essentials.DM
|
||||
public Dictionary<uint, string> InputNames { get; set; }
|
||||
public Dictionary<uint, string> OutputNames { get; set; }
|
||||
public Dictionary<uint, DmCardAudioOutputController> VolumeControls { get; private set; }
|
||||
public DmpsMicrophoneController Microphones { get; private set; }
|
||||
|
||||
public const int RouteOffTime = 500;
|
||||
Dictionary<PortNumberType, CTimer> RouteOffTimers = new Dictionary<PortNumberType, CTimer>();
|
||||
@@ -112,10 +123,40 @@ namespace PepperDash.Essentials.DM
|
||||
/// <param name="chassis"></param>
|
||||
public DmpsRoutingController(string key, string name, ISystemControl systemControl)
|
||||
: base(key, name)
|
||||
{
|
||||
|
||||
{
|
||||
Dmps = Global.ControlSystem;
|
||||
SystemControl = systemControl;
|
||||
|
||||
switch (systemControl.SystemControlType)
|
||||
{
|
||||
case eSystemControlType.Dmps34K150CSystemControl:
|
||||
SystemControl = systemControl as Dmps34K150CSystemControl;
|
||||
Dmps4kType = true;
|
||||
SystemPowerOnFeedback = new BoolFeedback(() => { return true; });
|
||||
SystemPowerOffFeedback = new BoolFeedback(() => { return false; });
|
||||
break;
|
||||
case eSystemControlType.Dmps34K200CSystemControl:
|
||||
case eSystemControlType.Dmps34K250CSystemControl:
|
||||
case eSystemControlType.Dmps34K300CSystemControl:
|
||||
case eSystemControlType.Dmps34K350CSystemControl:
|
||||
SystemControl = systemControl as Dmps34K300CSystemControl;
|
||||
Dmps4kType = true;
|
||||
SystemPowerOnFeedback = new BoolFeedback(() => { return true; });
|
||||
SystemPowerOffFeedback = new BoolFeedback(() => { return false; });
|
||||
break;
|
||||
default:
|
||||
SystemControl = systemControl as Dmps3SystemControl;
|
||||
Dmps4kType = false;
|
||||
SystemPowerOnFeedback = new BoolFeedback(() =>
|
||||
{
|
||||
return ((Dmps3SystemControl)SystemControl).SystemPowerOnFeedBack.BoolValue;
|
||||
});
|
||||
SystemPowerOffFeedback = new BoolFeedback(() =>
|
||||
{
|
||||
return ((Dmps3SystemControl)SystemControl).SystemPowerOffFeedBack.BoolValue;
|
||||
});
|
||||
break;
|
||||
}
|
||||
Debug.Console(1, this, "DMPS Type = {0}, 4K Type = {1}", systemControl.SystemControlType, Dmps4kType);
|
||||
|
||||
InputPorts = new RoutingPortCollection<RoutingInputPort>();
|
||||
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
|
||||
@@ -123,6 +164,15 @@ namespace PepperDash.Essentials.DM
|
||||
TxDictionary = new Dictionary<uint, string>();
|
||||
RxDictionary = new Dictionary<uint, string>();
|
||||
|
||||
FrontPanelLockOnFeedback = new BoolFeedback(() =>
|
||||
{
|
||||
return SystemControl.FrontPanelLockOnFeedback.BoolValue;
|
||||
});
|
||||
FrontPanelLockOffFeedback = new BoolFeedback(() =>
|
||||
{
|
||||
return SystemControl.FrontPanelLockOffFeedback.BoolValue;
|
||||
});
|
||||
|
||||
VideoOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||
AudioOutputFeedbacks = new Dictionary<uint, IntFeedback>();
|
||||
VideoInputSyncFeedbacks = new Dictionary<uint, BoolFeedback>();
|
||||
@@ -142,6 +192,8 @@ namespace PepperDash.Essentials.DM
|
||||
SetupOutputCards();
|
||||
|
||||
SetupInputCards();
|
||||
|
||||
Microphones = new DmpsMicrophoneController(Dmps);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
@@ -154,6 +206,42 @@ namespace PepperDash.Essentials.DM
|
||||
// Subscribe to events
|
||||
Dmps.DMInputChange += Dmps_DMInputChange;
|
||||
Dmps.DMOutputChange += Dmps_DMOutputChange;
|
||||
Dmps.DMSystemChange += Dmps_DMSystemChange;
|
||||
|
||||
foreach (var x in VideoOutputFeedbacks)
|
||||
{
|
||||
x.Value.FireUpdate();
|
||||
}
|
||||
foreach (var x in AudioOutputFeedbacks)
|
||||
{
|
||||
x.Value.FireUpdate();
|
||||
}
|
||||
foreach (var x in VideoInputSyncFeedbacks)
|
||||
{
|
||||
x.Value.FireUpdate();
|
||||
}
|
||||
foreach (var x in InputEndpointOnlineFeedbacks)
|
||||
{
|
||||
x.Value.FireUpdate();
|
||||
}
|
||||
foreach (var x in InputNameFeedbacks)
|
||||
{
|
||||
x.Value.FireUpdate();
|
||||
}
|
||||
foreach (var x in OutputNameFeedbacks)
|
||||
{
|
||||
x.Value.FireUpdate();
|
||||
}
|
||||
foreach (var x in OutputEndpointOnlineFeedbacks)
|
||||
{
|
||||
x.Value.FireUpdate();
|
||||
}
|
||||
|
||||
SystemPowerOnFeedback.FireUpdate();
|
||||
SystemPowerOffFeedback.FireUpdate();
|
||||
|
||||
FrontPanelLockOnFeedback.FireUpdate();
|
||||
FrontPanelLockOffFeedback.FireUpdate();
|
||||
|
||||
return base.CustomActivate();
|
||||
}
|
||||
@@ -191,6 +279,12 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
public void SetRoutingEnable(bool enable)
|
||||
{
|
||||
CrestronEnvironment.Sleep(1000);
|
||||
EnableRouting = enable;
|
||||
}
|
||||
|
||||
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
{
|
||||
var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
|
||||
@@ -211,9 +305,26 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
//Link up system power only for non-4k DMPS3
|
||||
if (SystemControl is Dmps3SystemControl)
|
||||
{
|
||||
trilist.SetBoolSigAction(joinMap.SystemPowerOn.JoinNumber, a => { if (a) { ((Dmps3SystemControl)SystemControl).SystemPowerOn(); } });
|
||||
trilist.SetBoolSigAction(joinMap.SystemPowerOff.JoinNumber, a => { if (a) { ((Dmps3SystemControl)SystemControl).SystemPowerOff(); } });
|
||||
}
|
||||
|
||||
SystemPowerOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemPowerOn.JoinNumber]);
|
||||
SystemPowerOffFeedback.LinkInputSig(trilist.BooleanInput[joinMap.SystemPowerOff.JoinNumber]);
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.FrontPanelLockOn.JoinNumber, a => { if (a) {SystemControl.FrontPanelLockOn();}});
|
||||
trilist.SetBoolSigAction(joinMap.FrontPanelLockOff.JoinNumber, a => { if (a) {SystemControl.FrontPanelLockOff();}});
|
||||
|
||||
FrontPanelLockOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FrontPanelLockOn.JoinNumber]);
|
||||
FrontPanelLockOffFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FrontPanelLockOff.JoinNumber]);
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.EnableRouting.JoinNumber, SetRoutingEnable);
|
||||
|
||||
// Link up outputs
|
||||
LinkInputsToApi(trilist, joinMap);
|
||||
|
||||
LinkOutputsToApi(trilist, joinMap);
|
||||
}
|
||||
|
||||
@@ -272,6 +383,8 @@ namespace PepperDash.Essentials.DM
|
||||
if (OutputNameFeedbacks[ioSlot] != null)
|
||||
{
|
||||
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
|
||||
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputVideoNames.JoinNumber + ioSlotJoin]);
|
||||
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputAudioNames.JoinNumber + ioSlotJoin]);
|
||||
}
|
||||
if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
|
||||
{
|
||||
@@ -293,6 +406,14 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
private void LinkInputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
|
||||
{
|
||||
if (Dmps4kType)
|
||||
{
|
||||
//DMPS-4K audio inputs 1-5 are aux inputs
|
||||
for (uint i = 1; i <= 5; i++)
|
||||
{
|
||||
trilist.StringInput[joinMap.InputAudioNames.JoinNumber + i - 1].StringValue = String.Format("Aux Input {0}", i);
|
||||
}
|
||||
}
|
||||
for (uint i = 1; i <= Dmps.SwitcherInputs.Count; i++)
|
||||
{
|
||||
Debug.Console(2, this, "Linking Input Card {0}", i);
|
||||
@@ -300,15 +421,26 @@ namespace PepperDash.Essentials.DM
|
||||
var ioSlot = i;
|
||||
var ioSlotJoin = ioSlot - 1;
|
||||
|
||||
if (VideoInputSyncFeedbacks[ioSlot] != null)
|
||||
if (VideoInputSyncFeedbacks.ContainsKey(ioSlot) && VideoInputSyncFeedbacks[ioSlot] != null)
|
||||
{
|
||||
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(
|
||||
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
|
||||
}
|
||||
|
||||
if (InputNameFeedbacks[ioSlot] != null)
|
||||
if (InputNameFeedbacks.ContainsKey(ioSlot) && InputNameFeedbacks[ioSlot] != null)
|
||||
{
|
||||
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
|
||||
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputVideoNames.JoinNumber + ioSlotJoin]);
|
||||
|
||||
if (Dmps4kType)
|
||||
{
|
||||
//DMPS-4K Audio Inputs are offset by 5
|
||||
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputAudioNames.JoinNumber + ioSlotJoin + 5]);
|
||||
}
|
||||
else
|
||||
{
|
||||
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputAudioNames.JoinNumber + ioSlotJoin]);
|
||||
}
|
||||
}
|
||||
|
||||
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, s =>
|
||||
@@ -333,7 +465,7 @@ namespace PepperDash.Essentials.DM
|
||||
});
|
||||
|
||||
|
||||
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||
if (InputEndpointOnlineFeedbacks.ContainsKey(ioSlot) && InputEndpointOnlineFeedbacks[ioSlot] != null)
|
||||
{
|
||||
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
|
||||
trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
|
||||
@@ -384,7 +516,7 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
|
||||
{
|
||||
if (outputCard.NameFeedback != null && !string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
|
||||
if (outputCard.NameFeedback != null && outputCard.NameFeedback != CrestronControlSystem.NullStringOutputSig && !string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
|
||||
{
|
||||
Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue);
|
||||
return outputCard.NameFeedback.StringValue;
|
||||
@@ -430,14 +562,14 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
InputEndpointOnlineFeedbacks[inputCard.Number] = new BoolFeedback(() => inputCard.EndpointOnlineFeedback);
|
||||
|
||||
if (inputCard.VideoDetectedFeedback != null)
|
||||
if (inputCard.VideoDetectedFeedback != null && inputCard.VideoDetectedFeedback.Supported)
|
||||
{
|
||||
VideoInputSyncFeedbacks[inputCard.Number] = new BoolFeedback(() => inputCard.VideoDetectedFeedback.BoolValue);
|
||||
}
|
||||
|
||||
InputNameFeedbacks[inputCard.Number] = new StringFeedback(() =>
|
||||
{
|
||||
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue))
|
||||
if (inputCard.NameFeedback != null && inputCard.NameFeedback != CrestronControlSystem.NullStringOutputSig && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue))
|
||||
{
|
||||
Debug.Console(2, this, "Input Card {0} Name: {1}", inputCard.Number, inputCard.NameFeedback.StringValue);
|
||||
return inputCard.NameFeedback.StringValue;
|
||||
@@ -586,7 +718,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
AddAudioOnlyOutputPort(number, "Program");
|
||||
|
||||
var programOutput = new DmpsAudioOutputController(string.Format("processor-programAudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
|
||||
var programOutput = new DmpsAudioOutputController(string.Format("processor-programAudioOutput"), "Program Audio Output", outputCard as Card.Dmps3ProgramOutput);
|
||||
|
||||
DeviceManager.AddDevice(programOutput);
|
||||
}
|
||||
@@ -598,7 +730,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
AddAudioOnlyOutputPort(number, "Aux1");
|
||||
|
||||
var aux1Output = new DmpsAudioOutputController(string.Format("processor-aux1AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
|
||||
var aux1Output = new DmpsAudioOutputController(string.Format("processor-aux1AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3Aux1Output);
|
||||
|
||||
DeviceManager.AddDevice(aux1Output);
|
||||
}
|
||||
@@ -607,7 +739,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
AddAudioOnlyOutputPort(number, "Aux2");
|
||||
|
||||
var aux2Output = new DmpsAudioOutputController(string.Format("processor-aux2AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
|
||||
var aux2Output = new DmpsAudioOutputController(string.Format("processor-aux2AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3Aux2Output);
|
||||
|
||||
DeviceManager.AddDevice(aux2Output);
|
||||
}
|
||||
@@ -719,40 +851,53 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
void Dmps_DMInputChange(Switch device, DMInputEventArgs args)
|
||||
{
|
||||
//Debug.Console(2, this, "DMSwitch:{0} Input:{1} Event:{2}'", this.Name, args.Number, args.EventId.ToString());
|
||||
|
||||
switch (args.EventId)
|
||||
try
|
||||
{
|
||||
case (DMInputEventIds.OnlineFeedbackEventId):
|
||||
{
|
||||
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case (DMInputEventIds.VideoDetectedEventId):
|
||||
{
|
||||
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
||||
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case (DMInputEventIds.InputNameEventId):
|
||||
{
|
||||
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
||||
InputNameFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
switch (args.EventId)
|
||||
{
|
||||
case (DMInputEventIds.OnlineFeedbackEventId):
|
||||
{
|
||||
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case (DMInputEventIds.VideoDetectedEventId):
|
||||
{
|
||||
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
||||
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
||||
break;
|
||||
}
|
||||
case (DMInputEventIds.InputNameEventId):
|
||||
{
|
||||
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
||||
if(InputNameFeedbacks.ContainsKey(args.Number))
|
||||
{
|
||||
InputNameFeedbacks[args.Number].FireUpdate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "DMSwitch Input Change:{0} Input:{1} Event:{2}\rException: {3}", this.Name, args.Number, args.EventId.ToString(), e.ToString());
|
||||
}
|
||||
}
|
||||
void Dmps_DMOutputChange(Switch device, DMOutputEventArgs args)
|
||||
{
|
||||
Debug.Console(2, this, "DMOutputChange Output: {0} EventId: {1}", args.Number, args.EventId.ToString());
|
||||
|
||||
if (args.EventId == DMOutputEventIds.OutputVuFeedBackEventId)
|
||||
{
|
||||
//Frequently called event that isn't needed
|
||||
return;
|
||||
}
|
||||
|
||||
var output = args.Number;
|
||||
|
||||
DMOutput outputCard = Dmps.SwitcherOutputs[output] as DMOutput;
|
||||
|
||||
if (args.EventId == DMOutputEventIds.VolumeEventId &&
|
||||
VolumeControls.ContainsKey(output))
|
||||
if (args.EventId == DMOutputEventIds.VolumeEventId && VolumeControls.ContainsKey(output))
|
||||
{
|
||||
VolumeControls[args.Number].VolumeEventFromChassis();
|
||||
}
|
||||
@@ -812,6 +957,27 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
}
|
||||
|
||||
void Dmps_DMSystemChange(Switch device, DMSystemEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case DMSystemEventIds.SystemPowerOnEventId:
|
||||
case DMSystemEventIds.SystemPowerOffEventId:
|
||||
{
|
||||
SystemPowerOnFeedback.FireUpdate();
|
||||
SystemPowerOffFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
case DMSystemEventIds.FrontPanelLockOnEventId:
|
||||
case DMSystemEventIds.FrontPanelLockOffEventId:
|
||||
{
|
||||
FrontPanelLockOnFeedback.FireUpdate();
|
||||
FrontPanelLockOffFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -829,6 +995,10 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
try
|
||||
{
|
||||
if (EnableRouting == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Console(2, this, "Attempting a DM route from input {0} to output {1} {2}", inputSelector, outputSelector, sigType);
|
||||
|
||||
@@ -879,7 +1049,6 @@ namespace PepperDash.Essentials.DM
|
||||
// NOTE THAT BITWISE COMPARISONS - TO CATCH ALL ROUTING TYPES
|
||||
if ((sigType & eRoutingSignalType.Video) == eRoutingSignalType.Video)
|
||||
{
|
||||
|
||||
output.VideoOut = input;
|
||||
}
|
||||
|
||||
@@ -903,7 +1072,6 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
if ((sigType & eRoutingSignalType.UsbOutput) == eRoutingSignalType.UsbOutput)
|
||||
{
|
||||
|
||||
output.USBRoutedTo = input;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
[Description("Wrapper Class for DM-RMC-4K-Z-SCALER-C")]
|
||||
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRoutingWithFeedback,
|
||||
IIROutputPorts, IComPorts, ICec
|
||||
IIROutputPorts, IComPorts, ICec, IRelayPorts
|
||||
{
|
||||
private readonly DmRmc4kzScalerC _rmc;
|
||||
|
||||
@@ -168,5 +168,18 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Implementation of IRelayPorts
|
||||
|
||||
public CrestronCollection<Relay> RelayPorts
|
||||
{
|
||||
get { return _rmc.RelayPorts; }
|
||||
}
|
||||
|
||||
public int NumberOfRelayPorts
|
||||
{
|
||||
get { return _rmc.NumberOfRelayPorts; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -61,6 +61,7 @@ namespace PepperDash.Essentials.DM
|
||||
Debug.Console(1, rmc, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
rmc.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = rmc.Name;
|
||||
if (rmc.VideoOutputResolutionFeedback != null)
|
||||
rmc.VideoOutputResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentOutputResolution.JoinNumber]);
|
||||
if (rmc.EdidManufacturerFeedback != null)
|
||||
@@ -329,7 +330,14 @@ namespace PepperDash.Essentials.DM
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (parentDev is DmpsRoutingController)
|
||||
{
|
||||
return GetDmRmcControllerForDmps(key, name, typeName, parentDev as DmpsRoutingController, props.ParentOutputNumber);
|
||||
if ((parentDev as DmpsRoutingController).Dmps4kType)
|
||||
{
|
||||
return GetDmRmcControllerForDmps4k(key, name, typeName, parentDev as DmpsRoutingController, props.ParentOutputNumber);
|
||||
}
|
||||
else
|
||||
{
|
||||
return GetDmRmcControllerForDmps(key, name, typeName, ipid, parentDev as DmpsRoutingController, props.ParentOutputNumber);
|
||||
}
|
||||
}
|
||||
if (!(parentDev is IDmSwitch))
|
||||
{
|
||||
@@ -395,25 +403,47 @@ namespace PepperDash.Essentials.DM
|
||||
return null;
|
||||
}
|
||||
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
|
||||
uint ipid, DmpsRoutingController controller, uint num)
|
||||
{
|
||||
Func<string, string, uint, DMOutput, CrestronGenericBaseDevice> dmpsHandler;
|
||||
if (ChassisDict.TryGetValue(typeName.ToLower(), out dmpsHandler))
|
||||
{
|
||||
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
|
||||
|
||||
if (output != null)
|
||||
{
|
||||
return dmpsHandler(key, name, ipid, output);
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS chassis. Output is not a DM Output.",
|
||||
typeName, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS chassis", typeName, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps4k(string key, string name, string typeName,
|
||||
DmpsRoutingController controller, uint num)
|
||||
{
|
||||
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmpsHandler;
|
||||
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmpsHandler))
|
||||
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmps4kHandler;
|
||||
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmps4kHandler))
|
||||
{
|
||||
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
|
||||
|
||||
if (output != null)
|
||||
{
|
||||
return dmpsHandler(key, name, output);
|
||||
return dmps4kHandler(key, name, output);
|
||||
}
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS chassis. Output is not a DM Output.",
|
||||
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS-4K chassis. Output is not a DM Output.",
|
||||
typeName, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS chassis", typeName, num);
|
||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS-4K chassis", typeName, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace PepperDash.Essentials.DM
|
||||
var ipid = props.Control.IpIdInt;
|
||||
var pKey = props.ParentDeviceKey.ToLower();
|
||||
|
||||
if (pKey == "processor")
|
||||
if (pKey == "processor")
|
||||
{
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
@@ -65,99 +65,135 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
if (!(parentDev is IDmSwitch))
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
|
||||
key, pKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
var parentDev = DeviceManager.GetDeviceForKey(pKey);
|
||||
DMInput dmInput;
|
||||
bool isCpu3 = false;
|
||||
|
||||
if (parentDev is IDmSwitch)
|
||||
{
|
||||
// Get the Crestron chassis and link stuff up
|
||||
var switchDev = (parentDev as IDmSwitch);
|
||||
var chassis = switchDev.Chassis;
|
||||
var switchDev = (parentDev as IDmSwitch);
|
||||
var chassis = switchDev.Chassis;
|
||||
|
||||
var num = props.ParentInputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
//Check that the input is within range of this chassis' possible inputs
|
||||
var num = props.ParentInputNumber;
|
||||
if (num <= 0 || num > chassis.NumberOfInputs)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. Input number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
switchDev.TxDictionary.Add(num, key);
|
||||
dmInput = chassis.Inputs[num];
|
||||
|
||||
//Determine if IpId is needed for this chassis type
|
||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
|
||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||
{
|
||||
var controller = (parentDev as IDmSwitch);
|
||||
controller.TxDictionary.Add(num, key);
|
||||
isCpu3 = true;
|
||||
}
|
||||
|
||||
// Catch constructor failures, mainly dues to IPID
|
||||
try
|
||||
{
|
||||
// Must use different constructor for CPU3 chassis types. No IPID
|
||||
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
|
||||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
|
||||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps||
|
||||
chassis is DmMd128x128 || chassis is DmMd64x64)
|
||||
{
|
||||
if (typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx201c"))
|
||||
return new DmTx201CController(key, name, new DmTx201C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx201s"))
|
||||
return new DmTx201SController(key, name, new DmTx201S(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k100"))
|
||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz100"))
|
||||
return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4kz202CController(key, name, new DmTx4kz202C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("hdbasettx"))
|
||||
return new HDBaseTTxController(key, name, new HDTx3CB(chassis.Inputs[num]));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx201c"))
|
||||
return new DmTx201CController(key, name, new DmTx201C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx201s"))
|
||||
return new DmTx201SController(key, name, new DmTx201S(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k100"))
|
||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz100"))
|
||||
return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4kz202CController(key, name, new DmTx4kz202C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, chassis.Inputs[num]));
|
||||
if (typeName.StartsWith("hdbasettx"))
|
||||
return new HDBaseTTxController(key, name, new HDTx3CB(ipid, chassis.Inputs[num]));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
}
|
||||
else if(parentDev is DmpsRoutingController)
|
||||
{
|
||||
// Get the DMPS chassis and link stuff up
|
||||
var dmpsDev = (parentDev as DmpsRoutingController);
|
||||
var chassis = dmpsDev.Dmps;
|
||||
|
||||
//Check that the input is within range of this chassis' possible inputs
|
||||
var num = props.ParentInputNumber;
|
||||
if (num <= 0 || num > chassis.SwitcherInputs.Count)
|
||||
{
|
||||
Debug.Console(0, "Cannot create DMPS device '{0}'. Input number '{1}' is out of range",
|
||||
key, num);
|
||||
return null;
|
||||
}
|
||||
|
||||
dmpsDev.TxDictionary.Add(num, key);
|
||||
|
||||
try
|
||||
{
|
||||
dmInput = chassis.SwitcherInputs[num] as DMInput;
|
||||
}
|
||||
catch
|
||||
{
|
||||
Debug.Console(0, "Cannot create DMPS device '{0}'. Input number '{1}' is not a DM input", key, num);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a processor, DM Chassis or DMPS.", key, pKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
// Must use different constructor for CPU3 or DMPS3-4K types. No IPID
|
||||
if (isCpu3 || Global.ControlSystemIsDmps4kType)
|
||||
{
|
||||
if (typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(dmInput));
|
||||
if (typeName.StartsWith("dmtx201c"))
|
||||
return new DmTx201CController(key, name, new DmTx201C(dmInput));
|
||||
if (typeName.StartsWith("dmtx201s"))
|
||||
return new DmTx201SController(key, name, new DmTx201S(dmInput));
|
||||
if (typeName.StartsWith("dmtx4k100"))
|
||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(dmInput));
|
||||
if (typeName.StartsWith("dmtx4kz100"))
|
||||
return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(dmInput));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(dmInput));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4kz202CController(key, name, new DmTx4kz202C(dmInput));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(dmInput));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(dmInput));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(dmInput));
|
||||
if (typeName.StartsWith("hdbasettx"))
|
||||
return new HDBaseTTxController(key, name, new HDTx3CB(dmInput));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (typeName.StartsWith("dmtx200"))
|
||||
return new DmTx200Controller(key, name, new DmTx200C2G(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx201c"))
|
||||
return new DmTx201CController(key, name, new DmTx201C(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx201s"))
|
||||
return new DmTx201SController(key, name, new DmTx201S(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx4k100"))
|
||||
return new DmTx4k100Controller(key, name, new DmTx4K100C1G(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx4kz100"))
|
||||
return new DmTx4kz100Controller(key, name, new DmTx4kz100C1G(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx4k202"))
|
||||
return new DmTx4k202CController(key, name, new DmTx4k202C(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx4kz202"))
|
||||
return new DmTx4kz202CController(key, name, new DmTx4kz202C(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx4k302"))
|
||||
return new DmTx4k302CController(key, name, new DmTx4k302C(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx4kz302"))
|
||||
return new DmTx4kz302CController(key, name, new DmTx4kz302C(ipid, dmInput));
|
||||
if (typeName.StartsWith("dmtx401"))
|
||||
return new DmTx401CController(key, name, new DmTx401C(ipid, dmInput));
|
||||
if (typeName.StartsWith("hdbasettx"))
|
||||
return new HDBaseTTxController(key, name, new HDTx3CB(ipid, dmInput));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "[{0}] WARNING: Cannot create DM-TX device: {1}", key, e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,11 +221,12 @@ namespace PepperDash.Essentials.DM
|
||||
protected DmTxControllerBase(string key, string name, EndpointTransmitterBase hardware)
|
||||
: base(key, name, hardware)
|
||||
{
|
||||
// if wired to a chassis, skip registration step in base class
|
||||
if (hardware.DMInput != null)
|
||||
{
|
||||
this.PreventRegistration = true;
|
||||
}
|
||||
// if wired to a chassis or DMPS, skip registration step in base class
|
||||
if (hardware.DMInput != null || (Global.ControlSystemIsDmpsType && hardware.DMInput != null))
|
||||
{
|
||||
this.PreventRegistration = true;
|
||||
}
|
||||
|
||||
AddToFeedbackList(ActiveVideoInputFeedback);
|
||||
}
|
||||
|
||||
@@ -226,6 +263,7 @@ namespace PepperDash.Essentials.DM
|
||||
tx.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber]);
|
||||
tx.AnyVideoInput.VideoStatus.VideoResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentInputResolution.JoinNumber]);
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber].UShortValue = (ushort)tx.HdcpSupportCapability;
|
||||
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = tx.Name;
|
||||
|
||||
bool hdcpTypeSimple;
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="AirMedia\AirMediaPropertiesConfig.cs" />
|
||||
<Compile Include="AirMedia\AirMediaController.cs" />
|
||||
<Compile Include="Chassis\DmpsMicrophoneController.cs" />
|
||||
<Compile Include="Chassis\DmBladeChassisController.cs" />
|
||||
<Compile Include="Chassis\DmCardAudioOutput.cs" />
|
||||
<Compile Include="Chassis\DmChassisController.cs" />
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
|
||||
public abstract class CameraBase : ReconfigurableDevice, IRoutingOutputs
|
||||
{
|
||||
[JsonProperty("controlMode", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public eCameraControlMode ControlMode { get; protected set; }
|
||||
|
||||
#region IRoutingOutputs Members
|
||||
@@ -37,6 +38,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
|
||||
#endregion
|
||||
|
||||
[JsonProperty("canPan", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool CanPan
|
||||
{
|
||||
get
|
||||
@@ -44,7 +46,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
return (Capabilities & eCameraCapabilities.Pan) == eCameraCapabilities.Pan;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("canTilt", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool CanTilt
|
||||
{
|
||||
get
|
||||
@@ -52,7 +54,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
return (Capabilities & eCameraCapabilities.Tilt) == eCameraCapabilities.Tilt;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("canZoom", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool CanZoom
|
||||
{
|
||||
get
|
||||
@@ -60,7 +62,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
return (Capabilities & eCameraCapabilities.Zoom) == eCameraCapabilities.Zoom;
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("canFocus", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool CanFocus
|
||||
{
|
||||
get
|
||||
@@ -216,21 +218,11 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
var presetsCamera = cameraDevice as IHasCameraPresets;
|
||||
presetsCamera.PresetsListHasChanged += new EventHandler<EventArgs>((o, a) =>
|
||||
{
|
||||
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
|
||||
{
|
||||
int tempNum = i - 1;
|
||||
|
||||
string label = "";
|
||||
|
||||
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
||||
|
||||
if (preset != null)
|
||||
label = preset.Description;
|
||||
|
||||
trilist.SetString((ushort) (joinMap.PresetLabelStart.JoinNumber + tempNum), label);
|
||||
}
|
||||
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
|
||||
});
|
||||
|
||||
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
|
||||
|
||||
for (int i = 0; i < joinMap.NumberOfPresets.JoinNumber; i++)
|
||||
{
|
||||
int tempNum = i;
|
||||
@@ -246,10 +238,35 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
presetsCamera.PresetStore(tempNum, label);
|
||||
});
|
||||
}
|
||||
trilist.OnlineStatusChange += (sender, args) =>
|
||||
{
|
||||
if (!args.DeviceOnLine)
|
||||
{ return; }
|
||||
|
||||
SendCameraPresetNamesToApi(presetsCamera, joinMap, trilist);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
private void SendCameraPresetNamesToApi(IHasCameraPresets presetsCamera, CameraControllerJoinMap joinMap, BasicTriList trilist)
|
||||
{
|
||||
for (int i = 1; i <= joinMap.NumberOfPresets.JoinNumber; i++)
|
||||
{
|
||||
int tempNum = i - 1;
|
||||
|
||||
string label = "";
|
||||
|
||||
var preset = presetsCamera.Presets.FirstOrDefault(p => p.ID.Equals(i));
|
||||
|
||||
if (preset != null)
|
||||
label = preset.Description;
|
||||
|
||||
trilist.SetString((ushort)(joinMap.PresetLabelStart.JoinNumber + tempNum), label);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class CameraPreset : PresetBase
|
||||
{
|
||||
public CameraPreset(int id, string description, bool isDefined, bool isDefinable)
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
void CameraMuteToggle();
|
||||
}
|
||||
|
||||
public interface IHasCameraMuteWithUnmuteReqeust : IHasCameraMute
|
||||
{
|
||||
event EventHandler VideoUnmuteRequested;
|
||||
}
|
||||
|
||||
public class CameraSelectedEventArgs : EventArgs
|
||||
{
|
||||
public CameraBase SelectedCamera { get; private set; }
|
||||
|
||||
@@ -525,6 +525,15 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
|
||||
public event EventHandler<EventArgs> PresetsListHasChanged;
|
||||
|
||||
protected void OnPresetsListHasChanged()
|
||||
{
|
||||
var handler = PresetsListHasChanged;
|
||||
if (handler == null)
|
||||
return;
|
||||
|
||||
handler.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public List<CameraPreset> Presets { get; private set; }
|
||||
|
||||
public void PresetSelect(int preset)
|
||||
@@ -537,6 +546,7 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
|
||||
SavePreset(preset);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region IHasCameraFocusControl Members
|
||||
|
||||
@@ -12,34 +12,40 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
{
|
||||
public class CodecActiveCallItem
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
[JsonProperty("name", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty("number")]
|
||||
[JsonProperty("number", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Number { get; set; }
|
||||
|
||||
[JsonProperty("type")]
|
||||
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public eCodecCallType Type { get; set; }
|
||||
|
||||
[JsonProperty("status")]
|
||||
[JsonProperty("status", NullValueHandling = NullValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public eCodecCallStatus Status { get; set; }
|
||||
|
||||
[JsonProperty("direction")]
|
||||
[JsonProperty("direction", NullValueHandling = NullValueHandling.Ignore)]
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public eCodecCallDirection Direction { get; set; }
|
||||
|
||||
[JsonProperty("id")]
|
||||
[JsonProperty("id", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public string Id { get; set; }
|
||||
|
||||
[JsonProperty("isOnHold", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool IsOnHold { get; set; }
|
||||
|
||||
[JsonProperty("duration", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public TimeSpan Duration { get; set; }
|
||||
|
||||
//public object CallMetaData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true when this call is any status other than
|
||||
/// Unknown, Disconnected, Disconnecting
|
||||
/// </summary>
|
||||
[JsonProperty("isActiveCall")]
|
||||
[JsonProperty("isActiveCall", NullValueHandling = NullValueHandling.Ignore)]
|
||||
public bool IsActiveCall
|
||||
{
|
||||
get
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
{
|
||||
public interface IHasCallHold
|
||||
{
|
||||
/// <summary>
|
||||
/// Put the specified call on hold
|
||||
/// </summary>
|
||||
/// <param name="activeCall"></param>
|
||||
void HoldCall(CodecActiveCallItem activeCall);
|
||||
|
||||
/// <summary>
|
||||
/// Resume the specified call
|
||||
/// </summary>
|
||||
/// <param name="activeCall"></param>
|
||||
void ResumeCall(CodecActiveCallItem activeCall);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a device that has Do Not Disturb mode capability
|
||||
/// </summary>
|
||||
public interface IHasDoNotDisturbMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Indictes whether Do Not Disturb mode is on (Activated)
|
||||
/// </summary>
|
||||
BoolFeedback DoNotDisturbModeIsOnFeedback { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Activates Do Not Disturb mode
|
||||
/// </summary>
|
||||
void ActivateDoNotDisturbMode();
|
||||
|
||||
/// <summary>
|
||||
/// Deactivates Do Not Disturb mode
|
||||
/// </summary>
|
||||
void DeactivateDoNotDisturbMode();
|
||||
|
||||
/// <summary>
|
||||
/// Toggles Do Not Disturb mode
|
||||
/// </summary>
|
||||
void ToggleDoNotDisturbMode();
|
||||
}
|
||||
|
||||
public interface IHasDoNotDisturbModeWithTimeout : IHasDoNotDisturbMode
|
||||
{
|
||||
/// <summary>
|
||||
/// Activates Do Not Disturb mode with a timeout
|
||||
/// </summary>
|
||||
/// <param name="timeout"></param>
|
||||
void ActivateDoNotDisturbMode(int timeout);
|
||||
}
|
||||
}
|
||||
@@ -23,9 +23,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
public enum eCodecOccurrenceType
|
||||
{
|
||||
Unknown = 0,
|
||||
Placed,
|
||||
Received,
|
||||
NoAnswer
|
||||
Placed = 1,
|
||||
Received = 2,
|
||||
NoAnswer = 3,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -65,10 +65,12 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the contents of the directory
|
||||
/// We don't want to serialize this for messages to MobileControl. MC can combine Contacts and Folders to get the same data
|
||||
/// </summary>
|
||||
[JsonProperty("directoryResults")]
|
||||
[JsonIgnore]
|
||||
public List<DirectoryItem> CurrentDirectoryResults { get; private set; }
|
||||
|
||||
[JsonProperty("contacts")]
|
||||
public List<DirectoryItem> Contacts
|
||||
{
|
||||
get
|
||||
@@ -77,6 +79,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
}
|
||||
}
|
||||
|
||||
[JsonProperty("folders")]
|
||||
public List<DirectoryItem> Folders
|
||||
{
|
||||
get
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||
WarmupTime = 10000;
|
||||
CooldownTime = 8000;
|
||||
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, StatusGet);
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 2000, 120000, 300000, StatusGet, true);
|
||||
DeviceManager.AddDevice(CommunicationMonitor);
|
||||
|
||||
VolumeIncrementer = new ActionIncrementer(655, 0, 65535, 800, 80,
|
||||
|
||||
@@ -108,6 +108,8 @@
|
||||
<Compile Include="Codec\eCodecCallStatus.cs" />
|
||||
<Compile Include="Codec\eMeetingPrivacy.cs" />
|
||||
<Compile Include="Codec\iCodecAudio.cs" />
|
||||
<Compile Include="Codec\IHasCallHold.cs" />
|
||||
<Compile Include="Codec\IHasDoNotDisturb.cs" />
|
||||
<Compile Include="Codec\IHasExternalSourceSwitching.cs" />
|
||||
<Compile Include="ImageProcessors\TVOneCorio.cs" />
|
||||
<Compile Include="ImageProcessors\TVOneCorioPropertiesConfig.cs" />
|
||||
@@ -117,15 +119,20 @@
|
||||
<Compile Include="ImageProcessors\AnalogWay\AnalogWayLiveCorePropertiesConfig.cs" />
|
||||
<Compile Include="SoftCodec\BlueJeansPc.cs" />
|
||||
<Compile Include="VideoCodec\CiscoCodec\CiscoCamera.cs" />
|
||||
<Compile Include="VideoCodec\CiscoCodec\CiscoCodecJoinMap.cs" />
|
||||
<Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" />
|
||||
<Compile Include="Cameras\CameraControl.cs" />
|
||||
<Compile Include="Display\PanasonicThDisplay.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasMeetingInfo.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasMeetingLock.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasMeetingRecording.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasParticipants.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasPresentationOnlyMeeting.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasSelfviewPosition.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasSelfviewSize.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasStandbyMode.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IHasStartMeeting.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\IJoinCalls.cs" />
|
||||
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
|
||||
<Compile Include="Codec\iHasCallFavorites.cs" />
|
||||
<Compile Include="Codec\iHasCallHistory.cs" />
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
public class AppleTV : EssentialsBridgeableDevice, IDPad, ITransport, IUiDisplayInfo, IRoutingOutputs
|
||||
{
|
||||
public IrOutputPortController IrPort { get; private set; }
|
||||
public const string StandardDriverName = "Apple AppleTV-v2.ir";
|
||||
public const string StandardDriverName = "Apple_AppleTV_4th_Gen_Essentials.ir";
|
||||
public uint DisplayUiType { get { return DisplayUiConstants.TypeAppleTv; } }
|
||||
|
||||
public AppleTV(string key, string name, IrOutputPortController portCont)
|
||||
|
||||
@@ -41,12 +41,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
public void PanLeft()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Call FarEndControl Camera Move Value: Left CallId: {0}", CallId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: Left CallId: {0}", CallId));
|
||||
}
|
||||
|
||||
public void PanRight()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Call FarEndControl Camera Move Value: Right CallId: {0}", CallId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: Right CallId: {0}", CallId));
|
||||
}
|
||||
|
||||
public void PanStop()
|
||||
@@ -60,12 +60,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
public void TiltDown()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Call FarEndControl Camera Move Value: Down CallId: {0}", CallId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: Down CallId: {0}", CallId));
|
||||
}
|
||||
|
||||
public void TiltUp()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Call FarEndControl Camera Move Value: Up CallId: {0}", CallId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: Up CallId: {0}", CallId));
|
||||
}
|
||||
|
||||
public void TiltStop()
|
||||
@@ -79,12 +79,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
public void ZoomIn()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Call FarEndControl Camera Move Value: ZoomIn CallId: {0}", CallId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: ZoomIn CallId: {0}", CallId));
|
||||
}
|
||||
|
||||
public void ZoomOut()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Call FarEndControl Camera Move Value: ZoomOut CallId: {0}", CallId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Move Value: ZoomOut CallId: {0}", CallId));
|
||||
}
|
||||
|
||||
public void ZoomStop()
|
||||
@@ -97,7 +97,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
|
||||
void Stop()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Call FarEndControl Camera Stop CallId: {0}", CallId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Call FarEndControl Camera Stop CallId: {0}", CallId));
|
||||
}
|
||||
|
||||
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||
@@ -116,7 +116,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
/// <summary>
|
||||
/// The ID of the camera on the codec
|
||||
/// </summary>
|
||||
protected uint CameraId { get; private set; }
|
||||
public uint CameraId { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Valid range 1-15
|
||||
@@ -202,7 +202,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (!isMoving)
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Left PanSpeed: {1}", CameraId, PanSpeed));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Left PanSpeed: {1}", CameraId, PanSpeed));
|
||||
isPanning = true;
|
||||
}
|
||||
}
|
||||
@@ -211,14 +211,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (!isMoving)
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Right PanSpeed: {1}", CameraId, PanSpeed));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Right PanSpeed: {1}", CameraId, PanSpeed));
|
||||
isPanning = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void PanStop()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Stop", CameraId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Pan: Stop", CameraId));
|
||||
isPanning = false;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (!isMoving)
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Down TiltSpeed: {1}", CameraId, TiltSpeed));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Down TiltSpeed: {1}", CameraId, TiltSpeed));
|
||||
isTilting = true;
|
||||
}
|
||||
}
|
||||
@@ -241,14 +241,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (!isMoving)
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Up TiltSpeed: {1}", CameraId, TiltSpeed));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Up TiltSpeed: {1}", CameraId, TiltSpeed));
|
||||
isTilting = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void TiltStop()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Stop", CameraId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Tilt: Stop", CameraId));
|
||||
isTilting = false;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (!isMoving)
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: In ZoomSpeed: {1}", CameraId, ZoomSpeed));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: In ZoomSpeed: {1}", CameraId, ZoomSpeed));
|
||||
isZooming = true;
|
||||
}
|
||||
}
|
||||
@@ -269,14 +269,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (!isMoving)
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: Out ZoomSpeed: {1}", CameraId, ZoomSpeed));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: Out ZoomSpeed: {1}", CameraId, ZoomSpeed));
|
||||
isZooming = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void ZoomStop()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: Stop", CameraId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Zoom: Stop", CameraId));
|
||||
isZooming = false;
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (!isMoving)
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Near", CameraId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Near", CameraId));
|
||||
isFocusing = true;
|
||||
}
|
||||
}
|
||||
@@ -297,20 +297,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
if (!isMoving)
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Far", CameraId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Far", CameraId));
|
||||
isFocusing = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void FocusStop()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Stop", CameraId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera Ramp CameraId: {0} Focus: Stop", CameraId));
|
||||
isFocusing = false;
|
||||
}
|
||||
|
||||
public void TriggerAutoFocus()
|
||||
{
|
||||
ParentCodec.SendText(string.Format("xCommand Camera TriggerAutofocus CameraId: {0}", CameraId));
|
||||
ParentCodec.EnqueueCommand(string.Format("xCommand Camera TriggerAutofocus CameraId: {0}", CameraId));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
using System;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Bridges.JoinMaps;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
{
|
||||
public class CiscoCodecJoinMap : VideoCodecControllerJoinMap
|
||||
{
|
||||
#region Digital
|
||||
|
||||
[JoinName("PresentationLocalOnly")]
|
||||
public JoinDataComplete PresentationLocalOnly = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 205,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Presentation Local Only Feedback",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("PresentationLocalRemote")]
|
||||
public JoinDataComplete PresentationLocalRemote = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 206,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Presentation Local and Remote Feedback",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("ActivateDoNotDisturbMode")]
|
||||
public JoinDataComplete ActivateDoNotDisturbMode = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 241,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Activates Do Not Disturb Mode. FB High if active.",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("DeactivateDoNotDisturbMode")]
|
||||
public JoinDataComplete DeactivateDoNotDisturbMode = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 242,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Deactivates Do Not Disturb Mode. FB High if deactivated.",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("ToggleDoNotDisturbMode")]
|
||||
public JoinDataComplete ToggleDoNotDisturbMode = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 243,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Toggles Do Not Disturb Mode.",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("ActivateStandby")]
|
||||
public JoinDataComplete ActivateStandby = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 246,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Activates Standby Mode. FB High if active.",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("DeactivateStandby")]
|
||||
public JoinDataComplete DeactivateStandby = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 247,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Deactivates Standby Mode. FB High if deactivated.",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("ActivateHalfWakeMode")]
|
||||
public JoinDataComplete ActivateHalfWakeMode = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 248,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Activates Half Wake Mode. FB High if active.",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
[JoinName("EnteringStandbyMode")]
|
||||
public JoinDataComplete EnteringStandbyMode = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 249,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "High to indicate that the codec is entering standby mode",
|
||||
JoinCapabilities = eJoinCapabilities.ToSIMPL,
|
||||
JoinType = eJoinType.Digital
|
||||
});
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Analog
|
||||
|
||||
[JoinName("RingtoneVolume")]
|
||||
public JoinDataComplete RingtoneVolume = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 21,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Ringtone volume set/FB. Valid values are 0 - 100 in increments of 5 (5, 10, 15, 20, etc.)",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
[JoinName("PresentationSource")]
|
||||
public JoinDataComplete PresentationSource = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 201,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Presentation set/FB. Valid values are 0 - 6 depending on the codec model.",
|
||||
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
|
||||
JoinType = eJoinType.Analog
|
||||
});
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Serials
|
||||
|
||||
[JoinName("CommandToDevice")]
|
||||
public JoinDataComplete CommandToDevice = new JoinDataComplete(
|
||||
new JoinData
|
||||
{
|
||||
JoinNumber = 5,
|
||||
JoinSpan = 1
|
||||
},
|
||||
new JoinMetadata
|
||||
{
|
||||
Description = "Sends a serial command to the device. Do not include the delimiter, it will be added automatically.",
|
||||
JoinCapabilities = eJoinCapabilities.FromSIMPL,
|
||||
JoinType = eJoinType.Serial
|
||||
});
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
public CiscoCodecJoinMap(uint joinStart)
|
||||
: base(joinStart, typeof(CiscoCodecJoinMap))
|
||||
{
|
||||
}
|
||||
|
||||
public CiscoCodecJoinMap(uint joinStart, Type type)
|
||||
: base(joinStart, type)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -50,8 +50,16 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
public uint PhonebookResultsLimit { get; set; }
|
||||
|
||||
[JsonProperty("UiBranding")]
|
||||
public BrandingLogoProperties UiBranding { get; set; }
|
||||
public BrandingLogoProperties UiBranding { get; set; }
|
||||
|
||||
[JsonProperty("cameraInfo")]
|
||||
public List<CameraInfo> CameraInfo { get; set; }
|
||||
|
||||
|
||||
public CiscoSparkCodecPropertiesConfig()
|
||||
{
|
||||
CameraInfo = new List<CameraInfo>();
|
||||
}
|
||||
}
|
||||
|
||||
public class SharingProperties
|
||||
@@ -68,4 +76,14 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
[JsonProperty("brandingUrl")]
|
||||
public string BrandingUrl { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes configuration information for the near end cameras
|
||||
/// </summary>
|
||||
public class CameraInfo
|
||||
{
|
||||
public int CameraNumber { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int SourceId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
void CodecRoomPresetSelect(int preset);
|
||||
|
||||
void CodecRoomPresetStore(int preset, string description);
|
||||
|
||||
void SelectFarEndPreset(int preset);
|
||||
}
|
||||
|
||||
public static class RoomPresets
|
||||
|
||||
@@ -112,16 +112,46 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public string Value { get; set; }
|
||||
}
|
||||
|
||||
public class RingVolume
|
||||
public class RingVolume : ValueProperty
|
||||
{
|
||||
public string valueSpaceRef { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
string _Value;
|
||||
|
||||
/// <summary>
|
||||
/// Sets Value and triggers the action when set
|
||||
/// </summary>
|
||||
public string Value
|
||||
{
|
||||
get
|
||||
{
|
||||
return _Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
_Value = value;
|
||||
OnValueChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public int Volume
|
||||
{
|
||||
get
|
||||
{
|
||||
return Int32.Parse(_Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SoundsAndAlerts
|
||||
{
|
||||
public RingTone RingTone { get; set; }
|
||||
public RingVolume RingVolume { get; set; }
|
||||
|
||||
public SoundsAndAlerts()
|
||||
{
|
||||
RingVolume = new RingVolume();
|
||||
}
|
||||
}
|
||||
|
||||
public class Audio
|
||||
@@ -131,6 +161,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public Microphones Microphones { get; set; }
|
||||
public Output Output { get; set; }
|
||||
public SoundsAndAlerts SoundsAndAlerts { get; set; }
|
||||
|
||||
|
||||
public Audio()
|
||||
{
|
||||
SoundsAndAlerts = new SoundsAndAlerts();
|
||||
}
|
||||
}
|
||||
|
||||
public class DefaultMode
|
||||
@@ -340,6 +376,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public Delay Delay { get; set; }
|
||||
public Mode9 Mode { get; set; }
|
||||
public Mute2 Mute { get; set; }
|
||||
|
||||
public AutoAnswer()
|
||||
{
|
||||
Mode = new Mode9();
|
||||
Delay = new Delay();
|
||||
Mute = new Mute2();
|
||||
}
|
||||
}
|
||||
|
||||
public class Protocol
|
||||
@@ -440,6 +483,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public MaxTotalTransmitCallRate MaxTotalTransmitCallRate { get; set; }
|
||||
public MaxTransmitCallRate MaxTransmitCallRate { get; set; }
|
||||
public MultiStream MultiStream { get; set; }
|
||||
|
||||
public Conference()
|
||||
{
|
||||
AutoAnswer = new AutoAnswer();
|
||||
}
|
||||
}
|
||||
|
||||
public class LoginName
|
||||
@@ -690,6 +738,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public Assignment Assignment { get; set; }
|
||||
public Gateway Gateway { get; set; }
|
||||
public SubnetMask SubnetMask { get; set; }
|
||||
|
||||
public IPv4()
|
||||
{
|
||||
Address = new Address4();
|
||||
}
|
||||
}
|
||||
|
||||
public class Address5
|
||||
@@ -841,6 +894,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public RemoteAccess RemoteAccess { get; set; }
|
||||
public Speed Speed { get; set; }
|
||||
public VLAN VLAN { get; set; }
|
||||
|
||||
public Network()
|
||||
{
|
||||
IPv4 = new IPv4();
|
||||
}
|
||||
}
|
||||
|
||||
public class Mode19
|
||||
@@ -1797,11 +1855,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
|
||||
public UserInterface UserInterface { get; set; }
|
||||
public UserManagement UserManagement { get; set; }
|
||||
public Video2 Video { get; set; }
|
||||
|
||||
public Configuration()
|
||||
{
|
||||
Audio = new Audio();
|
||||
Conference = new Conference();
|
||||
Network = new List<Network>();
|
||||
}
|
||||
}
|
||||
|
||||
public class RootObject
|
||||
{
|
||||
public Configuration Configuration { get; set; }
|
||||
|
||||
public RootObject()
|
||||
{
|
||||
Configuration = new Configuration();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user