Compare commits

...

149 Commits
1.6.3 ... 1.6.5

Author SHA1 Message Date
Andrew Welker
f22bf60eb6 Merge pull request #461 from PepperDash/release/1.6.5
Release/1.6.5 Main
2020-10-22 13:31:25 -06:00
Andrew Welker
d1b99fdda3 Merge pull request #460 from PepperDash/feature/i18n-addition
Add lists for optional things
2020-10-22 11:26:52 -06:00
Andrew Welker
e1a4cfca4e Add lists for additional values 2020-10-22 11:23:32 -06:00
Andrew Welker
8a43824f3d Merge pull request #459 from PepperDash/hotfix/dm-rx-DMPS
Multiple fixes for DMPS and Essentials
2020-10-21 16:15:09 -06:00
Andrew Welker
b948fc7264 Merge pull request #458 from PepperDash/feature/IDspPreset
Add IDspPreset Interface
2020-10-21 16:14:54 -06:00
Trevor Payne
d9f891dfb1 removed IHasDspPreset from Tesira Classes 2020-10-21 16:59:45 -05:00
Trevor Payne
a9524bcc33 Updated Interface to be more genericized 2020-10-21 16:30:48 -05:00
Andrew Welker
4b537cb79d Fixing some things for Essentials routing and linking to bridge 2020-10-21 13:00:12 -06:00
Trevor Payne
1484c26434 added IDspPreset Interface
Implemented IDspPreset Interface on internal Tesira DSP

Resolves #457
2020-10-21 12:55:41 -05:00
Andrew Welker
36e8dc9fa5 Add check for NameSig Support 2020-10-21 11:53:52 -06:00
Andrew Welker
8feb7037aa Change cast to ACTUAL Dmps3Dmoutput 2020-10-21 11:53:32 -06:00
Andrew Welker
d8863142c7 Refactor CustomActivate & LinkToApi 2020-10-21 10:21:40 -06:00
Andrew Welker
061109c901 add method to create a rmc for DMPS chassis 2020-10-21 10:05:19 -06:00
Andrew Welker
f95b50c99d Merge pull request #445 from PepperDash/feature/I18N-Support
Add interfaces for I18N support
2020-10-20 09:56:27 -06:00
Andrew Welker
def5cc273c Merge branch 'development' into feature/I18N-Support 2020-10-19 17:04:39 -06:00
Andrew Welker
e01d2c9569 Merge pull request #450 from PepperDash/bugfix/fix-docker-image
Update docker.yml
2020-10-19 17:04:11 -06:00
Andrew Welker
415dbbb195 Update docker.yml 2020-10-16 08:16:47 -06:00
Andrew Welker
765d90214d Merge branch 'feature/I18N-Support' of https://github.com/PepperDash/Essentials into feature/I18N-Support 2020-10-15 17:00:01 -06:00
Andrew Welker
36fd1dcda9 file name change 2020-10-15 16:59:39 -06:00
Andrew Welker
812b9b731b Merge branch 'development' into feature/I18N-Support 2020-10-15 16:59:20 -06:00
Andrew Welker
e80a68485d Merge pull request #449 from PepperDash/bugfix/zoom-room-incomingcall
Fix for Incoming Call issues
2020-10-15 16:58:37 -06:00
Andrew Welker
535f4ccb8e Merge branch 'development' into bugfix/zoom-room-incomingcall 2020-10-15 16:39:51 -06:00
Andrew Welker
7bbdf43452 add full implementation for LanguageLabel 2020-10-15 16:37:41 -06:00
Andrew Welker
59881d6b3b fix for unanticipated messages from Zoom 2020-10-15 16:14:27 -06:00
Andrew Welker
085e198409 fix for incoming call stuff 2020-10-15 13:34:47 -06:00
Neil Dorin
81f27fcbde Merge branch 'development' into feature/I18N-Support 2020-10-15 12:41:49 -06:00
Neil Dorin
50dae0ef69 Merge pull request #447 from PepperDash/bugfix/card-cage-iteration-fix
Bugfix/card cage iteration fix
2020-10-15 12:41:35 -06:00
Alex Johnson
e0fdefa28e Fix to allow card cage creation loop to continue even if a previous card encountered an issue 2020-10-15 12:36:14 -04:00
Andrew Welker
f6a826505c Merge branch 'development' into feature/I18N-Support 2020-10-13 23:39:12 -06:00
Andrew Welker
68ac506a25 Merge pull request #444 from PepperDash/feature/add-encoding-overload
Add SetString Overload to allow for setting encoding on a sig
2020-10-13 18:11:45 -05:00
Andrew Welker
1150d9e497 add IKeyed to ILanguageLabel to easily get the key 2020-10-13 15:18:31 -06:00
Andrew Welker
633a946f26 Merge branch 'development' into feature/add-encoding-overload 2020-10-13 16:15:04 -05:00
Andrew Welker
8e01455140 Merge pull request #442 from PepperDash/feature/zoom-room-feature-add
Zoom Room Updates & Adds
2020-10-13 16:14:49 -05:00
Andrew Welker
b373ab8708 #443 Add SetString Overload 2020-10-13 14:06:48 -06:00
Andrew Welker
cb752850ff correct interfaces 2020-10-13 13:30:29 -06:00
Andrew Welker
08c929699f #440 Updates for csproj file 2020-10-13 10:29:30 -06:00
Andrew Welker
1862090a89 #440 add interfaces 2020-10-13 09:53:18 -06:00
Alex Johnson
1ea80c3fab Adds phone call ringing status to zoom phone status enum 2020-10-12 12:58:22 -04:00
Andrew Welker
1676f5a956 add phone call logic and commands to Zoom Room 2020-10-08 17:09:59 -06:00
Alex Johnson
cdc9cdbe95 Adds joining meetings 2 and 3 if meetings exist 2020-10-08 15:25:51 -04:00
Alex Johnson
28e8a1fb11 Fixes for selfview feedback. Rearranges order to happen in clockwise motion 2020-10-08 14:40:44 -04:00
Alex Johnson
5f1b92ca62 Adds additional check for if DisablePhonebookAutoDownload is true to CustomActivate method. Fixes issue where layout was not being set properly on sharing end. 2020-10-08 11:43:12 -04:00
Alex Johnson
c58a1874ca Limits max video participant list size to 50 2020-10-07 15:41:04 -04:00
Andrew Welker
f4fb9cd173 add fix for sharing status not updating
add fix for clearing participants list on meeting end
2020-10-07 12:45:05 -06:00
Alex Johnson
ad4a6e9383 Fixes for UpdateCallStatusXSig() method 2020-10-06 16:59:27 -04:00
Andrew Welker
decdaf9f1f lots of updates 2020-10-02 16:58:18 -06:00
Andrew Welker
27382a6be1 various fixes 2020-10-01 14:40:13 -06:00
Andrew Welker
34440af1c5 fix for updating call status when in meeting & call is already connected 2020-10-01 13:25:33 -06:00
Andrew Welker
c0e3da9214 fix for EiscApiAdvanced loading 2020-10-01 12:15:54 -06:00
Andrew Welker
d50ad7345d fix ZoomRoomCamera Timer 2020-10-01 10:37:31 -06:00
Andrew Welker
95016c3ec6 fix camera mute command 2020-10-01 10:07:08 -06:00
Andrew Welker
f8f5c2474c Merge branch 'development' into feature/zoom-room-feature-add 2020-09-30 17:05:17 -06:00
Andrew Welker
b997e9a135 Merge pull request #428 from PepperDash/feature/vc4-eisc
Add VirtualControlEiscClient
2020-09-30 17:01:56 -06:00
Andrew Welker
c7ccac2fe6 fix merge issue 2020-09-30 16:40:58 -06:00
Andrew Welker
05885f568e Merge branch 'development' into feature/zoom-room-feature-add 2020-09-30 16:27:00 -06:00
Andrew Welker
b500b9f6cc Add feedbacks for Camera Auto Mode 2020-09-30 16:26:48 -06:00
Andrew Welker
e784c08f80 Add camera off and auto stuff to Zoom Room 2020-09-30 15:47:32 -06:00
Andrew Welker
45ea5cc875 Merge branch 'development' into feature/vc4-eisc 2020-09-30 14:09:04 -06:00
Andrew Welker
a006698bb2 Merge pull request #433 from PepperDash/feature/add-runtime-ip-info-to-global
Add runtime IP info to global
2020-09-30 14:06:38 -06:00
Andrew Welker
e365944dc3 add config object to stop downloading large phonebooks 2020-09-30 13:55:40 -06:00
Neil Dorin
c33dcb78d0 Merge branch 'development' into feature/add-runtime-ip-info-to-global 2020-09-30 13:21:52 -06:00
Neil Dorin
e48ec3af7c Adds information about ethernet interfaces to Global class 2020-09-30 13:15:23 -06:00
Andrew Welker
4b9d7d1a1f adjust queue size 2020-09-30 11:21:13 -06:00
Andrew Welker
d6133905b2 really fix pepperdash core version 2020-09-30 09:00:56 -06:00
Andrew Welker
741b401d8c fix PepperDash Core version 2020-09-30 08:52:16 -06:00
Jason DeVito
cb661313c2 Fixes for indexing form xsig 2020-09-29 17:21:17 -05:00
Andrew Welker
3c794849bd added a couple of debugging statements 2020-09-29 15:22:32 -06:00
Andrew Welker
753b4e69ee add constructor to CodecScheduleAwareness to chang refresh timer 2020-09-29 15:08:33 -06:00
Andrew Welker
b502007fff Changes to keep from clearing meeting list 2020-09-29 14:41:55 -06:00
Andrew Welker
1e6d65fe53 changing some things to check for updates to meetings list 2020-09-29 13:24:53 -06:00
Andrew Welker
72515a79ca fixes and additions 2020-09-29 12:08:29 -06:00
Andrew Welker
b286008403 fix signal direction 2020-09-28 19:17:09 -06:00
Andrew Welker
c8e3f752db added properties to support dynamic time before meeting start for warnings 2020-09-28 19:15:39 -06:00
Andrew Welker
33c3822b7c fix join type for hook state 2020-09-28 14:53:02 -06:00
Andrew Welker
97701ef3c4 add privacy & volume controls to VC Join Map 2020-09-25 16:00:17 -06:00
Andrew Welker
d2eadcd2f5 Use InitialParametersClass.RoomId instead of Config 2020-09-25 10:42:41 -06:00
Andrew Welker
6589f8c4f4 Merge branch 'development' into feature/zoom-room-feature-add 2020-09-25 08:57:29 -06:00
Andrew Welker
13dabc09c7 Merge branch 'development' into feature/vc4-eisc 2020-09-25 08:53:39 -06:00
Andrew Welker
eb80f38813 Merge pull request #427 from PepperDash/feature/add-qr-code-cisco-touch10
Add MC QR Code display to Touch10 and OSD
2020-09-25 08:49:44 -06:00
Andrew Welker
0fc6a73b30 adjust factory and constructor for EiscApiAdvanced
Keep SystemMonitor from getting instantiated
if we're on a VC-4 instance
2020-09-25 08:47:31 -06:00
Andrew Welker
aa38b13adf add online status link 2020-09-24 15:52:40 -06:00
Andrew Welker
6a79f41367 Add Online updates. 2020-09-23 16:10:39 -06:00
Andrew Welker
88263ccc77 finished up with some things 2020-09-23 15:54:11 -06:00
Andrew Welker
9d15704b78 cleaning some things up and getting more pieces working 2020-09-23 08:51:44 -06:00
Andrew Welker
832060e8ad Lots of changes
* Copied join map from Mobile Control
* Started implementing for JoinMapBase
* Made some changes and improvements to ZoomRoom for handling Directory stuff
2020-09-21 18:59:17 -06:00
Andrew Welker
5d5652907b Started linking classes to the API 2020-09-18 16:28:04 -06:00
Andrew Welker
477d7957e3 Working through join map stuff 2020-09-17 11:03:29 -06:00
Andrew Welker
41b39a5d3b remove duplicate using statement 2020-09-17 11:03:14 -06:00
Andrew Welker
6972b544ec Add IBridgeAdvanced to VideoCodecBase 2020-09-17 11:03:04 -06:00
Andrew Welker
1bd9eca806 Update to PepperDash Core 1.0.42 2020-09-17 11:02:36 -06:00
Andrew Welker
a203eef9a6 clean up and organize 2020-09-16 16:33:16 -06:00
Andrew Welker
f583b84951 Add VideoCodecControllerJoinMap 2020-09-16 16:32:03 -06:00
Andrew Welker
8f319a4405 making changes for adding VC4 bridge 2020-09-16 09:55:58 -06:00
Andrew Welker
862a5ebd12 Added logic to set messages for instructions 2020-09-09 10:54:01 -06:00
Andrew Welker
cb89bd3908 Changed debug levels 2020-09-09 10:29:53 -06:00
Andrew Welker
54dd424b01 add some debug statements 2020-09-09 09:09:10 -06:00
Andrew Welker
b6b88086f3 Add logic to init branding 2020-09-09 09:09:10 -06:00
Andrew Welker
b2ec99e663 add logic for branding 2020-09-09 09:09:10 -06:00
Andrew Welker
74c101628b Add Config for branding 2020-09-09 09:09:10 -06:00
Andrew Welker
ea28b8afa4 add IHasBranding Interface 2020-09-09 09:09:10 -06:00
Andrew Welker
f5d7c90be1 add config for branding 2020-09-09 09:09:10 -06:00
Andrew Welker
62b6c5193a Merge pull request #411 from PepperDash/feature/LocalConfig-Notice
Feature/local config notice
2020-09-09 08:52:03 -06:00
Trevor Payne
6d9ea8a13c Made the LocalConfig notice cleaner
Resolves #399
2020-09-09 09:34:52 -05:00
Trevor Payne
9abac555c3 Resolves #399
Added obvious ascii art and a friendly message whenever a local config is present.
2020-09-03 23:42:48 -05:00
Andrew Welker
f742f850eb Merge pull request #410 from PepperDash/feature/remove-pdCore-submodule
Remove PepperDash Core as submodule
2020-09-03 17:03:25 -06:00
Andrew Welker
83ca24b32a Merge branch 'development' into feature/remove-pdCore-submodule 2020-09-03 16:45:29 -06:00
Andrew Welker
484e7c2102 removed files for submodule 2020-09-03 16:43:48 -06:00
Andrew Welker
f416e12dac remove PepperDashCore-Builds submodule 2020-09-03 16:40:12 -06:00
Andrew Welker
1a140ab5c8 Merge pull request #409 from PepperDash/feature/add-inputSlotSupportsHdcp2-object-to-example-config
Add input slot supports hdcp2 object to example config
2020-09-03 16:38:10 -06:00
Neil Dorin
006c5f8655 Updates example config to include inputSlotSupportsHdcp2 object 2020-09-03 15:17:00 -06:00
Andrew Welker
b0e2985f5e Merge pull request #408 from PepperDash/feature/generic-ir-device
Add GenericIrController device
2020-09-03 09:55:35 -06:00
Andrew Welker
cbb57411a0 Merge branch 'development' into feature/generic-ir-device 2020-09-03 09:35:41 -06:00
Andrew Welker
28c1172db3 Merge pull request #396 from PepperDash/feature/add-queues
Add Generic queue and implementations
2020-09-03 09:30:06 -06:00
Nick Genovese
e708946f4c Merge branch 'development' into feature/add-queues 2020-09-03 11:05:40 -04:00
Nick Genovese
b9fff95215 added IQueueMessage and two implementations; GenericQueue now accepts type IQueueMessage 2020-09-03 10:57:06 -04:00
Andrew Welker
7cd3a143a0 Adds Essentials core as a project reference 2020-09-03 08:00:16 -06:00
Andrew Welker
7248e90762 add property to get IR Commands for Essentials 2020-09-03 00:01:25 -06:00
Andrew Welker
ceef883ad8 fixed some null refs and got join map being created correctly 2020-09-02 23:59:26 -06:00
Andrew Welker
8a98924ad7 Use joinData methods to set offset to get joins in the right spot 2020-09-02 21:03:24 -06:00
Andrew Welker
9526b9b6fe added feedback for IrOutputController and added join map 2020-09-02 17:18:08 -06:00
Andrew Welker
741f694733 add genericIrController class 2020-09-02 16:55:25 -06:00
Andrew Welker
8f2ef9082b Merge pull request #405 from PepperDash/hotfix/unable-to-use-hightest-IR-port-number
Hotfix/unable to use hightest ir port number
2020-09-02 18:54:32 -04:00
Andrew Welker
e7dcc088d6 Merge branch 'development' into hotfix/unable-to-use-hightest-IR-port-number 2020-09-01 12:59:17 -04:00
Neil Dorin
f036c3f1cc Merge pull request #401 from PepperDash/hotfix/unable-to-use-hightest-IR-port-number
Multiple Fixes for IR
2020-09-01 10:56:13 -06:00
Andrew Welker
d3c64be229 Merge branch 'main' into hotfix/unable-to-use-hightest-IR-port-number 2020-09-01 11:56:58 -04:00
Andrew Welker
5404309193 Merge pull request #402 from PepperDash/hotfix/make-screensaver-clear-fully-on-incoming-call
Clear MC screensaver completely on incoming call
2020-09-01 11:56:45 -04:00
Andrew Welker
635b4d2432 called the method to print expected IR values 2020-09-01 09:27:36 -06:00
Neil Dorin
3fc9ff3abf fixes minor issue with camera preset hold actions 2020-08-31 16:23:25 -06:00
Neil Dorin
41833c8aad closes #400 2020-08-31 16:11:10 -06:00
Neil Dorin
fdf9778f46 Fixes issue where not all screensaver subpage visibility joins were being set low on incoming call 2020-08-31 16:02:39 -06:00
Andrew Welker
1e676f5a6b Merge branch 'main' into hotfix/unable-to-use-hightest-IR-port-number 2020-08-31 15:43:10 -06:00
Andrew Welker
0af944176a update .gitignore for nuget 2020-08-31 15:31:41 -06:00
Andrew Welker
6fe13b6a92 Add methods to print IR functions 2020-08-31 14:48:06 -06:00
Nick Genovese
4f562e0d8e Merge branch 'development' into feature/add-queues 2020-08-31 15:39:26 -04:00
Nick Genovese
fdae50a972 Adds a generic queue and string/byte implementations. Also adds a class that processes string responses from a IBasicCommunication or Gather 2020-08-31 15:38:06 -04:00
Andrew Welker
277886b092 add property to get IrFile commands 2020-08-31 10:23:51 -06:00
Andrew Welker
75c407ca01 Merge pull request #395 from PepperDash/feature/Expose-HRx50-Buttons
Exposes buttons for HR-xx0 remotes to Essentials
2020-08-29 16:18:30 -04:00
Andrew Welker
2b40c5a55c Merge branch 'development' into feature/Expose-HRx50-Buttons 2020-08-29 15:10:17 -04:00
Trevor Payne
cffe55428a Exposes buttons for HR-xx0 remotes to essentials
Resolves #394
2020-08-28 14:57:09 -05:00
Andrew Welker
f51708e01d Merge pull request #393 from PepperDash/hotfix/add-vc-camera-control-to-sg-ui
Hotfix/add vc camera control to sg ui
2020-08-28 14:58:09 -04:00
Andrew Welker
6194948259 Merge pull request #391 from PepperDash/hotfix/fix-joinedsiginterlock-nullref
Hotfix/fix joinedsiginterlock nullref
2020-08-27 20:51:18 -04:00
Andrew Welker
2373d0ace7 Merge pull request #390 from PepperDash/hotfix/fix-hdcp-issues-on-specific-inputcard-types
Hotfix/fix hdcp issues on specific inputcard types
2020-08-27 19:16:21 -04:00
Andrew Welker
726f2083db Merge pull request #385 from PepperDash/release/1.6.2
Release/1.6.2
2020-08-26 18:48:39 -04:00
Andrew Welker
468aff6e3f move load file to end of postactivation action
and change to use the IrPortController's loadFile method
add printing of available IR Commands in the loaded file.
2020-08-18 16:34:24 -06:00
Andrew Welker
a30062db71 add static class for IR Command values and use them 2020-08-18 14:46:13 -06:00
Neil Dorin
d0a2ccd7d6 Fixes #362 by addressing issues with Loading IR driver as post activation action 2020-08-11 22:59:26 -06:00
Neil Dorin
84099b1d0b Fixes #362 and #363 issue with duplicate device key when adding an IRPortController 2020-08-10 12:08:06 -06:00
Neil Dorin
1b7dd2dd2a Addse debug statements for RunRouteAction 2020-08-10 12:01:04 -06:00
Neil Dorin
e5d4ba48fb Updates conditional check to allow for the highes numbered IR port to be used. 2020-08-10 10:11:54 -06:00
64 changed files with 6479 additions and 2465 deletions

View File

@@ -60,7 +60,7 @@ jobs:
- name: Build Solution
shell: powershell
run: |
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder:v1.4.1 c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
# Zip up the output files as needed
- name: Zip Build Output
shell: powershell

3
.gitmodules vendored
View File

@@ -1,6 +1,3 @@
[submodule "essentials-framework/pepperdashcore-builds"]
path = essentials-framework/pepperdashcore-builds
url = https://github.com/ndorin/PepperDashCore-Builds.git
[submodule "Essentials-Template-UI"]
path = Essentials-Template-UI
url = https://github.com/PepperDash/Essentials-Template-UI.git

View File

@@ -327,7 +327,11 @@ namespace PepperDash.Essentials
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
// Add global System Monitor device
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
{
DeviceManager.AddDevice(
new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
}
foreach (var devConf in ConfigReader.ConfigObject.Devices)
{

View File

@@ -225,6 +225,14 @@
"2": "Output 2",
"3": "Output 3",
"4": "Output 4"
},
"inputSlotSupportsHdcp2":{
"1": "false",
"2": "false",
"3": "false",
"4": "false",
"5": "false",
"6": "false"
}
}
},

View File

@@ -75,10 +75,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
</Reference>
<Reference Include="PepperDash_Essentials_DM, Version=1.0.0.19343, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\essentials-framework\Essentials DM\Essentials_DM\bin\PepperDash_Essentials_DM.dll</HintPath>
</Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
@@ -215,6 +211,10 @@
<Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project>
<Name>Essentials Devices Common</Name>
</ProjectReference>
<ProjectReference Include="..\essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj">
<Project>{9199CE8A-0C9F-4952-8672-3EED798B284F}</Project>
<Name>PepperDash_Essentials_DM</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<ProjectExtensions>

View File

@@ -13,6 +13,7 @@ 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
{
@@ -313,7 +314,7 @@ namespace PepperDash.Essentials
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
VideoCodec.IsReadyChange += (o, a) => this.SetCodecExternalSources();
VideoCodec.IsReadyChange += (o, a) => { this.SetCodecExternalSources(); SetCodecBranding(); };
if (AudioCodec != null)
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
@@ -424,10 +425,14 @@ namespace PepperDash.Essentials
{
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>
@@ -699,29 +704,36 @@ namespace PepperDash.Essentials
{
return;
}
else
{
string codecTieLine = "";
codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort;
videoCodecWithExternalSwitching.ClearExternalSources();
videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
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;
string codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort;
videoCodecWithExternalSwitching.ClearExternalSources();
videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
{
foreach (var kvp in srcList)
{
var srcConfig = kvp.Value;
videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
{
videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
}
}
}
}
}
}
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

View File

@@ -272,6 +272,20 @@ namespace PepperDash.Essentials
public const uint VCCameraPreset3 = 1283;
/// <summary>
/// 1291
/// </summary>
public const uint VCCameraPreset1Visible = 1291;
/// <summary>
/// 1292
/// </summary>
public const uint VCCameraPreset2Visible = 1292;
/// <summary>
/// 1293
/// </summary>
public const uint VCCameraPreset3Visible = 1293;
// Letter joins start at 2921;
//******************************************************

View File

@@ -1,80 +1,81 @@
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.UI;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials
{
/// <summary>
///
/// </summary>
public class EssentialsPanelMainInterfaceDriver : PanelDriverBase
{
CTimer InactivityTimer;
/// <summary>
/// Assign the appropriate A/V driver.
/// Want to keep the AvDriver alive, because it may hold states
/// </summary>
public IAVDriver AvDriver { get; set; }
public EssentialsHeaderDriver HeaderDriver { get; set; }
public EssentialsEnvironmentDriver EnvironmentDriver { get; set; }
public PanelDriverBase CurrentChildDriver { get; private set; }
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.UI;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials
{
/// <summary>
///
/// </summary>
public class EssentialsPanelMainInterfaceDriver : PanelDriverBase, IHasScreenSaverController
{
CTimer InactivityTimer;
/// <summary>
/// Assign the appropriate A/V driver.
/// Want to keep the AvDriver alive, because it may hold states
/// </summary>
public IAVDriver AvDriver { get; set;}
public EssentialsHeaderDriver HeaderDriver { get; set; }
public EssentialsEnvironmentDriver EnvironmentDriver { get; set; }
public PanelDriverBase CurrentChildDriver { get; private set; }
public ScreenSaverController ScreenSaverController { get; set; }
private readonly long _timeoutMs;
CrestronTouchpanelPropertiesConfig Config;
/// <summary>
/// The main interlock for popups
/// </summary>
//public JoinedSigInterlock PopupInterlock { get; private set; }
public EssentialsPanelMainInterfaceDriver(BasicTriListWithSmartObject trilist,
CrestronTouchpanelPropertiesConfig config)
: base(trilist)
{
Config = config;
_timeoutMs = Config.ScreenSaverTimeoutMin * 60 * 1000;
var tsx52or60 = trilist as Tswx52ButtonVoiceControl;
private readonly long _timeoutMs;
CrestronTouchpanelPropertiesConfig Config;
/// <summary>
/// The main interlock for popups
/// </summary>
//public JoinedSigInterlock PopupInterlock { get; private set; }
public EssentialsPanelMainInterfaceDriver(BasicTriListWithSmartObject trilist,
CrestronTouchpanelPropertiesConfig config)
: base(trilist)
{
Config = config;
_timeoutMs = Config.ScreenSaverTimeoutMin * 60 * 1000;
var tsx52or60 = trilist as Tswx52ButtonVoiceControl;
if (tsx52or60 != null)
{
tsx52or60.ExtenderTouchDetectionReservedSigs.Use();
tsx52or60.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange;
tsx52or60.ExtenderTouchDetectionReservedSigs.Time.UShortValue = 1;
ManageInactivityTimer();
}
else
{
var tswx70 = trilist as TswX70Base;
if (tswx70 != null)
}
else
{
var tswx70 = trilist as TswX70Base;
if (tswx70 != null)
{
tswx70.ExtenderTouchDetectionReservedSigs.Use();
tswx70.ExtenderTouchDetectionReservedSigs.DeviceExtenderSigChange += ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange;
tswx70.ExtenderTouchDetectionReservedSigs.Time.UShortValue = 1;
ManageInactivityTimer();
}
}
}
void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args)
{
ManageInactivityTimer();
}
}
}
void ExtenderTouchDetectionReservedSigs_DeviceExtenderSigChange(Crestron.SimplSharpPro.DeviceExtender currentDeviceExtender, Crestron.SimplSharpPro.SigEventArgs args)
{
if (args.Sig.BoolValue)
{
ManageInactivityTimer();
}
}
}
private void ManageInactivityTimer()
@@ -87,46 +88,52 @@ namespace PepperDash.Essentials
{
InactivityTimer = new CTimer((o) => InactivityTimerExpired(), _timeoutMs);
}
}
void InactivityTimerExpired()
{
InactivityTimer.Stop();
InactivityTimer.Dispose();
InactivityTimer = null;
ScreenSaverController.Show();
}
public override void Show()
{
CurrentChildDriver = null;
ShowSubDriver(AvDriver as PanelDriverBase);
base.Show();
}
public override void Hide()
{
TriList.BooleanInput[AvDriver.StartPageVisibleJoin].BoolValue = false;
base.Hide();
}
void ShowSubDriver(PanelDriverBase driver)
{
CurrentChildDriver = driver;
if (driver == null)
return;
this.Hide();
driver.Show();
}
/// <summary>
///
/// </summary>
public override void BackButtonPressed()
{
if(CurrentChildDriver != null)
CurrentChildDriver.BackButtonPressed();
}
}
}
void InactivityTimerExpired()
{
InactivityTimer.Stop();
InactivityTimer.Dispose();
InactivityTimer = null;
ScreenSaverController.Show();
}
public override void Show()
{
CurrentChildDriver = null;
ShowSubDriver(AvDriver as PanelDriverBase);
base.Show();
}
public override void Hide()
{
TriList.BooleanInput[AvDriver.StartPageVisibleJoin].BoolValue = false;
base.Hide();
}
void ShowSubDriver(PanelDriverBase driver)
{
CurrentChildDriver = driver;
if (driver == null)
return;
this.Hide();
driver.Show();
}
/// <summary>
///
/// </summary>
public override void BackButtonPressed()
{
if(CurrentChildDriver != null)
CurrentChildDriver.BackButtonPressed();
}
}
public interface IHasScreenSaverController
{
ScreenSaverController ScreenSaverController { get; }
}
}

View File

@@ -114,7 +114,7 @@ namespace PepperDash.Essentials
/// <summary>
/// The parent driver for this
/// </summary>
PanelDriverBase Parent;
public PanelDriverBase Parent { get; private set; }
/// <summary>
/// All children attached to this driver. For hiding and showing as a group.

View File

@@ -72,7 +72,7 @@ namespace PepperDash.Essentials
/// <summary>
/// The parent driver for this
/// </summary>
PanelDriverBase Parent;
public PanelDriverBase Parent { get; private set; }
/// <summary>
/// All children attached to this driver. For hiding and showing as a group.
@@ -1430,6 +1430,7 @@ namespace PepperDash.Essentials
/// </summary>
public interface IAVDriver
{
PanelDriverBase Parent { get; }
JoinedSigInterlock PopupInterlock { get; }
void ShowNotificationRibbon(string message, int timeout);
void HideNotificationRibbon();

View File

@@ -21,6 +21,8 @@ namespace PepperDash.Essentials
private readonly EssentialsPanelMainInterfaceDriver _parent;
private JoinedSigInterlock PositionInterlock;
CTimer PositionTimer;
uint PositionTimeoutMs;
@@ -38,7 +40,9 @@ namespace PepperDash.Essentials
PositionJoins = new List<uint>() { UIBoolJoin.MCScreenSaverPosition1Visible, UIBoolJoin.MCScreenSaverPosition2Visible, UIBoolJoin.MCScreenSaverPosition3Visible, UIBoolJoin.MCScreenSaverPosition4Visible };
var cmdName = String.Format("shwscrsvr-{0}", config.IpId);
PositionInterlock = new JoinedSigInterlock(parent.TriList);
var cmdName = String.Format("shwscrsvr-{0}", parent.TriList.ID);
CrestronConsole.AddNewConsoleCommand((o) => Show(), cmdName, "Shows Panel Screensaver", ConsoleAccessLevelEnum.AccessOperator);
@@ -47,10 +51,13 @@ namespace PepperDash.Essentials
public override void Show()
{
_parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.MCScreenSaverVisible);
if (_parent.AvDriver != null)
{
_parent.AvDriver.PopupInterlock.ShowInterlocked(UIBoolJoin.MCScreenSaverVisible);
}
CurrentPositionIndex = 0;
SetCurrentPosition();
ShowCurrentPosition();
StartPositionTimer();
base.Show();
@@ -58,6 +65,8 @@ namespace PepperDash.Essentials
public override void Hide()
{
Debug.Console(1, "Hiding ScreenSaverController");
if (PositionTimer != null)
{
PositionTimer.Stop();
@@ -67,7 +76,10 @@ namespace PepperDash.Essentials
ClearAllPositions();
_parent.AvDriver.PopupInterlock.HideAndClear();
if (_parent.AvDriver != null)
{
_parent.AvDriver.PopupInterlock.HideAndClear();
}
base.Hide();
}
@@ -89,7 +101,7 @@ namespace PepperDash.Essentials
{
IncrementPositionIndex();
SetCurrentPosition();
ShowCurrentPosition();
StartPositionTimer();
}
@@ -109,20 +121,16 @@ namespace PepperDash.Essentials
}
//
void SetCurrentPosition()
void ShowCurrentPosition()
{
ClearAllPositions();
// Set based on current index
TriList.SetBool(PositionJoins[CurrentPositionIndex], true);
PositionInterlock.ShowInterlocked(PositionJoins[CurrentPositionIndex]);
}
void ClearAllPositions()
{
foreach (var join in PositionJoins)
{
TriList.SetBool(join, false);
}
Debug.Console(1, "Hiding all screensaver positions");
PositionInterlock.HideAndClear();
}
}

View File

@@ -398,6 +398,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
void ShowIncomingModal(CodecActiveCallItem call)
{
Debug.Console(1, "Showing Incoming Call Modal");
(Parent as IAVWithVCDriver).PrepareForCodecIncomingCall();
IncomingCallModal = new ModalDialog(TriList);
string msg;
@@ -413,13 +415,19 @@ namespace PepperDash.Essentials.UIDrivers.VC
msg = string.Format("Incoming video call from: {0}", call.Name);
}
if (Parent.PopupInterlock.IsShown)
// Hide screensaver
var screenSaverParent = Parent.Parent as IHasScreenSaverController;
if (screenSaverParent != null)
{
if (Parent.PopupInterlock.CurrentJoin == UIBoolJoin.MCScreenSaverVisible)
{
Parent.PopupInterlock.HideAndClear();
}
screenSaverParent.ScreenSaverController.Hide();
}
else
{
Debug.Console(1, "Parent.Parent is null or does not implement IHasScreenSaverController");
}
IncomingCallModal.PresentModalDialog(2, "Incoming Call", icon, msg,
"Ignore", "Accept", false, false, b =>
@@ -709,17 +717,45 @@ namespace PepperDash.Essentials.UIDrivers.VC
uint holdTime = 5000;
presetsCodec.CodecRoomPresetsListHasChanged += new EventHandler<EventArgs>(presetsCodec_CodecRoomPresetsListHasChanged);
TriList.BooleanOutput[UIBoolJoin.VCCameraPreset1].SetSigHeldAction(
holdTime, () => presetsCodec.CodecRoomPresetStore(1, presetsCodec.NearEndPresets[0].Description), ShowPresetStoreFeedback, () => presetsCodec.CodecRoomPresetSelect(1));
TriList.BooleanOutput[UIBoolJoin.VCCameraPreset2].SetSigHeldAction(
holdTime, () => presetsCodec.CodecRoomPresetStore(2, presetsCodec.NearEndPresets[1].Description), ShowPresetStoreFeedback, () => presetsCodec.CodecRoomPresetSelect(2));
TriList.BooleanOutput[UIBoolJoin.VCCameraPreset3].SetSigHeldAction(
holdTime, () => presetsCodec.CodecRoomPresetStore(3, presetsCodec.NearEndPresets[2].Description), ShowPresetStoreFeedback, () => presetsCodec.CodecRoomPresetSelect(3));
var preset = 1;
if (presetsCodec.NearEndPresets[preset - 1] != null && presetsCodec.NearEndPresets[preset - 1].Defined)
{
TriList.SetBool(UIBoolJoin.VCCameraPreset1Visible, true);
TriList.BooleanOutput[UIBoolJoin.VCCameraPreset1].SetSigHeldAction(
holdTime, ShowPresetStoreFeedback,() => presetsCodec.CodecRoomPresetStore(preset, presetsCodec.NearEndPresets[preset - 1].Description),
() => presetsCodec.CodecRoomPresetSelect(preset));
TriList.StringInput[UIStringJoin.VCCameraPresetLabel1].StringValue = presetsCodec.NearEndPresets[preset - 1].Description;
}
else
{
TriList.SetBool(UIBoolJoin.VCCameraPreset1Visible, false);
}
TriList.StringInput[UIStringJoin.VCCameraPresetLabel1].StringValue = presetsCodec.NearEndPresets[0].Description;
TriList.StringInput[UIStringJoin.VCCameraPresetLabel2].StringValue = presetsCodec.NearEndPresets[1].Description;
TriList.StringInput[UIStringJoin.VCCameraPresetLabel3].StringValue = presetsCodec.NearEndPresets[2].Description;
if (presetsCodec.NearEndPresets[1] != null && presetsCodec.NearEndPresets[1].Defined)
{
TriList.SetBool(UIBoolJoin.VCCameraPreset2Visible, true);
TriList.BooleanOutput[UIBoolJoin.VCCameraPreset2].SetSigHeldAction(
holdTime, ShowPresetStoreFeedback, () => presetsCodec.CodecRoomPresetStore(preset, presetsCodec.NearEndPresets[preset - 1].Description),
() => presetsCodec.CodecRoomPresetSelect(preset));
TriList.StringInput[UIStringJoin.VCCameraPresetLabel2].StringValue = presetsCodec.NearEndPresets[1].Description;
}
else
{
TriList.SetBool(UIBoolJoin.VCCameraPreset2Visible, false);
}
if (presetsCodec.NearEndPresets[2] != null && presetsCodec.NearEndPresets[2].Defined)
{
TriList.SetBool(UIBoolJoin.VCCameraPreset3Visible, true);
TriList.BooleanOutput[UIBoolJoin.VCCameraPreset3].SetSigHeldAction(
holdTime, ShowPresetStoreFeedback, () => presetsCodec.CodecRoomPresetStore(preset, presetsCodec.NearEndPresets[preset - 1].Description),
() => presetsCodec.CodecRoomPresetSelect(preset));
TriList.StringInput[UIStringJoin.VCCameraPresetLabel3].StringValue = presetsCodec.NearEndPresets[2].Description;
}
else
{
TriList.SetBool(UIBoolJoin.VCCameraPreset3Visible, false);
}
}
}

View File

@@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.EthernetCommunication;
using Newtonsoft.Json;
@@ -82,9 +84,9 @@ namespace PepperDash.Essentials.Core.Bridges
protected Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; }
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; }
public BasicTriList Eisc { get; private set; }
public EiscApiAdvanced(DeviceConfig dc) :
public EiscApiAdvanced(DeviceConfig dc, BasicTriList eisc) :
base(dc.Key)
{
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
@@ -92,44 +94,52 @@ namespace PepperDash.Essentials.Core.Bridges
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
//PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString());
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(PropertiesConfig.Control.IpIdInt, PropertiesConfig.Control.TcpSshProperties.Address, Global.ControlSystem);
Eisc = eisc;
Eisc.SigChange += Eisc_SigChange;
AddPostActivationAction( () =>
AddPostActivationAction(LinkDevices);
}
private void LinkDevices()
{
Debug.Console(1, this, "Linking Devices...");
foreach (var d in PropertiesConfig.Devices)
{
Debug.Console(1, this, "Linking Devices...");
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
foreach (var d in PropertiesConfig.Devices)
if (device == null)
{
var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
if (device == null) continue;
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{
Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",
device.Key);
continue;
}
var bridge = device as IBridgeAdvanced;
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
continue;
}
var registerResult = Eisc.Register();
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (registerResult != eDeviceRegistrationUnRegistrationResponse.Success)
if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Registration result: {0}", registerResult);
return;
Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",
device.Key);
continue;
}
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
});
var bridge = device as IBridgeAdvanced;
if (bridge != null)
{
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
}
}
var registerResult = Eisc.Register();
if (registerResult != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Registration result: {0}", registerResult);
return;
}
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
}
/// <summary>
@@ -152,7 +162,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// <summary>
/// Prints all the join maps on this bridge
/// </summary>
public void PrintJoinMaps()
public virtual void PrintJoinMaps()
{
Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
@@ -247,7 +257,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary>
/// <param name="currentDevice"></param>
/// <param name="args"></param>
void Eisc_SigChange(object currentDevice, SigEventArgs args)
protected void Eisc_SigChange(object currentDevice, SigEventArgs args)
{
try
{
@@ -299,15 +309,34 @@ namespace PepperDash.Essentials.Core.Bridges
{
public EiscApiAdvancedFactory()
{
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced" };
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "vceiscapiadv", "vceiscapiadvanced" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new EiscApiAdvanced Device");
return new EiscApiAdvanced(dc);
var controlProperties = CommFactory.GetControlPropertiesConfig(dc);
switch (dc.Type.ToLower())
{
case "eiscapiadv":
case "eiscapiadvanced":
{
var eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
return new EiscApiAdvanced(dc, eisc);
}
case "vceiscapiadv":
case "vceiscapiadvanced":
{
var eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, InitialParametersClass.RoomId,
Global.ControlSystem);
return new EiscApiAdvanced(dc, eisc);
}
default:
return null;
}
}
}

View File

@@ -0,0 +1,811 @@
using System;
using PepperDash.Essentials.Core;
namespace PepperDash_Essentials_Core.Bridges.JoinMaps
{
public class VideoCodecControllerJoinMap : JoinMapBaseAdvanced
{
#region Status
[JoinName("IsOnline")] public JoinDataComplete IsOnline =
new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 1},
new JoinMetadata
{
Description = "Device is Online",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
#endregion
[JoinName("CallDirection")] public JoinDataComplete CallDirection =
new JoinDataComplete(new JoinData {JoinNumber = 22, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Call Direction",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CameraLayout")] public JoinDataComplete CameraLayout =
new JoinDataComplete(new JoinData {JoinNumber = 142, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Layout Toggle",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraLayoutStringFb")] public JoinDataComplete CameraLayoutStringFb =
new JoinDataComplete(new JoinData {JoinNumber = 141, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Layout Fb",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("CameraModeAuto")] public JoinDataComplete CameraModeAuto =
new JoinDataComplete(new JoinData {JoinNumber = 131, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Mode Auto",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraModeManual")] public JoinDataComplete CameraModeManual =
new JoinDataComplete(new JoinData {JoinNumber = 132, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Mode Manual",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraModeOff")] public JoinDataComplete CameraModeOff =
new JoinDataComplete(new JoinData {JoinNumber = 133, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Mode Off",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraNumberSelect")] public JoinDataComplete CameraNumberSelect =
new JoinDataComplete(new JoinData {JoinNumber = 60, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Number Select/FB",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("CameraPanLeft")] public JoinDataComplete CameraPanLeft =
new JoinDataComplete(new JoinData {JoinNumber = 113, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Pan Left",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraPanRight")] public JoinDataComplete CameraPanRight =
new JoinDataComplete(new JoinData {JoinNumber = 114, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Pan Right",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraPresetNames")] public JoinDataComplete CameraPresetNames =
new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Preset Names - XSIG, max of 15",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CameraPresetSelect")] public JoinDataComplete CameraPresetSelect =
new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Preset Select",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("CameraPresetSave")] public JoinDataComplete CameraPresetSave =
new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
new JoinMetadata
{
Description = "Save Selected Preset",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraSelfView")] public JoinDataComplete CameraSelfView =
new JoinDataComplete(new JoinData {JoinNumber = 141, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Self View Toggle/FB",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraSupportsAutoMode")] public JoinDataComplete CameraSupportsAutoMode =
new JoinDataComplete(new JoinData {JoinNumber = 143, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Supports Auto Mode FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraSupportsOffMode")] public JoinDataComplete CameraSupportsOffMode =
new JoinDataComplete(new JoinData {JoinNumber = 144, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Supports Off Mode FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraTiltDown")] public JoinDataComplete CameraTiltDown =
new JoinDataComplete(new JoinData {JoinNumber = 112, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Tilt Down",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraTiltUp")] public JoinDataComplete CameraTiltUp =
new JoinDataComplete(new JoinData {JoinNumber = 111, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Tilt Up",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraZoomIn")] public JoinDataComplete CameraZoomIn =
new JoinDataComplete(new JoinData {JoinNumber = 115, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Zoom In",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraZoomOut")] public JoinDataComplete CameraZoomOut =
new JoinDataComplete(new JoinData {JoinNumber = 116, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Zoom Out",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CurrentCallName")] public JoinDataComplete CurrentCallData =
new JoinDataComplete(new JoinData {JoinNumber = 2, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Call Data - XSIG",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CurrentDialString")] public JoinDataComplete CurrentDialString =
new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Dial String",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CurrentParticipants")] public JoinDataComplete CurrentParticipants =
new JoinDataComplete(new JoinData {JoinNumber = 151, JoinSpan = 1},
new JoinMetadata()
{
Description = "Current Participants XSig",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CurrentSource")] public JoinDataComplete CurrentSource =
new JoinDataComplete(new JoinData {JoinNumber = 201, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Source",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DialMeeting1")] public JoinDataComplete DialMeeting1 =
new JoinDataComplete(new JoinData {JoinNumber = 161, JoinSpan = 1},
new JoinMetadata
{
Description = "Join first meeting",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DialMeeting2")]
public JoinDataComplete DialMeeting2 =
new JoinDataComplete(new JoinData { JoinNumber = 162, JoinSpan = 1 },
new JoinMetadata
{
Description = "Join second meeting",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DialMeeting3")]
public JoinDataComplete DialMeeting3 =
new JoinDataComplete(new JoinData { JoinNumber = 163, JoinSpan = 1 },
new JoinMetadata
{
Description = "Join third meeting",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryDialSelectedLine")] public JoinDataComplete DirectoryDialSelectedLine =
new JoinDataComplete(new JoinData {JoinNumber = 106, JoinSpan = 1},
new JoinMetadata
{
Description = "Dial selected directory line",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryEntries")] public JoinDataComplete DirectoryEntries =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Entries - XSig, 255 entries",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectoryEntryIsContact")] public JoinDataComplete DirectoryEntryIsContact =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Selected Entry Is Contact FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryEntrySelectedName")] public JoinDataComplete DirectoryEntrySelectedName =
new JoinDataComplete(new JoinData {JoinNumber = 356, JoinSpan = 1},
new JoinMetadata
{
Description = "Selected Directory Entry Name",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectoryEntrySelectedNumber")] public JoinDataComplete DirectoryEntrySelectedNumber =
new JoinDataComplete(new JoinData {JoinNumber = 357, JoinSpan = 1},
new JoinMetadata
{
Description = "Selected Directory Entry Number",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectoryFolderBack")] public JoinDataComplete DirectoryFolderBack =
new JoinDataComplete(new JoinData {JoinNumber = 105, JoinSpan = 1},
new JoinMetadata
{
Description = "Go back one directory level",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryHasChanged")] public JoinDataComplete DirectoryHasChanged =
new JoinDataComplete(new JoinData {JoinNumber = 103, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory has changed FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryIsRoot")] public JoinDataComplete DirectoryIsRoot =
new JoinDataComplete(new JoinData {JoinNumber = 102, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory is on Root FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryLineSelected")] public JoinDataComplete DirectoryLineSelected =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Line Selected FB",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryRoot")] public JoinDataComplete DirectoryRoot =
new JoinDataComplete(new JoinData {JoinNumber = 104, JoinSpan = 1},
new JoinMetadata
{
Description = "Go to Directory Root",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryRowCount")] public JoinDataComplete DirectoryRowCount =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Row Count FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("DirectorySearchBusy")] public JoinDataComplete DirectorySearchBusy =
new JoinDataComplete(new JoinData {JoinNumber = 100, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Search Busy FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectorySearchString")] public JoinDataComplete DirectorySearchString =
new JoinDataComplete(new JoinData {JoinNumber = 100, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Search String",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectorySelectRow")] public JoinDataComplete DirectorySelectRow =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Select Row",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("DirectorySelectedFolderName")] public JoinDataComplete DirectorySelectedFolderName =
new JoinDataComplete(new JoinData {JoinNumber = 358, JoinSpan = 1},
new JoinMetadata
{
Description = "Selected Directory Folder Name",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("0")] public JoinDataComplete Dtmf0 =
new JoinDataComplete(new JoinData {JoinNumber = 20, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 0",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("1")] public JoinDataComplete Dtmf1 =
new JoinDataComplete(new JoinData {JoinNumber = 11, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 1",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("2")] public JoinDataComplete Dtmf2 =
new JoinDataComplete(new JoinData {JoinNumber = 12, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 2",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("3")] public JoinDataComplete Dtmf3 =
new JoinDataComplete(new JoinData {JoinNumber = 13, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 3",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("4")] public JoinDataComplete Dtmf4 =
new JoinDataComplete(new JoinData {JoinNumber = 14, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 4",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("5")] public JoinDataComplete Dtmf5 =
new JoinDataComplete(new JoinData {JoinNumber = 15, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 5",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("6")] public JoinDataComplete Dtmf6 =
new JoinDataComplete(new JoinData {JoinNumber = 16, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 6",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("7")] public JoinDataComplete Dtmf7 =
new JoinDataComplete(new JoinData {JoinNumber = 17, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 7",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("8")] public JoinDataComplete Dtmf8 =
new JoinDataComplete(new JoinData {JoinNumber = 18, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 8",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("9")] public JoinDataComplete Dtmf9 =
new JoinDataComplete(new JoinData {JoinNumber = 19, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 9",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("#")] public JoinDataComplete DtmfPound =
new JoinDataComplete(new JoinData {JoinNumber = 22, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF #",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("*")] public JoinDataComplete DtmfStar =
new JoinDataComplete(new JoinData {JoinNumber = 21, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF *",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("EndCall")] public JoinDataComplete EndCall =
new JoinDataComplete(new JoinData {JoinNumber = 24, JoinSpan = 1},
new JoinMetadata
{
Description = "Hang Up",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("HookState")] public JoinDataComplete HookState =
new JoinDataComplete(new JoinData {JoinNumber = 31, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Hook State",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("IncomingAnswer")] public JoinDataComplete IncomingAnswer =
new JoinDataComplete(new JoinData {JoinNumber = 51, JoinSpan = 1},
new JoinMetadata
{
Description = "Answer Incoming Call",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("IncomingCall")] public JoinDataComplete IncomingCall =
new JoinDataComplete(new JoinData {JoinNumber = 50, JoinSpan = 1},
new JoinMetadata
{
Description = "Incoming Call",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("IncomingCallName")] public JoinDataComplete IncomingCallName =
new JoinDataComplete(new JoinData {JoinNumber = 51, JoinSpan = 1},
new JoinMetadata
{
Description = "Incoming Call Name",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("IncomingCallNumber")] public JoinDataComplete IncomingCallNumber =
new JoinDataComplete(new JoinData {JoinNumber = 52, JoinSpan = 1},
new JoinMetadata
{
Description = "Incoming Call Number",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("IncomingReject")] public JoinDataComplete IncomingReject =
new JoinDataComplete(new JoinData {JoinNumber = 52, JoinSpan = 1},
new JoinMetadata
{
Description = "Reject Incoming Call",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("ManualDial")] public JoinDataComplete ManualDial =
new JoinDataComplete(new JoinData {JoinNumber = 71, JoinSpan = 1},
new JoinMetadata
{
Description = "Dial manual string",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("Meeting Count Fb")] public JoinDataComplete MeetingCount =
new JoinDataComplete(new JoinData {JoinNumber = 161, JoinSpan = 1},
new JoinMetadata
{
Description = "Meeting Count",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("MicMuteOff")] public JoinDataComplete MicMuteOff =
new JoinDataComplete(new JoinData {JoinNumber = 172, JoinSpan = 1},
new JoinMetadata
{
Description = "Mic Mute Off",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("MicMuteOn")] public JoinDataComplete MicMuteOn =
new JoinDataComplete(new JoinData {JoinNumber = 171, JoinSpan = 1},
new JoinMetadata
{
Description = "Mic Mute On",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("MicMuteToggle")] public JoinDataComplete MicMuteToggle =
new JoinDataComplete(new JoinData {JoinNumber = 173, JoinSpan = 1},
new JoinMetadata
{
Description = "Mic Mute Toggle",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("MinutesBeforeMeetingStart")] public JoinDataComplete MinutesBeforeMeetingStart =
new JoinDataComplete(new JoinData {JoinNumber = 41, JoinSpan = 1},
new JoinMetadata
{
Description = "Minutes before meeting start that a meeting is joinable",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("ParticipantCount")] public JoinDataComplete ParticipantCount =
new JoinDataComplete(new JoinData {JoinNumber = 151, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Participant Count",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("Schedule")] public JoinDataComplete Schedule =
new JoinDataComplete(new JoinData {JoinNumber = 102, JoinSpan = 1},
new JoinMetadata
{
Description = "Schedule Data - XSIG",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("AutoShareWhileInCall")] public JoinDataComplete SourceShareAutoStart =
new JoinDataComplete(new JoinData {JoinNumber = 203, JoinSpan = 1},
new JoinMetadata
{
Description = "When high, will autostart sharing when a call is joined",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("SourceShareEnd")] public JoinDataComplete SourceShareEnd =
new JoinDataComplete(new JoinData {JoinNumber = 202, JoinSpan = 1},
new JoinMetadata
{
Description = "Stop Sharing & Feedback",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("SourceShareStart")] public JoinDataComplete SourceShareStart =
new JoinDataComplete(new JoinData {JoinNumber = 201, JoinSpan = 1},
new JoinMetadata
{
Description = "Start Sharing & Feedback",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("RecievingContent")] public JoinDataComplete RecievingContent =
new JoinDataComplete(new JoinData {JoinNumber = 204, JoinSpan = 1},
new JoinMetadata
{
Description = "Recieving content from the far end",
JoinType = eJoinType.Digital,
JoinCapabilities = eJoinCapabilities.ToSIMPL
});
[JoinName("SelfviewPosition")] public JoinDataComplete SelfviewPosition =
new JoinDataComplete(new JoinData {JoinNumber = 211, JoinSpan = 1},
new JoinMetadata
{
Description = "advance selfview position",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("SelfviewPositionFb")]
public JoinDataComplete SelfviewPositionFb =
new JoinDataComplete(new JoinData { JoinNumber = 211, JoinSpan = 1 },
new JoinMetadata
{
Description = "advance selfview position",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("SpeedDialStart")] public JoinDataComplete SpeedDialStart =
new JoinDataComplete(new JoinData {JoinNumber = 41, JoinSpan = 4},
new JoinMetadata
{
Description = "Speed Dial",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("UpdateMeetings")] public JoinDataComplete UpdateMeetings =
new JoinDataComplete(new JoinData {JoinNumber = 160, JoinSpan = 1},
new JoinMetadata
{
Description = "Update Meetings",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeDown")] public JoinDataComplete VolumeDown =
new JoinDataComplete(new JoinData {JoinNumber = 175, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Down",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeLevel")] public JoinDataComplete VolumeLevel =
new JoinDataComplete(new JoinData {JoinNumber = 174, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Level",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("VolumeMuteOff")] public JoinDataComplete VolumeMuteOff =
new JoinDataComplete(new JoinData {JoinNumber = 177, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Mute Off",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeMuteOn")] public JoinDataComplete VolumeMuteOn =
new JoinDataComplete(new JoinData {JoinNumber = 176, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Mute On",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeMuteToggle")] public JoinDataComplete VolumeMuteToggle =
new JoinDataComplete(new JoinData {JoinNumber = 178, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Mute Toggle",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeUp")] public JoinDataComplete VolumeUp =
new JoinDataComplete(new JoinData {JoinNumber = 174, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Up",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DialPhoneCall")]
public JoinDataComplete DialPhone =
new JoinDataComplete(new JoinData { JoinNumber = 72, JoinSpan = 1 },
new JoinMetadata
{
Description = "Dial Phone",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("PhoneHookState")]
public JoinDataComplete PhoneHookState =
new JoinDataComplete(new JoinData { JoinNumber = 72, JoinSpan = 1 },
new JoinMetadata
{
Description = "Dial Phone",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("EndPhoneCall")]
public JoinDataComplete HangUpPhone =
new JoinDataComplete(new JoinData { JoinNumber = 73, JoinSpan = 1 },
new JoinMetadata
{
Description = "Hang Up PHone",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("PhoneString")]
public JoinDataComplete PhoneDialString =
new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata
{
Description = "Phone Dial String",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Serial
});
public VideoCodecControllerJoinMap(uint joinStart) : base(joinStart, typeof (VideoCodecControllerJoinMap))
{
}
public VideoCodecControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
{
}
}
}

View File

@@ -1,120 +1,120 @@
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public class CommFactory
{
public static EssentialsControlPropertiesConfig GetControlPropertiesConfig(DeviceConfig deviceConfig)
{
try
{
return JsonConvert.DeserializeObject<EssentialsControlPropertiesConfig>
(deviceConfig.Properties["control"].ToString());
//Debug.Console(2, "Control TEST: {0}", JsonConvert.SerializeObject(controlConfig));
}
catch (Exception e)
{
Debug.Console(0, "ERROR: [{0}] Control properties deserialize failed:\r{1}", deviceConfig.Key, e);
return null;
}
}
/// <summary>
/// Returns a comm method of either com port, TCP, SSH, and puts this into the DeviceManager
/// </summary>
/// <param name="deviceConfig">The Device config object</param>
public static IBasicCommunication CreateCommForDevice(DeviceConfig deviceConfig)
{
EssentialsControlPropertiesConfig controlConfig = GetControlPropertiesConfig(deviceConfig);
if (controlConfig == null)
return null;
IBasicCommunication comm = null;
try
{
var c = controlConfig.TcpSshProperties;
switch (controlConfig.Method)
{
case eControlMethod.Com:
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort, controlConfig.ComParams, controlConfig);
break;
case eControlMethod.Cec:
comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort, controlConfig);
break;
case eControlMethod.IR:
break;
case eControlMethod.Ssh:
{
var ssh = new GenericSshClient(deviceConfig.Key + "-ssh", c.Address, c.Port, c.Username, c.Password);
ssh.AutoReconnect = c.AutoReconnect;
if(ssh.AutoReconnect)
ssh.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = ssh;
break;
}
case eControlMethod.Tcpip:
{
var tcp = new GenericTcpIpClient(deviceConfig.Key + "-tcp", c.Address, c.Port, c.BufferSize);
tcp.AutoReconnect = c.AutoReconnect;
if (tcp.AutoReconnect)
tcp.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = tcp;
break;
}
case eControlMethod.Udp:
{
var udp = new GenericUdpServer(deviceConfig.Key + "-udp", c.Address, c.Port, c.BufferSize);
comm = udp;
break;
}
case eControlMethod.Telnet:
break;
default:
break;
}
}
catch (Exception e)
{
Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}",
deviceConfig.Properties.ToString(), e);
}
// put it in the device manager if it's the right flavor
var comDev = comm as Device;
if (comDev != null)
DeviceManager.AddDevice(comDev);
return comm;
}
public static ComPort GetComPort(EssentialsControlPropertiesConfig config)
{
var comPar = config.ComParams;
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
return dev.ComPorts[config.ControlPortNumber];
Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
return null;
}
/// <summary>
/// Gets an ICec port from a RoutingInput or RoutingOutput on a device
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
public static ICec GetCecPort(ControlPropertiesConfig config)
{
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public class CommFactory
{
public static EssentialsControlPropertiesConfig GetControlPropertiesConfig(DeviceConfig deviceConfig)
{
try
{
return JsonConvert.DeserializeObject<EssentialsControlPropertiesConfig>
(deviceConfig.Properties["control"].ToString());
//Debug.Console(2, "Control TEST: {0}", JsonConvert.SerializeObject(controlConfig));
}
catch (Exception e)
{
Debug.Console(0, "ERROR: [{0}] Control properties deserialize failed:\r{1}", deviceConfig.Key, e);
return null;
}
}
/// <summary>
/// Returns a comm method of either com port, TCP, SSH, and puts this into the DeviceManager
/// </summary>
/// <param name="deviceConfig">The Device config object</param>
public static IBasicCommunication CreateCommForDevice(DeviceConfig deviceConfig)
{
EssentialsControlPropertiesConfig controlConfig = GetControlPropertiesConfig(deviceConfig);
if (controlConfig == null)
return null;
IBasicCommunication comm = null;
try
{
var c = controlConfig.TcpSshProperties;
switch (controlConfig.Method)
{
case eControlMethod.Com:
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort, controlConfig.ComParams, controlConfig);
break;
case eControlMethod.Cec:
comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort, controlConfig);
break;
case eControlMethod.IR:
break;
case eControlMethod.Ssh:
{
var ssh = new GenericSshClient(deviceConfig.Key + "-ssh", c.Address, c.Port, c.Username, c.Password);
ssh.AutoReconnect = c.AutoReconnect;
if(ssh.AutoReconnect)
ssh.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = ssh;
break;
}
case eControlMethod.Tcpip:
{
var tcp = new GenericTcpIpClient(deviceConfig.Key + "-tcp", c.Address, c.Port, c.BufferSize);
tcp.AutoReconnect = c.AutoReconnect;
if (tcp.AutoReconnect)
tcp.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = tcp;
break;
}
case eControlMethod.Udp:
{
var udp = new GenericUdpServer(deviceConfig.Key + "-udp", c.Address, c.Port, c.BufferSize);
comm = udp;
break;
}
case eControlMethod.Telnet:
break;
default:
break;
}
}
catch (Exception e)
{
Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}",
deviceConfig.Properties.ToString(), e);
}
// put it in the device manager if it's the right flavor
var comDev = comm as Device;
if (comDev != null)
DeviceManager.AddDevice(comDev);
return comm;
}
public static ComPort GetComPort(EssentialsControlPropertiesConfig config)
{
var comPar = config.ComParams;
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
return dev.ComPorts[config.ControlPortNumber];
Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
return null;
}
/// <summary>
/// Gets an ICec port from a RoutingInput or RoutingOutput on a device
/// </summary>
/// <param name="config"></param>
/// <returns></returns>
public static ICec GetCecPort(ControlPropertiesConfig config)
{
var dev = DeviceManager.GetDeviceForKey(config.ControlPortDevKey);
if (dev != null)
@@ -147,64 +147,64 @@ namespace PepperDash.Essentials.Core
Debug.Console(0, "GetCecPort: '{0}' - Configuration missing 'ControlPortName'", config.ControlPortDevKey);
}
}
Debug.Console(0, "GetCecPort: Device '{0}' is not a valid device.", config.ControlPortDevKey);
return null;
}
/// <summary>
/// Helper to grab the IComPorts device for this PortDeviceKey. Key "controlSystem" will
/// return the ControlSystem object from the Global class.
/// </summary>
/// <returns>IComPorts device or null if the device is not found or does not implement IComPorts</returns>
public static IComPorts GetIComPortsDeviceFromManagedDevice(string ComPortDevKey)
{
if ((ComPortDevKey.Equals("controlSystem", System.StringComparison.OrdinalIgnoreCase)
|| ComPortDevKey.Equals("processor", System.StringComparison.OrdinalIgnoreCase))
&& Global.ControlSystem is IComPorts)
return Global.ControlSystem;
else
{
var dev = DeviceManager.GetDeviceForKey(ComPortDevKey) as IComPorts;
if (dev == null)
Debug.Console(0, "ComPortConfig: Cannot find com port device '{0}'", ComPortDevKey);
return dev;
}
}
}
/// <summary>
///
/// </summary>
public class EssentialsControlPropertiesConfig :
PepperDash.Core.ControlPropertiesConfig
{
[JsonConverter(typeof(ComSpecJsonConverter))]
public ComPort.ComPortSpec ComParams { get; set; }
public string CresnetId { get; set; }
/// <summary>
/// Attempts to provide uint conversion of string CresnetId
/// </summary>
public uint CresnetIdInt
{
get
{
try
{
return Convert.ToUInt32(CresnetId, 16);
}
catch (Exception)
{
throw new FormatException(string.Format("ERROR:Unable to convert Cresnet ID: {0} to hex. Error:\n{1}", CresnetId));
}
}
Debug.Console(0, "GetCecPort: Device '{0}' is not a valid device.", config.ControlPortDevKey);
return null;
}
public string InfinetId { get; set; }
/// <summary>
/// Helper to grab the IComPorts device for this PortDeviceKey. Key "controlSystem" will
/// return the ControlSystem object from the Global class.
/// </summary>
/// <returns>IComPorts device or null if the device is not found or does not implement IComPorts</returns>
public static IComPorts GetIComPortsDeviceFromManagedDevice(string ComPortDevKey)
{
if ((ComPortDevKey.Equals("controlSystem", System.StringComparison.OrdinalIgnoreCase)
|| ComPortDevKey.Equals("processor", System.StringComparison.OrdinalIgnoreCase))
&& Global.ControlSystem is IComPorts)
return Global.ControlSystem;
else
{
var dev = DeviceManager.GetDeviceForKey(ComPortDevKey) as IComPorts;
if (dev == null)
Debug.Console(0, "ComPortConfig: Cannot find com port device '{0}'", ComPortDevKey);
return dev;
}
}
}
/// <summary>
///
/// </summary>
public class EssentialsControlPropertiesConfig :
PepperDash.Core.ControlPropertiesConfig
{
[JsonConverter(typeof(ComSpecJsonConverter))]
public ComPort.ComPortSpec ComParams { get; set; }
public string CresnetId { get; set; }
/// <summary>
/// Attempts to provide uint conversion of string CresnetId
/// </summary>
public uint CresnetIdInt
{
get
{
try
{
return Convert.ToUInt32(CresnetId, 16);
}
catch (Exception)
{
throw new FormatException(string.Format("ERROR:Unable to convert Cresnet ID: {0} to hex. Error:\n{1}", CresnetId));
}
}
}
public string InfinetId { get; set; }
/// <summary>
/// Attepmts to provide uiont conversion of string InifinetId
/// </summary>
@@ -221,13 +221,13 @@ namespace PepperDash.Essentials.Core
throw new FormatException(string.Format("ERROR:Unable to conver Infinet ID: {0} to hex. Error:\n{1}", InfinetId));
}
}
}
}
public class IrControlSpec
{
public string PortDeviceKey { get; set; }
public uint PortNumber { get; set; }
public string File { get; set; }
}
}
}
public class IrControlSpec
{
public string PortDeviceKey { get; set; }
public uint PortNumber { get; set; }
public string File { get; set; }
}
}

View File

@@ -1,83 +1,83 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharpPro;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public static class IRPortHelper
{
public static string IrDriverPathPrefix
{
get
{
return Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
}
}
/// <summary>
/// Finds either the ControlSystem or a device controller that contains IR ports and
/// returns a port from the hardware device
/// </summary>
/// <param name="propsToken"></param>
/// <returns>IrPortConfig object. The port and or filename will be empty/null
/// if valid values don't exist on config</returns>
public static IrOutPortConfig GetIrPort(JToken propsToken)
{
var control = propsToken["control"];
if (control == null)
return null;
if (control["method"].Value<string>() != "ir")
{
Debug.Console(0, "IRPortHelper called with non-IR properties");
return null;
}
var port = new IrOutPortConfig();
var portDevKey = control.Value<string>("controlPortDevKey");
var portNum = control.Value<uint>("controlPortNumber");
if (portDevKey == null || portNum == 0)
{
Debug.Console(1, "WARNING: Properties is missing port device or port number");
return port;
}
IIROutputPorts irDev = null;
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
irDev = Global.ControlSystem;
else
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
if (irDev == null)
{
Debug.Console(1, "[Config] Error, device with IR ports '{0}' not found", portDevKey);
return port;
}
if (portNum <= irDev.NumberOfIROutputPorts) // success!
{
var file = IrDriverPathPrefix + control["irFile"].Value<string>();
port.Port = irDev.IROutputPorts[portNum];
port.FileName = file;
return port; // new IrOutPortConfig { Port = irDev.IROutputPorts[portNum], FileName = file };
}
else
{
Debug.Console(1, "[Config] Error, device '{0}' IR port {1} out of range",
portDevKey, portNum);
return port;
}
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharpPro;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public static class IRPortHelper
{
public static string IrDriverPathPrefix
{
get
{
return Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
}
}
/// <summary>
/// Finds either the ControlSystem or a device controller that contains IR ports and
/// returns a port from the hardware device
/// </summary>
/// <param name="propsToken"></param>
/// <returns>IrPortConfig object. The port and or filename will be empty/null
/// if valid values don't exist on config</returns>
public static IrOutPortConfig GetIrPort(JToken propsToken)
{
var control = propsToken["control"];
if (control == null)
return null;
if (control["method"].Value<string>() != "ir")
{
Debug.Console(0, "IRPortHelper called with non-IR properties");
return null;
}
var port = new IrOutPortConfig();
var portDevKey = control.Value<string>("controlPortDevKey");
var portNum = control.Value<uint>("controlPortNumber");
if (portDevKey == null || portNum == 0)
{
Debug.Console(1, "WARNING: Properties is missing port device or port number");
return port;
}
IIROutputPorts irDev = null;
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
irDev = Global.ControlSystem;
else
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
if (irDev == null)
{
Debug.Console(1, "[Config] Error, device with IR ports '{0}' not found", portDevKey);
return port;
}
if (portNum <= irDev.NumberOfIROutputPorts) // success!
{
var file = IrDriverPathPrefix + control["irFile"].Value<string>();
port.Port = irDev.IROutputPorts[portNum];
port.FileName = file;
return port; // new IrOutPortConfig { Port = irDev.IROutputPorts[portNum], FileName = file };
}
else
{
Debug.Console(1, "[Config] Error, device '{0}' IR port {1} out of range",
portDevKey, portNum);
return port;
}
}
public static IROutputPort GetIrOutputPort(DeviceConfig dc)
@@ -124,7 +124,7 @@ namespace PepperDash.Essentials.Core
Debug.Console(0, "WARNING: device with IR ports '{0}' not found", portDevKey);
return null;
}
if (portNum >= irDev.NumberOfIROutputPorts)
if (portNum > irDev.NumberOfIROutputPorts)
{
Debug.Console(0, "WARNING: device '{0}' IR port {1} out of range",
portDevKey, portNum);
@@ -134,10 +134,9 @@ namespace PepperDash.Essentials.Core
var port = irDev.IROutputPorts[portNum];
port.LoadIRDriver(Global.FilePathPrefix + "IR" + Global.DirectorySeparator + control["irFile"].Value<string>());
return port;
}
public static IrOutputPortController GetIrOutputPortController(DeviceConfig config)
@@ -149,87 +148,88 @@ namespace PepperDash.Essentials.Core
return null;
}
var irDevice = new IrOutputPortController(config.Key, GetIrOutputPort, config);
var postActivationFunc = new Func<DeviceConfig,IROutputPort> (GetIrOutputPort);
var irDevice = new IrOutputPortController(config.Key + "-ir", postActivationFunc, config);
return irDevice;
}
/*
/// <summary>
/// Returns a ready-to-go IrOutputPortController from a DeviceConfig object.
/// </summary>
public static IrOutputPortController GetIrOutputPortController(DeviceConfig devConf)
{
var irControllerKey = devConf.Key + "-ir";
if (devConf.Properties == null)
{
Debug.Console(0, "[{0}] WARNING: Device config does not include properties. IR will not function.", devConf.Key);
return new IrOutputPortController(irControllerKey, null, "");
}
var control = devConf.Properties["control"];
if (control == null)
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: Device config does not include control properties. IR will not function");
return c;
}
var portDevKey = control.Value<string>("controlPortDevKey");
var portNum = control.Value<uint>("controlPortNumber");
IIROutputPorts irDev = null;
if (portDevKey == null)
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: control properties is missing ir device");
return c;
}
if (portNum == 0)
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: control properties is missing ir port number");
return c;
}
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
irDev = Global.ControlSystem;
else
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
if (irDev == null)
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: device with IR ports '{0}' not found", portDevKey);
return c;
}
if (portNum <= irDev.NumberOfIROutputPorts) // success!
return new IrOutputPortController(irControllerKey, irDev.IROutputPorts[portNum],
IrDriverPathPrefix + control["irFile"].Value<string>());
else
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: device '{0}' IR port {1} out of range",
portDevKey, portNum);
return c;
}
/*
/// <summary>
/// Returns a ready-to-go IrOutputPortController from a DeviceConfig object.
/// </summary>
public static IrOutputPortController GetIrOutputPortController(DeviceConfig devConf)
{
var irControllerKey = devConf.Key + "-ir";
if (devConf.Properties == null)
{
Debug.Console(0, "[{0}] WARNING: Device config does not include properties. IR will not function.", devConf.Key);
return new IrOutputPortController(irControllerKey, null, "");
}
var control = devConf.Properties["control"];
if (control == null)
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: Device config does not include control properties. IR will not function");
return c;
}
var portDevKey = control.Value<string>("controlPortDevKey");
var portNum = control.Value<uint>("controlPortNumber");
IIROutputPorts irDev = null;
if (portDevKey == null)
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: control properties is missing ir device");
return c;
}
if (portNum == 0)
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: control properties is missing ir port number");
return c;
}
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
irDev = Global.ControlSystem;
else
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
if (irDev == null)
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: device with IR ports '{0}' not found", portDevKey);
return c;
}
if (portNum <= irDev.NumberOfIROutputPorts) // success!
return new IrOutputPortController(irControllerKey, irDev.IROutputPorts[portNum],
IrDriverPathPrefix + control["irFile"].Value<string>());
else
{
var c = new IrOutputPortController(irControllerKey, null, "");
Debug.Console(0, c, "WARNING: device '{0}' IR port {1} out of range",
portDevKey, portNum);
return c;
}
}*/
}
/// <summary>
/// Wrapper to help in IR port creation
/// </summary>
public class IrOutPortConfig
{
public IROutputPort Port { get; set; }
public string FileName { get; set; }
public IrOutPortConfig()
{
FileName = "";
}
}
}
/// <summary>
/// Wrapper to help in IR port creation
/// </summary>
public class IrOutPortConfig
{
public IROutputPort Port { get; set; }
public string FileName { get; set; }
public IrOutPortConfig()
{
FileName = "";
}
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Linq;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json;
@@ -12,8 +13,14 @@ namespace PepperDash.Essentials.Core.Config
/// <summary>
/// Loads the ConfigObject from the file
/// </summary>
public class ConfigReader
{
public class ConfigReader
{
public const string LocalConfigPresent =
@"
***************************************************
************* Using Local config file *************
***************************************************";
public static EssentialsConfig ConfigObject { get; private set; }
public static bool LoadConfig2()
@@ -40,10 +47,10 @@ namespace PepperDash.Essentials.Core.Config
"****Error: Multiple Local Configuration files present. Please ensure only a single file exists and reset program.****");
return false;
}
else if(configFiles.Length == 1)
if(configFiles.Length == 1)
{
localConfigFound = true;
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Found Local config file: '{0}'", filePath);
localConfigFound = true;
}
}
else
@@ -91,7 +98,13 @@ namespace PepperDash.Essentials.Core.Config
}
// Get the actual file path
filePath = configFiles[0].FullName;
filePath = configFiles[0].FullName;
// Generate debug statement if using a local file.
if (localConfigFound)
{
GetLocalFileMessage(filePath);
}
// Read the file
using (StreamReader fs = new StreamReader(filePath))
@@ -177,7 +190,65 @@ namespace PepperDash.Essentials.Core.Config
{
var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
return dev == null ? null : dev.Group;
}
}
private static void GetLocalFileMessage(string filePath)
{
var filePathLength = filePath.Length + 2;
var debugStringWidth = filePathLength + 12;
if (debugStringWidth < 51)
{
debugStringWidth = 51;
}
var qualifier = (filePathLength % 2 != 0)
? " Using Local Config File "
: " Using Local Config File ";
var bookend1 = (debugStringWidth - qualifier.Length) / 2;
var bookend2 = (debugStringWidth - filePathLength) / 2;
var newDebugString = new StringBuilder()
.Append(CrestronEnvironment.NewLine)
// Line 1
.Append(new string('*', debugStringWidth))
.Append(CrestronEnvironment.NewLine)
// Line 2
.Append(new string('*', debugStringWidth))
.Append(CrestronEnvironment.NewLine)
// Line 3
.Append(new string('*', 2))
.Append(new string(' ', debugStringWidth - 4))
.Append(new string('*', 2))
.Append(CrestronEnvironment.NewLine)
// Line 4
.Append(new string('*', 2))
.Append(new string(' ', bookend1 - 2))
.Append(qualifier)
.Append(new string(' ', bookend1 - 2))
.Append(new string('*', 2))
.Append(CrestronEnvironment.NewLine)
// Line 5
.Append(new string('*', 2))
.Append(new string(' ', bookend2 - 2))
.Append(" " + filePath + " ")
.Append(new string(' ', bookend2 - 2))
.Append(new string('*', 2))
.Append(CrestronEnvironment.NewLine)
// Line 6
.Append(new string('*', 2))
.Append(new string(' ', debugStringWidth - 4))
.Append(new string('*', 2))
.Append(CrestronEnvironment.NewLine)
// Line 7
.Append(new string('*', debugStringWidth))
.Append(CrestronEnvironment.NewLine)
// Line 8
.Append(new string('*', debugStringWidth));
Debug.Console(2, Debug.ErrorLogLevel.Notice, "Found Local config file: '{0}'", filePath);
Debug.Console(0, newDebugString.ToString());
}
}
}

View File

@@ -1,5 +1,5 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
@@ -81,7 +81,7 @@ namespace PepperDash.Essentials.Core.Config
// }
//}
/// <summary>
/// <summary>,
/// The OS Version of the processor (Firmware Version)
/// </summary>
[JsonProperty("osVersion")]
@@ -92,5 +92,18 @@ namespace PepperDash.Essentials.Core.Config
// return Crestron.SimplSharp.CrestronEnvironment.OSVersion.Firmware;
// }
//}
/// <summary>
/// The information gathered by the processor at runtime about it's NICs and their IP addresses.
/// </summary>
[JsonProperty("ipInfo")]
public Dictionary<short, EthernetAdapterInfo> IpInfo
{
get
{
return Global.EthernetAdapterInfoCollection;
}
}
}
}

View File

@@ -73,21 +73,21 @@ namespace PepperDash.Essentials.Core.CrestronIO.Cards
string cardType;
if (!_config.Cards.TryGetValue(i, out cardType))
{
Debug.Console(1, this, "No card found for slot {0}", i);
Debug.Console(0, this, "No card found for slot {0}", i);
continue;
}
if (String.IsNullOrEmpty(cardType))
{
Debug.Console(0, this, "No card specified for slot {0}", i);
return;
continue;
}
Func<uint, C3CardControllerBase> cardBuilder;
if (!_cardDict.TryGetValue(cardType.ToLower(), out cardBuilder))
{
Debug.Console(0, "Unable to find factory for 3-Series card type {0}.", cardType);
return;
continue;
}
try

View File

@@ -179,7 +179,7 @@ namespace PepperDash.Essentials.Core
{
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
{
var result = device.Register();
var result = device.Register();
var level = result == eDeviceRegistrationUnRegistrationResponse.Success ?
Debug.ErrorLogLevel.Notice : Debug.ErrorLogLevel.Error;
Debug.Console(0, level, "Register device result: '{0}', type '{1}', result {2}", key, device, result);

View File

@@ -0,0 +1,8 @@
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public interface IHasBranding
{
bool BrandingEnabled { get; }
void InitializeBranding(string roomKey);
}
}

View File

@@ -0,0 +1,7 @@
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IHasFarEndContentStatus
{
BoolFeedback ReceivingContent { get; }
}
}

View File

@@ -0,0 +1,14 @@
using PepperDash.Essentials.Core;
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public interface IHasPhoneDialing
{
BoolFeedback PhoneOffHookFeedback { get; }
StringFeedback CallerIdNameFeedback { get; }
StringFeedback CallerIdNumberFeedback { get; }
void DialPhoneCall(string number);
void EndPhoneCall();
void SendDtmfToPhone(string digit);
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public interface ILanguageDefinition
{
string LocaleName { get; set; }
string FriendlyName { get; set; }
bool Enable { get; set; }
List<LanguageLabel> UiLabels { get; set; }
List<LanguageLabel> Sources { get; set; }
List<LanguageLabel> Destinations { get; set; }
List<LanguageLabel> SourceGroupNames { get; set; }
List<LanguageLabel> DestinationGroupNames { get; set; }
List<LanguageLabel> RoomNames { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public interface ILanguageProvider
{
ILanguageDefinition CurrentLanguage { get; set; }
event EventHandler CurrentLanguageChanged;
}
}

View File

@@ -0,0 +1,12 @@
using PepperDash.Core;
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public class LanguageLabel
{
public string Key { get; set; }
public string Description { get; set; }
public string DisplayText { get; set; }
public uint JoinNumber { get; set; }
}
}

View File

@@ -0,0 +1,138 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash_Essentials_Core.Devices
{
public class GenericIrController: EssentialsBridgeableDevice
{
//data storage for bridging
private BasicTriList _trilist;
private uint _joinStart;
private string _joinMapKey;
private EiscApiAdvanced _bridge;
private readonly IrOutputPortController _port;
public string[] IrCommands {get { return _port.IrFileCommands; }}
public GenericIrController(string key, string name, IrOutputPortController irPort) : base(key, name)
{
_port = irPort;
if (_port == null)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "IR Port is null, device will not function");
return;
}
DeviceManager.AddDevice(_port);
_port.DriverLoaded.OutputChange += DriverLoadedOnOutputChange;
}
private void DriverLoadedOnOutputChange(object sender, FeedbackEventArgs args)
{
if (!args.BoolValue)
{
return;
}
if (_trilist == null || _bridge == null)
{
return;
}
LinkToApi(_trilist, _joinStart, _joinMapKey, _bridge);
}
#region Overrides of EssentialsBridgeableDevice
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
//if driver isn't loaded yet, store the variables until it is loaded, then call the LinkToApi method again
if (!_port.DriverIsLoaded)
{
_trilist = trilist;
_joinStart = joinStart;
_joinMapKey = joinMapKey;
_bridge = bridge;
return;
}
var joinMap = new GenericIrControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GenericIrControllerJoinMap>(joinMapSerialized);
for (uint i = 0; i < _port.IrFileCommands.Length; i++)
{
var cmd = _port.IrFileCommands[i];
var joinData = new JoinDataComplete(new JoinData {JoinNumber = i, JoinSpan = 1},
new JoinMetadata
{
Description = cmd,
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
joinData.SetJoinOffset(joinStart);
joinMap.Joins.Add(cmd,joinData);
trilist.SetBoolSigAction(joinData.JoinNumber, (b) => Press(cmd, b));
}
joinMap.PrintJoinMapInfo();
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.");
}
}
#endregion
public void Press(string command, bool pressRelease)
{
_port.PressRelease(command, pressRelease);
}
}
public sealed class GenericIrControllerJoinMap : JoinMapBaseAdvanced
{
public GenericIrControllerJoinMap(uint joinStart) : base(joinStart)
{
}
}
public class GenericIrControllerFactory : EssentialsDeviceFactory<GenericIrController>
{
public GenericIrControllerFactory()
{
TypeNames = new List<string> {"genericIrController"};
}
#region Overrides of EssentialsDeviceFactory<GenericIRController>
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic IR Controller Device");
var irPort = IRPortHelper.GetIrOutputPortController(dc);
return new GenericIrController(dc.Key, dc.Name, irPort);
}
#endregion
}
}

View File

@@ -0,0 +1,17 @@
using System.Collections.Generic;
namespace PepperDash.Essentials.Core
{
public interface IHasDspPresets
{
List<IDspPreset> Presets { get; }
void RecallPreset(IDspPreset preset);
}
public interface IDspPreset
{
string Name { get; }
}
}

View File

@@ -21,10 +21,14 @@ namespace PepperDash.Essentials.Core
uint IrPortUid;
IROutputPort IrPort;
public BoolFeedback DriverLoaded { get; private set; }
public ushort StandardIrPulseTime { get; set; }
public string DriverFilepath { get; private set; }
public bool DriverIsLoaded { get; private set; }
public string[] IrFileCommands { get { return IrPort.AvailableStandardIRCmds(IrPortUid); } }
/// <summary>
/// Constructor for IrDevice base class. If a null port is provided, this class will
/// still function without trying to talk to a port.
@@ -33,6 +37,8 @@ namespace PepperDash.Essentials.Core
: base(key)
{
//if (port == null) throw new ArgumentNullException("port");
DriverLoaded = new BoolFeedback(() => DriverIsLoaded);
IrPort = port;
if (port == null)
{
@@ -46,12 +52,34 @@ namespace PepperDash.Essentials.Core
DeviceConfig config)
: base(key)
{
DriverLoaded = new BoolFeedback(() => DriverIsLoaded);
AddPostActivationAction(() =>
{
IrPort = postActivationFunc(config);
if (IrPort == null)
{
Debug.Console(0, this, "WARNING No valid IR Port assigned to controller. IR will not function");
return;
}
var filePath = Global.FilePathPrefix + "ir" + Global.DirectorySeparator + config.Properties["control"]["irFile"].Value<string>();
Debug.Console(1, "*************Attempting to load IR file: {0}***************", filePath);
LoadDriver(filePath);
PrintAvailableCommands();
});
}
public void PrintAvailableCommands()
{
Debug.Console(2, this, "Available IR Commands in IR File {0}", IrPortUid);
foreach (var cmd in IrPort.AvailableIRCmds())
{
Debug.Console(2, this, "{0}", cmd);
}
}
/// <summary>
@@ -60,20 +88,23 @@ namespace PepperDash.Essentials.Core
/// <param name="path"></param>
public void LoadDriver(string path)
{
Debug.Console(2, this, "***Loading IR File***");
if (string.IsNullOrEmpty(path)) path = DriverFilepath;
try
{
IrPortUid = IrPort.LoadIRDriver(path);
DriverFilepath = path;
StandardIrPulseTime = 200;
DriverIsLoaded = true;
}
try
{
IrPortUid = IrPort.LoadIRDriver(path);
DriverFilepath = path;
StandardIrPulseTime = 200;
DriverIsLoaded = true;
DriverLoaded.FireUpdate();
}
catch
{
DriverIsLoaded = false;
var message = string.Format("WARNING IR Driver '{0}' failed to load", path);
Debug.Console(0, this, message);
ErrorLog.Error(message);
Debug.Console(0, this, Debug.ErrorLogLevel.Error, message);
DriverLoaded.FireUpdate();
}
}

View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash_Essentials_Core.Gateways
{
public class CenCn2Controller
{
}
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
public class EthernetAdapterInfo
{
public EthernetAdapterType Type { get; set; }
public bool DhcpIsOn { get; set; }
public string Hostname { get; set; }
public string MacAddress { get; set; }
public string IpAddress { get; set; }
public string Subnet { get; set; }
public string Gateway { get; set; }
public string Dns1 { get; set; }
public string Dns2 { get; set; }
public string Dns3 { get; set; }
public string Domain { get; set; }
}
}

View File

@@ -1,175 +1,180 @@
using System;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharp.CrestronDataStore;
using Crestron.SimplSharpPro;
using PepperDash.Core;
using PepperDash.Essentials.License;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;
namespace PepperDash.Essentials.Core
{
public static class Global
{
using System;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using System.Collections.Generic;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharp.CrestronDataStore;
using Crestron.SimplSharpPro;
using PepperDash.Core;
using PepperDash.Essentials.License;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;
namespace PepperDash.Essentials.Core
{
public static class Global
{
public static CrestronControlSystem ControlSystem { get; set; }
public static LicenseManager LicenseManager { get; set; }
/// <summary>
/// The file path prefix to the folder containing configuration files
/// </summary>
public static string FilePathPrefix { get; private set; }
/// <summary>
/// The file path prefix to the applciation directory
/// </summary>
public static string ApplicationDirectoryPathPrefix
{
get
{
return Crestron.SimplSharp.CrestronIO.Directory.GetApplicationDirectory();
}
}
/// <summary>
/// Returns the directory separator character based on the running OS
/// </summary>
public static char DirectorySeparator
{
get
{
return System.IO.Path.DirectorySeparatorChar;
}
}
/// <summary>
/// Wildcarded config file name for global reference
/// </summary>
public const string ConfigFileName = "*configurationFile*.json";
/// <summary>
/// Sets the file path prefix
/// </summary>
/// <param name="prefix"></param>
public static void SetFilePathPrefix(string prefix)
{
FilePathPrefix = prefix;
}
static string _AssemblyVersion;
/// <summary>
/// Gets the Assembly Version of Essentials
/// </summary>
/// <returns>The Assembly Version at Runtime</returns>
public static string AssemblyVersion
{
get
{
return _AssemblyVersion;
}
private set
{
_AssemblyVersion = value;
}
}
/// <summary>
/// Sets the Assembly version to the version of the Essentials Library
/// </summary>
/// <param name="assemblyVersion"></param>
public static void SetAssemblyVersion(string assemblyVersion)
{
AssemblyVersion = assemblyVersion;
}
/// <summary>
/// Checks to see if the running version meets or exceed the minimum specified version. For beta versions (0.xx.yy), will always return true.
/// </summary>
/// <param name="minimumVersion">Minimum specified version in format of xx.yy.zz</param>
/// <returns>Returns true if the running version meets or exceeds the minimum specified version</returns>
public static bool IsRunningMinimumVersionOrHigher(string minimumVersion)
{
Debug.Console(2, "Comparing running version '{0}' to minimum version '{1}'", AssemblyVersion, minimumVersion);
if (String.IsNullOrEmpty(minimumVersion))
{
Debug.Console(0,"Plugin does not specify a minimum version. Loading plugin may not work as expected. Proceeding with loading plugin");
return true;
}
var runtimeVersion = Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*");
var runtimeVersionMajor = Int16.Parse(runtimeVersion.Groups[1].Value);
var runtimeVersionMinor = Int16.Parse(runtimeVersion.Groups[2].Value);
var runtimeVersionBuild = Int16.Parse(runtimeVersion.Groups[3].Value);
var runtimeVer = new Version(runtimeVersionMajor, runtimeVersionMinor, runtimeVersionBuild);
Version minimumVer;
try
{
minimumVer = new Version(minimumVersion);
}
catch
{
Debug.Console(2, "unable to parse minimum version {0}. Bypassing plugin load.", minimumVersion);
return false;
}
// Check for beta build version
if (runtimeVer.Major != 0)
{
return runtimeVer.CompareTo(minimumVer) >= 0;
}
Debug.Console(2, "Running Local Build. Bypassing Dependency Check.");
return true;
/*
var minVersion = Regex.Match(minimumVersion, @"^(\d*).(\d*).(\d*)$");
if(!minVersion.Success)
{
}
var minVersionMajor = Int16.Parse(minVersion.Groups[1].Value);
var minVersionMinor = Int16.Parse(minVersion.Groups[2].Value);
var minVersionBuild = Int16.Parse(minVersion.Groups[3].Value);
if (minVersionMajor > runtimeVersionMajor)
return false;
if (minVersionMinor > runtimeVersionMinor)
return false;
if (minVersionBuild > runtimeVersionBuild)
return false;
return true;
*/
}
static Global()
{
// Fire up CrestronDataStoreStatic
var err = CrestronDataStoreStatic.InitCrestronDataStore();
if (err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
{
CrestronConsole.PrintLine("Error starting CrestronDataStoreStatic: {0}", err);
return;
}
}
}
public static eDevicePlatform Platform { get { return CrestronEnvironment.DevicePlatform; } }
public static Dictionary<short, EthernetAdapterInfo> EthernetAdapterInfoCollection { get; private set; }
public static LicenseManager LicenseManager { get; set; }
/// <summary>
/// The file path prefix to the folder containing configuration files
/// </summary>
public static string FilePathPrefix { get; private set; }
/// <summary>
/// The file path prefix to the applciation directory
/// </summary>
public static string ApplicationDirectoryPathPrefix
{
get
{
return Crestron.SimplSharp.CrestronIO.Directory.GetApplicationDirectory();
}
}
/// <summary>
/// Returns the directory separator character based on the running OS
/// </summary>
public static char DirectorySeparator
{
get
{
return System.IO.Path.DirectorySeparatorChar;
}
}
/// <summary>
/// Wildcarded config file name for global reference
/// </summary>
public const string ConfigFileName = "*configurationFile*.json";
/// <summary>
/// Sets the file path prefix
/// </summary>
/// <param name="prefix"></param>
public static void SetFilePathPrefix(string prefix)
{
FilePathPrefix = prefix;
}
static string _AssemblyVersion;
/// <summary>
/// Gets the Assembly Version of Essentials
/// </summary>
/// <returns>The Assembly Version at Runtime</returns>
public static string AssemblyVersion
{
get
{
return _AssemblyVersion;
}
private set
{
_AssemblyVersion = value;
}
}
/// <summary>
/// Sets the Assembly version to the version of the Essentials Library
/// </summary>
/// <param name="assemblyVersion"></param>
public static void SetAssemblyVersion(string assemblyVersion)
{
AssemblyVersion = assemblyVersion;
}
/// <summary>
/// Checks to see if the running version meets or exceed the minimum specified version. For beta versions (0.xx.yy), will always return true.
/// </summary>
/// <param name="minimumVersion">Minimum specified version in format of xx.yy.zz</param>
/// <returns>Returns true if the running version meets or exceeds the minimum specified version</returns>
public static bool IsRunningMinimumVersionOrHigher(string minimumVersion)
{
Debug.Console(2, "Comparing running version '{0}' to minimum version '{1}'", AssemblyVersion, minimumVersion);
if (String.IsNullOrEmpty(minimumVersion))
{
Debug.Console(0,"Plugin does not specify a minimum version. Loading plugin may not work as expected. Proceeding with loading plugin");
return true;
}
var runtimeVersion = Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*");
var runtimeVersionMajor = Int16.Parse(runtimeVersion.Groups[1].Value);
var runtimeVersionMinor = Int16.Parse(runtimeVersion.Groups[2].Value);
var runtimeVersionBuild = Int16.Parse(runtimeVersion.Groups[3].Value);
var runtimeVer = new Version(runtimeVersionMajor, runtimeVersionMinor, runtimeVersionBuild);
Version minimumVer;
try
{
minimumVer = new Version(minimumVersion);
}
catch
{
Debug.Console(2, "unable to parse minimum version {0}. Bypassing plugin load.", minimumVersion);
return false;
}
// Check for beta build version
if (runtimeVer.Major != 0)
{
return runtimeVer.CompareTo(minimumVer) >= 0;
}
Debug.Console(2, "Running Local Build. Bypassing Dependency Check.");
return true;
/*
var minVersion = Regex.Match(minimumVersion, @"^(\d*).(\d*).(\d*)$");
if(!minVersion.Success)
{
}
var minVersionMajor = Int16.Parse(minVersion.Groups[1].Value);
var minVersionMinor = Int16.Parse(minVersion.Groups[2].Value);
var minVersionBuild = Int16.Parse(minVersion.Groups[3].Value);
if (minVersionMajor > runtimeVersionMajor)
return false;
if (minVersionMinor > runtimeVersionMinor)
return false;
if (minVersionBuild > runtimeVersionBuild)
return false;
return true;
*/
}
static Global()
{
// Fire up CrestronDataStoreStatic
var err = CrestronDataStoreStatic.InitCrestronDataStore();
if (err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
{
CrestronConsole.PrintLine("Error starting CrestronDataStoreStatic: {0}", err);
return;
}
}
}
}

View File

@@ -48,48 +48,39 @@
<ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.ThreeSeriesCards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
@@ -98,33 +89,30 @@
</Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
</Reference>
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference>
<Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -158,6 +146,7 @@
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\VideoCodecControllerJoinMap.cs" />
<Compile Include="Comm and IR\CecPortController.cs" />
<Compile Include="Comm and IR\CommFactory.cs" />
<Compile Include="Comm and IR\CommunicationExtras.cs" />
@@ -200,11 +189,19 @@
<Compile Include="Devices\DeviceFeedbackExtensions.cs" />
<Compile Include="Devices\EssentialsBridgeableDevice.cs" />
<Compile Include="Devices\EssentialsDevice.cs" />
<Compile Include="Devices\GenericIRController.cs" />
<Compile Include="Devices\IDspPreset.cs" />
<Compile Include="Devices\IProjectorInterfaces.cs" />
<Compile Include="Devices\PC\InRoomPc.cs" />
<Compile Include="Devices\PC\Laptop.cs" />
<Compile Include="Devices\ReconfigurableDevice.cs" />
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
<Compile Include="DeviceTypeInterfaces\LanguageLabel.cs" />
<Compile Include="DeviceTypeInterfaces\ILanguageProvider.cs" />
<Compile Include="DeviceTypeInterfaces\IHasBranding.cs" />
<Compile Include="DeviceTypeInterfaces\ILanguageDefinition.cs" />
<Compile Include="DeviceTypeInterfaces\IHasFarEndContentStatus.cs" />
<Compile Include="DeviceTypeInterfaces\IHasPhoneDialing.cs" />
<Compile Include="DeviceTypeInterfaces\IMobileControl.cs" />
<Compile Include="Factory\DeviceFactory.cs" />
<Compile Include="Factory\IDeviceFactory.cs" />
@@ -222,8 +219,13 @@
<Compile Include="Fusion\FusionRviDataClasses.cs" />
<Compile Include="Gateways\CenRfgwController.cs" />
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
<Compile Include="Global\EthernetAdapterInfo.cs" />
<Compile Include="Queues\ComsMessage.cs" />
<Compile Include="Queues\ProcessStringMessage.cs" />
<Compile Include="Queues\GenericQueue.cs" />
<Compile Include="Global\JobTimer.cs" />
<Compile Include="Global\Scheduler.cs" />
<Compile Include="Queues\IQueue.cs" />
<Compile Include="JoinMaps\JoinMapBase.cs" />
<Compile Include="Lighting\Lighting Interfaces.cs" />
<Compile Include="Lighting\LightingBase.cs" />
@@ -238,6 +240,7 @@
<Compile Include="Plugins\PluginLoader.cs" />
<Compile Include="Presets\PresetBase.cs" />
<Compile Include="Plugins\IPluginDeviceFactory.cs" />
<Compile Include="Queues\IQueueMessage.cs" />
<Compile Include="Ramps and Increments\ActionIncrementer.cs" />
<Compile Include="Config\BasicConfig.cs" />
<Compile Include="Config\ConfigPropertiesHelpers.cs" />
@@ -313,6 +316,7 @@
<Compile Include="SmartObjects\SmartObjectDPad.cs" />
<Compile Include="SmartObjects\SmartObjectHelperBase.cs" />
<Compile Include="Routing\TieLine.cs" />
<Compile Include="Queues\StringResponseProcessor.cs" />
<Compile Include="Timers\CountdownTimer.cs" />
<Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" />
<Compile Include="Touchpanels\Interfaces.cs" />

View File

@@ -0,0 +1,73 @@
using System;
using PepperDash.Core;
namespace PepperDash_Essentials_Core.Queues
{
/// <summary>
/// IBasicCommunication Message for IQueue
/// </summary>
public class ComsMessage : IQueueMessage
{
private readonly byte[] _bytes;
private readonly IBasicCommunication _coms;
private readonly string _string;
private readonly bool _isByteMessage;
/// <summary>
/// Constructor for a string message
/// </summary>
/// <param name="coms">IBasicCommunication to send the message</param>
/// <param name="message">Message to send</param>
public ComsMessage(IBasicCommunication coms, string message)
{
Validate(coms, message);
_coms = coms;
_string = message;
}
/// <summary>
/// Constructor for a byte message
/// </summary>
/// <param name="coms">IBasicCommunication to send the message</param>
/// <param name="message">Message to send</param>
public ComsMessage(IBasicCommunication coms, byte[] message)
{
Validate(coms, message);
_coms = coms;
_bytes = message;
_isByteMessage = true;
}
private void Validate(IBasicCommunication coms, object message)
{
if (_coms == null)
throw new ArgumentNullException("coms");
if (message == null)
throw new ArgumentNullException("message");
}
/// <summary>
/// Dispatchs the string/byte[] to the IBasicCommunication specified
/// </summary>
public void Dispatch()
{
if (_isByteMessage)
{
_coms.SendBytes(_bytes);
}
else
{
_coms.SendText(_string);
}
}
/// <summary>
/// Shows either the byte[] or string to be sent
/// </summary>
public override string ToString()
{
return _bytes != null ? _bytes.ToString() : _string;
}
}
}

View File

@@ -0,0 +1,144 @@
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.CrestronThread;
using PepperDash.Core;
namespace PepperDash_Essentials_Core.Queues
{
/// <summary>
/// Threadsafe processing of queued items with pacing if required
/// </summary>
public class GenericQueue : IQueue<IQueueMessage>
{
private readonly string _key;
protected readonly CrestronQueue<IQueueMessage> _queue;
protected readonly Thread _worker;
protected readonly CEvent _waitHandle = new CEvent();
private readonly bool _delayEnabled;
private readonly int _delayTime;
/// <summary>
/// If the instance has been disposed.
/// </summary>
public bool Disposed { get; private set; }
/// <summary>
/// Constructor for generic queue with no pacing
/// </summary>
/// <param name="key">Key</param>
public GenericQueue(string key)
{
_key = key;
_queue = new CrestronQueue<IQueueMessage>();
_worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running);
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
{
if (programEvent != eProgramStatusEventType.Stopping)
return;
Dispose();
};
}
/// <summary>
/// Constructor for generic queue with no pacing
/// </summary>
/// <param name="key">Key</param>
/// <param name="pacing">Pacing in ms between actions</param>
public GenericQueue(string key, int pacing)
: this(key)
{
_delayEnabled = pacing > 0;
_delayTime = pacing;
}
/// <summary>
/// Thread callback
/// </summary>
/// <param name="obj">The action used to process dequeued items</param>
/// <returns>Null when the thread is exited</returns>
private object ProcessQueue(object obj)
{
while (true)
{
IQueueMessage item = null;
if (_queue.Count > 0)
{
item = _queue.Dequeue();
if (item == null)
break;
}
if (item != null)
{
try
{
Debug.Console(2, this, "Processing queue item: '{0}'", item.ToString());
item.Dispatch();
if (_delayEnabled)
Thread.Sleep(_delayTime);
}
catch (Exception ex)
{
Debug.ConsoleWithLog(0, this, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
}
}
else _waitHandle.Wait();
}
return null;
}
public void Enqueue(IQueueMessage item)
{
_queue.Enqueue(item);
_waitHandle.Set();
}
/// <summary>
/// Disposes the thread and cleans up resources. Thread cannot be restarted once
/// disposed.
/// </summary>
public void Dispose()
{
Dispose(true);
CrestronEnvironment.GC.SuppressFinalize(this);
}
/// <summary>
/// Actually does the disposing. If you override this method, be sure to either call the base implementation
/// or clean up all the resources yourself.
/// </summary>
/// <param name="disposing">set to true unless called from finalizer</param>
protected void Dispose(bool disposing)
{
if (Disposed)
return;
if (disposing)
{
Enqueue(null);
_worker.Join();
_waitHandle.Close();
}
Disposed = true;
}
~GenericQueue()
{
Dispose(false);
}
/// <summary>
/// Key
/// </summary>
public string Key
{
get { return _key; }
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash_Essentials_Core.Queues
{
public interface IQueue<T> : IKeyed, IDisposable where T : class
{
void Enqueue(T item);
bool Disposed { get; }
}
}

View File

@@ -0,0 +1,7 @@
namespace PepperDash_Essentials_Core.Queues
{
public interface IQueueMessage
{
void Dispatch();
}
}

View File

@@ -0,0 +1,44 @@
using System;
namespace PepperDash_Essentials_Core.Queues
{
/// <summary>
/// Message class for processing strings via an IQueue
/// </summary>
public class ProcessStringMessage : IQueueMessage
{
private readonly Action<string> _action;
private readonly string _message;
/// <summary>
/// Constructor
/// </summary>
/// <param name="message">Message to be processed</param>
/// <param name="action">Action to invoke on the message</param>
public ProcessStringMessage(string message, Action<string> action)
{
_message = message;
_action = action;
}
/// <summary>
/// Processes the string with the given action
/// </summary>
public void Dispatch()
{
if (_action == null || String.IsNullOrEmpty(_message))
return;
_action(_message);
}
/// <summary>
/// To string
/// </summary>
/// <returns>The current message</returns>
public override string ToString()
{
return _message ?? String.Empty;
}
}
}

View File

@@ -0,0 +1,106 @@
using System;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash_Essentials_Core.Queues
{
public sealed class StringResponseProcessor : IKeyed, IDisposable
{
private readonly Action<string> _processStringAction;
private readonly IQueue<IQueueMessage> _queue;
private readonly IBasicCommunication _coms;
private readonly CommunicationGather _gather;
private StringResponseProcessor(string key, Action<string> processStringAction)
{
_processStringAction = processStringAction;
_queue = new GenericQueue(key);
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
{
if (programEvent != eProgramStatusEventType.Stopping)
return;
Dispose();
};
}
/// <summary>
/// Constructor that builds an instance and subscribes to coms TextReceived for processing
/// </summary>
/// <param name="coms">Com port to process strings from</param>
/// <param name="processStringAction">Action to process the incoming strings</param>
public StringResponseProcessor(IBasicCommunication coms, Action<string> processStringAction)
: this(coms.Key, processStringAction)
{
_coms = coms;
coms.TextReceived += OnResponseReceived;
}
/// <summary>
/// Constructor that builds an instance and subscribes to gather Line Received for processing
/// </summary>
/// <param name="gather">Gather to process strings from</param>
/// <param name="processStringAction">Action to process the incoming strings</param>
public StringResponseProcessor(CommunicationGather gather, Action<string> processStringAction)
: this(gather.Port.Key, processStringAction)
{
_gather = gather;
gather.LineReceived += OnResponseReceived;
}
private void OnResponseReceived(object sender, GenericCommMethodReceiveTextArgs args)
{
_queue.Enqueue(new ProcessStringMessage(args.Text, _processStringAction));
}
/// <summary>
/// Key
/// </summary>
public string Key
{
get { return _queue.Key; }
}
/// <summary>
/// Disposes the instance and cleans up resources.
/// </summary>
public void Dispose()
{
Dispose(true);
CrestronEnvironment.GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (Disposed)
return;
if (disposing)
{
if (_coms != null)
_coms.TextReceived -= OnResponseReceived;
if (_gather != null)
{
_gather.LineReceived -= OnResponseReceived;
_gather.Stop();
}
_queue.Dispose();
}
Disposed = true;
}
/// <summary>
/// If the instance has been disposed or not. If it has, you can not use it anymore
/// </summary>
public bool Disposed { get; private set; }
~StringResponseProcessor()
{
Dispose(false);
}
}
}

View File

@@ -18,32 +18,29 @@ using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core
{
[Description("Wrapper class for all HR-Series remotes")]
public class Hrxx0WirelessRemoteController : EssentialsBridgeableDevice, IHasFeedback
[Description("Wrapper class for all HR-Series remotes")]
public class Hrxx0WirelessRemoteController : EssentialsBridgeableDevice, IHasFeedback, IHR52Button
{
private CenRfgwController _gateway;
private GatewayBase _gatewayBase;
private Hr1x0WirelessRemoteBase _remote;
private Hr1x0WirelessRemoteBase _remote;
public FeedbackCollection<Feedback> Feedbacks { get; set; }
public CrestronCollection<Button> Buttons { get { return _remote.Button; } }
private DeviceConfig _config;
private DeviceConfig _config;
public Hrxx0WirelessRemoteController(string key, Func<DeviceConfig, Hr1x0WirelessRemoteBase> preActivationFunc,
DeviceConfig config)
: base(key, config.Name)
{
Feedbacks = new FeedbackCollection<Feedback>();
var props = JsonConvert.DeserializeObject<CrestronRemotePropertiesConfig>(config.Properties.ToString());
var type = config.Type;
var rfId = (uint)props.Control.InfinetIdInt;
var props = JsonConvert.DeserializeObject<CrestronRemotePropertiesConfig>(config.Properties.ToString());
_config = config;
if (props.GatewayDeviceKey == "processor")
@@ -128,7 +125,20 @@ namespace PepperDash.Essentials.Core
if (handler is Action<bool>)
{
(handler as Action<bool>)(args.Button.State == eButtonState.Pressed ? true : false);
}
}
var newHandler = ButtonStateChange;
if (ButtonStateChange != null)
{
newHandler(device, args);
}
var newerHandler = EssentialsButtonStateChange;
if (EssentialsButtonStateChange != null)
{
newerHandler(this, args);
}
}
catch (Exception e)
{
@@ -312,6 +322,504 @@ namespace PepperDash.Essentials.Core
public void SetTrilistBool(BasicTriList trilist, uint join, bool b)
{
trilist.BooleanInput[join].BoolValue = b;
}
}
#region IHR52Button Members
public Button Custom9
{
get
{
var localRemote = (IHR52Button) _remote;
return localRemote == null ? null : localRemote.Custom9;
}
}
public Button Favorite
{
get
{
var localRemote = (IHR52Button)_remote;
return localRemote == null ? null : localRemote.Favorite;
}
}
public Button Home
{
get
{
var localRemote = (IHR52Button)_remote;
return localRemote == null ? null : localRemote.Home;
}
}
#endregion
#region IHR49Button Members
public Button Clear
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Clear;
}
}
public Button Custom5
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Custom5;
}
}
public Button Custom6
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Custom6;
}
}
public Button Custom7
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Custom7;
}
}
public Button Custom8
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Custom8;
}
}
public Button Enter
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Enter;
}
}
public Button Keypad0
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad0;
}
}
public Button Keypad1
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad1;
}
}
public Button Keypad2Abc
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad2Abc;
}
}
public Button Keypad3Def
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad3Def;
}
}
public Button Keypad4Ghi
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad4Ghi;
}
}
public Button Keypad5Jkl
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad5Jkl;
}
}
public Button Keypad6Mno
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad6Mno;
}
}
public Button Keypad7Pqrs
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad7Pqrs;
}
}
public Button Keypad8Tuv
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad8Tuv;
}
}
public Button Keypad9Wxyz
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad9Wxyz;
}
}
#endregion
#region IHR33Button Members
public Button Blue
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Blue;
}
}
public Button ChannelDown
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.ChannelDown;
}
}
public Button ChannelUp
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.ChannelUp;
}
}
public Button Custom1
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Custom1;
}
}
public Button Custom2
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Custom2;
}
}
public Button Custom3
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Custom3;
}
}
public Button Custom4
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Custom4;
}
}
public Button DialPadDown
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadDown;
}
}
public Button DialPadEnter
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadEnter;
}
}
public Button DialPadLeft
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadLeft;
}
}
public Button DialPadRight
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadRight;
}
}
public Button DialPadUp
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadUp;
}
}
public Button Dvr
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Dvr;
}
}
public Button Exit
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Exit;
}
}
public Button FastForward
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.FastForward;
}
}
public Button Green
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Green;
}
}
public Button Guide
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Blue;
}
}
public Button Information
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Information;
}
}
public Button Last
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Last;
}
}
public Button Menu
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Menu;
}
}
public Button Mute
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Mute;
}
}
public Button NextTrack
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.NextTrack;
}
}
public Button Pause
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Pause;
}
}
public Button Play
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Play;
}
}
public Button Power
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Power;
}
}
public Button PreviousTrack
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.PreviousTrack;
}
}
public Button Record
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Record;
}
}
public Button Red
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Red;
}
}
public Button Rewind
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Rewind;
}
}
public Button Stop
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Stop;
}
}
public Button VolumeDown
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.VolumeDown;
}
}
public Button VolumeUp
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.VolumeUp;
}
}
public Button Yellow
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Yellow;
}
}
#endregion
#region IButton Members
public CrestronCollection<Button> Button
{
get { return Buttons; }
}
public event ButtonEventHandler ButtonStateChange;
public delegate void EssentialsButtonEventHandler(EssentialsDevice device, ButtonEventArgs args);
public event EssentialsButtonEventHandler EssentialsButtonStateChange;
#endregion
}
}

View File

@@ -251,6 +251,12 @@ namespace PepperDash.Essentials.Core
tl.StringInput[sigNum].StringValue = value;
}
public static void SetString(this BasicTriList tl, uint sigNum, string value, eStringEncoding encoding)
{
tl.StringInput[sigNum].StringEncoding = encoding;
tl.StringInput[sigNum].StringValue = value;
}
/// <summary>
/// Returns bool value of trilist sig
/// </summary>

View File

@@ -118,7 +118,10 @@ namespace PepperDash.Essentials.DM
OutputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>();
Debug.Console(1, this, "{0} Switcher Inputs Present.", Dmps.SwitcherInputs.Count);
Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.SwitcherOutputs.Count);
Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.SwitcherOutputs.Count);
Debug.Console(1, this, "{0} Inputs in ControlSystem", Dmps.NumberOfSwitcherInputs);
Debug.Console(1, this, "{0} Outputs in ControlSystem", Dmps.NumberOfSwitcherOutputs);
SetupOutputCards();
@@ -128,32 +131,50 @@ namespace PepperDash.Essentials.DM
public override bool CustomActivate()
{
// Set input and output names from config
if (InputNames != null)
{
foreach (var kvp in InputNames)
{
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
if (input != null)
input.Name.StringValue = kvp.Value;
}
}
if (OutputNames != null)
{
foreach (var kvp in OutputNames)
{
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
if (output != null)
output.Name.StringValue = kvp.Value;
}
}
SetInputNames();
SetOutputNames();
// Subscribe to events
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange);
Dmps.DMOutputChange += new DMOutputEventHandler(Dmps_DMOutputChange);
Dmps.DMInputChange += Dmps_DMInputChange;
Dmps.DMOutputChange += Dmps_DMOutputChange;
return base.CustomActivate();
}
}
private void SetOutputNames()
{
if (OutputNames == null)
{
return;
}
foreach (var kvp in OutputNames)
{
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
if (output != null && output.Name.Type != eSigType.NA)
{
output.Name.StringValue = kvp.Value;
}
}
}
private void SetInputNames()
{
if (InputNames == null)
{
return;
}
foreach (var kvp in InputNames)
{
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
if (input != null && input.Name.Type != eSigType.NA)
{
input.Name.StringValue = kvp.Value;
}
}
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
@@ -175,171 +196,197 @@ namespace PepperDash.Essentials.DM
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
// Link up outputs
for (uint i = 1; i <= Dmps.NumberOfSwitcherInputs; i++)
{
Debug.Console(2, this, "Linking Input Card {0}", i);
LinkInputsToApi(trilist, joinMap);
var ioSlot = i;
var ioSlotJoin = ioSlot - 1;
//if (TxDictionary.ContainsKey(ioSlot))
//{
// Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
// var TxKey = TxDictionary[ioSlot];
// var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase;
// //TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
// // TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
// // trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
// // TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
// // trilist.UShortInput[ApiMap.HdcpSupportCapability[ioSlot]].UShortValue = TxDevice.HdcpSupportCapability;
//}
//else
//{
// // dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
//}
if (VideoInputSyncFeedbacks[ioSlot] != null)
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
if (InputNameFeedbacks[ioSlot] != null)
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
LinkOutputsToApi(trilist, joinMap);
}
private void LinkOutputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
{
for (uint i = 1; i <= Dmps.SwitcherOutputs.Count; i++)
{
Debug.Console(2, this, "Linking Output Card {0}", i);
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, new Action<string>(s =>
{
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
if (inputCard != null)
{
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) && inputCard.NameFeedback.StringValue != s)
if (inputCard.Name != null)
inputCard.Name.StringValue = s;
}
}));
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
}
for (uint i = 1; i <= Dmps.NumberOfSwitcherOutputs; i++)
{
Debug.Console(2, this, "Linking Output Card {0}", i);
var ioSlot = i;
var ioSlotJoin = ioSlot - 1;
var ioSlotJoin = ioSlot - 1;
// Control
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin,
o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin,
o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
{
var outputCard = Dmps.SwitcherOutputs[ioSlot] as DMOutput;
//Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
if (outputCard != null)
{
//Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
if (!(outputCard is Card.Dmps3CodecOutput) && outputCard.NameFeedback != null)
{
if (!string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
{
//Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
{
outputCard.Name.StringValue = s;
}
}
}
}
});
// Feedback
trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
{
var outputCard = Dmps.SwitcherOutputs[ioSlot] as DMOutput;
//Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
if (outputCard == null)
{
return;
}
//Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
if (outputCard is Card.Dmps3CodecOutput || outputCard.NameFeedback == null)
{
return;
}
if (string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
{
return;
}
//Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
{
outputCard.Name.StringValue = s;
}
});
// Feedback
if (VideoOutputFeedbacks[ioSlot] != null)
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
{
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
}
if (AudioOutputFeedbacks[ioSlot] != null)
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
{
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
}
if (OutputNameFeedbacks[ioSlot] != null)
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
{
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
}
if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
{
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(
trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
}
if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
{
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(
trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
}
if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
}
}
{
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
}
}
}
private void LinkInputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
{
for (uint i = 1; i <= Dmps.SwitcherInputs.Count; i++)
{
Debug.Console(2, this, "Linking Input Card {0}", i);
var ioSlot = i;
var ioSlotJoin = ioSlot - 1;
if (VideoInputSyncFeedbacks[ioSlot] != null)
{
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
}
if (InputNameFeedbacks[ioSlot] != null)
{
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
}
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, s =>
{
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
if (inputCard == null)
{
return;
}
if (inputCard.NameFeedback == null || string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) ||
inputCard.NameFeedback.StringValue == s)
{
return;
}
if (inputCard.Name != null)
{
inputCard.Name.StringValue = s;
}
});
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
{
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
}
}
}
/// <summary>
/// Iterate the SwitcherOutputs collection to setup feedbacks and add routing ports
/// </summary>
void SetupOutputCards()
{
foreach (var card in Dmps.SwitcherOutputs)
{
var outputCard = card as DMOutput;
foreach (var card in Dmps.SwitcherOutputs)
{
Debug.Console(1, this, "Output Card Type: {0}", card.CardInputOutputType);
var outputCard = card as DMOutput;
if (outputCard == null)
{
Debug.Console(1, this, "Output card {0} is not a DMOutput", card.CardInputOutputType);
continue;
}
Debug.Console(1, this, "Adding Output Card Number {0} Type: {1}", outputCard.Number, outputCard.CardInputOutputType.ToString());
if (outputCard != null)
VideoOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
{
VideoOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
{
if (outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number; }
else { return 0; };
});
AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
{
if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; }
else { return 0; };
});
if (outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number; }
return 0;
;
});
AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
{
if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; }
return 0;
;
});
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
{
if (outputCard.NameFeedback != null && !string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
{
if (outputCard.NameFeedback != null && !string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
{
Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue);
return outputCard.NameFeedback.StringValue;
}
else
{
return "";
}
});
Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue);
return outputCard.NameFeedback.StringValue;
}
return "";
});
OutputVideoRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
OutputVideoRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
{
if (outputCard.VideoOutFeedback != null && outputCard.VideoOutFeedback.NameFeedback != null)
{
if (outputCard.VideoOutFeedback != null && outputCard.VideoOutFeedback.NameFeedback != null)
{
return outputCard.VideoOutFeedback.NameFeedback.StringValue;
}
else
{
return NoRouteText;
}
});
OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
return outputCard.VideoOutFeedback.NameFeedback.StringValue;
}
return NoRouteText;
});
OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
{
if (outputCard.AudioOutFeedback != null && outputCard.AudioOutFeedback.NameFeedback != null)
{
if (outputCard.AudioOutFeedback != null && outputCard.AudioOutFeedback.NameFeedback != null)
{
return outputCard.AudioOutFeedback.NameFeedback.StringValue;
}
else
{
return NoRouteText;
return outputCard.AudioOutFeedback.NameFeedback.StringValue;
}
return NoRouteText;
});
}
});
OutputEndpointOnlineFeedbacks[outputCard.Number] = new BoolFeedback(() => outputCard.EndpointOnlineFeedback);
OutputEndpointOnlineFeedbacks[outputCard.Number] = new BoolFeedback(() => { return outputCard.EndpointOnlineFeedback; });
AddOutputCard(outputCard.Number, outputCard);
}
AddOutputCard(outputCard.Number, outputCard);
}
}
@@ -494,18 +541,23 @@ namespace PepperDash.Essentials.DM
var cecPort = hdmiOutputCard.HdmiOutputPort;
AddHdmiOutputPort(number, cecPort);
return;
AddHdmiOutputPort(number, cecPort);
}
else if (outputCard is Card.Dmps3HdmiOutputBackend)
{
var hdmiOutputCard = outputCard as Card.Dmps3HdmiOutputBackend;
var cecPort = hdmiOutputCard.HdmiOutputPort;
AddHdmiOutputPort(number, cecPort);
}
else if (outputCard is Card.Dmps3DmOutput)
{
var dmOutputCard = outputCard as Card.Dmps3DmOutput;
var cecPort = dmOutputCard.DmOutputPort;
AddDmOutputPort(number);
return;
{
AddDmOutputPort(number);
}
else if (outputCard is Card.Dmps3DmOutputBackend)
{
AddDmOutputPort(number);
}
else if (outputCard is Card.Dmps3ProgramOutput)
{
@@ -513,50 +565,51 @@ namespace PepperDash.Essentials.DM
var programOutput = new DmpsAudioOutputController(string.Format("processor-programAudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
DeviceManager.AddDevice(programOutput);
return;
DeviceManager.AddDevice(programOutput);
}
else if (outputCard is Card.Dmps3AuxOutput)
{
if (outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux1Output)
{
AddAudioOnlyOutputPort(number, "Aux1");
else if (outputCard is Card.Dmps3AuxOutput)
{
switch (outputCard.CardInputOutputType)
{
case eCardInputOutputType.Dmps3Aux1Output:
{
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.Dmps3OutputBase);
DeviceManager.AddDevice(aux1Output);
}
else if (outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux2Output)
{
AddAudioOnlyOutputPort(number, "Aux2");
DeviceManager.AddDevice(aux1Output);
}
break;
case eCardInputOutputType.Dmps3Aux2Output:
{
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.Dmps3OutputBase);
DeviceManager.AddDevice(aux2Output);
}
return;
}
else if (outputCard is Card.Dmps3CodecOutput)
{
if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec1
|| number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec1
|| number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec1
|| number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec1
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec1)
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec1.ToString());
else if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec2
|| number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec2
|| number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec2
|| number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec2
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec2)
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec2.ToString());
return;
}
DeviceManager.AddDevice(aux2Output);
}
break;
}
}
else if (outputCard is Card.Dmps3CodecOutput)
{
switch (number)
{
case (uint)CrestronControlSystem.eDmps34K350COutputs.Codec1:
case (uint)CrestronControlSystem.eDmps34K250COutputs.Codec1:
case (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec1:
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec1.ToString());
break;
case (uint)CrestronControlSystem.eDmps34K350COutputs.Codec2:
case (uint)CrestronControlSystem.eDmps34K250COutputs.Codec2:
case (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec2:
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec2.ToString());
break;
}
}
else if (outputCard is Card.Dmps3DialerOutput)
{
AddAudioOnlyOutputPort(number, "Dialer");
return;
AddAudioOnlyOutputPort(number, "Dialer");
}
else if (outputCard is Card.Dmps3DigitalMixOutput)
{
@@ -567,13 +620,11 @@ namespace PepperDash.Essentials.DM
if (number == (uint)CrestronControlSystem.eDmps34K250COutputs.Mix2
|| number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix2
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix2)
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix2.ToString());
return;
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix2.ToString());
}
else if (outputCard is Card.Dmps3AecOutput)
{
AddAudioOnlyOutputPort(number, "Aec");
return;
AddAudioOnlyOutputPort(number, "Aec");
}
else
{

View File

@@ -1,4 +1,5 @@
using System;
using System.Linq;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Cards;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using Newtonsoft.Json;
using PepperDash.Core;
@@ -221,6 +222,10 @@ namespace PepperDash.Essentials.DM
DmRmcPropertiesConfig props, string pKey, uint ipid)
{
var parentDev = DeviceManager.GetDeviceForKey(pKey);
if (parentDev is DmpsRoutingController)
{
return GetDmRmcControllerForDmps(key, name, typeName, parentDev as DmpsRoutingController, props.ParentOutputNumber);
}
if (!(parentDev is IDmSwitch))
{
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
@@ -285,6 +290,28 @@ namespace PepperDash.Essentials.DM
return null;
}
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
DmpsRoutingController controller, uint num)
{
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmpsHandler;
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmpsHandler))
{
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
if (output != null)
{
return dmpsHandler(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.",
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 GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
{
try
@@ -305,6 +332,8 @@ namespace PepperDash.Essentials.DM
return null;
}
}
}
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>

View File

@@ -48,18 +48,15 @@
<ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
@@ -68,28 +65,26 @@
</Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
</Reference>
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -40,9 +40,15 @@ namespace PepperDash.Essentials.Devices.Common.Codec
/// <summary>
/// Tracks the directory browse history when browsing beyond the root directory
/// </summary>
[Obsolete("Please use the Stack-based history instead")]
List<CodecDirectory> DirectoryBrowseHistory { get; }
}
public interface IHasDirectoryHistoryStack : IHasDirectory
{
Stack<CodecDirectory> DirectoryBrowseHistoryStack { get; }
}
/// <summary>
///
/// </summary>
@@ -147,6 +153,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("parentFolderId")]
public string ParentFolderId { get; set; }
}
/// <summary>
@@ -157,8 +166,6 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("contacts")]
public List<DirectoryContact> Contacts { get; set; }
[JsonProperty("parentFolderId")]
public string ParentFolderId { get; set; }
public DirectoryFolder()
{
@@ -177,6 +184,8 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("title")]
public string Title { get; set; }
[JsonProperty("contactMethods")]
public List<ContactMethod> ContactMethods { get; set; }

View File

@@ -24,24 +24,32 @@ namespace PepperDash.Essentials.Devices.Common.Codec
public class CodecScheduleAwareness
{
List<Meeting> _Meetings;
List<Meeting> _meetings;
public event EventHandler<MeetingEventArgs> MeetingEventChange;
public event EventHandler<EventArgs> MeetingsListHasChanged;
/// <summary>
private int _meetingWarningMinutes = 5;
public int MeetingWarningMinutes
{
get { return _meetingWarningMinutes; }
set { _meetingWarningMinutes = value; }
}
/// <summary>
/// Setter triggers MeetingsListHasChanged event
/// </summary>
public List<Meeting> Meetings
{
get
{
return _Meetings;
return _meetings;
}
set
{
_Meetings = value;
_meetings = value;
var handler = MeetingsListHasChanged;
if (handler != null)
@@ -51,13 +59,20 @@ namespace PepperDash.Essentials.Devices.Common.Codec
}
}
private CTimer ScheduleChecker;
private CTimer _scheduleChecker;
public CodecScheduleAwareness()
{
Meetings = new List<Meeting>();
ScheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
_scheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
}
public CodecScheduleAwareness(long pollTime)
{
Meetings = new List<Meeting>();
_scheduleChecker = new CTimer(CheckSchedule, null, pollTime, pollTime);
}
private void OnMeetingChange(eMeetingEventChangeType changeType, Meeting meeting)
@@ -74,9 +89,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
// Iterate the meeting list and check if any meeting need to do anythingk
const double meetingTimeEpsilon = 0.0001;
foreach (Meeting m in Meetings)
foreach (var m in Meetings)
{
eMeetingEventChangeType changeType = eMeetingEventChangeType.Unkown;
var changeType = eMeetingEventChangeType.Unkown;
if (m.TimeToMeetingStart.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start
changeType = eMeetingEventChangeType.MeetingStartWarning;
@@ -100,12 +115,17 @@ namespace PepperDash.Essentials.Devices.Common.Codec
/// </summary>
public class Meeting
{
public TimeSpan MeetingWarningMinutes = TimeSpan.FromMinutes(5);
public int MinutesBeforeMeeting;
public string Id { get; set; }
public string Organizer { get; set; }
public string Title { get; set; }
public string Agenda { get; set; }
public TimeSpan MeetingWarningMinutes
{
get { return TimeSpan.FromMinutes(MinutesBeforeMeeting); }
}
public TimeSpan TimeToMeetingStart
{
get
@@ -134,7 +154,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{
get
{
return StartTime.AddMinutes(-5) <= DateTime.Now
return StartTime.AddMinutes(-MinutesBeforeMeeting) <= DateTime.Now
&& DateTime.Now <= EndTime; //.AddMinutes(-5);
}
}

View File

@@ -6,390 +6,398 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using System.Text.RegularExpressions;
namespace PepperDash.Essentials.Devices.Common.DSP
{
// QUESTIONS:
//
// When subscribing, just use the Instance ID for Custom Name?
// Verbose on subscriptions?
// Example subscription feedback responses
// ! "publishToken":"name" "value":-77.0
// ! "myLevelName" -77
public class BiampTesiraForteDsp : DspBase
{
public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; }
public StatusMonitorBase CommunicationMonitor { get; private set; }
new public Dictionary<string, TesiraForteLevelControl> LevelControlPoints { get; private set; }
public bool isSubscribed;
private CTimer SubscriptionTimer;
CrestronQueue CommandQueue;
bool CommandQueueInProgress = false;
//new public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
//new public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
/// <summary>
/// Shows received lines as hex
/// </summary>
public bool ShowHexResponse { get; set; }
public BiampTesiraForteDsp(string key, string name, IBasicCommunication comm, BiampTesiraFortePropertiesConfig props) :
base(key, name)
{
CommandQueue = new CrestronQueue(100);
Communication = comm;
var socket = comm as ISocketStatus;
if (socket != null)
{
// This instance uses IP control
socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
}
else
{
// This instance uses RS-232 control
}
PortGather = new CommunicationGather(Communication, "\x0d\x0a");
PortGather.LineReceived += this.Port_LineReceived;
if (props.CommunicationMonitorProperties != null)
{
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
}
else
{
//#warning Need to deal with this poll string
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 120000, 120000, 300000, "SESSION get aliases\x0d\x0a");
}
LevelControlPoints = new Dictionary<string, TesiraForteLevelControl>();
foreach (KeyValuePair<string, BiampTesiraForteLevelControlBlockConfig> block in props.LevelControlBlocks)
{
this.LevelControlPoints.Add(block.Key, new TesiraForteLevelControl(block.Key, block.Value, this));
}
}
public override bool CustomActivate()
{
Communication.Connect();
CommunicationMonitor.StatusChange += (o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); };
CommunicationMonitor.Start();
CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
return true;
}
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
{
Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());
if (e.Client.IsConnected)
{
// Tasks on connect
}
else
{
// Cleanup items from this session
if (SubscriptionTimer != null)
{
SubscriptionTimer.Stop();
SubscriptionTimer = null;
}
isSubscribed = false;
CommandQueue.Clear();
CommandQueueInProgress = false;
}
}
/// <summary>
/// Initiates the subscription process to the DSP
/// </summary>
void SubscribeToAttributes()
{
SendLine("SESSION set verbose true");
foreach (KeyValuePair<string, TesiraForteLevelControl> level in LevelControlPoints)
{
level.Value.Subscribe();
}
if (!CommandQueueInProgress)
SendNextQueuedCommand();
ResetSubscriptionTimer();
}
/// <summary>
/// Resets or Sets the subscription timer
/// </summary>
void ResetSubscriptionTimer()
{
isSubscribed = true;
if (SubscriptionTimer != null)
{
SubscriptionTimer = new CTimer(o => SubscribeToAttributes(), 30000);
SubscriptionTimer.Reset();
}
}
/// <summary>
/// Handles a response message from the DSP
/// </summary>
/// <param name="dev"></param>
/// <param name="args"></param>
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
{
if (Debug.Level == 2)
Debug.Console(2, this, "RX: '{0}'",
ShowHexResponse ? ComTextHelper.GetEscapedText(args.Text) : args.Text);
Debug.Console(1, this, "RX: '{0}'", args.Text);
try
{
if (args.Text.IndexOf("Welcome to the Tesira Text Protocol Server...") > -1)
{
// Indicates a new TTP session
SubscribeToAttributes();
}
else if (args.Text.IndexOf("publishToken") > -1)
{
// response is from a subscribed attribute
string pattern = "! \"publishToken\":[\"](.*)[\"] \"value\":(.*)";
Match match = Regex.Match(args.Text, pattern);
if (match.Success)
{
string key;
string customName;
string value;
customName = match.Groups[1].Value;
// Finds the key (everything before the '~' character
key = customName.Substring(0, customName.IndexOf("~", 0) - 1);
value = match.Groups[2].Value;
foreach (KeyValuePair<string, TesiraForteLevelControl> controlPoint in LevelControlPoints)
{
if (customName == controlPoint.Value.LevelCustomName || customName == controlPoint.Value.MuteCustomName)
{
controlPoint.Value.ParseSubscriptionMessage(customName, value);
return;
}
}
}
/// same for dialers
/// same for switchers
}
else if (args.Text.IndexOf("+OK") > -1)
{
if (args.Text == "+OK" || args.Text.IndexOf("list\":") > -1 ) // Check for a simple "+OK" only 'ack' repsonse or a list response and ignore
return;
// response is not from a subscribed attribute. From a get/set/toggle/increment/decrement command
if (!CommandQueue.IsEmpty)
{
if (CommandQueue.Peek() is QueuedCommand)
{
// Expected response belongs to a child class
QueuedCommand tempCommand = (QueuedCommand)CommandQueue.TryToDequeue();
//Debug.Console(1, this, "Command Dequeued. CommandQueue Size: {0}", CommandQueue.Count);
tempCommand.ControlPoint.ParseGetMessage(tempCommand.AttributeCode, args.Text);
}
else
{
// Expected response belongs to this class
string temp = (string)CommandQueue.TryToDequeue();
//Debug.Console(1, this, "Command Dequeued. CommandQueue Size: {0}", CommandQueue.Count);
}
if (CommandQueue.IsEmpty)
CommandQueueInProgress = false;
else
SendNextQueuedCommand();
}
}
else if (args.Text.IndexOf("-ERR") > -1)
{
// Error response
switch (args.Text)
{
case "-ERR ALREADY_SUBSCRIBED":
{
ResetSubscriptionTimer();
break;
}
default:
{
Debug.Console(0, this, "Error From DSP: '{0}'", args.Text);
break;
}
}
}
}
catch (Exception e)
{
if (Debug.Level == 2)
Debug.Console(2, this, "Error parsing response: '{0}'\n{1}", args.Text, e);
}
}
/// <summary>
/// Sends a command to the DSP (with delimiter appended)
/// </summary>
/// <param name="s">Command to send</param>
public void SendLine(string s)
{
Debug.Console(1, this, "TX: '{0}'", s);
Communication.SendText(s + "\x0a");
}
/// <summary>
/// Adds a command from a child module to the queue
/// </summary>
/// <param name="command">Command object from child module</param>
public void EnqueueCommand(QueuedCommand commandToEnqueue)
{
CommandQueue.Enqueue(commandToEnqueue);
//Debug.Console(1, this, "Command (QueuedCommand) Enqueued '{0}'. CommandQueue has '{1}' Elements.", commandToEnqueue.Command, CommandQueue.Count);
if(!CommandQueueInProgress)
SendNextQueuedCommand();
}
/// <summary>
/// Adds a raw string command to the queue
/// </summary>
/// <param name="command"></param>
public void EnqueueCommand(string command)
{
CommandQueue.Enqueue(command);
//Debug.Console(1, this, "Command (string) Enqueued '{0}'. CommandQueue has '{1}' Elements.", command, CommandQueue.Count);
if (!CommandQueueInProgress)
SendNextQueuedCommand();
}
/// <summary>
/// Sends the next queued command to the DSP
/// </summary>
void SendNextQueuedCommand()
{
//Debug.Console(2, this, "Attempting to send next queued command. CommandQueueInProgress: {0} Communication isConnected: {1}", CommandQueueInProgress, Communication.IsConnected);
//if (CommandQueue.IsEmpty)
// CommandQueueInProgress = false;
//Debug.Console(1, this, "CommandQueue has {0} Elements:\n", CommandQueue.Count);
//foreach (object o in CommandQueue)
//{
// if (o is string)
// Debug.Console(1, this, "{0}", o);
// else if(o is QueuedCommand)
// {
// var item = (QueuedCommand)o;
// Debug.Console(1, this, "{0}", item.Command);
// }
//}
//Debug.Console(1, this, "End of CommandQueue");
if (Communication.IsConnected && !CommandQueue.IsEmpty)
{
CommandQueueInProgress = true;
if (CommandQueue.Peek() is QueuedCommand)
{
QueuedCommand nextCommand = new QueuedCommand();
nextCommand = (QueuedCommand)CommandQueue.Peek();
SendLine(nextCommand.Command);
}
else
{
string nextCommand = (string)CommandQueue.Peek();
SendLine(nextCommand);
}
}
}
/// <summary>
/// Sends a command to execute a preset
/// </summary>
/// <param name="name">Preset Name</param>
public override void RunPreset(string name)
{
SendLine(string.Format("DEVICE recallPreset {0}", name));
}
public class QueuedCommand
{
public string Command { get; set; }
public string AttributeCode { get; set; }
public TesiraForteControlPoint ControlPoint { get; set; }
}
}
public class BiampTesiraForteDspFactory : EssentialsDeviceFactory<BiampTesiraForteDsp>
{
public BiampTesiraForteDspFactory()
{
TypeNames = new List<string>() { "biamptesira" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new BiampTesira Device");
var comm = CommFactory.CreateCommForDevice(dc);
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<BiampTesiraFortePropertiesConfig>(
dc.Properties.ToString());
return new BiampTesiraForteDsp(dc.Key, dc.Name, comm, props);
}
}
}
using System.Text.RegularExpressions;
namespace PepperDash.Essentials.Devices.Common.DSP
{
// QUESTIONS:
//
// When subscribing, just use the Instance ID for Custom Name?
// Verbose on subscriptions?
// Example subscription feedback responses
// ! "publishToken":"name" "value":-77.0
// ! "myLevelName" -77
public class BiampTesiraForteDsp : DspBase
{
public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; }
public StatusMonitorBase CommunicationMonitor { get; private set; }
public new Dictionary<string, TesiraForteLevelControl> LevelControlPoints { get; private set; }
public bool isSubscribed;
private CTimer SubscriptionTimer;
private CrestronQueue CommandQueue;
private bool CommandQueueInProgress = false;
//new public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
//new public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
/// <summary>
/// Shows received lines as hex
/// </summary>
public bool ShowHexResponse { get; set; }
public BiampTesiraForteDsp(string key, string name, IBasicCommunication comm,
BiampTesiraFortePropertiesConfig props) :
base(key, name)
{
CommandQueue = new CrestronQueue(100);
Communication = comm;
var socket = comm as ISocketStatus;
if (socket != null)
{
// This instance uses IP control
socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
}
else
{
// This instance uses RS-232 control
}
PortGather = new CommunicationGather(Communication, "\x0d\x0a");
PortGather.LineReceived += this.Port_LineReceived;
if (props.CommunicationMonitorProperties != null)
{
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication,
props.CommunicationMonitorProperties);
}
else
{
//#warning Need to deal with this poll string
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 120000, 120000, 300000,
"SESSION get aliases\x0d\x0a");
}
LevelControlPoints = new Dictionary<string, TesiraForteLevelControl>();
foreach (KeyValuePair<string, BiampTesiraForteLevelControlBlockConfig> block in props.LevelControlBlocks)
{
this.LevelControlPoints.Add(block.Key, new TesiraForteLevelControl(block.Key, block.Value, this));
}
}
public override bool CustomActivate()
{
Communication.Connect();
CommunicationMonitor.StatusChange +=
(o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); };
CommunicationMonitor.Start();
CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "",
ConsoleAccessLevelEnum.AccessOperator);
return true;
}
private void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
{
Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());
if (e.Client.IsConnected)
{
// Tasks on connect
}
else
{
// Cleanup items from this session
if (SubscriptionTimer != null)
{
SubscriptionTimer.Stop();
SubscriptionTimer = null;
}
isSubscribed = false;
CommandQueue.Clear();
CommandQueueInProgress = false;
}
}
/// <summary>
/// Initiates the subscription process to the DSP
/// </summary>
private void SubscribeToAttributes()
{
SendLine("SESSION set verbose true");
foreach (KeyValuePair<string, TesiraForteLevelControl> level in LevelControlPoints)
{
level.Value.Subscribe();
}
if (!CommandQueueInProgress)
SendNextQueuedCommand();
ResetSubscriptionTimer();
}
/// <summary>
/// Resets or Sets the subscription timer
/// </summary>
private void ResetSubscriptionTimer()
{
isSubscribed = true;
if (SubscriptionTimer != null)
{
SubscriptionTimer = new CTimer(o => SubscribeToAttributes(), 30000);
SubscriptionTimer.Reset();
}
}
/// <summary>
/// Handles a response message from the DSP
/// </summary>
/// <param name="dev"></param>
/// <param name="args"></param>
private void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
{
if (Debug.Level == 2)
Debug.Console(2, this, "RX: '{0}'",
ShowHexResponse ? ComTextHelper.GetEscapedText(args.Text) : args.Text);
Debug.Console(1, this, "RX: '{0}'", args.Text);
try
{
if (args.Text.IndexOf("Welcome to the Tesira Text Protocol Server...") > -1)
{
// Indicates a new TTP session
SubscribeToAttributes();
}
else if (args.Text.IndexOf("publishToken") > -1)
{
// response is from a subscribed attribute
string pattern = "! \"publishToken\":[\"](.*)[\"] \"value\":(.*)";
Match match = Regex.Match(args.Text, pattern);
if (match.Success)
{
string key;
string customName;
string value;
customName = match.Groups[1].Value;
// Finds the key (everything before the '~' character
key = customName.Substring(0, customName.IndexOf("~", 0) - 1);
value = match.Groups[2].Value;
foreach (KeyValuePair<string, TesiraForteLevelControl> controlPoint in LevelControlPoints)
{
if (customName == controlPoint.Value.LevelCustomName ||
customName == controlPoint.Value.MuteCustomName)
{
controlPoint.Value.ParseSubscriptionMessage(customName, value);
return;
}
}
}
/// same for dialers
/// same for switchers
}
else if (args.Text.IndexOf("+OK") > -1)
{
if (args.Text == "+OK" || args.Text.IndexOf("list\":") > -1)
// Check for a simple "+OK" only 'ack' repsonse or a list response and ignore
return;
// response is not from a subscribed attribute. From a get/set/toggle/increment/decrement command
if (!CommandQueue.IsEmpty)
{
if (CommandQueue.Peek() is QueuedCommand)
{
// Expected response belongs to a child class
QueuedCommand tempCommand = (QueuedCommand) CommandQueue.TryToDequeue();
//Debug.Console(1, this, "Command Dequeued. CommandQueue Size: {0}", CommandQueue.Count);
tempCommand.ControlPoint.ParseGetMessage(tempCommand.AttributeCode, args.Text);
}
else
{
// Expected response belongs to this class
string temp = (string) CommandQueue.TryToDequeue();
//Debug.Console(1, this, "Command Dequeued. CommandQueue Size: {0}", CommandQueue.Count);
}
if (CommandQueue.IsEmpty)
CommandQueueInProgress = false;
else
SendNextQueuedCommand();
}
}
else if (args.Text.IndexOf("-ERR") > -1)
{
// Error response
switch (args.Text)
{
case "-ERR ALREADY_SUBSCRIBED":
{
ResetSubscriptionTimer();
break;
}
default:
{
Debug.Console(0, this, "Error From DSP: '{0}'", args.Text);
break;
}
}
}
}
catch (Exception e)
{
if (Debug.Level == 2)
Debug.Console(2, this, "Error parsing response: '{0}'\n{1}", args.Text, e);
}
}
/// <summary>
/// Sends a command to the DSP (with delimiter appended)
/// </summary>
/// <param name="s">Command to send</param>
public void SendLine(string s)
{
Debug.Console(1, this, "TX: '{0}'", s);
Communication.SendText(s + "\x0a");
}
/// <summary>
/// Adds a command from a child module to the queue
/// </summary>
/// <param name="command">Command object from child module</param>
public void EnqueueCommand(QueuedCommand commandToEnqueue)
{
CommandQueue.Enqueue(commandToEnqueue);
//Debug.Console(1, this, "Command (QueuedCommand) Enqueued '{0}'. CommandQueue has '{1}' Elements.", commandToEnqueue.Command, CommandQueue.Count);
if (!CommandQueueInProgress)
SendNextQueuedCommand();
}
/// <summary>
/// Adds a raw string command to the queue
/// </summary>
/// <param name="command"></param>
public void EnqueueCommand(string command)
{
CommandQueue.Enqueue(command);
//Debug.Console(1, this, "Command (string) Enqueued '{0}'. CommandQueue has '{1}' Elements.", command, CommandQueue.Count);
if (!CommandQueueInProgress)
SendNextQueuedCommand();
}
/// <summary>
/// Sends the next queued command to the DSP
/// </summary>
private void SendNextQueuedCommand()
{
//Debug.Console(2, this, "Attempting to send next queued command. CommandQueueInProgress: {0} Communication isConnected: {1}", CommandQueueInProgress, Communication.IsConnected);
//if (CommandQueue.IsEmpty)
// CommandQueueInProgress = false;
//Debug.Console(1, this, "CommandQueue has {0} Elements:\n", CommandQueue.Count);
//foreach (object o in CommandQueue)
//{
// if (o is string)
// Debug.Console(1, this, "{0}", o);
// else if(o is QueuedCommand)
// {
// var item = (QueuedCommand)o;
// Debug.Console(1, this, "{0}", item.Command);
// }
//}
//Debug.Console(1, this, "End of CommandQueue");
if (Communication.IsConnected && !CommandQueue.IsEmpty)
{
CommandQueueInProgress = true;
if (CommandQueue.Peek() is QueuedCommand)
{
QueuedCommand nextCommand = new QueuedCommand();
nextCommand = (QueuedCommand) CommandQueue.Peek();
SendLine(nextCommand.Command);
}
else
{
string nextCommand = (string) CommandQueue.Peek();
SendLine(nextCommand);
}
}
}
/// <summary>
/// Sends a command to execute a preset
/// </summary>
/// <param name="name">Preset Name</param>
public void RunPreset(string name)
{
SendLine(string.Format("DEVICE recallPreset {0}", name));
}
public class QueuedCommand
{
public string Command { get; set; }
public string AttributeCode { get; set; }
public TesiraForteControlPoint ControlPoint { get; set; }
}
}
public class BiampTesiraForteDspFactory : EssentialsDeviceFactory<BiampTesiraForteDsp>
{
public BiampTesiraForteDspFactory()
{
TypeNames = new List<string>() {"biamptesira"};
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new BiampTesira Device");
var comm = CommFactory.CreateCommForDevice(dc);
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<BiampTesiraFortePropertiesConfig>(
dc.Properties.ToString());
return new BiampTesiraForteDsp(dc.Key, dc.Name, comm, props);
}
}
}

View File

@@ -15,18 +15,19 @@ namespace PepperDash.Essentials.Devices.Common.DSP
public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
public abstract void RunPreset(string name);
public DspBase(string key, string name) :
base(key, name) { }
public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
public DspBase(string key, string name) :
base(key, name)
{
}
// in audio call feedback
// VOIP
// Phone dialer
// Phone dialer
}
// Fusion

View File

@@ -48,57 +48,47 @@
<ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Lighting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
</Reference>
<Reference Include="PepperDash_Essentials_Core, Version=0.0.0.22043, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Essentials Core\PepperDashEssentialsBase\bin\PepperDash_Essentials_Core.dll</HintPath>
</Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
</Reference>
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
<Private>True</Private>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -130,6 +120,8 @@
<Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" />
<Compile Include="Cameras\CameraControl.cs" />
<Compile Include="Display\PanasonicThDisplay.cs" />
<Compile Include="VideoCodec\Interfaces\IHasParticipants.cs" />
<Compile Include="VideoCodec\Interfaces\IHasSelfviewPosition.cs" />
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
<Compile Include="Codec\iHasCallFavorites.cs" />
<Compile Include="Codec\iHasCallHistory.cs" />
@@ -187,6 +179,12 @@
<Compile Include="VideoCodec\ZoomRoom\ZoomRoomPropertiesConfig.cs" />
<None Include="Properties\ControlSystem.cfg" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj">
<Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project>
<Name>PepperDash_Essentials_Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>

View File

@@ -17,7 +17,6 @@ using PepperDash.Essentials.Core.CrestronIO;
using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.Devices.Common.DSP;
using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common.Environment;
namespace PepperDash.Essentials.Devices.Common

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
@@ -32,39 +33,50 @@ namespace PepperDash.Essentials.Devices.Common
AnyAudioOut = new RoutingOutputPort(RoutingPortNames.AnyAudioOut, eRoutingSignalType.Audio,
eRoutingPortConnectionType.DigitalAudio, null, this);
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut, AnyAudioOut };
PrintExpectedIrCommands();
}
public void PrintExpectedIrCommands()
{
var cmds = typeof (AppleTvIrCommands).GetCType().GetFields(BindingFlags.Public | BindingFlags.Static);
#region IDPad Members
foreach (var value in cmds.Select(cmd => cmd.GetValue(null)).OfType<string>())
{
Debug.Console(2, this, "Expected IR Function Name: {0}", value);
}
}
#region IDPad Members
public void Up(bool pressRelease)
{
IrPort.PressRelease("+", pressRelease);
IrPort.PressRelease(AppleTvIrCommands.Up, pressRelease);
}
public void Down(bool pressRelease)
{
IrPort.PressRelease("-", pressRelease);
IrPort.PressRelease(AppleTvIrCommands.Down, pressRelease);
}
public void Left(bool pressRelease)
{
IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_MINUS, pressRelease);
IrPort.PressRelease(AppleTvIrCommands.Left, pressRelease);
}
public void Right(bool pressRelease)
{
IrPort.PressRelease(IROutputStandardCommands.IROut_TRACK_PLUS, pressRelease);
IrPort.PressRelease(AppleTvIrCommands.Right, pressRelease);
}
public void Select(bool pressRelease)
{
IrPort.PressRelease(IROutputStandardCommands.IROut_ENTER, pressRelease);
IrPort.PressRelease(AppleTvIrCommands.Enter, pressRelease);
}
public void Menu(bool pressRelease)
{
IrPort.PressRelease("Menu", pressRelease);
IrPort.PressRelease(AppleTvIrCommands.Menu, pressRelease);
}
public void Exit(bool pressRelease)
@@ -78,12 +90,12 @@ namespace PepperDash.Essentials.Devices.Common
public void Play(bool pressRelease)
{
IrPort.PressRelease("PLAY/PAUSE", pressRelease);
IrPort.PressRelease(AppleTvIrCommands.PlayPause, pressRelease);
}
public void Pause(bool pressRelease)
{
IrPort.PressRelease("PLAY/PAUSE", pressRelease);
IrPort.PressRelease(AppleTvIrCommands.PlayPause, pressRelease);
}
/// <summary>
@@ -190,4 +202,17 @@ namespace PepperDash.Essentials.Devices.Common
}
}
public static class AppleTvIrCommands
{
public static string Up = "+";
public static string Down = "-";
public static string Left = IROutputStandardCommands.IROut_TRACK_MINUS;
public static string Right = IROutputStandardCommands.IROut_TRACK_PLUS;
public static string Enter = IROutputStandardCommands.IROut_ENTER;
public static string PlayPause = "PLAY/PAUSE";
public static string Rewind = "REWIND";
public static string Menu = "Menu";
public static string FastForward = "FASTFORWARD";
}
}

View File

@@ -5,17 +5,20 @@ using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.CrestronThread;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Devices.Common.Cameras;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{
@@ -25,10 +28,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching, IHasBranding
{
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
private CTimer _brandingTimer;
public CommunicationGather PortGather { get; private set; }
public StatusMonitorBase CommunicationMonitor { get; private set; }
@@ -401,13 +406,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CreateOsdSource();
if (props.ExternalSourceListEnabled != null)
{
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
}
ExternalSourceListEnabled = props.ExternalSourceListEnabled;
if (props.UiBranding == null)
{
return;
}
Debug.Console(2, this, "Setting branding properties enable: {0} _brandingUrl {1}", props.UiBranding.Enable,
props.UiBranding.BrandingUrl);
BrandingEnabled = props.UiBranding.Enable;
_brandingUrl = props.UiBranding.BrandingUrl;
}
/// <summary>
/// Runs in it's own thread to dequeue messages in the order they were received to be processed
/// </summary>
/// <returns></returns>
@@ -443,6 +454,83 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
TieLineCollection.Default.Add(tl);
}
public void InitializeBranding(string roomKey)
{
Debug.Console(1, this, "Initializing Branding for room {0}", roomKey);
if (!BrandingEnabled)
{
return;
}
var mcBridgeKey = String.Format("mobileControlBridge-{0}", roomKey);
var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey) as IMobileControlRoomBridge;
if (!String.IsNullOrEmpty(_brandingUrl))
{
Debug.Console(1, this, "Branding URL found: {0}", _brandingUrl);
if (_brandingTimer != null)
{
_brandingTimer.Stop();
_brandingTimer.Dispose();
}
_brandingTimer = new CTimer((o) =>
{
if (_sendMcUrl)
{
SendMcBrandingUrl(mcBridge);
_sendMcUrl = false;
}
else
{
SendBrandingUrl();
_sendMcUrl = true;
}
}, 0, 15000);
} else if (String.IsNullOrEmpty(_brandingUrl))
{
Debug.Console(1, this, "No Branding URL found");
if (mcBridge == null) return;
Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl);
mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge);
SendMcBrandingUrl(mcBridge);
}
}
private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge)
{
if (mcBridge == null)
{
return;
}
Debug.Console(1, this, "Sending url: {0}", mcBridge.QrCodeUrl);
SendText("xconfiguration userinterface custommessage: \"Scan the QR code with a mobile phone to get started\"");
SendText("xconfiguration userinterface osd halfwakemessage: \"Tap the touch panel or scan the QR code with a mobile phone to get started\"");
SendText(String.Format(
"xcommand userinterface branding fetch type: branding url: {0}",
mcBridge.QrCodeUrl));
SendText(String.Format(
"xcommand userinterface branding fetch type: halfwakebranding url: {0}",
mcBridge.QrCodeUrl));
}
private void SendBrandingUrl()
{
Debug.Console(1, this, "Sending url: {0}", _brandingUrl);
SendText(String.Format("xcommand userinterface branding fetch type: branding url: {0}",
_brandingUrl));
SendText(String.Format("xcommand userinterface branding fetch type: halfwakebranding url: {0}",
_brandingUrl));
}
/// <summary>
/// Starts the HTTP feedback server and syncronizes state of codec
/// </summary>
@@ -1388,6 +1476,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText("xCommand Standby Deactivate");
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
throw new NotImplementedException();
}
/// <summary>
/// Reboots the codec
/// </summary>
@@ -1835,6 +1928,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
private set;
}
public bool BrandingEnabled { get; private set; }
private string _brandingUrl;
private bool _sendMcUrl;
/// <summary>
/// Adds an external source to the Cisco
/// </summary>
@@ -2006,6 +2103,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Cisco Codec Device");
var comm = CommFactory.CreateCommForDevice(dc);
return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm);
}

View File

@@ -40,6 +40,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("phonebookResultsLimit")]
public uint PhonebookResultsLimit { get; set; }
[JsonProperty("UiBranding")]
public BrandingLogoProperties UiBranding { get; set; }
}
public class SharingProperties
@@ -47,4 +50,13 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("autoShareContentWhileInCall")]
public bool AutoShareContentWhileInCall { get; set; }
}
public class BrandingLogoProperties
{
[JsonProperty("enable")]
public bool Enable { get; set; }
[JsonProperty("brandingUrl")]
public string BrandingUrl { get; set; }
}
}

View File

@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
{
public interface IHasParticipants
{
CodecParticipants Participants { get; }
}
public interface IHasParticipantVideoMute:IHasParticipants
{
void MuteVideoForParticipant(int userId);
void UnmuteVideoForParticipant(int userId);
void ToggleVideoForParticipant(int userId);
}
public interface IHasParticipantAudioMute:IHasParticipantVideoMute
{
void MuteAudioForParticipant(int userId);
void UnmuteAudioForParticipant(int userId);
void ToggleAudioForParticipant(int userId);
}
public class CodecParticipants
{
private List<Participant> _currentParticipants;
public List<Participant> CurrentParticipants {
get { return _currentParticipants; }
set
{
_currentParticipants = value;
var handler = ParticipantsListHasChanged;
if(handler == null) return;
handler(this, new EventArgs());
}
}
public event EventHandler<EventArgs> ParticipantsListHasChanged;
public CodecParticipants()
{
_currentParticipants = new List<Participant>();
}
}
public class Participant
{
public bool IsHost { get; set; }
public string Name { get; set; }
public bool CanMuteVideo { get; set; }
public bool CanUnmuteVideo { get; set; }
public bool VideoMuteFb { get; set; }
public bool AudioMuteFb { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IHasSelfviewPosition
{
StringFeedback SelfviewPipPositionFeedback { get; }
void SelfviewPipPositionSet(CodecCommandWithLabel position);
void SelfviewPipPositionToggle();
}
}

View File

@@ -3,9 +3,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Devices.Common.Codec;
@@ -226,6 +227,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
_StandbyIsOn = false;
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
throw new NotImplementedException();
}
/// <summary>
/// Called by routing to make it happen
/// </summary>

View File

@@ -11,6 +11,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
@@ -57,6 +58,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public List<zStatus.AudioVideoInputOutputLineItem> AudioInputs { get; set; }
public List<zStatus.AudioVideoInputOutputLineItem> AudioOuputs { get; set; }
public List<zStatus.AudioVideoInputOutputLineItem> Cameras { get; set; }
public zEvent.PhoneCallStatus PhoneCall { get; set; }
public ZoomRoomStatus()
{
@@ -73,6 +75,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
AudioInputs = new List<zStatus.AudioVideoInputOutputLineItem>();
AudioOuputs = new List<zStatus.AudioVideoInputOutputLineItem>();
Cameras = new List<zStatus.AudioVideoInputOutputLineItem>();
PhoneCall = new zEvent.PhoneCallStatus();
}
}
@@ -85,6 +88,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public zConfiguration.Audio Audio { get; set; }
public zConfiguration.Video Video { get; set; }
public zConfiguration.Client Client { get; set; }
public zConfiguration.Camera Camera { get; set; }
public ZoomRoomConfiguration()
{
@@ -92,6 +96,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Audio = new zConfiguration.Audio();
Video = new zConfiguration.Video();
Client = new zConfiguration.Client();
Camera = new zConfiguration.Camera();
}
}
@@ -255,9 +260,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
/// <returns></returns>
public static CodecDirectory ConvertZoomContactsToGeneric(List<Contact> zoomContacts)
{
var directory = new Codec.CodecDirectory();
var directory = new CodecDirectory();
var folders = new List<Codec.DirectoryItem>();
var folders = new List<DirectoryItem>();
var roomFolder = new DirectoryFolder();
@@ -272,9 +277,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
// If so, setup a rooms and contacts folder and add them.
roomFolder.Name = "Rooms";
roomFolder.ParentFolderId = "root";
roomFolder.FolderId = "rooms";
contactFolder.Name = "Contacts";
contactFolder.ParentFolderId = "root";
contactFolder.FolderId = "contacts";
folders.Add(roomFolder);
@@ -285,21 +292,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
try
{
if (zoomContacts.Count > 0)
if (zoomContacts.Count == 0) return directory;
{
foreach (Contact c in zoomContacts)
{
var contact = new ZoomDirectoryContact();
contact.Name = c.ScreenName;
contact.ContactId = c.Jid;
var contact = new ZoomDirectoryContact {Name = c.ScreenName, ContactId = c.Jid};
if (folders.Count > 0)
{
if (c.IsZoomRoom)
contact.FolderId = roomFolder.FolderId;
else
contact.FolderId = contactFolder.FolderId;
contact.ParentFolderId = c.IsZoomRoom ? "rooms" : "contacts";
}
contacts.Add(contact);
@@ -371,7 +372,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public CallRecordInfo CallRecordInfo { get; set; }
public zCommand.InfoResult Info { get; set; }
private zCommand.InfoResult _info;
public zCommand.InfoResult Info
{
get
{
return _info;
}
set
{
_info = value;
NotifyPropertyChanged("Info");
}
}
public Call()
{
@@ -577,7 +591,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public string meetingID { get; set; }
public string password { get; set; }
public string meetingOption { get; set; }
public int MeetingNumber { get; set; }
public long MeetingNumber { get; set; }
public string callerName { get; set; }
public string avatarURL { get; set; }
public int lifeTime { get; set; }
@@ -688,6 +702,86 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
[JsonProperty("why_cannot_pin_share")]
public string WhyCannotPinShare { get; set; }
}
public class PhoneCallStatus:NotifiableObject
{
private bool _isIncomingCall;
private string _peerDisplayName;
private string _peerNumber;
private bool _offHook;
public string CallId { get; set; }
public bool IsIncomingCall {
get { return _isIncomingCall; }
set
{
if(value == _isIncomingCall) return;
_isIncomingCall = value;
NotifyPropertyChanged("IsIncomingCall");
} }
public string PeerDisplayName
{
get { return _peerDisplayName; }
set
{
if (value == _peerDisplayName) return;
_peerDisplayName = value;
NotifyPropertyChanged("PeerDisplayName");
}
}
public string PeerNumber
{
get { return _peerNumber; }
set
{
if (value == _peerNumber) return;
_peerNumber = value;
NotifyPropertyChanged("PeerNumber");
}
}
public string PeerUri { get; set; }
private ePhoneCallStatus _status;
public ePhoneCallStatus Status
{
get { return _status; }
set
{
_status = value;
OffHook = _status == ePhoneCallStatus.PhoneCallStatus_Accepted ||
_status == ePhoneCallStatus.PhoneCallStatus_InCall ||
_status == ePhoneCallStatus.PhoneCallStatus_Init ||
_status == ePhoneCallStatus.PhoneCallStatus_Ringing;
}
}
public bool OffHook
{
get { return _offHook; }
set
{
if (value == _offHook) return;
_offHook = value;
NotifyPropertyChanged("OffHook");
}
}
}
public enum ePhoneCallStatus
{
PhoneCallStatus_Ringing,
PhoneCallStatus_Terminated,
PhoneCallStatus_Accepted,
PhoneCallStatus_InCall,
PhoneCallStatus_Init,
}
}
/// <summary>
@@ -701,9 +795,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public bool OptimizeVideoSharing { get; set; }
}
public class Camera
public class Camera : NotifiableObject
{
public bool Mute { get; set; }
private bool _mute;
public bool Mute
{
get { return _mute; }
set
{
Debug.Console(1, "Camera Mute response received: {0}", value);
if (value == _mute) return;
_mute = value;
NotifyPropertyChanged("Mute");
}
}
}
public class Microphone : NotifiableObject
@@ -757,12 +865,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
DownLeft
}
public class Layout
public class Layout:NotifiableObject
{
public bool ShareThumb { get; set; }
public eLayoutStyle Style { get; set; }
public eLayoutSize Size { get; set; }
public eLayoutPosition Position { get; set; }
private eLayoutPosition _position;
public eLayoutPosition Position {
get { return _position; }
set
{
_position = value;
NotifyPropertyChanged("Position");
} }
}
public class Lock
@@ -831,13 +947,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
get
{
return this._volume;
return _volume;
}
set
{
if (value != _volume)
{
this._volume = value;
_volume = value;
NotifyPropertyChanged("Volume");
}
}
@@ -913,7 +1029,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
/// </summary>
public class zCommand
{
public partial class BookingsListResult
public class BookingsListResult
{
[JsonProperty("accessRole")]
public string AccessRole { get; set; }
@@ -949,8 +1065,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public ThirdParty ThirdParty { get; set; }
}
public static List<Meeting> GetGenericMeetingsFromBookingResult(List<BookingsListResult> bookings,
int minutesBeforeMeetingStart)
{
var rv = GetGenericMeetingsFromBookingResult(bookings);
foreach (var meeting in rv)
{
meeting.MinutesBeforeMeeting = minutesBeforeMeetingStart;
}
return rv;
}
/// <summary>
/// Extracts the necessary meeting values from the Cisco bookings response ans converts them to the generic class
/// Extracts the necessary meeting values from the Zoom bookings response and converts them to the generic class
/// </summary>
/// <param name="bookings"></param>
/// <returns></returns>
@@ -983,6 +1111,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
meeting.Privacy = b.IsPrivate ? eMeetingPrivacy.Private : eMeetingPrivacy.Public;
// No meeting.Calls data exists for Zoom Rooms. Leaving out for now.
var now = DateTime.Now;
if (meeting.StartTime < now && meeting.EndTime < now)
{
Debug.Console(1, "Skipping meeting {0}. Meeting is in the past.", meeting.Title);
continue;
}
meetings.Add(meeting);
@@ -1070,6 +1204,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{
HandStatus = new HandStatus();
}
public static List<Participant> GetGenericParticipantListFromParticipantsResult(
List<ListParticipant> participants)
{
return
participants.Select(
p =>
new Participant
{
Name = p.UserName,
IsHost = p.IsHost,
CanMuteVideo = p.IsVideoCanMuteByHost,
CanUnmuteVideo = p.IsVideoCanUnmuteByHost,
AudioMuteFb = p.AudioStatusState == "AUDIO_MUTED",
VideoMuteFb = p.VideoStatusIsSending
}).ToList();
}
}
public class CallinCountryList

View File

@@ -68,7 +68,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
/// <summary>
/// Builds the command and triggers the parent ZoomRoom to send it
/// </summary>
/// <param name="id"></param>
/// <param name="state"></param>
/// <param name="action"></param>
void SendCommand(eZoomRoomCameraState state, eZoomRoomCameraAction action)
@@ -79,23 +78,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
void StartContinueTimer()
{
if(ContinueTimer == null)
ContinueTimer = new CTimer((o) => SendContinueAction(LastAction), ContinueTime);
if (ContinueTimer == null)
ContinueTimer = new CTimer((o) => SendContinueAction(LastAction), null, ContinueTime, ContinueTime);
}
void SendContinueAction(eZoomRoomCameraAction action)
{
SendCommand(eZoomRoomCameraState.Continue, action);
ContinueTimer.Reset();
}
void StopContinueTimer()
{
if (ContinueTimer != null)
if (ContinueTimer == null)
{
ContinueTimer.Stop();
ContinueTimer.Dispose();
return;
}
ContinueTimer.Stop();
ContinueTimer.Dispose();
ContinueTimer = null;
}
#region IHasCameraPtzControl Members
@@ -111,22 +112,26 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public void PanLeft()
{
if (!isMoving)
if (isMoving)
{
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Left);
StartContinueTimer();
isPanning = true;
return;
}
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Left);
StartContinueTimer();
isPanning = true;
}
public void PanRight()
{
if (!isMoving)
if (isMoving)
{
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Right);
StartContinueTimer();
isPanning = true;
return;
}
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Right);
StartContinueTimer();
isPanning = true;
}
public void PanStop()

View File

@@ -12,5 +12,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public class ZoomRoomPropertiesConfig
{
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
public bool DisablePhonebookAutoDownload { get; set; }
public bool SupportsCameraAutoMode { get; set; }
public bool SupportsCameraOff { get; set; }
//if true, the layouts will be set automatically when sharing starts/ends or a call is joined
public bool AutoDefaultLayouts { get; set; }
/* This layout will be selected when Sharing starts (either from Far end or locally)*/
public string DefaultSharingLayout { get; set; }
//This layout will be selected when a call is connected and no content is being shared
public string DefaultCallLayout { get; set; }
}
}

View File

@@ -1,3 +1,3 @@
<packages>
<package id="PepperDashCore" version="1.0.41" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
<package id="PepperDashCore" version="1.0.42" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
</packages>