Compare commits

...

255 Commits

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
3e6b98894d Merge pull request #392 from PepperDash/hotfix/add-vc-camera-control-to-sg-ui
Add camera control for SG UI's
2020-08-28 14:57:50 -04:00
Andrew Welker
25faa7e702 Merge branch 'main' into hotfix/add-vc-camera-control-to-sg-ui 2020-08-28 14:17:55 -04:00
Andrew Welker
c6dab1fe9a added SO event handler 2020-08-28 12:02:53 -06:00
Neil Dorin
c9178aef76 Everything working except the actions to select cameras 2020-08-28 00:12:01 -06:00
Andrew Welker
aa8b349711 Merge pull request #388 from PepperDash/hotfix/fix-joinedsiginterlock-nullref
Fix odd merge issues with Screensaver controller class
2020-08-27 20:51:33 -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
Neil Dorin
ff6e898091 More testing. Only remaining issue is camera selection 2020-08-27 18:14:11 -06:00
Neil Dorin
c43503eb27 Tested locally. Most funtions working correclty 2020-08-27 17:58:45 -06: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
f10ac6da06 Merge branch 'main' into hotfix/fix-joinedsiginterlock-nullref 2020-08-27 19:15:58 -04:00
Neil Dorin
e90b9fe5e3 Merge remote-tracking branch 'origin/hotfix/fix-joinedsiginterlock-nullref' into hotfix/add-vc-camera-control-to-sg-ui 2020-08-27 16:39:09 -06:00
Neil Dorin
da73365c2f Camera Control implemented and ready to test 2020-08-27 16:24:05 -06:00
Andrew Welker
3f9253a550 Merge pull request #389 from PepperDash/hotfix/fix-hdcp-issues-on-specific-inputcard-types
Hotfix/fix hdcp issues on specific inputcard types
2020-08-27 16:54:08 -04:00
Neil Dorin
0ed316eaa4 cast as correct base type and change port to HdmiInput 2020-08-27 13:31:00 -06:00
Neil Dorin
5f80e12faf Handles scenario where Dmc4kHdDspBase may not support Hdcp2 2020-08-27 13:22:54 -06:00
Neil Dorin
64d92fdfce adds extra event handler 2020-08-27 13:09:28 -06:00
Neil Dorin
6c400c80a2 Fixes issue where true was always being passed into SetHdcpStateAction method 2020-08-27 12:58:43 -06:00
Neil Dorin
9846d87a40 Adds case to handle misisng eventId for HdcpSupportOffEventId 2020-08-27 12:25:08 -06:00
Neil Dorin
e952f3d775 Adds missing case for Dmc4kHdDspBase 2020-08-27 11:51:06 -06: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
436db82006 fix weird merge conflicts 2020-08-26 14:49:11 -06:00
Andrew Welker
5938869e7a fix show & hide methods 2020-08-26 14:26:59 -06:00
Andrew Welker
4bad8585e5 add null check to popup handler method 2020-08-26 14:24:20 -06:00
Neil Dorin
9af95e017a Merge pull request #384 from PepperDash/release/1.6.2
Release/1.6.2
2020-08-25 12:26:18 -06:00
Andrew Welker
5e74eaf3f2 Merge branch 'main' into release/1.6.2 2020-08-25 12:05:41 -06:00
Trevor Payne
74268d6a9b Merge pull request #383 from PepperDash/feature/Modify-LoadRoom-Errors
Change some console messages
2020-08-20 09:04:40 -05:00
Trevor Payne
4d53e6b33e Resolves #16
Changed some error messages to notices in LoadRooms() to make them a little less spooky
2020-08-19 17:07:11 -05:00
Trevor Payne
9f70031cc1 Merge pull request #356 from PepperDash/feature/Descriptive-CEC-genericComm-failure-message
Add descriptive CEC generic comm failure message
2020-08-19 16:42:01 -05:00
Trevor Payne
c74a92d220 Merge branch 'development' into feature/Descriptive-CEC-genericComm-failure-message 2020-08-19 16:28:02 -05:00
Andrew Welker
a4c24fc197 Merge pull request #379 from PepperDash/bugfix/ScreenSaver-Never-Starts
Fixed improperly set up device extender
2020-08-19 17:27:19 -04:00
Andrew Welker
25fccbd095 Merge branch 'development' into bugfix/ScreenSaver-Never-Starts 2020-08-19 17:11:54 -04:00
Neil Dorin
c9fce06bd7 Updates necessary to make screen saver disappear on incoming call 2020-08-19 14:53:47 -06:00
Trevor Payne
b1040b56d5 Fix Build Process 2020-08-19 13:30:28 -05:00
Neil Dorin
5359427981 Merge pull request #382 from PepperDash/feature/push-to-nuget.org
Put nuget publishing and consumption back where it's supposed to be
2020-08-19 11:23:16 -06:00
Andrew Welker
764f61a500 Merge branch 'development' into feature/push-to-nuget.org 2020-08-18 20:56:39 -04:00
Andrew Welker
e292790cea adding nuspec 2020-08-18 18:42:24 -06:00
Andrew Welker
1fb329f1c1 now it'll ACTUALLY use nuget 2020-08-18 17:05:46 -06:00
Andrew Welker
a2fc1b9f40 make essentials use nuget instead of submodule 2020-08-18 17:01:51 -06:00
Andrew Welker
419e7c5b31 fix readme.md 2020-08-18 16:59:15 -06:00
Andrew Welker
efbd78fb7c fixing everything to use nuget 2020-08-18 16:57:03 -06:00
Trevor Payne
486c951982 Fix some merge conflicts 2020-08-18 17:35:03 -05: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
fc67c53f4c Merge pull request #381 from PepperDash/feature/push-to-nuget.org
Re-add nuget stuff
2020-08-18 18:28:37 -04:00
Trevor Payne
f0a887981d Resolved Tracking Packages 2020-08-18 17:13:41 -05:00
Andrew Welker
7628b0ffff Merge branch 'development' into feature/push-to-nuget.org 2020-08-18 18:11:45 -04:00
Trevor Payne
63d8cf27fd gMerge branch 'bugfix/ScreenSaver-Never-Starts' of https://github.com/PepperDash/Essentials into bugfix/ScreenSaver-Never-Starts 2020-08-18 16:37:36 -05:00
Trevor Payne
eb9149b96a More gitignore changes 2020-08-18 16:37:28 -05:00
Trevor Payne
f5410c0786 Merge branch 'development' into bugfix/ScreenSaver-Never-Starts 2020-08-18 16:27:09 -05:00
Trevor Payne
7624445b4b Merge pull request #369 from PepperDash/bugfix/SystemMonitor-IndexOutOfRange
Fix system monitor index out of range exception
2020-08-18 16:26:45 -05:00
Trevor Payne
ece05caa28 Merge branch 'bugfix/ScreenSaver-Never-Starts' of https://github.com/PepperDash/Essentials into bugfix/ScreenSaver-Never-Starts 2020-08-18 16:25:25 -05:00
Trevor Payne
702c186c2c Fixed Gitignore 2020-08-18 16:24:32 -05:00
Andrew Welker
22ce57e628 add packages folder to .gitignore 2020-08-18 15:04:35 -06:00
Andrew Welker
10f1f5b1d6 update version for PepperDashCore to match the correct version 2020-08-18 14:57:05 -06:00
Andrew Welker
a30062db71 add static class for IR Command values and use them 2020-08-18 14:46:13 -06:00
Trevor Payne
182499a79b Merge branch 'development' into bugfix/ScreenSaver-Never-Starts 2020-08-18 15:35:18 -05:00
Trevor Payne
6e148e7d62 Resolves #378
Fixed improperly set up device extender
2020-08-18 15:30:58 -05:00
Andrew Welker
6a31504cf8 Merge branch 'development' into bugfix/SystemMonitor-IndexOutOfRange 2020-08-18 15:42:56 -04:00
Andrew Welker
a6bb35a20d Merge pull request #375 from PepperDash/feature/test-build-image-revert-373
Revert "Update docker build image to use Crestron DB 200.00.004.00 & …
2020-08-18 15:42:43 -04:00
Andrew Welker
b53282e3e0 Merge pull request #376 from PepperDash/feature/test-build-image
Update docker build image to use Crestron DB 200.00.004.00 & Device DB 200.00.015.00
2020-08-18 15:42:28 -04:00
Andrew Welker
d6fd9517f0 Revert "Update docker build image to use Crestron DB 200.00.004.00 & Device DB 200.00.015.00" 2020-08-18 13:06:18 -06:00
Trevor Payne
bbcd3598b2 Merge pull request #373 from PepperDash/feature/test-build-image
Update docker build image to use Crestron DB 200.00.004.00 & Device DB 200.00.015.00
2020-08-18 14:04:33 -05:00
Andrew Welker
4ad966d909 back to main image 2020-08-18 12:20:31 -06:00
Andrew Welker
f61db7f7bf testing dev image 2020-08-18 11:05:48 -06:00
Trevor Payne
95fb6cc204 Merge branch 'development' into bugfix/SystemMonitor-IndexOutOfRange 2020-08-18 11:38:27 -05:00
Andrew Welker
5668653785 Merge pull request #370 from PepperDash/feature/cisco-external-sources
Feature/cisco external sources
2020-08-18 12:34:38 -04:00
Trevor Payne
3325d81cab Merge branch 'development' into bugfix/SystemMonitor-IndexOutOfRange 2020-08-18 10:55:07 -05:00
Trevor Payne
78f9142b35 Resolves #368
Changed parsing routine to no longer use absolute indicies for 'ParseUptime'
2020-08-18 10:40:20 -05:00
Trevor Payne
f18ed56909 Merge branch 'bugfix/SystemMonitor-IndexOutOfRange' of https://github.com/PepperDash/Essentials into bugfix/SystemMonitor-IndexOutOfRange 2020-08-18 10:19:29 -05:00
Trevor Payne
951da716a6 Added try/catch to ParseUptime with a way to view what was being parsed
Testing for #368
2020-08-18 10:18:49 -05:00
Trevor Payne
7ac11952eb Added try/catch to ParseUptime with a way to view what was being parsed 2020-08-18 10:17:13 -05:00
Andrew Welker
a99b6e37e4 Merge pull request #366 from PepperDash/feature/cisco-external-sources
Add External Source API to VideoCodec
2020-08-18 10:55:06 -04:00
Andrew Welker
9b567b7ead Merge branch 'development' into feature/Descriptive-CEC-genericComm-failure-message 2020-08-18 10:04:59 -04:00
Jason Alborough
67f0ae92ef Adds null check before running RunRouteAction event in Cisco Spark class.
Fixes spelling error and other minor cleanup.
2020-08-18 10:00:53 -04:00
Jason Alborough
4e2683f8fc Removes ToDo's 2020-08-17 14:57:33 -04:00
Jason Alborough
f0d10fb1f9 Finalized IHasExternalSourceSwitching adding method for setting the ExternalSource State
Adds arguments for External Source type it the AddExternalSource()
Adds subscription and parsing for External Source events
2020-08-17 14:52:49 -04:00
Jason Alborough
aea6942a1f Update to support Cisco Codec External Sources using Essentials Room logic.
Adds new interface for Codecs IHasExternalSourceSwitching
Adds ability to set and clear External Sources in Cisco Spark device class
Adds ability to send sources from the source list to the Cisco Spark in the "EssentialsHuddleVtc1Room" room
[ ] still needs parsing when source is selected on the Cisco touch 10
2020-08-14 15:51:37 -04: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
Neil Dorin
22ff61d7f3 Merge pull request #361 from PepperDash/feature/add-qr-code-on-tsw-panels
Add Mobile Control QR code to TSW Panels for Essentials Standalone
2020-08-07 09:56:55 -06:00
Neil Dorin
f066321f3a Merge branch 'main' into feature/add-qr-code-on-tsw-panels 2020-08-07 09:41:47 -06:00
Neil Dorin
302603aa54 Updates to phone and video address logic 2020-08-07 09:29:55 -06:00
Neil Dorin
dea858e187 Updates to phone and video address logic 2020-08-07 09:11:31 -06:00
Neil Dorin
ddbee2ed04 Fixed incorrect join for dark background logo. Updates CodecInfo class to correclty poppulate values 2020-08-07 08:56:29 -06:00
Neil Dorin
b7c9677c7a Updates to finesse screen saver and get phone/video number display working correclty 2020-08-06 22:04:07 -06:00
Neil Dorin
d6581cab2e Updates to work out kinks 2020-08-06 21:16:03 -06:00
Neil Dorin
66c481e3dc Seems to work except dynamic graphics for logos and QR code 2020-08-06 19:46:12 -06:00
Neil Dorin
edd01785d5 Adds ability to get URL for both light and dark logo options 2020-08-06 18:07:23 -06:00
Neil Dorin
192aa4255c Adds ability for dark logo option 2020-08-06 15:20:24 -06:00
Neil Dorin
637ca2f312 removes parent from interfaces 2020-08-06 15:04:02 -06:00
Neil Dorin
bf7a0600f3 specified previous docker build version 2020-08-06 14:42:45 -06:00
Neil Dorin
f59654d75e working on #109 to add QR support for TSW panels 2020-08-06 13:56:42 -06:00
Andrew Welker
211665c0c4 Merge pull request #358 from PepperDash/release/1.6.0
Release/1.6.0
2020-08-06 09:21:00 -04:00
Neil Dorin
829e3eb634 Merge pull request #345 from PepperDash/release/1.6.0
Release 1.6.0
2020-08-05 13:45:04 -06:00
Andrew Welker
683f007e0b Merge pull request #357 from PepperDash/hotfix/cisco-large-directory-issues
Hotfix/cisco large directory issues
2020-08-05 12:34:36 -07:00
Trevor Payne
c77fe5c454 Add more desciptive error messages when creating a CEC genericComm device
Resolves #355
2020-08-05 13:59:48 -05:00
Neil Dorin
23bfecd870 Adds E164 and H323 fixes from release branch 2020-08-05 12:04:43 -06:00
Neil Dorin
0b485d8d96 Revert "Merge branch 'release/1.6.0' into hotfix/cisco-large-directory-issues"
This reverts commit 1d42d88c3f, reversing
changes made to ec0b2fa181.
2020-08-05 11:58:41 -06:00
Neil Dorin
1d42d88c3f Merge branch 'release/1.6.0' into hotfix/cisco-large-directory-issues 2020-08-05 11:42:47 -06:00
Neil Dorin
ec0b2fa181 Adds receive queue and thread to CiscoSparkCodec class and sets receive thread priority for ZoomRoom 2020-08-05 10:50:48 -06:00
Andrew Welker
1b621e1655 Merge branch 'main' into release/1.6.0 2020-08-04 14:32:25 -07:00
Neil Dorin
3ecadf72e9 Merge pull request #352 from PepperDash/feature/add-dmc-4kz-hdo-support-and-try-catch
Adds support for DMC-4KZ-HDO output card and adds try catch to solve …
2020-08-04 15:31:23 -06:00
Neil Dorin
744298bdb5 Adds support for DMC-4KZ-HDO output card and adds try catch to solve issue with incorrect inputSlotSupportsHdcp2 value 2020-08-04 15:13:48 -06:00
Andrew Welker
fe090113ce Merge pull request #349 from PepperDash/hotfix/ciscocodec-missing-config-options
Add null check for Cisco CE codec H323 object
2020-08-04 09:02:59 -07:00
Andrew Welker
55e50f68d3 check h323 object for null 2020-07-30 13:56:32 -06:00
Andrew Welker
8d13de0e8c Merge branch 'main' into release/1.6.0 2020-07-30 09:49:34 -07:00
Andrew Welker
41aae794b6 Merge pull request #344 from PepperDash/bugfix/essentials-huddleVtc1-routing
fix RunRouteAction methods in Huddle VTC Room
2020-07-30 09:22:04 -07:00
Andrew Welker
dbafce0aa8 fix RunRouteAction methods 2020-07-29 14:42:26 -06:00
Neil Dorin
5e24bb6cd3 Merge pull request #340 from PepperDash/hotfix/Fusion-Activation
Move some Fusion Activation steps to PostActivation action
2020-07-29 10:03:46 -06:00
Andrew Welker
35d7c23815 move method to postactivation action 2020-07-23 09:10:15 -06:00
Andrew Welker
c7e6e0c250 Move some activation steps to PostActivation 2020-07-23 08:48:05 -06:00
Andrew Welker
7c4222a598 move most init actions to PostActivationAction 2020-07-23 08:30:00 -06:00
Andrew Welker
fda888b095 fixes for activation sequence issues 2020-07-23 08:22:27 -06:00
Andrew Welker
f9b326e1e1 Merge pull request #334 from PepperDash/hotfix/fix-joinmap-constructors
Change access for constructors to enable extension and creating an instance
2020-07-22 13:22:44 -07:00
87 changed files with 11510 additions and 5748 deletions

View File

@@ -1,7 +0,0 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#332848",
"titleBar.activeBackground": "#483764",
"titleBar.activeForeground": "#FBFBFD"
}
}

View File

@@ -32,20 +32,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
# And any submodules
#- name: Checkout submodules
# shell: bash
# run: |
# git config --global url."https://github.com/".insteadOf "git@github.com:"
# auth_header="$(git config --local --get http.https://github.com/.extraheader)"
# git submodule sync --recursive
# git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Add nuget.exe
uses: nuget/setup-nuget@v1
- name: Add Github Packages source
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
- name: restore Nuget Packages
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
submodules: true
# Fetch all tags
- name: Fetch tags
run: git fetch --tags
@@ -61,6 +48,8 @@ jobs:
run: |
Write-Output ${{ env.VERSION }}
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
- name: restore Nuget Packages
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
# Login to Docker
- name: Login to Docker
uses: azure/docker-login@v1

View File

@@ -25,19 +25,13 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2
# And any submodules
#- name: Checkout submodules
# shell: bash
# run: |
# git config --global url."https://github.com/".insteadOf "git@github.com:"
# auth_header="$(git config --local --get http.https://github.com/.extraheader)"
# git submodule sync --recursive
# git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Add nuget.exe
uses: nuget/setup-nuget@v1
- name: Add Github Packages source
run: nuget sources add -name github -source https://nuget.pkg.github.com/pepperdash/index.json -username Pepperdash -password ${{ secrets.GITHUB_TOKEN }}
- name: restore Nuget Packages
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
- name: Checkout submodules
shell: bash
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
# Generate the appropriate version number
- name: Set Version Number
shell: powershell
@@ -50,6 +44,8 @@ jobs:
run: |
Write-Output ${{ env.VERSION }}
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
- name: restore Nuget Packages
run: nuget install .\packages.config -OutputDirectory .\packages -ExcludeVersion
# Login to Docker
- name: Login to Docker
uses: azure/docker-login@v1

363
.gitignore vendored
View File

@@ -25,5 +25,366 @@ essentials-framework/EssentialDMTestConfig/
output/
packages/
PepperDashEssentials-0.0.0-buildType-test.zip
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

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

@@ -53,7 +53,7 @@ namespace PepperDash.Essentials
if (Debug.DoNotLoadOnNextBoot)
{
CrestronConsole.AddNewConsoleCommand(s => GoWithLoadDeferred(), "go", "Loads configuration file",
CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
ConsoleAccessLevelEnum.AccessOperator);
}
@@ -91,20 +91,18 @@ namespace PepperDash.Essentials
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(DeviceManager.GetRoutingPorts,
"getroutingports", "Reports all routing ports, if any. Requires a device key", ConsoleAccessLevelEnum.AccessOperator);
if (!Debug.DoNotLoadOnNextBoot)
{
GoWithLoad(null);
GoWithLoad();
return;
}
SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
}
private void GoWithLoadDeferred()
{
CrestronInvoke.BeginInvoke(GoWithLoad);
}
/// <summary>
/// Determines if the program is running on a processor (appliance) or server (VC-4).
///
@@ -177,7 +175,7 @@ namespace PepperDash.Essentials
/// <summary>
/// Begins the process of loading resources including plugins and configuration data
/// </summary>
public void GoWithLoad(object notUsed)
public void GoWithLoad()
{
try
{
@@ -329,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)
{
@@ -445,7 +447,7 @@ namespace PepperDash.Essentials
{
if (ConfigReader.ConfigObject.Rooms == null)
{
Debug.Console(0, Debug.ErrorLogLevel.Warning, "WARNING: Configuration contains no rooms");
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Configuration contains no rooms - Is this intentional? This may be a valid configuration.");
return;
}
@@ -493,7 +495,7 @@ namespace PepperDash.Essentials
}
else
Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
}
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");

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

@@ -2,340 +2,340 @@
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.Fusion;
using Crestron.SimplSharpPro.Fusion;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Fusion;
namespace PepperDash.Essentials.Fusion
{
public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
{
BooleanSigData CodecIsInCall;
public EssentialsHuddleVtc1FusionController(EssentialsHuddleVtc1Room room, uint ipId)
: base(room, ipId)
{
}
/// <summary>
/// Called in base class constructor before RVI and GUID files are built
/// </summary>
protected override void ExecuteCustomSteps()
{
SetUpCodec();
}
/// <summary>
/// Creates a static asset for the codec and maps the joins to the main room symbol
/// </summary>
void SetUpCodec()
{
try
{
var codec = (Room as EssentialsHuddleVtc1Room).VideoCodec;
if (codec == null)
{
Debug.Console(1, this, "Cannot link codec to Fusion because codec is null");
return;
}
codec.UsageTracker = new UsageTracking(codec);
codec.UsageTracker.UsageIsTracked = true;
codec.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
var codecPowerOnAction = new Action<bool>(b => { if (!b) codec.StandbyDeactivate(); });
var codecPowerOffAction = new Action<bool>(b => { if (!b) codec.StandbyActivate(); });
// Map FusionRoom Attributes:
// Codec volume
var codecVolume = FusionRoom.CreateOffsetUshortSig(50, "Volume - Fader01", eSigIoMask.InputOutputSig);
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
// In Call Status
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(69, "Conf - VC 1 In Call", eSigIoMask.InputSigOnly);
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
// Online status
if (codec is ICommunicationMonitor)
{
var c = codec as ICommunicationMonitor;
var codecOnline = FusionRoom.CreateOffsetBoolSig(122, "Online - VC 1", eSigIoMask.InputSigOnly);
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
c.CommunicationMonitor.StatusChange += (o, a) =>
{
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
};
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, "Online - VC 1");
}
// Codec IP Address
bool codecHasIpInfo = false;
var codecComm = codec.Communication;
string codecIpAddress = string.Empty;
int codecIpPort = 0;
StringSigData codecIpAddressSig;
StringSigData codecIpPortSig;
if(codecComm is GenericSshClient)
{
codecIpAddress = (codecComm as GenericSshClient).Hostname;
codecIpPort = (codecComm as GenericSshClient).Port;
codecHasIpInfo = true;
}
else if (codecComm is GenericTcpIpClient)
{
codecIpAddress = (codecComm as GenericTcpIpClient).Hostname;
codecIpPort = (codecComm as GenericTcpIpClient).Port;
codecHasIpInfo = true;
}
if (codecHasIpInfo)
{
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(121, "IP Address - VC", eSigIoMask.InputSigOnly);
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
codecIpPortSig = FusionRoom.CreateOffsetStringSig(150, "IP Port - VC", eSigIoMask.InputSigOnly);
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
}
var tempAsset = new FusionAsset();
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(c => c.Key.Equals(codec.Key));
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
{
tempAsset = FusionStaticAssets[deviceConfig.Uid];
}
else
{
// Create a new asset
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), codec.Name, "Codec", "");
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
}
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
// TODO: Map relevant attributes on asset symbol
codecAsset.TrySetMakeModel(codec);
codecAsset.TryLinkAssetErrorToCommunication(codec);
}
catch (Exception e)
{
Debug.Console(1, this, "Error setting up codec in Fusion: {0}", e);
}
}
void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e)
{
var codec = (Room as EssentialsHuddleVtc1Room).VideoCodec;
CodecIsInCall.InputSig.BoolValue = codec.IsInCall;
}
// These methods are overridden because they access the room class which is of a different type
protected override void CreateSymbolAndBasicSigs(uint ipId)
{
Debug.Console(1, this, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
FusionRoom.ExtenderFusionRoomDataReservedSigs.Use();
FusionRoom.Register();
FusionRoom.FusionStateChange += FusionRoom_FusionStateChange;
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += FusionRoomSchedule_DeviceExtenderSigChange;
FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange;
FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange;
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(CreateAsHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
// Room to fusion room
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
// Moved to
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Display 1 - Current Source", eSigIoMask.InputSigOnly);
// Don't think we need to get current status of this as nothing should be alive yet.
(Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
// NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
}
protected override void SetUpSources()
{
// Sources
var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as EssentialsHuddleVtc1Room).SourceListKey);
if (dict != null)
{
// NEW PROCESS:
// Make these lists and insert the fusion attributes by iterating these
var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
uint i = 1;
foreach (var kvp in setTopBoxes)
{
TryAddRouteActionSigs("Display 1 - Source TV " + i, 188 + i, kvp.Key, kvp.Value.SourceDevice);
i++;
if (i > 5) // We only have five spots
break;
}
var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
i = 1;
foreach (var kvp in discPlayers)
{
TryAddRouteActionSigs("Display 1 - Source DVD " + i, 181 + i, kvp.Key, kvp.Value.SourceDevice);
i++;
if (i > 5) // We only have five spots
break;
}
var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop);
i = 1;
foreach (var kvp in laptops)
{
TryAddRouteActionSigs("Display 1 - Source Laptop " + i, 166 + i, kvp.Key, kvp.Value.SourceDevice);
i++;
if (i > 10) // We only have ten spots???
break;
}
foreach (var kvp in dict)
{
var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
if (usageDevice != null)
{
usageDevice.UsageTracker = new UsageTracking(usageDevice as Device);
usageDevice.UsageTracker.UsageIsTracked = true;
usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
}
}
}
else
{
Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
(Room as EssentialsHuddleVtc1Room).SourceListKey, Room.Key);
}
}
protected override void SetUpDisplay()
{
try
{
//Setup Display Usage Monitoring
var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase);
// Consider updating this in multiple display systems
foreach (DisplayBase display in displays)
{
display.UsageTracker = new UsageTracking(display);
display.UsageTracker.UsageIsTracked = true;
display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
}
var defaultDisplay = (Room as EssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
if (defaultDisplay == null)
{
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
return;
}
var dispPowerOnAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOn(); });
var dispPowerOffAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOff(); });
// Display to fusion room sigs
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
defaultDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
if (defaultDisplay is IDisplayUsage)
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
MapDisplayToRoomJoins(1, 158, defaultDisplay);
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
//Check for existing asset in GUIDs collection
var tempAsset = new FusionAsset();
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
{
tempAsset = FusionStaticAssets[deviceConfig.Uid];
}
else
{
// Create a new asset
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), defaultDisplay.Name, "Display", "");
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
}
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
defaultDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
// NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
// Use extension methods
dispAsset.TrySetMakeModel(defaultDisplay);
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
}
catch (Exception e)
{
Debug.Console(1, this, "Error setting up display in Fusion: {0}", e);
}
}
protected override void MapDisplayToRoomJoins(int displayIndex, int joinOffset, DisplayBase display)
{
string displayName = string.Format("Display {0} - ", displayIndex);
if (display == (Room as EssentialsHuddleVtc1Room).DefaultDisplay)
{
// Power on
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
// Power Off
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
// Current Source
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
}
}
}
namespace PepperDash.Essentials.Fusion
{
public class EssentialsHuddleVtc1FusionController : EssentialsHuddleSpaceFusionSystemControllerBase
{
BooleanSigData CodecIsInCall;
public EssentialsHuddleVtc1FusionController(EssentialsHuddleVtc1Room room, uint ipId)
: base(room, ipId)
{
}
/// <summary>
/// Called in base class constructor before RVI and GUID files are built
/// </summary>
protected override void ExecuteCustomSteps()
{
SetUpCodec();
}
/// <summary>
/// Creates a static asset for the codec and maps the joins to the main room symbol
/// </summary>
void SetUpCodec()
{
try
{
var codec = (Room as EssentialsHuddleVtc1Room).VideoCodec;
if (codec == null)
{
Debug.Console(1, this, "Cannot link codec to Fusion because codec is null");
return;
}
codec.UsageTracker = new UsageTracking(codec);
codec.UsageTracker.UsageIsTracked = true;
codec.UsageTracker.DeviceUsageEnded += UsageTracker_DeviceUsageEnded;
var codecPowerOnAction = new Action<bool>(b => { if (!b) codec.StandbyDeactivate(); });
var codecPowerOffAction = new Action<bool>(b => { if (!b) codec.StandbyActivate(); });
// Map FusionRoom Attributes:
// Codec volume
var codecVolume = FusionRoom.CreateOffsetUshortSig(50, "Volume - Fader01", eSigIoMask.InputOutputSig);
codecVolume.OutputSig.UserObject = new Action<ushort>(b => (codec as IBasicVolumeWithFeedback).SetVolume(b));
(codec as IBasicVolumeWithFeedback).VolumeLevelFeedback.LinkInputSig(codecVolume.InputSig);
// In Call Status
CodecIsInCall = FusionRoom.CreateOffsetBoolSig(69, "Conf - VC 1 In Call", eSigIoMask.InputSigOnly);
codec.CallStatusChange += new EventHandler<PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs>(codec_CallStatusChange);
// Online status
if (codec is ICommunicationMonitor)
{
var c = codec as ICommunicationMonitor;
var codecOnline = FusionRoom.CreateOffsetBoolSig(122, "Online - VC 1", eSigIoMask.InputSigOnly);
codecOnline.InputSig.BoolValue = c.CommunicationMonitor.Status == MonitorStatus.IsOk;
c.CommunicationMonitor.StatusChange += (o, a) =>
{
codecOnline.InputSig.BoolValue = a.Status == MonitorStatus.IsOk;
};
Debug.Console(0, this, "Linking '{0}' communication monitor to Fusion '{1}'", codec.Key, "Online - VC 1");
}
// Codec IP Address
bool codecHasIpInfo = false;
var codecComm = codec.Communication;
string codecIpAddress = string.Empty;
int codecIpPort = 0;
StringSigData codecIpAddressSig;
StringSigData codecIpPortSig;
if(codecComm is GenericSshClient)
{
codecIpAddress = (codecComm as GenericSshClient).Hostname;
codecIpPort = (codecComm as GenericSshClient).Port;
codecHasIpInfo = true;
}
else if (codecComm is GenericTcpIpClient)
{
codecIpAddress = (codecComm as GenericTcpIpClient).Hostname;
codecIpPort = (codecComm as GenericTcpIpClient).Port;
codecHasIpInfo = true;
}
if (codecHasIpInfo)
{
codecIpAddressSig = FusionRoom.CreateOffsetStringSig(121, "IP Address - VC", eSigIoMask.InputSigOnly);
codecIpAddressSig.InputSig.StringValue = codecIpAddress;
codecIpPortSig = FusionRoom.CreateOffsetStringSig(150, "IP Port - VC", eSigIoMask.InputSigOnly);
codecIpPortSig.InputSig.StringValue = codecIpPort.ToString();
}
var tempAsset = new FusionAsset();
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(c => c.Key.Equals(codec.Key));
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
{
tempAsset = FusionStaticAssets[deviceConfig.Uid];
}
else
{
// Create a new asset
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), codec.Name, "Codec", "");
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
}
var codecAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
codecAsset.PowerOn.OutputSig.UserObject = codecPowerOnAction;
codecAsset.PowerOff.OutputSig.UserObject = codecPowerOffAction;
codec.StandbyIsOnFeedback.LinkComplementInputSig(codecAsset.PowerOn.InputSig);
// TODO: Map relevant attributes on asset symbol
codecAsset.TrySetMakeModel(codec);
codecAsset.TryLinkAssetErrorToCommunication(codec);
}
catch (Exception e)
{
Debug.Console(1, this, "Error setting up codec in Fusion: {0}", e);
}
}
void codec_CallStatusChange(object sender, PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs e)
{
var codec = (Room as EssentialsHuddleVtc1Room).VideoCodec;
CodecIsInCall.InputSig.BoolValue = codec.IsInCall;
}
// These methods are overridden because they access the room class which is of a different type
protected override void CreateSymbolAndBasicSigs(uint ipId)
{
Debug.Console(1, this, "Creating Fusion Room symbol with GUID: {0}", RoomGuid);
FusionRoom = new FusionRoom(ipId, Global.ControlSystem, Room.Name, RoomGuid);
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.Use();
FusionRoom.ExtenderFusionRoomDataReservedSigs.Use();
FusionRoom.Register();
FusionRoom.FusionStateChange += FusionRoom_FusionStateChange;
FusionRoom.ExtenderRoomViewSchedulingDataReservedSigs.DeviceExtenderSigChange += FusionRoomSchedule_DeviceExtenderSigChange;
FusionRoom.ExtenderFusionRoomDataReservedSigs.DeviceExtenderSigChange += ExtenderFusionRoomDataReservedSigs_DeviceExtenderSigChange;
FusionRoom.OnlineStatusChange += FusionRoom_OnlineStatusChange;
CrestronConsole.AddNewConsoleCommand(RequestFullRoomSchedule, "FusReqRoomSchedule", "Requests schedule of the room for the next 24 hours", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ModifyMeetingEndTimeConsoleHelper, "FusReqRoomSchMod", "Ends or extends a meeting by the specified time", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(CreateAsHocMeeting, "FusCreateMeeting", "Creates and Ad Hoc meeting for on hour or until the next meeting", ConsoleAccessLevelEnum.AccessOperator);
// Room to fusion room
Room.OnFeedback.LinkInputSig(FusionRoom.SystemPowerOn.InputSig);
// Moved to
CurrentRoomSourceNameSig = FusionRoom.CreateOffsetStringSig(84, "Display 1 - Current Source", eSigIoMask.InputSigOnly);
// Don't think we need to get current status of this as nothing should be alive yet.
(Room as EssentialsHuddleVtc1Room).CurrentSourceChange += Room_CurrentSourceInfoChange;
FusionRoom.SystemPowerOn.OutputSig.SetSigFalseAction((Room as EssentialsHuddleVtc1Room).PowerOnToDefaultOrLastSource);
FusionRoom.SystemPowerOff.OutputSig.SetSigFalseAction(() => (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey));
// NO!! room.RoomIsOn.LinkComplementInputSig(FusionRoom.SystemPowerOff.InputSig);
CrestronEnvironment.EthernetEventHandler += CrestronEnvironment_EthernetEventHandler;
}
protected override void SetUpSources()
{
// Sources
var dict = ConfigReader.ConfigObject.GetSourceListForKey((Room as EssentialsHuddleVtc1Room).SourceListKey);
if (dict != null)
{
// NEW PROCESS:
// Make these lists and insert the fusion attributes by iterating these
var setTopBoxes = dict.Where(d => d.Value.SourceDevice is ISetTopBoxControls);
uint i = 1;
foreach (var kvp in setTopBoxes)
{
TryAddRouteActionSigs("Display 1 - Source TV " + i, 188 + i, kvp.Key, kvp.Value.SourceDevice);
i++;
if (i > 5) // We only have five spots
break;
}
var discPlayers = dict.Where(d => d.Value.SourceDevice is IDiscPlayerControls);
i = 1;
foreach (var kvp in discPlayers)
{
TryAddRouteActionSigs("Display 1 - Source DVD " + i, 181 + i, kvp.Key, kvp.Value.SourceDevice);
i++;
if (i > 5) // We only have five spots
break;
}
var laptops = dict.Where(d => d.Value.SourceDevice is Core.Devices.Laptop);
i = 1;
foreach (var kvp in laptops)
{
TryAddRouteActionSigs("Display 1 - Source Laptop " + i, 166 + i, kvp.Key, kvp.Value.SourceDevice);
i++;
if (i > 10) // We only have ten spots???
break;
}
foreach (var kvp in dict)
{
var usageDevice = kvp.Value.SourceDevice as IUsageTracking;
if (usageDevice != null)
{
usageDevice.UsageTracker = new UsageTracking(usageDevice as Device);
usageDevice.UsageTracker.UsageIsTracked = true;
usageDevice.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
}
}
}
else
{
Debug.Console(1, this, "WARNING: Config source list '{0}' not found for room '{1}'",
(Room as EssentialsHuddleVtc1Room).SourceListKey, Room.Key);
}
}
protected override void SetUpDisplay()
{
try
{
//Setup Display Usage Monitoring
var displays = DeviceManager.AllDevices.Where(d => d is DisplayBase);
// Consider updating this in multiple display systems
foreach (DisplayBase display in displays)
{
display.UsageTracker = new UsageTracking(display);
display.UsageTracker.UsageIsTracked = true;
display.UsageTracker.DeviceUsageEnded += new EventHandler<DeviceUsageEventArgs>(UsageTracker_DeviceUsageEnded);
}
var defaultDisplay = (Room as EssentialsHuddleVtc1Room).DefaultDisplay as DisplayBase;
if (defaultDisplay == null)
{
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
return;
}
var dispPowerOnAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOn(); });
var dispPowerOffAction = new Action<bool>(b => { if (!b) defaultDisplay.PowerOff(); });
// Display to fusion room sigs
FusionRoom.DisplayPowerOn.OutputSig.UserObject = dispPowerOnAction;
FusionRoom.DisplayPowerOff.OutputSig.UserObject = dispPowerOffAction;
defaultDisplay.PowerIsOnFeedback.LinkInputSig(FusionRoom.DisplayPowerOn.InputSig);
if (defaultDisplay is IDisplayUsage)
(defaultDisplay as IDisplayUsage).LampHours.LinkInputSig(FusionRoom.DisplayUsage.InputSig);
MapDisplayToRoomJoins(1, 158, defaultDisplay);
var deviceConfig = ConfigReader.ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(defaultDisplay.Key));
//Check for existing asset in GUIDs collection
var tempAsset = new FusionAsset();
if (FusionStaticAssets.ContainsKey(deviceConfig.Uid))
{
tempAsset = FusionStaticAssets[deviceConfig.Uid];
}
else
{
// Create a new asset
tempAsset = new FusionAsset(FusionRoomGuids.GetNextAvailableAssetNumber(FusionRoom), defaultDisplay.Name, "Display", "");
FusionStaticAssets.Add(deviceConfig.Uid, tempAsset);
}
var dispAsset = FusionRoom.CreateStaticAsset(tempAsset.SlotNumber, tempAsset.Name, "Display", tempAsset.InstanceId);
dispAsset.PowerOn.OutputSig.UserObject = dispPowerOnAction;
dispAsset.PowerOff.OutputSig.UserObject = dispPowerOffAction;
defaultDisplay.PowerIsOnFeedback.LinkInputSig(dispAsset.PowerOn.InputSig);
// NO!! display.PowerIsOn.LinkComplementInputSig(dispAsset.PowerOff.InputSig);
// Use extension methods
dispAsset.TrySetMakeModel(defaultDisplay);
dispAsset.TryLinkAssetErrorToCommunication(defaultDisplay);
}
catch (Exception e)
{
Debug.Console(1, this, "Error setting up display in Fusion: {0}", e);
}
}
protected override void MapDisplayToRoomJoins(int displayIndex, int joinOffset, DisplayBase display)
{
string displayName = string.Format("Display {0} - ", displayIndex);
if (display == (Room as EssentialsHuddleVtc1Room).DefaultDisplay)
{
// Power on
var defaultDisplayPowerOn = FusionRoom.CreateOffsetBoolSig((uint)joinOffset, displayName + "Power On", eSigIoMask.InputOutputSig);
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOn(); });
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
// Power Off
var defaultDisplayPowerOff = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 1, displayName + "Power Off", eSigIoMask.InputOutputSig);
defaultDisplayPowerOn.OutputSig.UserObject = new Action<bool>(b => { if (!b) display.PowerOff(); }); ;
display.PowerIsOnFeedback.LinkInputSig(defaultDisplayPowerOn.InputSig);
// Current Source
var defaultDisplaySourceNone = FusionRoom.CreateOffsetBoolSig((uint)joinOffset + 8, displayName + "Source None", eSigIoMask.InputOutputSig);
defaultDisplaySourceNone.OutputSig.UserObject = new Action<bool>(b => { if (!b) (Room as EssentialsHuddleVtc1Room).RunRouteAction("roomOff", Room.SourceListKey); }); ;
}
}
}
}

View File

@@ -71,14 +71,10 @@
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.39.33033, Culture=neutral, processorArchitecture=MSIL">
<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_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>
@@ -155,6 +151,7 @@
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
<Compile Include="UIDrivers\Essentials\EssentialsHeaderDriver.cs" />
<Compile Include="UIDrivers\JoinedSigInterlock.cs" />
<Compile Include="UIDrivers\ScreenSaverController.cs" />
<Compile Include="UIDrivers\SigInterlock.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddlePresentationUiDriver.cs" />
<Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddleTechPageDriver.cs" />
@@ -214,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

@@ -156,7 +156,10 @@ namespace PepperDash.Essentials.Room.Config
public EssentialsEnvironmentPropertiesConfig Environment { get; set; }
[JsonProperty("logo")]
public EssentialsLogoPropertiesConfig Logo { get; set; }
public EssentialsLogoPropertiesConfig LogoLight { get; set; }
[JsonProperty("logoDark")]
public EssentialsLogoPropertiesConfig LogoDark { get; set; }
[JsonProperty("microphonePrivacy")]
public EssentialsRoomMicrophonePrivacyConfig MicrophonePrivacy { get; set; }
@@ -181,6 +184,12 @@ namespace PepperDash.Essentials.Room.Config
[JsonProperty("zeroVolumeWhenSwtichingVolumeDevices")]
public bool ZeroVolumeWhenSwtichingVolumeDevices { get; set; }
public EssentialsRoomPropertiesConfig()
{
LogoLight = new EssentialsLogoPropertiesConfig();
LogoDark = new EssentialsLogoPropertiesConfig();
}
}
public class EssentialsAvRoomPropertiesConfig : EssentialsRoomPropertiesConfig
@@ -280,7 +289,7 @@ namespace PepperDash.Essentials.Room.Config
/// <summary>
/// Gets either the custom URL, a local-to-processor URL, or null if it's a default logo
/// </summary>
public string GetUrl()
public string GetLogoUrlLight()
{
if (Type == "url")
return Url;
@@ -289,6 +298,16 @@ namespace PepperDash.Essentials.Room.Config
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
return null;
}
public string GetLogoUrlDark()
{
if (Type == "url")
return Url;
if (Type == "system")
return string.Format("http://{0}:8080/logo-dark.png",
CrestronEthernetHelper.GetEthernetParameter(CrestronEthernetHelper.ETHERNET_PARAMETER_TO_GET.GET_CURRENT_IP_ADDRESS, 0));
return null;
}
}
/// <summary>

View File

@@ -327,7 +327,8 @@ namespace PepperDash.Essentials
this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
this.LogoUrl = PropertiesConfig.Logo.GetUrl();
this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
this.SourceListKey = PropertiesConfig.SourceListKey;
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);

View File

@@ -250,7 +250,8 @@ namespace PepperDash.Essentials
this.SetRoomOccupancy(DeviceManager.GetDeviceForKey(PropertiesConfig.Occupancy.DeviceKey) as
IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
this.LogoUrl = PropertiesConfig.Logo.GetUrl();
this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
this.SourceListKey = PropertiesConfig.SourceListKey;
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);

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
{
@@ -50,6 +51,19 @@ namespace PepperDash.Essentials
//************************
public override string SourceListKey
{
get
{
return _SourceListKey;
}
set
{
_SourceListKey = value;
SetCodecExternalSources();
}
}
protected override Func<bool> OnFeedbackFunc
{
@@ -206,9 +220,11 @@ namespace PepperDash.Essentials
VideoCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.VideoCodecKey) as
PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase;
if (VideoCodec == null)
throw new ArgumentNullException("codec cannot be null");
AudioCodec = DeviceManager.GetDeviceForKey(PropertiesConfig.AudioCodecKey) as
PepperDash.Essentials.Devices.Common.AudioCodec.AudioCodecBase;
if (AudioCodec == null)
@@ -298,6 +314,7 @@ namespace PepperDash.Essentials
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
VideoCodec.IsReadyChange += (o, a) => { this.SetCodecExternalSources(); SetCodecBranding(); };
if (AudioCodec != null)
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
@@ -340,15 +357,16 @@ namespace PepperDash.Essentials
IOccupancyStatusProvider, PropertiesConfig.Occupancy.TimeoutMinutes);
}
this.LogoUrl = PropertiesConfig.Logo.GetUrl();
this.LogoUrlLightBkgnd = PropertiesConfig.LogoLight.GetLogoUrlLight();
this.LogoUrlDarkBkgnd = PropertiesConfig.LogoDark.GetLogoUrlDark();
this.SourceListKey = PropertiesConfig.SourceListKey;
this.DefaultSourceItem = PropertiesConfig.DefaultSourceItem;
this.DefaultVolume = (ushort)(PropertiesConfig.Volumes.Master.Level * 65535 / 100);
return base.CustomActivate();
}
/// <summary>
///
/// </summary>
@@ -407,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>
@@ -670,6 +692,49 @@ namespace PepperDash.Essentials
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
}
/// <summary>
/// Setup the external sources for the Cisco Touch 10 devices that support IHasExternalSourceSwitch
/// </summary>
private void SetCodecExternalSources()
{
var videoCodecWithExternalSwitching = VideoCodec as IHasExternalSourceSwitching;
if (videoCodecWithExternalSwitching == null)
{
return;
}
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); ;
foreach (var kvp in srcList)
{
var srcConfig = kvp.Value;
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

@@ -224,6 +224,8 @@ namespace PepperDash.Essentials
var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
if (room is EssentialsHuddleSpaceRoom)
{
// Screen Saver Driver
mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, props);
// Header Driver
Debug.Console(0, panelController, "Adding header driver");
@@ -272,6 +274,9 @@ namespace PepperDash.Essentials
{
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
// Screen Saver Driver
mainDriver.ScreenSaverController = new ScreenSaverController(mainDriver, props);
// Header Driver
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);

File diff suppressed because it is too large Load Diff

View File

@@ -33,6 +33,21 @@
/// </summary>
public const uint VCLayoutsList = 1205;
/// <summary>
/// 1206 VC Camera Mode horizontal list
/// </summary>
public const uint VCCameraMode = 1206;
/// <summary>
/// 1207 VC Camera Mode Dpad
/// </summary>
public const uint VCCameraDpad = 1207;
/// <summary>
/// 1208 VC Camera Select
/// </summary>
public const uint VCCameraSelect = 1208;
//******************************************************
// General

View File

@@ -41,6 +41,21 @@ namespace PepperDash.Essentials
public const uint VCRecentListTimeTextStart = 1231;
// RANGE IN USE
public const uint VCRecentListTimeTextEnd = 1260;
/// <summary>
/// 1281
/// </summary>
public const uint VCCameraPresetLabel1 = 1281;
/// <summary>
/// 1282
/// </summary>
public const uint VCCameraPresetLabel2 = 1282;
/// <summary>
/// 1283
/// </summary>
public const uint VCCameraPresetLabel3 = 1283;
/// <summary>
/// 1291 - the current layout mode
/// </summary>
@@ -146,6 +161,10 @@ namespace PepperDash.Essentials
/// </summary>
public const uint RoomPhoneText = 3904;
/// <summary>
/// 3905 - Video address/number for room header
/// </summary>
public const uint RoomVideoAddressText = 3905;
/// <summary>
/// 3906 - The separator for verbose-header text on addresses
/// </summary>
public const uint RoomAddressPipeText = 3906;
@@ -154,6 +173,14 @@ namespace PepperDash.Essentials
/// </summary>
public const uint RoomUserCode = 3907;
/// <summary>
/// 3908 - The url for the mobile control server
/// </summary>
public const uint RoomMcUrl = 3908;
/// <summary>
/// 3909 - The url for the mobile control QR Code image
/// </summary>
public const uint RoomMcQrCodeUrl = 3909;
/// <summary>
/// 3911
/// </summary>
public const uint PowerOffMessage = 3911;
@@ -189,12 +216,19 @@ namespace PepperDash.Essentials
/// <summary>
/// 3923
/// </summary>
public const uint LogoUrl = 3923;
public const uint LogoUrlLightBkgnd = 3923;
/// <summary>
/// 3924 - the text on the "call help desk" button
/// </summary>
public const uint HelpPageCallButtonText = 3924;
/// <summary>
/// 3925
/// </summary>
public const uint LogoUrlDarkBkgnd = 3925;
/// <summary>
/// 3951
/// </summary>

View File

@@ -349,7 +349,7 @@ namespace PepperDash.Essentials
// Check if the popup interlock is shown, and if one of the header popups is current, then show the carets subpage
if (e.IsShown)
{
if (e.NewJoin == Parent.EnvironmentDriver.BackgroundSubpageJoin)
if (Parent.EnvironmentDriver != null && e.NewJoin == Parent.EnvironmentDriver.BackgroundSubpageJoin)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.HeaderActiveCallsListVisible)
headerPopupShown = true;

View File

@@ -1,71 +1,139 @@
using System;
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
{
/// <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; }
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;
}
public override void Show()
{
CurrentChildDriver = null;
ShowSubDriver(AvDriver as PanelDriverBase);
base.Show();
}
public override void Hide()
{
TriList.BooleanInput[UIBoolJoin.StartPageVisible].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();
}
}
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;
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)
{
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)
{
if (args.Sig.BoolValue)
{
ManageInactivityTimer();
}
}
private void ManageInactivityTimer()
{
if (InactivityTimer != null)
{
InactivityTimer.Reset(_timeoutMs);
}
else
{
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();
}
}
public interface IHasScreenSaverController
{
ScreenSaverController ScreenSaverController { get; }
}
}

View File

@@ -267,7 +267,7 @@
// HideAndClearCurrentDisplayModeSigsInUse();
// tl[UIBoolJoin.TopBarHabaneroVisible].BoolValue = false;
// tl[UIBoolJoin.ActivityFooterVisible].BoolValue = false;
// tl[UIBoolJoin.StartPageVisible].BoolValue = false;
// tl[StartPageVisibleJoin].BoolValue = false;
// tl[UIBoolJoin.TapToBeginVisible].BoolValue = false;
// tl[UIBoolJoin.ToggleSharingModeVisible].BoolValue = false;
// tl[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
@@ -335,7 +335,7 @@
// }
// else
// {
// TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = true;
// TriList.BooleanInput[StartPageVisibleJoin].BoolValue = true;
// TriList.BooleanInput[UIBoolJoin.TapToBeginVisible].BoolValue = true;
// TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
// }
@@ -525,7 +525,7 @@
// if (!_CurrentRoom.OnFeedback.BoolValue)
// {
// ShareButtonSig.BoolValue = true;
// TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false;
// TriList.BooleanInput[StartPageVisibleJoin].BoolValue = false;
// ShowCurrentSharingMode();
// }
// }
@@ -953,13 +953,13 @@
// if (value)
// {
// SetupActivityFooterWhenRoomOn();
// TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false;
// TriList.BooleanInput[StartPageVisibleJoin].BoolValue = false;
// }
// else
// {
// HideCurrentSharingMode();
// SetupActivityFooterWhenRoomOff();
// TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = true;
// TriList.BooleanInput[StartPageVisibleJoin].BoolValue = true;
// if (LastSelectedSourceSig != null)
// {
// LastSelectedSourceSig.BoolValue = false;

View File

@@ -24,6 +24,9 @@ namespace PepperDash.Essentials
PresentationMode, AudioSetup
}
public uint StartPageVisibleJoin { get; private set; }
/// <summary>
/// Whether volume ramping from this panel will show the volume
/// gauge popup.
@@ -111,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.
@@ -209,6 +212,7 @@ namespace PepperDash.Essentials
"Tap Share to begin";
}
/// <summary>
///
/// </summary>
@@ -225,20 +229,34 @@ namespace PepperDash.Essentials
if (Config.HeaderStyle.ToLower() == CrestronTouchpanelPropertiesConfig.Habanero)
{
TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () =>
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderPageVisible));
{
if (CurrentRoom.IsMobileControlEnabled)
{
Debug.Console(1, "Showing Mobile Control Header Info");
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoMCPageVisible);
}
else
{
Debug.Console(1, "Showing Non Mobile Control Header Info");
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoPageVisible);
}
});
}
else if (Config.HeaderStyle.ToLower() == CrestronTouchpanelPropertiesConfig.Verbose)
{
// room name on join 1, concat phone and sip on join 2, no button method
//var addr = roomConf.Addresses;
//if (addr == null) // protect from missing values by using default empties
// addr = new EssentialsRoomAddressPropertiesConfig();
//// empty string when either missing, pipe when both showing
//TriList.SetString(UIStringJoin.RoomAddressPipeText,
// (string.IsNullOrEmpty(addr.PhoneNumber.Trim())
// || string.IsNullOrEmpty(addr.SipAddress.Trim())) ? "" : " | ");
//TriList.SetString(UIStringJoin.RoomPhoneText, addr.PhoneNumber);
//TriList.SetString(UIStringJoin.RoomSipText, addr.SipAddress);
TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () =>
{
if (CurrentRoom.IsMobileControlEnabled)
{
Debug.Console(1, "Showing Mobile Control Header Info");
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoMCPageVisible);
}
else
{
Debug.Console(1, "Showing Non Mobile Control Header Info");
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoPageVisible);
}
});
}
TriList.SetBool(UIBoolJoin.DateAndTimeVisible, Config.ShowDate && Config.ShowTime);
@@ -256,7 +274,7 @@ namespace PepperDash.Essentials
}
else
{
TriList.SetBool(UIBoolJoin.StartPageVisible, true);
TriList.SetBool(StartPageVisibleJoin, true);
TriList.SetBool(UIBoolJoin.TapToBeginVisible, true);
SetupActivityFooterWhenRoomOff();
}
@@ -321,7 +339,7 @@ namespace PepperDash.Essentials
/// </summary>
void ShowLogo()
{
if (CurrentRoom.LogoUrl == null)
if (CurrentRoom.LogoUrlLightBkgnd == null)
{
TriList.SetBool(UIBoolJoin.LogoDefaultVisible, true);
TriList.SetBool(UIBoolJoin.LogoUrlVisible, false);
@@ -330,7 +348,8 @@ namespace PepperDash.Essentials
{
TriList.SetBool(UIBoolJoin.LogoDefaultVisible, false);
TriList.SetBool(UIBoolJoin.LogoUrlVisible, true);
TriList.SetString(UIStringJoin.LogoUrl, _CurrentRoom.LogoUrl);
TriList.SetString(UIStringJoin.LogoUrlLightBkgnd, _CurrentRoom.LogoUrlLightBkgnd);
TriList.SetString(UIStringJoin.LogoUrlDarkBkgnd, _CurrentRoom.LogoUrlDarkBkgnd);
}
}
@@ -351,7 +370,7 @@ namespace PepperDash.Essentials
HideAndClearCurrentDisplayModeSigsInUse();
TriList.BooleanInput[UIBoolJoin.TopBarHabaneroDynamicVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.ActivityFooterVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false;
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.TapToBeginVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
//TriList.BooleanInput[UIBoolJoin.StagingPageVisible].BoolValue = false;
@@ -416,7 +435,7 @@ namespace PepperDash.Essentials
}
else
{
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = true;
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.TapToBeginVisible].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
}
@@ -474,7 +493,7 @@ namespace PepperDash.Essentials
void ShareButtonPressed()
{
ShareButtonSig.BoolValue = true;
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false;
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = true;
// Run default source when room is off and share is pressed
@@ -778,7 +797,7 @@ namespace PepperDash.Essentials
}
// Name and logo
TriList.StringInput[UIStringJoin.CurrentRoomName].StringValue = _CurrentRoom.Name;
if (_CurrentRoom.LogoUrl == null)
if (_CurrentRoom.LogoUrlLightBkgnd == null)
{
TriList.BooleanInput[UIBoolJoin.LogoDefaultVisible].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.LogoUrlVisible].BoolValue = false;
@@ -787,7 +806,9 @@ namespace PepperDash.Essentials
{
TriList.BooleanInput[UIBoolJoin.LogoDefaultVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.LogoUrlVisible].BoolValue = true;
TriList.StringInput[UIStringJoin.LogoUrl].StringValue = _CurrentRoom.LogoUrl;
TriList.StringInput[UIStringJoin.LogoUrlLightBkgnd].StringValue = _CurrentRoom.LogoUrlLightBkgnd;
TriList.StringInput[UIStringJoin.LogoUrlLightBkgnd].StringValue = _CurrentRoom.LogoUrlDarkBkgnd;
}
// Shutdown timer
@@ -820,12 +841,43 @@ namespace PepperDash.Essentials
if (_CurrentRoom == room) return;
// Disconnect current (probably never called)
if (_CurrentRoom != null)
_CurrentRoom.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged += room_ConfigChanged;
if (room.IsMobileControlEnabled)
{
StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible;
UpdateMCJoins(room);
if (_CurrentRoom != null)
_CurrentRoom.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged += MobileControlRoomBridge_UserCodeChanged;
}
else
{
StartPageVisibleJoin = UIBoolJoin.StartPageVisible;
}
RefreshCurrentRoom(room);
}
void MobileControlRoomBridge_UserCodeChanged(object sender, EventArgs e)
{
UpdateMCJoins(_CurrentRoom);
}
void UpdateMCJoins(EssentialsHuddleSpaceRoom room)
{
TriList.SetString(UIStringJoin.RoomMcUrl, room.MobileControlRoomBridge.McServerUrl);
TriList.SetString(UIStringJoin.RoomMcQrCodeUrl, room.MobileControlRoomBridge.QrCodeUrl);
TriList.SetString(UIStringJoin.RoomUserCode, room.MobileControlRoomBridge.UserCode);
}
/// <summary>
/// Fires when room config of current room has changed. Meant to refresh room values to propegate any updates to UI
/// </summary>
@@ -855,7 +907,7 @@ namespace PepperDash.Essentials
SetupActivityFooterWhenRoomOn();
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false;
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = true;
}
@@ -863,7 +915,7 @@ namespace PepperDash.Essentials
{
SetupActivityFooterWhenRoomOff();
ShowLogo();
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = true;
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = true;
TriList.BooleanInput[UIBoolJoin.VolumeSingleMute1Visible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SourceStagingBarVisible].BoolValue = false;
}

View File

@@ -28,6 +28,8 @@ namespace PepperDash.Essentials
Presentation, AudioSetup, Call, Start
}
public uint StartPageVisibleJoin { get; private set; }
/// <summary>
/// Whether volume ramping from this panel will show the volume
/// gauge popup.
@@ -70,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.
@@ -240,20 +242,34 @@ namespace PepperDash.Essentials
if (Config.HeaderStyle.ToLower() == CrestronTouchpanelPropertiesConfig.Habanero)
{
TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () =>
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderPageVisible));
{
if (CurrentRoom.IsMobileControlEnabled)
{
Debug.Console(1, "Showing Mobile Control Header Info");
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoMCPageVisible);
}
else
{
Debug.Console(1, "Showing Non Mobile Control Header Info");
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoPageVisible);
}
});
}
else if (Config.HeaderStyle.ToLower() == CrestronTouchpanelPropertiesConfig.Verbose)
{
// room name on join 1, concat phone and sip on join 2, no button method
//var addr = roomConf.Addresses;
//if (addr == null) // protect from missing values by using default empties
// addr = new EssentialsRoomAddressPropertiesConfig();
//// empty string when either missing, pipe when both showing
//TriList.SetString(UIStringJoin.RoomAddressPipeText,
// (string.IsNullOrEmpty(addr.PhoneNumber.Trim())
// || string.IsNullOrEmpty(addr.SipAddress.Trim())) ? "" : " | ");
//TriList.SetString(UIStringJoin.RoomPhoneText, addr.PhoneNumber);
//TriList.SetString(UIStringJoin.RoomSipText, addr.SipAddress);
TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () =>
{
if (CurrentRoom.IsMobileControlEnabled)
{
Debug.Console(1, "Showing Mobile Control Header Info");
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoMCPageVisible);
}
else
{
Debug.Console(1, "Showing Non Mobile Control Header Info");
PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoPageVisible);
}
});
}
TriList.SetBool(UIBoolJoin.DateAndTimeVisible, Config.ShowDate && Config.ShowTime);
@@ -276,7 +292,7 @@ namespace PepperDash.Essentials
}
else
{
TriList.SetBool(UIBoolJoin.StartPageVisible, true);
TriList.SetBool(StartPageVisibleJoin, true);
TriList.SetBool(UIBoolJoin.TapToBeginVisible, true);
SetupActivityFooterWhenRoomOff();
}
@@ -332,7 +348,7 @@ namespace PepperDash.Essentials
/// </summary>
void ShowLogo()
{
if (CurrentRoom.LogoUrl == null)
if (CurrentRoom.LogoUrlLightBkgnd == null)
{
TriList.SetBool(UIBoolJoin.LogoDefaultVisible, true);
TriList.SetBool(UIBoolJoin.LogoUrlVisible, false);
@@ -341,7 +357,8 @@ namespace PepperDash.Essentials
{
TriList.SetBool(UIBoolJoin.LogoDefaultVisible, false);
TriList.SetBool(UIBoolJoin.LogoUrlVisible, true);
TriList.SetString(UIStringJoin.LogoUrl, _CurrentRoom.LogoUrl);
TriList.SetString(UIStringJoin.LogoUrlLightBkgnd, _CurrentRoom.LogoUrlLightBkgnd);
TriList.SetString(UIStringJoin.LogoUrlDarkBkgnd, _CurrentRoom.LogoUrlDarkBkgnd);
}
}
@@ -362,7 +379,7 @@ namespace PepperDash.Essentials
HideAndClearCurrentDisplayModeSigsInUse();
TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, false);
TriList.BooleanInput[UIBoolJoin.ActivityFooterVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = false;
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.TapToBeginVisible].BoolValue = false;
TriList.BooleanInput[UIBoolJoin.SelectASourceVisible].BoolValue = false;
if (NextMeetingTimer != null)
@@ -606,7 +623,7 @@ namespace PepperDash.Essentials
return;
HideLogo();
HideNextMeetingPopup();
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
TriList.SetBool(StartPageVisibleJoin, false);
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, false);
TriList.SetBool(UIBoolJoin.SelectASourceVisible, false);
if (CurrentSourcePageManager != null)
@@ -626,7 +643,7 @@ namespace PepperDash.Essentials
if (VCDriver.IsVisible)
VCDriver.Hide();
HideNextMeetingPopup();
TriList.SetBool(UIBoolJoin.StartPageVisible, false);
TriList.SetBool(StartPageVisibleJoin, false);
TriList.SetBool(UIBoolJoin.CallStagingBarVisible, false);
TriList.SetBool(UIBoolJoin.SourceStagingBarVisible, true);
// Run default source when room is off and share is pressed
@@ -957,12 +974,43 @@ namespace PepperDash.Essentials
if (_CurrentRoom == room) return;
// Disconnect current (probably never called)
if(_CurrentRoom != null)
_CurrentRoom.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged += room_ConfigChanged;
if (room.IsMobileControlEnabled)
{
StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible;
UpdateMCJoins(room);
if (_CurrentRoom != null)
_CurrentRoom.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged += MobileControlRoomBridge_UserCodeChanged;
}
else
{
StartPageVisibleJoin = UIBoolJoin.StartPageVisible;
}
RefreshCurrentRoom(room);
}
void MobileControlRoomBridge_UserCodeChanged(object sender, EventArgs e)
{
UpdateMCJoins(_CurrentRoom);
}
void UpdateMCJoins(EssentialsHuddleVtc1Room room)
{
TriList.SetString(UIStringJoin.RoomMcUrl, room.MobileControlRoomBridge.McServerUrl);
TriList.SetString(UIStringJoin.RoomMcQrCodeUrl, room.MobileControlRoomBridge.QrCodeUrl);
TriList.SetString(UIStringJoin.RoomUserCode, room.MobileControlRoomBridge.UserCode);
}
/// <summary>
/// Fires when room config of current room has changed. Meant to refresh room values to propegate any updates to UI
/// </summary>
@@ -999,12 +1047,15 @@ namespace PepperDash.Essentials
/// </summary>
void SetupSourceList()
{
var inCall = CurrentRoom.InCallFeedback.BoolValue;
var config = ConfigReader.ConfigObject.SourceLists;
if (config.ContainsKey(_CurrentRoom.SourceListKey))
{
var srcList = config[_CurrentRoom.SourceListKey].OrderBy(kv => kv.Value.Order);
// Setup sources list
SourceStagingSrl.Clear();
@@ -1028,6 +1079,8 @@ namespace PepperDash.Essentials
b => { if (!b) UiSelectSource(routeKey); });
SourceStagingSrl.AddItem(item); // add to the SRL
item.RegisterForSourceChange(_CurrentRoom);
Debug.Console(1, "**** KEY {0}", kvp.Key);
}
SourceStagingSrl.Count = (ushort)(i - 1);
}
@@ -1149,7 +1202,7 @@ namespace PepperDash.Essentials
var value = _CurrentRoom.OnFeedback.BoolValue;
TriList.BooleanInput[UIBoolJoin.RoomIsOn].BoolValue = value;
TriList.BooleanInput[UIBoolJoin.StartPageVisible].BoolValue = !value;
TriList.BooleanInput[StartPageVisibleJoin].BoolValue = !value;
if (value) //ON
{
@@ -1377,10 +1430,12 @@ namespace PepperDash.Essentials
/// </summary>
public interface IAVDriver
{
PanelDriverBase Parent { get; }
JoinedSigInterlock PopupInterlock { get; }
void ShowNotificationRibbon(string message, int timeout);
void HideNotificationRibbon();
void ShowTech();
uint StartPageVisibleJoin { get; }
}
/// <summary>

View File

@@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials
{
/// <summary>
/// Driver responsible for controlling the screenshaver showing the client logo, MC connection information and QR Code. Moves the elements around to prevent screen burn in
/// </summary>
public class ScreenSaverController : PanelDriverBase
{
/// <summary>
/// The parent driver for this
/// </summary>
private readonly EssentialsPanelMainInterfaceDriver _parent;
private JoinedSigInterlock PositionInterlock;
CTimer PositionTimer;
uint PositionTimeoutMs;
List<uint> PositionJoins;
int CurrentPositionIndex = 0;
public ScreenSaverController(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
: base(parent.TriList)
{
_parent = parent;
PositionTimeoutMs = config.ScreenSaverMovePositionIntervalMs;
PositionJoins = new List<uint>() { UIBoolJoin.MCScreenSaverPosition1Visible, UIBoolJoin.MCScreenSaverPosition2Visible, UIBoolJoin.MCScreenSaverPosition3Visible, UIBoolJoin.MCScreenSaverPosition4Visible };
PositionInterlock = new JoinedSigInterlock(parent.TriList);
var cmdName = String.Format("shwscrsvr-{0}", parent.TriList.ID);
CrestronConsole.AddNewConsoleCommand((o) => Show(), cmdName, "Shows Panel Screensaver", ConsoleAccessLevelEnum.AccessOperator);
TriList.SetSigFalseAction(UIBoolJoin.MCScreenSaverClosePress, Hide);
}
public override void Show()
{
if (_parent.AvDriver != null)
{
_parent.AvDriver.PopupInterlock.ShowInterlocked(UIBoolJoin.MCScreenSaverVisible);
}
CurrentPositionIndex = 0;
ShowCurrentPosition();
StartPositionTimer();
base.Show();
}
public override void Hide()
{
Debug.Console(1, "Hiding ScreenSaverController");
if (PositionTimer != null)
{
PositionTimer.Stop();
PositionTimer.Dispose();
PositionTimer = null;
}
ClearAllPositions();
if (_parent.AvDriver != null)
{
_parent.AvDriver.PopupInterlock.HideAndClear();
}
base.Hide();
}
void StartPositionTimer()
{
if (PositionTimer == null)
{
PositionTimer = new CTimer((o) => PositionTimerExpired(), PositionTimeoutMs);
}
else
{
PositionTimer.Reset(PositionTimeoutMs);
}
}
void PositionTimerExpired()
{
IncrementPositionIndex();
ShowCurrentPosition();
StartPositionTimer();
}
void IncrementPositionIndex()
{
if (CurrentPositionIndex < PositionJoins.Count - 1)
{
CurrentPositionIndex++;
}
else
{
CurrentPositionIndex = 0;
}
Debug.Console(1, "ScreenSaver Position Timer Expired: Setting new position: {0}", CurrentPositionIndex);
}
//
void ShowCurrentPosition()
{
// Set based on current index
PositionInterlock.ShowInterlocked(PositionJoins[CurrentPositionIndex]);
}
void ClearAllPositions()
{
Debug.Console(1, "Hiding all screensaver positions");
PositionInterlock.HideAndClear();
}
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
@@ -13,6 +14,7 @@ using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Devices.Common.Cameras;
namespace PepperDash.Essentials.UIDrivers.VC
{
@@ -41,6 +43,11 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
JoinedSigInterlock VCControlsInterlock;
/// <summary>
/// For the camera control mode (auto/manual/off)
/// </summary>
JoinedSigInterlock VCCameraControlModeInterlock;
/// <summary>
/// For the different staging bars: Active, inactive
/// </summary>
@@ -58,6 +65,12 @@ namespace PepperDash.Essentials.UIDrivers.VC
SmartObjectDynamicList RecentCallsList;
SmartObjectDynamicList DirectoryList;
SmartObjectDPad CameraPtzPad;
SmartObjectDynamicList CameraModeList;
SmartObjectDynamicList CameraSelectList;
BoolFeedback DirectoryBackButtonVisibleFeedback;
@@ -76,6 +89,8 @@ namespace PepperDash.Essentials.UIDrivers.VC
bool CodecHasFavorites;
bool ShowCameraModeControls;
CTimer BackspaceTimer;
@@ -118,6 +133,9 @@ namespace PepperDash.Essentials.UIDrivers.VC
LocalPrivacyIsMuted = new BoolFeedback(() => false);
VCControlsInterlock = new JoinedSigInterlock(triList);
VCCameraControlModeInterlock = new JoinedSigInterlock(triList);
if (CodecHasFavorites)
VCControlsInterlock.SetButDontShow(UIBoolJoin.VCKeypadWithFavoritesVisible);
else
@@ -161,6 +179,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
SetupDirectoryList();
SearchStringBackspaceVisibleFeedback = new BoolFeedback(() => SearchStringBuilder.Length > 0);
SearchStringBackspaceVisibleFeedback.LinkInputSig(triList.BooleanInput[UIBoolJoin.VCDirectoryBackspaceVisible]);
@@ -192,20 +211,76 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// <param name="e"></param>
void Codec_IsReady()
{
string roomNumberSipUri = "";
if (!string.IsNullOrEmpty(Codec.CodecInfo.SipUri)) // If both values are present, format the string with a pipe divider
roomNumberSipUri = string.Format("{0} | {1}", GetFormattedPhoneNumber(Codec.CodecInfo.SipPhoneNumber), Codec.CodecInfo.SipUri);
else // If only one value present, just show the phone number
roomNumberSipUri = Codec.CodecInfo.SipPhoneNumber;
if(string.IsNullOrEmpty(roomNumberSipUri))
roomNumberSipUri = string.Format("{0} | {1}", Codec.CodecInfo.E164Alias, Codec.CodecInfo.H323Id);
TriList.SetString(UIStringJoin.RoomPhoneText, roomNumberSipUri);
SetupAddresses();
if(HeaderDriver.HeaderButtonsAreSetUp)
HeaderDriver.ComputeHeaderCallStatus(Codec);
SetupCameraControls();
}
void SetupAddresses()
{
string roomContactNumbers = "";
string roomPhoneNumber = "";
string roomVideoAddress = "";
Debug.Console(1,
@"
Codec.CodecInfo.IpAddress: {0}
Codec.CodecInfo.SipUri: {1}
Codec.CodecInfo.SipPhoneNumber: {2}
Codec.CodecInfo.E164Alias: {3}
Codec.CodecInfo.H323Id: {4}
", Codec.CodecInfo.IpAddress, Codec.CodecInfo.SipUri, Codec.CodecInfo.SipPhoneNumber, Codec.CodecInfo.E164Alias, Codec.CodecInfo.H323Id);
// Populate phone number
if (!string.IsNullOrEmpty(Codec.CodecInfo.SipUri)) // If both values are present, format the string with a pipe divider
{
roomPhoneNumber = Codec.CodecInfo.SipUri;
}
else if (!string.IsNullOrEmpty(Codec.CodecInfo.SipPhoneNumber)) // If only one value present, just show the phone number
{
roomPhoneNumber = GetFormattedPhoneNumber(Codec.CodecInfo.SipPhoneNumber);
}
// Populate video number
if (!string.IsNullOrEmpty(Codec.CodecInfo.IpAddress))
{
roomVideoAddress = Codec.CodecInfo.IpAddress;
}
else if (!string.IsNullOrEmpty(Codec.CodecInfo.E164Alias))
{
roomVideoAddress = Codec.CodecInfo.E164Alias;
}
else if (!string.IsNullOrEmpty(Codec.CodecInfo.H323Id))
{
roomVideoAddress = Codec.CodecInfo.H323Id;
}
Debug.Console(1,
@" Room Contact Numbers:
Phone Number: {0}
Video Number: {1}
", roomPhoneNumber, roomVideoAddress);
if (!string.IsNullOrEmpty(roomPhoneNumber) && !string.IsNullOrEmpty(roomVideoAddress))
{
roomContactNumbers = string.Format("{0} | {1}", roomPhoneNumber, roomVideoAddress);
}
else if (!string.IsNullOrEmpty(roomPhoneNumber))
{
roomContactNumbers = roomPhoneNumber;
}
else if (!string.IsNullOrEmpty(roomVideoAddress))
{
roomContactNumbers = roomVideoAddress;
}
TriList.SetString(UIStringJoin.RoomAddressPipeText, roomContactNumbers);
TriList.SetString(UIStringJoin.RoomPhoneText, roomPhoneNumber);
TriList.SetString(UIStringJoin.RoomVideoAddressText, roomVideoAddress);
}
/// <summary>
@@ -323,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;
@@ -337,6 +414,21 @@ namespace PepperDash.Essentials.UIDrivers.VC
icon = "Camera";
msg = string.Format("Incoming video call from: {0}", call.Name);
}
// Hide screensaver
var screenSaverParent = Parent.Parent as IHasScreenSaverController;
if (screenSaverParent != null)
{
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 =>
{
@@ -387,6 +479,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
TriList.SetSigFalseAction(UIBoolJoin.VCStagingDirectoryPress, ShowDirectory);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingKeypadPress, ShowKeypad);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingRecentsPress, ShowRecents);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingCameraPress, ShowCameraControls);
TriList.SetSigFalseAction(UIBoolJoin.VCStagingConnectPress, ConnectPress);
TriList.SetSigFalseAction(UIBoolJoin.CallEndPress, () =>
{
@@ -404,6 +497,393 @@ namespace PepperDash.Essentials.UIDrivers.VC
});
}
void SetupCameraControls()
{
CameraPtzPad = new SmartObjectDPad(TriList.SmartObjects[UISmartObjectJoin.VCCameraDpad], true);
// If the codec supports camera auto or off, we need to show the mode selector subpage
ShowCameraModeControls = Codec is IHasCameraAutoMode || Codec is IHasCameraOff;
if (ShowCameraModeControls)
{
CameraModeList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCCameraMode], true, 0);
VCControlsInterlock.StatusChanged += new EventHandler<StatusChangedEventArgs>(VCControlsInterlock_StatusChanged);
var codecOffCameras = Codec as IHasCameraOff;
var codecAutoCameras = Codec as IHasCameraAutoMode;
if (codecAutoCameras != null)
{
CameraModeList.SetItemButtonAction(1,(b) => codecAutoCameras.CameraAutoModeOn());
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 1 Visible"].BoolValue = true;
codecAutoCameras.CameraAutoModeIsOnFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 1 Selected"]);
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 1 Pressed"].SetSigFalseAction(
//() => codecAutoCameras.CameraAutoModeOn());
codecAutoCameras.CameraAutoModeIsOnFeedback.OutputChange += (o, a) =>
{
if (a.BoolValue)
{
SetCameraManualModeButtonFeedback(false);
if (VCControlsInterlock.CurrentJoin == UIBoolJoin.VCCameraModeBarVisible)
{
VCCameraControlModeInterlock.ShowInterlocked(UIBoolJoin.VCCameraAutoVisible);
}
else
{
VCCameraControlModeInterlock.SetButDontShow(UIBoolJoin.VCCameraAutoVisible);
}
}
else
{
ShowCameraManualMode();
}
};
}
// Manual button always visible
CameraModeList.SetItemButtonAction(2, (b) => ShowCameraManualMode());
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 2 Visible"].BoolValue = true;
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 2 Pressed"].SetSigFalseAction(
// () => ShowCameraManualMode());
if (codecOffCameras != null)
{
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 3 Visible"].BoolValue = true;
codecOffCameras.CameraIsOffFeedback.LinkInputSig(CameraModeList.SmartObject.BooleanInput["Item 3 Selected"]);
CameraModeList.SetItemButtonAction(3, (b) => codecOffCameras.CameraOff());
//TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanOutput["Item 3 Pressed"].SetSigFalseAction(
// () => codecOffCameras.CameraOff());
codecOffCameras.CameraIsOffFeedback.OutputChange += (o, a) =>
{
if (a.BoolValue)
{
SetCameraManualModeButtonFeedback(false);
if (VCControlsInterlock.CurrentJoin == UIBoolJoin.VCCameraModeBarVisible)
{
VCCameraControlModeInterlock.ShowInterlocked(UIBoolJoin.VCCameraOffVisible);
}
else
{
VCCameraControlModeInterlock.SetButDontShow(UIBoolJoin.VCCameraOffVisible);
}
}
else
{
ShowCameraManualMode();
}
};
}
}
var camerasCodec = Codec as IHasCameras;
if(camerasCodec != null)
{
//CameraSelectList = new SmartObjectDynamicList(TriList.SmartObjects[UISmartObjectJoin.VCCameraSelect], true, 0);
var so = TriList.SmartObjects[UISmartObjectJoin.VCCameraSelect];
so.SigChange += SmartObject_SigChange;
for (uint i = 1; i <= camerasCodec.Cameras.Count; i++)
{
var cameraKey = camerasCodec.Cameras[(int)i - 1].Key;
Debug.Console(1, "Setting up action for Camera {0} with Key: {1} for button Item {0} Pressed", i, cameraKey);
//TODO: Fix camera selection action. For some reson this action doesn't execute when the buttons are pressed
var sig = so.BooleanOutput[String.Format("Item {0} Pressed", i)];
so.BooleanOutput[string.Format("Item {0} Pressed", i)].SetSigFalseAction(
() => camerasCodec.SelectCamera(cameraKey));
}
so.UShortInput["Set Number of Items"].UShortValue = (ushort)camerasCodec.Cameras.Count;
//TriList.SmartObjects[UISmartObjectJoin.VCCameraSelect].UShortOutput["Item Clicked"].SetUShortSigAction(
// (u) =>
// {
// var cameraKey = camerasCodec.Cameras[u - 1].Key;
// Debug.Console(1, "Selecting Camera {0} with Key: {1}", u, cameraKey);
// camerasCodec.SelectCamera(cameraKey);
// });
// Set the names for the cameras
for (int i = 1; i <= camerasCodec.Cameras.Count; i++)
{
so.StringInput[string.Format("Set Item {0} Text", i)].StringValue = camerasCodec.Cameras[i - 1].Name;
}
SetCameraSelectedFeedback();
camerasCodec.CameraSelected += camerasCodec_CameraSelected;
MapCameraActions();
}
SetupPresets();
}
void SmartObject_SigChange(GenericBase currentDevice, SmartObjectEventArgs args)
{
var uo = args.Sig.UserObject;
if (uo is Action<bool>)
(uo as Action<bool>)(args.Sig.BoolValue);
else if (uo is Action<ushort>)
(uo as Action<ushort>)(args.Sig.UShortValue);
else if (uo is Action<string>)
(uo as Action<string>)(args.Sig.StringValue);
}
void VCControlsInterlock_StatusChanged(object sender, StatusChangedEventArgs e)
{
// Need to hide the camera mode interlock if the mode bar gets hidden
if (e.PreviousJoin == UIBoolJoin.VCCameraModeBarVisible)
VCCameraControlModeInterlock.Hide();
// These deal with hiding/showing the camera select bar if no mode controls are visible (tied to manual controls being visible)
if(!ShowCameraModeControls)
{
if(e.PreviousJoin == UIBoolJoin.VCCameraManualVisible)
TriList.SetBool(UIBoolJoin.VCCameraSelectBarWithoutModeVisible, false);
if (e.NewJoin == UIBoolJoin.VCCameraManualVisible)
TriList.SetBool(UIBoolJoin.VCCameraSelectBarWithoutModeVisible, true);
}
}
/// <summary>
/// Shows the preset saved label for 2 seconds
/// </summary>
void ShowPresetStoreFeedback()
{
TriList.BooleanInput[UIBoolJoin.VCCameraPresetSavedLabelVisible].BoolValue = true;
var timer = new CTimer((o) => TriList.BooleanInput[UIBoolJoin.VCCameraPresetSavedLabelVisible].BoolValue = false, 2000);
}
void presetsCodec_CodecRoomPresetsListHasChanged(object sender, EventArgs e)
{
SetupPresets();
}
void camerasCodec_CameraSelected(object sender, CameraSelectedEventArgs e)
{
MapCameraActions();
SetCameraSelectedFeedback();
}
/// <summary>
/// Set the feedback for the button of the selected camera
/// </summary>
void SetCameraSelectedFeedback()
{
var camerasCodec = Codec as IHasCameras;
for (int i = 1; i <= camerasCodec.Cameras.Count; i++)
{
var cameraSelected = camerasCodec.SelectedCameraFeedback.StringValue;
var state = false;
if (cameraSelected == camerasCodec.Cameras[i - 1].Key)
{
state = true;
}
TriList.SmartObjects[UISmartObjectJoin.VCCameraSelect].BooleanInput[string.Format("Item {0} Selected", i)].BoolValue = state;
}
}
void SetupPresets()
{
var presetsCodec = Codec as IHasCodecRoomPresets;
if (presetsCodec != null)
{
uint holdTime = 5000;
presetsCodec.CodecRoomPresetsListHasChanged += new EventHandler<EventArgs>(presetsCodec_CodecRoomPresetsListHasChanged);
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);
}
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);
}
}
}
/// <summary>
/// Maps button actions to the selected camera
/// </summary>
void MapCameraActions()
{
// Now we setup the button actions for the manual controls
var camerasCodec = Codec as IHasCameras;
if (camerasCodec != null && camerasCodec.SelectedCamera != null)
{
var dpad = CameraPtzPad;
var camera = camerasCodec.SelectedCamera as IHasCameraPtzControl;
if (camera != null)
{
if (camerasCodec.SelectedCamera.CanTilt)
{
dpad.SigUp.SetBoolSigAction((b) =>
{
if (b)
camera.TiltUp();
else
camera.TiltStop();
});
dpad.SigDown.SetBoolSigAction((b) =>
{
if (b)
camera.TiltDown();
else
camera.TiltStop();
});
}
if (camerasCodec.SelectedCamera.CanPan)
{
dpad.SigLeft.SetBoolSigAction((b) =>
{
if (b)
camera.PanLeft();
else
camera.PanStop();
});
dpad.SigRight.SetBoolSigAction((b) =>
{
if (b)
camera.PanRight();
else
camera.PanStop();
});
}
//dpad.SigCenter.SetSigFalseAction(() => camera.PositionHome());
//var homeButton = dpad.BooleanOutput["Home"];
//if (homeButton != null)
//{
// homeButton.SetSigFalseAction(() => camera.PositionHome());
//}
if (camerasCodec.SelectedCamera.CanZoom)
{
TriList.BooleanOutput[UIBoolJoin.VCCameraZoomIn].SetBoolSigAction((b) =>
{
if (b)
camera.ZoomIn();
else
camera.ZoomStop();
});
TriList.BooleanOutput[UIBoolJoin.VCCameraZoomOut].SetBoolSigAction((b) =>
{
if (b)
camera.ZoomOut();
else
camera.ZoomStop();
});
}
}
}
}
// Determines if codec is in manual camera control mode and shows feedback
void ShowCameraManualMode()
{
var inManualMode = true;
var codecOffCameras = Codec as IHasCameraOff;
var codecAutoCameras = Codec as IHasCameraAutoMode;
if (codecOffCameras != null && codecOffCameras.CameraIsOffFeedback.BoolValue)
{
inManualMode = false;
}
// Clear auto mode
if (codecAutoCameras != null )
{
if (codecAutoCameras.CameraAutoModeIsOnFeedback.BoolValue)
{
codecAutoCameras.CameraAutoModeOff();
inManualMode = true;
}
}
if (inManualMode)
{
VCCameraControlModeInterlock.SetButDontShow(UIBoolJoin.VCCameraManualVisible);
if (VCControlsInterlock.CurrentJoin == UIBoolJoin.VCCameraModeBarVisible)
VCCameraControlModeInterlock.Show();
}
SetCameraManualModeButtonFeedback(inManualMode);
}
void SetCameraManualModeButtonFeedback(bool state)
{
// Set button feedback for manual mode
TriList.SmartObjects[UISmartObjectJoin.VCCameraMode].BooleanInput["Item 2 Selected"].BoolValue = state;
}
/// <summary>
///
/// </summary>
@@ -864,7 +1344,32 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
void ShowCameraControls()
{
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraVisible);
if (ShowCameraModeControls)
{
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraModeBarVisible);
if (VCCameraControlModeInterlock.CurrentJoin != 0)
{
VCCameraControlModeInterlock.Show();
}
else
{
var codecAutoCamera = Codec as IHasCameraAutoMode;
if (codecAutoCamera != null)
{
ShowCameraManualMode();
VCCameraControlModeInterlock.Show();
}
}
}
else
{
// Just show the manual camera control page
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraManualVisible);
}
StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingCameraPress);
}
@@ -897,7 +1402,7 @@ namespace PepperDash.Essentials.UIDrivers.VC
/// </summary>
void ShowSelfViewLayout()
{
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCSelfViewLayoutVisible);
VCControlsInterlock.ShowInterlocked(UIBoolJoin.VCCameraAutoVisible);
StagingButtonsFeedbackInterlock.ShowInterlocked(UIBoolJoin.VCStagingSelfViewLayoutPress);
}

View File

@@ -24,11 +24,13 @@ The [PepperDash.Core](https://github.com/PepperDash/PepperDashCore) SIMPL# libra
### Installing Dependencies
To install dependencies once nuget.exe is installed, run the following command: `nuget install .\packages.config -OutputDirectory .\packages -excludeVersion`. To verify that the packages installed correctly, open Essentials and make sure that all references are found, then try and build it.
To install dependencies once nuget.exe is installed, run the following command:
`nuget install .\packages.config -OutputDirectory .\packages -excludeVersion`.
To verify that the packages installed correctly, open Essentials and make sure that all references are found, then try and build it.
### Installing Different versions of PepperDash Core
If you need a different version of PepperDash Core, use the command `nuget install .\packages.config -OutputDirectory .\packages -excludeVersion -Version {versionToGet}`. Omitting the `-Version` option will pull the latest release version of PepperDash Core.
If you need a different version of PepperDash Core, use the command `nuget install .\packages.config -OutputDirectory .\packages -excludeVersion -Version {versionToGet}`. Omitting the `-Version` option will pull the version indicated in the packages.config file.
## Utilization

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,193 +1,210 @@
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)
{
var inputPort = (dev as IRoutingInputsOutputs).InputPorts[config.ControlPortName];
if (inputPort != null)
if (inputPort.Port is ICec)
return inputPort.Port as ICec;
var outputPort = (dev as IRoutingInputsOutputs).OutputPorts[config.ControlPortName];
if (outputPort != null)
if (outputPort.Port is ICec)
return outputPort.Port as ICec;
}
Debug.Console(0, "GetCecPort: Device '{0}' does not have a CEC port called: '{1}'", config.ControlPortDevKey, config.ControlPortName);
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));
}
}
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)
{
if (!String.IsNullOrEmpty(config.ControlPortName))
{
var inputPort = (dev as IRoutingInputsOutputs).InputPorts[config.ControlPortName];
if (inputPort != null)
{
if (inputPort.Port is ICec)
return inputPort.Port as ICec;
}
var outputPort = (dev as IRoutingInputsOutputs).OutputPorts[config.ControlPortName];
if (outputPort != null)
{
if (outputPort.Port is ICec)
return outputPort.Port as ICec;
}
else
Debug.Console(0, "GetCecPort: Device '{0}' does not have a CEC port called: '{1}'",
config.ControlPortDevKey, config.ControlPortName);
}
else
{
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;
}
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>
@@ -204,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

@@ -1,11 +1,33 @@
using PepperDash.Core;
using System;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IMobileControl:IKeyed
/// <summary>
/// Describes a MobileControlSystemController
/// </summary>
public interface IMobileControl : IKeyed
{
void CreateMobileControlRoomBridge(EssentialsRoomBase room);
void LinkSystemMonitorToAppServer();
}
/// <summary>
/// Describes a MobileControl Room Bridge
/// </summary>
public interface IMobileControlRoomBridge : IKeyed
{
event EventHandler<EventArgs> UserCodeChanged;
string UserCode { get; }
string QrCodeUrl { get; }
string McServerUrl { get; }
string RoomName { get; }
}
}

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

@@ -337,7 +337,36 @@ namespace PepperDash.Essentials.Core
return;
}
com.SimulateReceive(match.Groups[2].Value);
}
}
/// <summary>
/// Prints a list of routing inputs and outputs by device key.
/// </summary>
/// <param name="s">Device key from which to report data</param>
public static void GetRoutingPorts(string s)
{
var device = GetDeviceForKey(s);
if (device == null) return;
var inputPorts = (device as IRoutingInputsOutputs).InputPorts;
var outputPorts = (device as IRoutingInputsOutputs).OutputPorts;
if (inputPorts != null)
{
Debug.Console(0, "Device {0} has {1} Input Ports:", s, inputPorts.Count);
foreach (var routingInputPort in inputPorts)
{
Debug.Console(0, "{0}", routingInputPort.Key);
}
}
if (outputPorts != null)
{
Debug.Console(0, "Device {0} has {1} Output Ports:", s, outputPorts.Count);
foreach (var routingOutputPort in outputPorts)
{
Debug.Console(0, "{0}", routingOutputPort.Key);
}
}
}
/// <summary>
/// Attempts to set the debug level of a device

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

@@ -1,138 +1,169 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using System;
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Core.Config;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// IR port wrapper. May act standalone
/// </summary>
public class IrOutputPortController : Device
{
uint IrPortUid;
IROutputPort IrPort;
public ushort StandardIrPulseTime { get; set; }
public string DriverFilepath { get; private set; }
public bool DriverIsLoaded { get; private set; }
/// <summary>
/// Constructor for IrDevice base class. If a null port is provided, this class will
/// still function without trying to talk to a port.
/// </summary>
public IrOutputPortController(string key, IROutputPort port, string irDriverFilepath)
: base(key)
{
//if (port == null) throw new ArgumentNullException("port");
IrPort = port;
if (port == null)
{
Debug.Console(0, this, "WARNING No valid IR Port assigned to controller. IR will not function");
return;
}
LoadDriver(irDriverFilepath);
using PepperDash.Essentials.Core.Config;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// IR port wrapper. May act standalone
/// </summary>
public class IrOutputPortController : Device
{
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.
/// </summary>
public IrOutputPortController(string key, IROutputPort port, string irDriverFilepath)
: base(key)
{
//if (port == null) throw new ArgumentNullException("port");
DriverLoaded = new BoolFeedback(() => DriverIsLoaded);
IrPort = port;
if (port == null)
{
Debug.Console(0, this, "WARNING No valid IR Port assigned to controller. IR will not function");
return;
}
LoadDriver(irDriverFilepath);
}
public IrOutputPortController(string key, Func<DeviceConfig, IROutputPort> postActivationFunc,
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>
/// Loads the IR driver at path
/// </summary>
/// <param name="path"></param>
public void LoadDriver(string path)
{
if (string.IsNullOrEmpty(path)) path = DriverFilepath;
try
{
IrPortUid = IrPort.LoadIRDriver(path);
DriverFilepath = path;
StandardIrPulseTime = 200;
DriverIsLoaded = true;
}
catch
{
DriverIsLoaded = false;
var message = string.Format("WARNING IR Driver '{0}' failed to load", path);
Debug.Console(0, this, message);
ErrorLog.Error(message);
}
}
/// <summary>
/// Starts and stops IR command on driver. Safe for missing commands
/// </summary>
public virtual void PressRelease(string command, bool state)
{
Debug.Console(2, this, "IR:'{0}'={1}", command, state);
if (IrPort == null)
{
Debug.Console(2, this, "WARNING No IR Port assigned to controller");
return;
}
if (!DriverIsLoaded)
{
Debug.Console(2, this, "WARNING IR driver is not loaded");
return;
}
if (state)
{
if (IrPort.IsIRCommandAvailable(IrPortUid, command))
IrPort.Press(IrPortUid, command);
else
NoIrCommandError(command);
}
else
IrPort.Release();
}
/// <summary>
/// Pulses a command on driver. Safe for missing commands
/// </summary>
public virtual void Pulse(string command, ushort time)
{
if (IrPort == null)
{
Debug.Console(2, this, "WARNING No IR Port assigned to controller");
return;
}
if (!DriverIsLoaded)
{
Debug.Console(2, this, "WARNING IR driver is not loaded");
return;
}
if (IrPort.IsIRCommandAvailable(IrPortUid, command))
IrPort.PressAndRelease(IrPortUid, command, time);
else
NoIrCommandError(command);
}
/// <summary>
/// Notifies the console when a bad command is used.
/// </summary>
protected void NoIrCommandError(string command)
{
Debug.Console(2, this, "Device {0}: IR Driver {1} does not contain command {2}",
Key, IrPort.IRDriverFileNameByIRDriverId(IrPortUid), command);
/// <summary>
/// Loads the IR driver at path
/// </summary>
/// <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;
DriverLoaded.FireUpdate();
}
catch
{
DriverIsLoaded = false;
var message = string.Format("WARNING IR Driver '{0}' failed to load", path);
Debug.Console(0, this, Debug.ErrorLogLevel.Error, message);
DriverLoaded.FireUpdate();
}
}
}
/// <summary>
/// Starts and stops IR command on driver. Safe for missing commands
/// </summary>
public virtual void PressRelease(string command, bool state)
{
Debug.Console(2, this, "IR:'{0}'={1}", command, state);
if (IrPort == null)
{
Debug.Console(2, this, "WARNING No IR Port assigned to controller");
return;
}
if (!DriverIsLoaded)
{
Debug.Console(2, this, "WARNING IR driver is not loaded");
return;
}
if (state)
{
if (IrPort.IsIRCommandAvailable(IrPortUid, command))
IrPort.Press(IrPortUid, command);
else
NoIrCommandError(command);
}
else
IrPort.Release();
}
/// <summary>
/// Pulses a command on driver. Safe for missing commands
/// </summary>
public virtual void Pulse(string command, ushort time)
{
if (IrPort == null)
{
Debug.Console(2, this, "WARNING No IR Port assigned to controller");
return;
}
if (!DriverIsLoaded)
{
Debug.Console(2, this, "WARNING IR driver is not loaded");
return;
}
if (IrPort.IsIRCommandAvailable(IrPortUid, command))
IrPort.PressAndRelease(IrPortUid, command, time);
else
NoIrCommandError(command);
}
/// <summary>
/// Notifies the console when a bad command is used.
/// </summary>
protected void NoIrCommandError(string command)
{
Debug.Console(2, this, "Device {0}: IR Driver {1} does not contain command {2}",
Key, IrPort.IRDriverFileNameByIRDriverId(IrPortUid), command);
}
}
}

View File

@@ -165,29 +165,34 @@ namespace PepperDash.Essentials.Core.Fusion
{
// Exists. Read GUIDs
ReadGuidFile(guidFilePath);
}
if (Room.RoomOccupancy != null)
{
if (Room.OccupancyStatusProviderIsRemote)
SetUpRemoteOccupancy();
else
{
SetUpLocalOccupancy();
}
}
CreateSymbolAndBasicSigs(IpId);
SetUpSources();
SetUpCommunitcationMonitors();
SetUpDisplay();
SetUpError();
ExecuteCustomSteps();
if (Room.RoomOccupancy != null)
{
if (Room.OccupancyStatusProviderIsRemote)
SetUpRemoteOccupancy();
else
{
SetUpLocalOccupancy();
}
}
AddPostActivationAction(() =>
{
CreateSymbolAndBasicSigs(IpId);
SetUpSources();
SetUpCommunitcationMonitors();
SetUpDisplay();
SetUpError();
ExecuteCustomSteps();
FusionRVI.GenerateFileForAllFusionDevices();
GenerateGuidFile(guidFilePath);
});
// Make it so!
FusionRVI.GenerateFileForAllFusionDevices();
GenerateGuidFile(guidFilePath);
}
catch (Exception e)
{

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

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.Diagnostics;
@@ -100,25 +101,28 @@ namespace PepperDash.Essentials.Core.Monitoring
UptimeFeedback.FireUpdate();
LastStartFeedback.FireUpdate();
}
private void ParseUptime(string response)
{
var splitString = response.Trim().Split('\r', '\n');
var lastStartRaw = splitString[2];
var lastStartIndex = lastStartRaw.IndexOf(':');
_lastStart = lastStartRaw.Substring(lastStartIndex + 1).Trim();
var uptimeRaw = splitString[0];
var forIndex = uptimeRaw.IndexOf("for", StringComparison.Ordinal);
//4 => "for " to get what's on the right
_uptime = uptimeRaw.Substring(forIndex + 4);
}
}
private void ParseUptime(string response)
{
var splitString = response.Trim().Split('\r', '\n');
var lastStartRaw = splitString.FirstOrDefault(o => o.Contains("started"));
var uptimeRaw = splitString.FirstOrDefault(o => o.Contains("running"));
if (!String.IsNullOrEmpty(lastStartRaw))
{
var lastStartIndex = lastStartRaw.IndexOf(':');
_lastStart = lastStartRaw.Substring(lastStartIndex + 1).Trim();
}
if (String.IsNullOrEmpty(uptimeRaw)) return;
var forIndex = uptimeRaw.IndexOf("for", StringComparison.Ordinal);
//4 => "for " to get what's on the right
_uptime = uptimeRaw.Substring(forIndex + 4);
}
private void CrestronEnvironmentOnEthernetEventHandler(EthernetEventArgs ethernetEventArgs)
{
if (ethernetEventArgs.EthernetEventType != eEthernetEventType.LinkUp) return;

View File

@@ -48,19 +48,19 @@
<ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -72,7 +72,7 @@
</Reference>
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.ThreeSeriesCards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -80,39 +80,39 @@
</Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.39.33033, Culture=neutral, processorArchitecture=MSIL">
<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="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>
<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>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference>
<Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -146,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" />
@@ -188,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" />
@@ -210,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" />
@@ -226,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" />
@@ -301,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

@@ -9,6 +9,7 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials.Core
{
@@ -37,10 +38,32 @@ namespace PepperDash.Essentials.Core
protected abstract Func<bool> IsWarmingFeedbackFunc { get; }
protected abstract Func<bool> IsCoolingFeedbackFunc { get; }
/// <summary>
/// Indicates if this room is Mobile Control Enabled
/// </summary>
public bool IsMobileControlEnabled { get; private set; }
/// <summary>
/// The bridge for this room if Mobile Control is enabled
/// </summary>
public IMobileControlRoomBridge MobileControlRoomBridge { get; private set; }
/// <summary>
/// The config name of the source list
/// </summary>
public string SourceListKey { get; set; }
///
protected string _SourceListKey;
public virtual string SourceListKey {
get
{
return _SourceListKey;
}
set
{
_SourceListKey = value;
}
}
/// <summary>
/// Timer used for informing the UIs of a shutdown
@@ -58,7 +81,9 @@ namespace PepperDash.Essentials.Core
public Core.Privacy.MicrophonePrivacyController MicrophonePrivacy { get; set; }
public string LogoUrl { get; set; }
public string LogoUrlLightBkgnd { get; set; }
public string LogoUrlDarkBkgnd { get; set; }
protected SecondsCountdownTimer RoomVacancyShutdownTimer { get; private set; }
@@ -128,6 +153,34 @@ namespace PepperDash.Essentials.Core
});
}
public override bool CustomActivate()
{
SetUpMobileControl();
return base.CustomActivate();
}
/// <summary>
/// If mobile control is enabled, sets the appropriate properties
/// </summary>
void SetUpMobileControl()
{
var mcBridgeKey = string.Format("mobileControlBridge-{0}", Key);
var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey);
if (mcBridge == null)
{
Debug.Console(1, this, "*********************Mobile Control Bridge Not found for this room.");
IsMobileControlEnabled = false;
return;
}
else
{
MobileControlRoomBridge = mcBridge as IMobileControlRoomBridge;
Debug.Console(1, this, "*********************Mobile Control Bridge found and enabled for this room");
IsMobileControlEnabled = true;
}
}
void RoomVacancyShutdownPromptTimer_HasFinished(object sender, EventArgs e)
{
switch (VacancyMode)

View File

@@ -14,6 +14,8 @@
public UiSetupPropertiesConfig Setup { get; set; }
public string HeaderStyle { get; set; }
public bool IncludeInFusionRoomHealth { get; set; }
public uint ScreenSaverTimeoutMin { get; set; }
public uint ScreenSaverMovePositionIntervalMs { get; set; }
/// <summary>
@@ -26,6 +28,10 @@
{
SourcesOverflowCount = 5;
HeaderStyle = CrestronTouchpanelPropertiesConfig.Habanero;
// Default values
ScreenSaverTimeoutMin = 5;
ScreenSaverMovePositionIntervalMs = 15000;
}
/// <summary>

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

@@ -198,6 +198,7 @@ namespace PepperDash.Essentials.DM
Chassis.DMInputChange += new DMInputEventHandler(Chassis_DMInputChange);
Chassis.DMSystemChange += new DMSystemEventHandler(Chassis_DMSystemChange);
Chassis.DMOutputChange += new DMOutputEventHandler(Chassis_DMOutputChange);
Chassis.BaseEvent += ChassisOnBaseEvent;
VideoOutputFeedbacks = new Dictionary<uint, IntFeedback>();
AudioOutputFeedbacks = new Dictionary<uint, IntFeedback>();
UsbOutputRoutedToFeebacks = new Dictionary<uint, IntFeedback>();
@@ -329,56 +330,78 @@ namespace PepperDash.Essentials.DM
InputEndpointOnlineFeedbacks[tempX] = new BoolFeedback(() => { return Chassis.Inputs[tempX].EndpointOnlineFeedback; });
InputCardHdcpStateFeedbacks[tempX] = new IntFeedback(() => {
var inputCard = Chassis.Inputs[tempX];
if (inputCard.Card is DmcHd)
try
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
var inputCard = Chassis.Inputs[tempX];
if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1;
return 0;
}
if (inputCard.Card is DmcHdDsp)
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1;
return 0;
}
if (inputCard.Card is Dmc4kHdBase)
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability;
}
if (inputCard.Card is Dmc4kCBase)
{
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
if (inputCard.Card is DmcHd)
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability;
if ((inputCard.Card as DmcHd).HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1;
return 0;
}
if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue)
return 1;
return 0;
}
if (inputCard.Card is Dmc4kCDspBase)
{
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
if (inputCard.Card is DmcHdDsp)
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability;
if ((inputCard.Card as DmcHdDsp).HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1;
return 0;
}
if (inputCard.Card is Dmc4kHdBase)
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
return (int)(inputCard.Card as Dmc4kHdBase).HdmiInput.HdcpReceiveCapability;
}
if (inputCard.Card is Dmc4kHdDspBase)
{
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.Hdcp2_2Support;
return (int)(inputCard.Card as Dmc4kHdDspBase).HdmiInput.HdcpReceiveCapability;
}
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
if ((inputCard.Card as Dmc4kHdDspBase).HdmiInput.HdcpSupportOnFeedback.BoolValue)
return 1;
return 0;
}
if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue)
return 1;
if (inputCard.Card is Dmc4kCBase)
{
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
return (int)(inputCard.Card as Dmc4kCBase).DmInput.HdcpReceiveCapability;
}
if ((inputCard.Card as Dmc4kCBase).DmInput.HdcpSupportOnFeedback.BoolValue)
return 1;
return 0;
}
if (inputCard.Card is Dmc4kCDspBase)
{
if (PropertiesConfig.InputSlotSupportsHdcp2[tempX])
{
InputCardHdcpCapabilityTypes[tempX] = eHdcpCapabilityType.HdcpAutoSupport;
return (int)(inputCard.Card as Dmc4kCDspBase).DmInput.HdcpReceiveCapability;
}
if ((inputCard.Card as Dmc4kCDspBase).DmInput.HdcpSupportOnFeedback.BoolValue)
return 1;
return 0;
}
return 0;
}
return 0;
catch (InvalidOperationException iopex)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Warning, "The Input Card in slot: {0} supports HDCP 2. Please update the configuration value in the inputCardSupportsHdcp2 object to true. Error: {1}", tempX, iopex);
return 0;
}
});
}
}
@@ -614,6 +637,13 @@ namespace PepperDash.Essentials.DM
var cecPort2 = outputCard.Card2.HdmiOutput;
AddDmcHdoPorts(number, cecPort1, cecPort2);
}
else if (type == "dmc4kzhdo")
{
var outputCard = new Dmc4kzHdoSingle(number, Chassis);
var cecPort1 = outputCard.Card1.HdmiOutput;
var cecPort2 = outputCard.Card2.HdmiOutput;
AddDmcHdoPorts(number, cecPort1, cecPort2);
}
else if (type == "dmchdo")
{
var outputCard = new DmcHdoSingle(number, Chassis);
@@ -800,56 +830,81 @@ namespace PepperDash.Essentials.DM
void Chassis_DMInputChange(Switch device, DMInputEventArgs args)
{
switch (args.EventId)
try
{
case DMInputEventIds.EndpointOnlineEventId:
switch (args.EventId)
{
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
break;
}
case DMInputEventIds.OnlineFeedbackEventId:
{
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
break;
}
case DMInputEventIds.VideoDetectedEventId:
{
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
VideoInputSyncFeedbacks[args.Number].FireUpdate();
break;
}
case DMInputEventIds.InputNameEventId:
{
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
InputNameFeedbacks[args.Number].FireUpdate();
break;
}
case DMInputEventIds.UsbRoutedToEventId:
{
Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number);
if (UsbInputRoutedToFeebacks[args.Number] != null)
UsbInputRoutedToFeebacks[args.Number].FireUpdate();
else
Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks");
break;
}
case DMInputEventIds.HdcpCapabilityFeedbackEventId:
{
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
if (InputCardHdcpStateFeedbacks[args.Number] != null)
InputCardHdcpStateFeedbacks[args.Number].FireUpdate();
else
Debug.Console(1, this, "No index of {0} found in InputCardHdcpStateFeedbacks");
break;
}
default:
{
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
break;
case DMInputEventIds.EndpointOnlineEventId:
{
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
break;
}
case DMInputEventIds.OnlineFeedbackEventId:
{
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
break;
}
case DMInputEventIds.VideoDetectedEventId:
{
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
VideoInputSyncFeedbacks[args.Number].FireUpdate();
break;
}
case DMInputEventIds.InputNameEventId:
{
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
InputNameFeedbacks[args.Number].FireUpdate();
break;
}
case DMInputEventIds.UsbRoutedToEventId:
{
Debug.Console(2, this, "DM Input {0} UsbRoutedToEventId", args.Number);
if (UsbInputRoutedToFeebacks[args.Number] != null)
UsbInputRoutedToFeebacks[args.Number].FireUpdate();
else
Debug.Console(1, this, "No index of {0} found in UsbInputRoutedToFeedbacks");
break;
}
case DMInputEventIds.HdcpCapabilityFeedbackEventId:
{
Debug.Console(2, this, "DM Input {0} HdcpCapabilityFeedbackEventId", args.Number);
if (InputCardHdcpStateFeedbacks[args.Number] != null)
InputCardHdcpStateFeedbacks[args.Number].FireUpdate();
else
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
break;
}
case DMInputEventIds.HdcpSupportOffEventId:
{
Debug.Console(2, this, "DM Input {0} HdcpSupportOffEventId", args.Number);
if (InputCardHdcpStateFeedbacks[args.Number] != null)
InputCardHdcpStateFeedbacks[args.Number].FireUpdate();
else
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
break;
}
case DMInputEventIds.HdcpSupportOnEventId:
{
Debug.Console(2, this, "DM Input {0} HdcpSupportOnEventId", args.Number);
if (InputCardHdcpStateFeedbacks[args.Number] != null)
InputCardHdcpStateFeedbacks[args.Number].FireUpdate();
else
Debug.Console(1, this, "No index of {0} found in InputCardHdcpCapabilityFeedbacks");
break;
}
default:
{
Debug.Console(2, this, "DMInputChange fired for Input {0} with Unhandled EventId: {1}", args.Number, args.EventId);
break;
}
}
}
catch (Exception ex)
{
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Error in Chassis_DMInputChange: {0}", ex);
}
}
///
@@ -1162,8 +1217,8 @@ namespace PepperDash.Essentials.DM
var hdmiInPortWCec = port as HdmiInputWithCEC;
SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
SetHdcpStateAction(PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], hdmiInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
InputCardHdcpStateFeedbacks[ioSlot].LinkInputSig(
@@ -1452,10 +1507,12 @@ namespace PepperDash.Essentials.DM
{
if (s == 0)
{
Debug.Console(2, this, "Join {0} value {1} Setting HdcpSupport to off", join, s);
port.HdcpSupportOff();
}
else if (s > 0)
{
Debug.Console(2, this, "Join {0} value {1} Setting HdcpSupport to on", join, s);
port.HdcpSupportOn();
}
});
@@ -1465,6 +1522,7 @@ namespace PepperDash.Essentials.DM
trilist.SetUShortSigAction(join,
u =>
{
Debug.Console(2, this, "Join {0} value {1} Setting HdcpReceiveCapability to: {2}", join, u, (eHdcpCapabilityType)u);
port.HdcpReceiveCapability = (eHdcpCapabilityType)u;
});
}
@@ -1479,10 +1537,12 @@ namespace PepperDash.Essentials.DM
{
if (s == 0)
{
Debug.Console(2, this, "Join {0} value {1} Setting HdcpSupport to off", join, s);
port.HdcpSupportOff();
}
else if (s > 0)
{
Debug.Console(2, this, "Join {0} value {1} Setting HdcpSupport to on", join, s);
port.HdcpSupportOn();
}
});
@@ -1492,6 +1552,7 @@ namespace PepperDash.Essentials.DM
trilist.SetUShortSigAction(join,
u =>
{
Debug.Console(2, this, "Join {0} value {1} Setting HdcpReceiveCapability to: {2}", join, u, (eHdcpCapabilityType)u);
port.HdcpCapability = (eHdcpCapabilityType)u;
});
}

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,38 +48,38 @@
<ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.39.33033, Culture=neutral, processorArchitecture=MSIL">
<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="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>
<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">

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public interface IHasExternalSourceSwitching
{
bool ExternalSourceListEnabled { get; }
void AddExternalSource(string connectorId, string key, string name, eExternalSourceType type);
void SetExternalSourceState(string key, eExternalSourceMode mode);
void ClearExternalSources();
Action<string, string> RunRouteAction { set;}
}
}

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,51 +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>
<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>
<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>
<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>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.39.33033, Culture=neutral, processorArchitecture=MSIL">
<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>
<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>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -112,6 +108,7 @@
<Compile Include="Codec\eCodecCallStatus.cs" />
<Compile Include="Codec\eMeetingPrivacy.cs" />
<Compile Include="Codec\iCodecAudio.cs" />
<Compile Include="Codec\IHasExternalSourceSwitching.cs" />
<Compile Include="ImageProcessors\TVOneCorio.cs" />
<Compile Include="ImageProcessors\TVOneCorioPropertiesConfig.cs" />
<Compile Include="Power Controllers\Digitallogger.cs" />
@@ -123,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" />
@@ -180,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

@@ -1,33 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public class CiscoSparkCodecPropertiesConfig
{
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
public List<CodecActiveCallItem> Favorites { get; set; }
/// <summary>
/// Valid values: "Local" or "Corporate"
/// </summary>
public string PhonebookMode { get; set; }
public bool ShowSelfViewByDefault { get; set; }
public SharingProperties Sharing { get; set; }
}
public class SharingProperties
{
public bool AutoShareContentWhileInCall { get; set; }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using Newtonsoft.Json;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public class CiscoSparkCodecPropertiesConfig
{
[JsonProperty("communicationMonitorProperties")]
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
[JsonProperty("favorites")]
public List<CodecActiveCallItem> Favorites { get; set; }
/// <summary>
/// Valid values: "Local" or "Corporate"
/// </summary>
[JsonProperty("phonebookMode")]
public string PhonebookMode { get; set; }
[JsonProperty("showSelfViewByDefault")]
public bool ShowSelfViewByDefault { get; set; }
[JsonProperty("sharing")]
public SharingProperties Sharing { get; set; }
[JsonProperty("externalSourceListEnabled")]
public bool ExternalSourceListEnabled { get; set; }
/// <summary>
/// Optionsal property to set the limit of any phonebook queries for directory or searching
/// </summary>
[JsonProperty("phonebookResultsLimit")]
public uint PhonebookResultsLimit { get; set; }
[JsonProperty("UiBranding")]
public BrandingLogoProperties UiBranding { get; set; }
}
public class SharingProperties
{
[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

@@ -126,11 +126,36 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public Encryption Encryption { get; set; }
public RequestedURI RequestedURI { get; set; }
public PeopleCountAverage PeopleCountAverage { get; set; }
}
}
public class UserInterface
{
public string id { get; set; }
public Presentation Presentation { get; set; }
}
public class Presentation
{
public string id { get; set; }
public ExternalSource ExternalSource { get; set; }
}
public class ExternalSource
{
public string id { get; set; }
public Selected Selected { get; set; }
}
public class Selected
{
public string id { get; set; }
public SourceIdentifier SourceIdentifier { get; set; }
}
public class SourceIdentifier
{
public string id { get; set; }
public string Value { get; set; }
}
public class Event
{
public CallDisconnect CallDisconnect { get; set; }
public CallDisconnect CallDisconnect { get; set; }
public UserInterface UserInterface { get; set; }
}
public class RootObject

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 +0,0 @@
<packages>
<package id="PepperDashCore" version="1.0.38-alpha-135" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
</packages>

View File

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