Compare commits

...

200 Commits

Author SHA1 Message Date
Neil Dorin
5ef7882955 Updates drawing to have correct decision labels 2020-07-28 22:58:00 -06:00
Neil Dorin
3992aba843 Adds updated plugin load sequence drawing 2020-07-27 23:38:31 -06:00
Andrew Welker
b689a54936 Merge pull request #253 from PepperDash/hotfix/eiscApiAdvanced-backwards-compatibility
Add backwards compatability with `IBridge` to `EiscApiAdvanced`
2020-06-12 13:43:05 -06:00
Andrew Welker
1046672386 Merge branch 'master' into hotfix/eiscApiAdvanced-backwards-compatibility 2020-06-12 13:16:20 -06:00
Andrew Welker
5853dd6617 Merge pull request #241 from PepperDash/hotfix/dm-tx-chassis-bridge-fix
Add BasicDmTxControllerBase back
2020-06-10 16:11:58 -06:00
Andrew Welker
a0ef356bac Fix casts in DmBladeChassisController 2020-06-09 14:40:11 -06:00
Andrew Welker
486d6db7d8 fixes casting issues 2020-06-09 13:06:40 -06:00
Andrew Welker
81d9261a73 Changes base class to BasicDmTxControllerBase 2020-06-09 13:06:25 -06:00
Andrew Welker
2ace6ef6bc adds BasicDmTxControllerBase back in 2020-06-09 13:05:56 -06:00
Andrew Welker
cc6d94b188 Updates EiscApiAdvanced for backwards compatibility 2020-06-09 10:57:42 -06:00
Andrew Welker
0525f76b6b Added IBridge to Core
made existing IBridge inherit from it for backwards compatabilty
2020-06-09 10:57:17 -06:00
Neil Dorin
345442e195 Merge pull request #235 from PepperDash/hotfix/update-readme-to-include-4-series
Hotfix/update readme to include 4 series
2020-06-07 16:53:45 -06:00
Neil Dorin
e94e8b60a6 Bolds 4-series 2020-06-07 16:36:00 -06:00
Neil Dorin
4f4c8cba04 Update README.md 2020-06-07 16:11:17 -06:00
Andrew Welker
0a38442ac5 Merge pull request #224 from PepperDash/hotfix/dm-rmc4kz100-build
Fix issue building DM-RMC-4KZ-100-C & DM-TX-4KZ-202-C
2020-06-01 16:59:04 -06:00
Andrew Welker
083a3662e0 adds DmTx4kz202CController class
fixes errors in DmTx4kz302CController that were fixed in a previous
commit but were not merged into dev
2020-06-01 13:33:28 -06:00
Andrew Welker
37e1e50b94 #222 changes updates for EDID Feedbacks 2020-06-01 10:38:45 -06:00
Neil Dorin
862610b17d Merge pull request #216 from PepperDash/hotfix/genericcomm-incorrect-cast
Fix incorrect cast in GenericComm LinkToApi method
2020-05-27 10:34:08 -06:00
Andrew Welker
7bfc82c3cc #215 fix for incorrect cast in LinkToApi method 2020-05-27 09:50:50 -06:00
Trevor Payne
f81fe3d01f Merge pull request #203 from PepperDash/hotfix/dm-tx-bridging
Hotfix/dm tx bridging
2020-05-20 15:08:44 -05:00
Trevor Payne
4f5b649b1d Updated DmTx4kz302CController
#200
2020-05-20 14:30:54 -05:00
Trevor Payne
d0ee05def9 Updated DmTx4kz100Controller
Updated DmTx4k302CController

#200
2020-05-20 14:19:19 -05:00
Trevor Payne
dd0a52c1a2 Updated dmTx402302CController
Updated DmTx4k202CController

#200
2020-05-20 14:10:27 -05:00
Trevor Payne
76abd05830 Updated DmTx4k202CController
#200
2020-05-20 13:55:37 -05:00
Trevor Payne
102535cd04 Updated DmTx401CController
#200
2020-05-20 13:42:39 -05:00
Trevor Payne
e0e9fc2ce4 Updated DmTx201SController
Added Decription Attribute to 200 and both 201 classes
2020-05-20 12:57:16 -05:00
Trevor Payne
a657525562 Updated DmTx201CController 2020-05-20 12:50:44 -05:00
Andrew Welker
496b70f73f Added event handler for VgaInput.Stream
added logic to fire various feedback updates as required
2020-05-20 08:43:18 -06:00
Neil Dorin
19b3c51c25 Merge pull request #196 from PepperDash/release/v1.5.2
1.5.2 Release
2020-05-19 14:53:53 -06:00
Andrew Welker
476d661ece removed duplicate method that somehow crept in... 2020-05-18 17:47:14 -06:00
Andrew Welker
546cdacc0f Merge branch 'master' into release/v1.5.2 2020-05-18 17:01:23 -06:00
Neil Dorin
b4605578ad Merge pull request #191 from PepperDash/hotfix/dm-usb-routing
Update DM USB Routing to match SIMPL Windows
2020-05-18 13:30:05 -06:00
Andrew Welker
39f25cc9db Adds GetJoinMapForDevice method back
somehow was missing from dev branch...
2020-05-18 12:43:00 -06:00
Andrew Welker
788aa33a3a Merge branch 'release/v1.5.2' into hotfix/dm-usb-routing 2020-05-18 11:36:58 -06:00
Andrew Welker
46ecb676c0 Fixes USB Routing for routing via Inputs and input to input
Also adds feedbacks for Audio Breakaway and USB Breakaway status
2020-05-18 11:32:44 -06:00
Andrew Welker
19c4428dc8 adds feedback joins for Audio & USB Breakway 2020-05-18 10:21:46 -06:00
Neil Dorin
25ddb95db5 Merge pull request #189 from PepperDash/hotfix/update-action
Updates action to login to Docker Hub
2020-05-18 09:35:56 -06:00
Andrew Welker
43ff15ff5e adds Docker login to master workflow 2020-05-18 09:13:38 -06:00
Andrew Welker
406e6a912f adds Docker Hub login to workflow 2020-05-18 08:52:08 -06:00
Andrew Welker
57f1db17c3 Added some debug statements 2020-05-15 15:45:37 -06:00
Andrew Welker
c9d97e5cae Adds support for routing In to In or Out to Out for USB for DM Chassis 2020-05-15 15:36:32 -06:00
Andrew Welker
f33763ce43 fixes bitwise comparison for routing type 2020-05-15 15:20:27 -06:00
Andrew Welker
a192ec3117 Merge pull request #185 from PepperDash/feature/fix-workflow-release-mechanism
Remove release creation for alpha and beta builds
2020-05-13 12:14:06 -06:00
Andrew Welker
f9ca609c1e fix to prevent branches with 'release' in the name from triggering the public repo push 2020-05-13 11:56:53 -06:00
Andrew Welker
b0a21a1c2f fixes order of operations for contains statement 2020-05-13 11:42:18 -06:00
Andrew Welker
a4339bf5a4 adjust conditions to NOT use expression syntax 2020-05-13 11:20:36 -06:00
Andrew Welker
06cc871432 fixes other comma issue... 2020-05-13 10:45:54 -06:00
Andrew Welker
45b6a09067 fixes contain statement - missed a comma 2020-05-13 10:41:27 -06:00
Andrew Welker
2085e14f24 updates workflow to only create releases for rc builds 2020-05-13 10:39:56 -06:00
Andrew Welker
55d8e6f205 Merge pull request #177 from PepperDash/feature/Improve-DGE-Trilist
Improvements to DGEController
2020-05-12 14:50:39 -06:00
Trevor Payne
4ef8e8cf14 --amend 2020-05-12 15:31:03 -05:00
Trevor Payne
e581219e32 --amend 2020-05-12 15:29:34 -05:00
Trevor Payne
d11e0db14a Refactor obsolete comport instantiation method for DGE devices 2020-05-12 15:28:00 -05:00
Trevor Payne
4c5b60bddb Exposed ICEC to DGE Controller Classes 2020-05-12 14:55:12 -05:00
Trevor Payne
0b59dbe20d Differentiation between Dge100 and DmDge200C 2020-05-12 14:20:15 -05:00
Trevor Payne
279eaaaf62 Merge branch 'development' into feature/Improve-DGE-Trilist 2020-05-12 13:46:07 -05:00
Trevor Payne
fd3e8d81f8 resolves #176 - Added IHasBasicTriListWithSmartObject to DgeController 2020-05-12 13:28:55 -05:00
Andrew Welker
1dfdca0ab4 Merge pull request #175 from PepperDash/feature/fix-DisplayJoinMap-Constructor-base
Fix DisplayControllerJoinMap Constructor
2020-05-12 12:23:16 -06:00
Trevor Payne
ba5ab18fad resolves #174 - fixed constructor issue 2020-05-12 12:13:08 -05:00
Andrew Welker
7caef808b7 Merge pull request #173 from PepperDash/feature/fix-devMan-threading
Update DeviceManager to provide protections for multiple threads or reentrancy
2020-05-12 10:10:51 -06:00
Andrew Welker
fd7f708a83 adds protections for devices doing things they shouldn't... 2020-05-12 09:49:03 -06:00
Andrew Welker
966a6c194f Adds CCriticalSection and try/finally for all Device Dictionary accesses 2020-05-12 09:49:03 -06:00
Andrew Welker
dea7edaa1f Merge pull request #172 from PepperDash/feature/Add-DmTx4kZ100C-C-1G-B-T
Add DM-TX-4KZ-100-C-1G support
2020-05-12 09:37:05 -06:00
Trevor Payne
75e74aa06b Added dmtx4k100c1g and dmtx4kz100c1g to TypeNames 2020-05-12 10:22:58 -05:00
Trevor Payne
b671f4c77e Added CEC, Comports, and IR to DmTx4kz100Controller 2020-05-12 10:12:06 -05:00
Trevor Payne
26eedb684a resolves #171 - Added DmTx4kz100C1G controller to essentials and added config values to instantiate it 2020-05-12 09:46:35 -05:00
Andrew Welker
0705c412fb Merge pull request #160 from PepperDash/feature/refactor-dm-rx-base-classes
Refactor DM RMC Classes
2020-05-11 18:20:21 -06:00
Andrew Welker
b76178990d fixes issue with merge commit and conflicts 2020-05-11 18:06:37 -06:00
Andrew Welker
c2ce9b2249 Merge branch 'development' into feature/refactor-dm-rx-base-classes 2020-05-11 15:32:27 -06:00
Neil Dorin
a1465f55ba Merge pull request #166 from PepperDash/feature/update-workflows
Update workflow to add Crestron dlls to output
2020-05-11 15:17:30 -06:00
Neil Dorin
ea4192838d Merge branch 'development' into feature/update-workflows 2020-05-11 15:04:22 -06:00
Andrew Welker
b8553bdb7c Merge pull request #159 from PepperDash/feature/add-dm-tx-video-sync-per-input
Adds new feedback type to link Dm-Tx input video sync to generic "inp…
2020-05-08 14:37:34 -06:00
Trevor Payne
6e741c4d44 Updated Joinmaps to JoinMapBaseAdvanced 2020-05-08 13:57:43 -05:00
Trevor Payne
24d9873af2 Fix Merge Issues 2020-05-08 13:45:28 -05:00
Andrew Welker
7e7159e543 Merge pull request #170 from PepperDash/feature/CENOdtOccupancySensorBase-MissingAddJoinMap
Added AddJoinMap to CenOdtOccupancySensorBaseController
2020-05-08 12:20:23 -06:00
Trevor Payne
2cc5631672 Added AddJoinMap to CenOdtOccupancySensorBaseController
resolves #167
2020-05-08 11:24:02 -05:00
Trevor Payne
4fcccfff0b Merge pull request #163 from PepperDash/feature/update-joinmaps-globally
Update PepperDash.Essentials.Core join maps to use JoinMapAdvanced
2020-05-08 11:10:20 -05:00
Andrew Welker
531bda5c7f Merge branch 'development' into feature/update-joinmaps-globally 2020-05-08 09:55:13 -06:00
Trevor Payne
04e159c1d1 Added bridge.AddJoinMap(Key, joinMap); to each LinkToApi method 2020-05-08 10:46:23 -05:00
Andrew Welker
281bfc4147 Adds *.dll to the initial file search
This is to allow for capturing Crestron .dlls and including them to make adding references from the build repo easier.
2020-05-08 09:04:54 -06:00
Andrew Welker
c6e511131b removes fetch tags step for Master branch workflow 2020-05-08 09:03:32 -06:00
Andrew Welker
88b10f7ae6 Merge pull request #164 from PepperDash/feature/ADD-CEN-ODT-OCC-SENSORS
Add CEN-ODT-C-POE Support
2020-05-08 08:49:53 -06:00
Trevor Payne
9286d5bfc4 Merge branch 'feature/ADD-CEN-ODT-OCC-SENSORS' of https://github.com/PepperDash/Essentials into feature/ADD-CEN-ODT-OCC-SENSORS
resolves #92
2020-05-07 22:24:50 -05:00
Trevor Payne
072c13459c Added CenOdtOccupancySensorBaseController;
Added CenOdtOccupancySensorBaseJoinMap
resolves #92
2020-05-07 22:23:09 -05:00
Trevor Payne
93d6bf607b Added CenOdtOccupancySensorBaseController;
Added CenOdtOccupancySensorBaseJoinMap
resolves #142
2020-05-07 22:20:38 -05:00
Trevor Payne
35effa5e82 Updated SystemMonitorController and System Monitor JoinMap;
resolves #162
2020-05-07 21:18:47 -05:00
Trevor Payne
caf5a6812b Updated StatusSignController and StatusSignControllerJoinMap 2020-05-07 17:22:54 -05:00
Trevor Payne
99c4dc2266 Updated IRSetTopBoxBase and SetTopBoxControllerJoinMap 2020-05-07 17:14:48 -05:00
Trevor Payne
1d47a60695 Updated GenericDigitalInputDevice IDigitalInputJoinMap 2020-05-07 16:44:35 -05:00
Trevor Payne
cde25c56e2 Updated MdMdxxxCEController and HdMdxxxCEControllerJoinMap 2020-05-07 16:41:43 -05:00
Trevor Payne
8da86c360c Updated GlsOccupancySensorBaseController and GlsOccupancySensorBaseJoinMap 2020-05-07 16:30:01 -05:00
Andrew Welker
53fa0c0865 updates DmRmcControllerBase 2020-05-07 14:59:52 -06:00
Andrew Welker
03cebb75ce udpates all DM 8G Receiver classes 2020-05-07 14:59:52 -06:00
Andrew Welker
fc8b4120c7 updates all DM Fiber Receiver Classes 2020-05-07 14:59:52 -06:00
Andrew Welker
5ec96310c6 Updates eRoutingSignalType AudioVideo 2020-05-07 14:59:52 -06:00
Andrew Welker
53d92555c8 refactors several RMC controller Classes 2020-05-07 14:59:52 -06:00
Andrew Welker
42b94e3a47 lots of refactoring 2020-05-07 14:59:52 -06:00
Andrew Welker
4b37d68c0e Refactors HDBaseTRxController
chagnes InputPorts and OutputPorts to not return a new collection every time they are accessed
2020-05-07 14:59:52 -06:00
Andrew Welker
b321fc7b76 removes virtual modifier on properties
updates DmHdBaseTControllerBase to use a protected field and sets the reference in the constructor

adds protected field for rmc device to DmRmcControllerBase and sets it in the constructor
2020-05-07 14:59:52 -06:00
Andrew Welker
41e9bead0b adds Flags Attribute to eRoutingSignalType 2020-05-07 14:59:52 -06:00
Andrew Welker
404f5c921b removes unnecessary usings 2020-05-07 14:59:52 -06:00
Andrew Welker
acfd82fa82 updates DmRmcHelper to use dicts
uses dicts for type lookups to make things more readable
2020-05-07 14:59:52 -06:00
Andrew Welker
e387a5534b removes unnecessary things and removes virtual keyword on properties 2020-05-07 14:59:52 -06:00
Trevor Payne
adbb76b87c Updated GenericRelayControllerJoinMap and GenericRelayDevice 2020-05-07 15:54:47 -05:00
Trevor Payne
230f29d3f8 Updated GenericLightingJoinMap, LightingBase, and LutronQuantum 2020-05-07 15:42:46 -05:00
Trevor Payne
6530856d28 Updated DmTxControllerJoinMap and DmTxControllerHelpers 2020-05-07 15:17:22 -05:00
Trevor Payne
5c560ae82f Updated DmRmcControllerJoinMap and DmRmcHelper 2020-05-07 14:29:45 -05:00
Trevor Payne
30c1b2755e Updated DmpsRoutingController and DmpsRoutingControllerJoinMap; Minor Edits to DmpsRoutingController to accomodate new joinmap span property 2020-05-07 14:21:39 -05:00
Trevor Payne
49fcb9e394 Updated DmpsAudioOutputController and DmpsAudioOutputControllerJoinMap 2020-05-07 13:52:00 -05:00
Trevor Payne
3a3ccb0acd Updated DmChassisController and DmChassisControllerJoinMap; Slightly changed DmChassisController Bridge to account for new offsets using the span property. 2020-05-07 13:31:26 -05:00
Trevor Payne
ff7a1838aa Updated DmBladeChassisController and DmBladeChassisControllerJoinMap; Slightly changed DmBladeChassisController Bridge to account for new offsets using span property 2020-05-07 12:59:33 -05:00
Trevor Payne
3a03fa31e8 Added [Obsolete] flag to Digitallogger and DigitalLoggerJoinMap. At direction of Jason A, it will be moved into a plugin and removed from essentials entirely in a future update. 2020-05-07 12:30:22 -05:00
Alex Johnson
f91930930b Changes Dm-Tx video sync feedback to be specific to port type (hdmi, dp, vga). Moves linking to Api join map into the tx specific LinkToApi() 2020-05-07 13:23:20 -04:00
Trevor Payne
d8671ea73f Updated C2nRthsController and C2nRthsControllerJoinMap 2020-05-07 11:38:41 -05:00
Trevor Payne
72ec4de912 Updated AppleTv and AppleTvJoinMap 2020-05-07 11:28:08 -05:00
Trevor Payne
b9bc3bd0f3 Updated AirMediaController and AirMediaControllerJoinMap 2020-05-07 11:19:55 -05:00
Alex Johnson
8f440c3cb9 Fixes mapping for DM-TX-401 where displayport=1 and hdmi=2 2020-05-07 11:27:07 -04:00
Alex Johnson
31536e7f97 Removes accidental duplication of code 2020-05-06 21:28:38 -04:00
ajohnson_pd
8499338fac Adds new feedback type to link Dm-Tx input video sync to generic "input1", "input2", "input3" video sync feedbacks for passing to SIMPL. Updates join map for DmTxController 2020-05-06 20:03:07 -04:00
Andrew Welker
622749a37f Merge pull request #157 from PepperDash/hotfix/fix-4kzX02-tx-audio-source-fb
Fix DM-TX-4KZ-302-C Audio feedback and routing
2020-05-06 16:27:31 -06:00
Andrew Welker
bcd7efa911 Merge branch 'master' into hotfix/fix-4kzX02-tx-audio-source-fb 2020-05-06 16:13:55 -06:00
Andrew Welker
b58b42c496 Merge pull request #156 from PepperDash/hotfix/add-dmc-4kz-hdo-support
Add dmc 4kz hdo support
2020-05-06 15:41:55 -06:00
Andrew Welker
f7a41f08c4 fixes audio source feedback and setting audio source
4kz302C does not support audio breakway routing.
2020-05-06 15:35:54 -06:00
Neil Dorin
7a7ab33fa4 Merge remote-tracking branch 'origin/hotfix/replace-getJoinMapsForDevice' into hotfix/add-dmc-4kz-hdo-support 2020-05-06 15:27:03 -06:00
Neil Dorin
dc9d285de0 Adds condition to support dmc4kzhdo output card type 2020-05-06 14:49:29 -06:00
Andrew Welker
2519fffb58 puts GetJoinMapForDevice method back into JoinMapHelper 2020-05-06 14:00:56 -06:00
Andrew Welker
3f4cc0cb26 Merge pull request #150 from PepperDash/release/v1.5.0
merge 1.5.0 back into development
2020-05-06 12:49:50 -06:00
Andrew Welker
12f8cc1c0c fixes issue with merging release/v1.5.0 into develop 2020-05-06 12:34:37 -06:00
Andrew Welker
bfa1fee522 Revert "Revert "Merge branch 'development' into release/v1.5.0""
This reverts commit 4cd01aa428.
2020-05-06 12:33:32 -06:00
Andrew Welker
4cd01aa428 Revert "Merge branch 'development' into release/v1.5.0"
This reverts commit 98c8a42d97, reversing
changes made to dc760caf71.
2020-05-06 12:30:13 -06:00
Andrew Welker
98c8a42d97 Merge branch 'development' into release/v1.5.0 2020-05-06 12:11:18 -06:00
Neil Dorin
2eacaec577 Merge pull request #149 from PepperDash/hotfix/fix-action
fixes master.yml action
2020-05-06 11:28:29 -06:00
Andrew Welker
dbec871500 fixes master.yml action...again 2020-05-06 11:13:43 -06:00
Neil Dorin
03bcb5f338 Merge pull request #148 from PepperDash/release/v1.5.0
Release v1.5.0
2020-05-06 10:59:44 -06:00
Andrew Welker
dc760caf71 Merge branch 'master' into release/v1.5.0 2020-05-06 10:46:34 -06:00
Neil Dorin
361a9caac1 Merge pull request #144 from PepperDash/feature/update-Display-Joinmap
resolves #143 - Joinmap and Bridge updated
2020-05-05 16:49:03 -06:00
Trevor Payne
e90436081a Fixes to Logging related to DisplayBase input joinmap 2020-05-05 17:32:31 -05:00
Trevor Payne
b3821e90d1 Added debug statement if there are more inputs than allowed bu the joinspan. 2020-05-05 16:49:50 -05:00
Trevor Payne
282c8b2cef Merge branch 'development' into feature/update-Display-Joinmap 2020-05-05 15:30:41 -05:00
Trevor Payne
250f62d79c Changed displayDevice.InputPorts API Linking to for loop 2020-05-05 15:14:53 -05:00
Trevor Payne
64b5bc8cb8 Added a check to verify that the number of inputs on a display is not greater than the size of the joinspan 2020-05-05 15:04:55 -05:00
Andrew Welker
6766574b38 Merge pull request #146 from PepperDash/feature/Update-IBasicCommunicationJoinMap-To-JoinMapBaseAdvanced
resolves #145 - Updated IBasicCommunicationJoinMap
2020-05-05 12:28:52 -06:00
Trevor Payne
0b660966ac resolves #145 - Updated IBasicCommunicationJoinMap 2020-05-05 12:35:01 -05:00
Trevor Payne
18c35b103e resolves #143 - Joinmap and Bridge updated 2020-05-05 12:09:53 -05:00
Andrew Welker
edb4a1f371 Merge pull request #137 from PepperDash/feature/Add_DM-RMC-4K-Z-100-C
resolves #135 - Add new controller class for DM-RMC-4K-Z-100-C
2020-04-29 13:52:16 -06:00
Andrew Welker
7a23f141fc Merge branch 'development' into feature/Add_DM-RMC-4K-Z-100-C 2020-04-29 13:07:29 -06:00
Andrew Welker
02c71f709c replaces 2 more occasions of Rm with Dm 2020-04-28 21:35:52 -06:00
Andrew Welker
b993419c3d fixes file name for 4kz100C everywhere 2020-04-28 21:20:56 -06:00
Andrew Welker
ef8a61c3eb removed duplicated logic from constructor 2020-04-28 21:12:52 -06:00
Andrew Welker
d2c8da68a5 adds todo for examining class inheritance design 2020-04-28 21:02:34 -06:00
Andrew Welker
618fa68000 removes properties in inherited class 2020-04-28 21:00:50 -06:00
Neil Dorin
64e100f839 Merge pull request #136 from PepperDash/feature/fix-version-comparisons
change plugin version comparison method to use .Net Version class
2020-04-28 17:01:26 -06:00
Andrew Welker
7991716ee2 Merge pull request #134 from PepperDash/feature/Add-DM-RMC-4KZ-SCALER-C
Feature/add dm rmc 4 kz scaler c
2020-04-28 16:17:32 -06:00
Trevor Payne
531c37c752 resolves #135 - Adds new controller class for DM-RMC-4K-Z-100-C
Extends existing controller class for RmcX100C devices and gives it additional connection metadata to report
2020-04-28 17:15:38 -05:00
Andrew Welker
c06184d973 fixes version comparison for plugin minimum versions 2020-04-28 15:59:31 -06:00
Neil Dorin
806d845750 Merge pull request #132 from PepperDash/feature/CameraBase-fix
Fix Issues with DisplayBase and CameraBase backwards compatibility
2020-04-28 14:23:38 -06:00
Andrew Welker
d0e357f4b7 adds IBridgeAdvanced at actual device level 2020-04-28 14:01:59 -06:00
Andrew Welker
15b65fb9a9 changes DisplayBase to inherit from EssentialsDevice 2020-04-28 13:55:14 -06:00
Andrew Welker
51dc215504 change CameraBase to EssentialsDevice
All internal types that derive from CameraBase now implement IBridgeAdvanced and call the protected method LinkCameraToApi for bridging
2020-04-28 12:16:24 -06:00
Andrew Welker
90c4435253 fix condition for determining if type is IBridgeAdvanced 2020-04-28 12:14:08 -06:00
Andrew Welker
44fcbf98f2 rename ConfigureComPort to RegisterAndConfigureComPort 2020-04-28 12:13:35 -06:00
Trevor Payne
79253c6b31 Fixed minor Interface Implementation Issues 2020-04-28 12:27:06 -05:00
Trevor Payne
4d433ebf22 resolve #130 Add new interface IRmcRouting
add DmRmc4kZScalerC endpoint and associated changes to bridge and joinmap
add DmRmc4kZScalerCController
2020-04-28 12:19:23 -05:00
Andrew Welker
671d506b45 moves Port registration for controller ports to ConfigureComPort
...and renames method to RegisterAndConfigureComPort
2020-04-28 08:54:38 -06:00
Neil Dorin
1acc018a81 Merge pull request #127 from PepperDash/feature/comPortController-post-activation-add
Adds ctor for ComPortController and CecPortController
2020-04-27 21:29:37 -06:00
Andrew Welker
0d33354f08 updates CommFactory to use new ctors for ComPortController
and CecPortController
2020-04-27 18:22:47 -06:00
Andrew Welker
d6d0e3cfda adds new ctor to CecPortController to add post activation func 2020-04-27 18:22:23 -06:00
Andrew Welker
282ea62f83 adds new ctor to add post activation action
for ComPortController
2020-04-27 18:21:55 -06:00
Andrew Welker
5608721e3d Merge pull request #123 from PepperDash/feature/update-to-new-device-factory-methodology
Feature/update to new device factory methodology
2020-04-23 16:22:52 -06:00
Neil Dorin
3aca786252 Merge branch 'development' into feature/update-to-new-device-factory-methodology 2020-04-23 16:10:53 -06:00
Andrew Welker
5c5d35a72b Merge pull request #122 from PepperDash/hotfix/add-ui-template-update-pd-core-ver
Adds Essentials UI Template submodule.  Updates PepperDash.Core to v1.0.35
2020-04-23 15:19:38 -06:00
Neil Dorin
fcdfaca6a8 Adds Essentials UI Template submodule. Updates PepperDash.Core to v1.0.35 2020-04-23 15:05:20 -06:00
Neil Dorin
a93ded8c79 New device loading methodology working via reflection 2020-04-23 14:59:54 -06:00
Andrew Welker
06edf6c508 Merge pull request #121 from PepperDash/feature/add-ui-template
Feature/add ui template
2020-04-23 11:01:47 -06:00
Neil Dorin
96adbdb76a Adds Template UI submodule 2020-04-23 09:55:33 -06:00
Neil Dorin
911bd8daba Moves to reflection based mechanism for loading device factories at boot (not working) 2020-04-22 17:52:29 -06:00
Neil Dorin
4f6ae386b4 Finishes converting all existing types to new DeviceFactory mechanism. #106 2020-04-22 17:52:29 -06:00
Neil Dorin
2170a79399 Updating more device factories in Essentials and Devices.Common 2020-04-22 17:51:22 -06:00
Neil Dorin
902a94a82c fixes incorrect type definitions in Device Factories. 2020-04-22 17:29:31 -06:00
Andrew Welker
e55a647854 fixes types for base device Generic types 2020-04-22 17:29:31 -06:00
Neil Dorin
ae23eec005 Progress on adding Description attribute and printing types at runtime 2020-04-22 17:29:31 -06:00
Neil Dorin
c5232ca6b8 Updates device factory methodology for Essentials Core and Essential DM libraries 2020-04-22 17:29:31 -06:00
Neil Dorin
f75d884986 Merge pull request #117 from PepperDash/feature/changes-to-IBridgeAdvanced
Fixes namespace for EssentialsBridgeableDevice
2020-04-20 21:25:40 -06:00
Andrew Welker
e1e0527184 Merge pull request #110 from PepperDash/hotfix/fix-dm-project-name
Updates the project name from Essentials_DM to PepperDash_Essentials_…
2020-04-14 11:00:21 -06:00
Neil Dorin
2ff87d6c4d Updates the project name from Essentials_DM to PepperDash_Essentials_DM to generate the correct .cplz filename needed by the GH action script for master builds. 2020-04-14 10:47:48 -06:00
Andrew Welker
373f271a91 Merge pull request #104 from PepperDash/release/v1.4.33
fixes -b switch for public push job
2020-04-13 11:50:26 -06:00
Andrew Welker
f46386cc28 Merge branch 'master' into release/v1.4.33 2020-04-13 11:37:34 -06:00
Andrew Welker
5a75be0a66 fixes -b switch for public push job 2020-04-13 11:37:01 -06:00
Neil Dorin
5782e82eea Merge pull request #100 from PepperDash/release/v1.4.33
removes -b switch on master branch checkout
2020-04-13 11:19:03 -06:00
Andrew Welker
011e82676c removes -b switch on master branch checkout 2020-04-10 09:51:25 -06:00
Neil Dorin
4edf8921bb Merge pull request #97 from PepperDash/release/v1.4.33
fixes branch naming & creation
2020-04-09 12:58:58 -06:00
Andrew Welker
d53b5470c5 Merge branch 'master' into release/v1.4.33 2020-04-09 10:47:12 -06:00
Andrew Welker
ddab940dab fixes branch naming & creation 2020-04-09 10:46:23 -06:00
Neil Dorin
c81c91aa46 Merge pull request #96 from PepperDash/release/v1.4.33
adds version.txt creation and upload steps
2020-04-09 10:13:49 -06:00
Andrew Welker
b3238ec7b4 adds version.txt creation and upload steps 2020-04-09 09:50:16 -06:00
Neil Dorin
eec025f5bd Merge pull request #95 from PepperDash/release/v1.4.33
fixes master.yml
2020-04-08 23:39:05 -06:00
Andrew Welker
0d20ddf66a fixes master.yml
adds back push to builds repos for releases
2020-04-08 23:14:37 -06:00
Andrew Welker
e078e6bda7 Merge pull request #93 from PepperDash/release/v1.4.33
Release/v1.4.33
2020-04-08 14:03:08 -06:00
Neil Dorin
60702755c1 Merge branch 'development' into release/v1.4.33 2020-03-24 16:24:22 -06:00
Neil Dorin
a4f1c7ecb5 added spaces to trigger build 2020-03-20 17:33:14 -06:00
151 changed files with 10438 additions and 7986 deletions

View File

@@ -10,7 +10,7 @@ Get-ChildItem ($destination)
$exclusions = @(git submodule foreach --quiet 'echo $name')
# Trying to get any .json schema files (not currently working)
# Gets any files with the listed extensions.
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz" | ForEach-Object {
Get-ChildItem -recurse -Path "$($Env:GITHUB_WORKSPACE)" -include "*.clz", "*.cpz", "*.cplz", "*.dll" | ForEach-Object {
$allowed = $true;
# Exclude any files in submodules
foreach ($exclude in $exclusions) {
@@ -28,7 +28,8 @@ Write-Host "Getting matching files..."
# Get any files from the output folder that match the following extensions
Get-ChildItem -Path $destination | Where-Object { ($_.Extension -eq ".clz") -or ($_.Extension -eq ".cpz" -or ($_.Extension -eq ".cplz")) } | ForEach-Object {
# Replace the extensions with dll and xml and create an array
$filenames = @($($_ -replace "cpz|clz|cplz", "dll"), $($_ -replace "cpz|clz|cplz", "xml"))
# Removed dll file capture, as previous step should capture all of them. Add if needed-> $($_ -replace "cpz|clz|cplz", "dll"),
$filenames = @($($_ -replace "cpz|clz|cplz", "xml"))
Write-Host "Filenames:"
Write-Host $filenames
if ($filenames.length -gt 0) {

View File

@@ -52,6 +52,12 @@ jobs:
run: |
Write-Output ${{ env.VERSION }}
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
# Login to Docker
- name: Login to Docker
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# Build the solutions in the docker image
- name: Build Solution
shell: powershell
@@ -77,9 +83,15 @@ jobs:
name: Version
path: ${{env.GITHUB_HOME}}\output\version.txt
# Create the release on the source repo
- name: Create tag for non-rc builds
if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta')
run: |
git tag $($Env:VERSION)
git push --tags origin
- name: Create Release
id: create_release
# using contributor's version to allow for pointing at the right commit
if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
uses: fleskesvor/create-release@feature/support-target-commitish
with:
tag_name: ${{ env.VERSION }}
@@ -89,6 +101,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload the build package to the release
- name: Upload Release Package
if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-')
id: upload_release
uses: actions/upload-release-asset@v1
with:
@@ -103,6 +116,8 @@ jobs:
needs: Build_Project
runs-on: windows-latest
steps:
- name: check Github ref
run: ${{toJson(github.ref)}}
# Checkout the repo
- name: Checkout Builds Repo
uses: actions/checkout@v2
@@ -178,9 +193,11 @@ jobs:
Public_Push_Output:
needs: Build_Project
runs-on: windows-latest
if: contains(github.ref, 'master') || contains(github.ref, 'release')
if: contains(github.ref, 'master') || contains(github.ref, '/release/')
steps:
# Checkout the repo
- name: check Github ref
run: ${{toJson(github.ref)}}
- name: Checkout Builds Repo
uses: actions/checkout@v2
with:

View File

@@ -32,9 +32,6 @@ jobs:
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
# Fetch all tags
- name: Fetch tags
run: git fetch --tags
# Generate the appropriate version number
- name: Set Version Number
shell: powershell
@@ -47,6 +44,12 @@ jobs:
run: |
Write-Output ${{ env.VERSION }}
./.github/scripts/UpdateAssemblyVersion.ps1 ${{ env.VERSION }}
# Login to Docker
- name: Login to Docker
uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
# Build the solutions in the docker image
- name: Build Solution
shell: powershell

3
.gitmodules vendored
View File

@@ -1,3 +1,6 @@
[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

@@ -21,7 +21,7 @@ using PepperDash.Essentials.AppServer.Messengers;
namespace PepperDash.Essentials
{
public class MobileControlSystemController : Device
public class MobileControlSystemController : EssentialsDevice
{
WebSocketClient WSClient;
@@ -865,4 +865,20 @@ namespace PepperDash.Essentials
CrestronConsole.ConsoleCommandResponse("Usage: mobilehttprequest:N get/post url\r");
}
}
public class MobileControlSystemControllerFactory : EssentialsDeviceFactory<MobileControlSystemController>
{
public MobileControlSystemControllerFactory()
{
TypeNames = new List<string>() { "appserver" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new MobileControlSystemController Device");
var props = JsonConvert.DeserializeObject<MobileControlConfig>(dc.Properties.ToString());
return new MobileControlSystemController(dc.Key, dc.Name, props);
}
}
}

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials
/// <summary>
///
/// </summary>
public abstract class MobileControlBridgeBase: Device
public abstract class MobileControlBridgeBase: EssentialsDevice
{
public MobileControlSystemController Parent { get; private set; }

View File

@@ -825,4 +825,35 @@ namespace PepperDash.Essentials.Room.MobileControl
EISC.StringInput[JoinMap.ServerUrl.JoinNumber].StringValue = Parent.Config.ClientAppUrl;
}
}
public class MobileControlSIMPLRoomBridgeFactory : EssentialsDeviceFactory<MobileControlSIMPLRoomBridge>
{
public MobileControlSIMPLRoomBridgeFactory()
{
TypeNames = new List<string>() { "mobilecontrolbridge-ddvc01", "mobilecontrolbridge-simpl" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new MobileControlSIMPLRoomBridge Device");
var comm = CommFactory.GetControlPropertiesConfig(dc);
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlSIMPLRoomBridge(dc.Key, dc.Name, comm.IpIdInt);
bridge.AddPreActivationAction(() =>
{
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
if (parent == null)
{
Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
}
Debug.Console(0, bridge, "Linking to parent controller");
bridge.AddParent(parent);
parent.AddBridge(bridge);
});
return bridge;
}
}
}

View File

@@ -16,25 +16,21 @@ using Crestron.SimplSharpPro.EthernetCommunication;
namespace PepperDash.Essentials
{
/// <summary>
/// Responsible for loading all of the device types for this library
/// </summary>
public class BridgeFactory
{
public static IKeyed GetDevice(DeviceConfig dc)
public BridgeFactory()
{
// ? why is this static JTA 2018-06-13?
var eiscApiAdvancedFactory = new EiscApiAdvancedFactory() as IDeviceFactory;
eiscApiAdvancedFactory.LoadTypeFactories();
var typeName = dc.Type.ToLower();
//Debug.Console(2, "Name {0}, Key {1}, Type {2}, Properties {3}", name, key, type, properties.ToString());
if (typeName == "eiscapiadv" || typeName == "eiscapiadvanced")
{
return new EiscApiAdvanced(dc);
}
return typeName == "eiscapi" ? new EiscApi(dc) : null;
var eiscApiFactory = new EiscApiFactory() as IDeviceFactory;
eiscApiFactory.LoadTypeFactories();
}
}
}
public class CommBridge : Device
{

View File

@@ -66,129 +66,10 @@ namespace PepperDash.Essentials.Bridges
Debug.ConsoleWithLog(0, this,
"Please update the bridge config to use EiscBridgeAdvanced with this device: {0}", device.Key);
}
//if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
//{
// var bridge = device as IBridge;
// if (bridge == null)
// continue;
// Debug.Console(2, this, "Linking device {0} as IBridge");
// bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//if (!device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced))) continue;
//var bridgeAdvanced = device as IBridgeAdvanced;
//if (bridgeAdvanced == null) continue;
//Debug.Console(2, this, "Linking device {0} as IBridgeAdvanced");
//bridgeAdvanced.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
}
Debug.Console(1, this, "Devices Linked.");
//
//else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
//{
// (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is GenericComm)
//{
// (device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is CameraBase)
//{
// (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
// continue;
//}
//else if (device is PepperDash.Essentials.Core.DisplayBase)
//{
// (device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmChassisController)
//{
// (device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmBladeChassisController)
//{
// (device as DmBladeChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmpsRoutingController)
//{
// (device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmpsAudioOutputController)
//{
// (device as DmpsAudioOutputController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmTxControllerBase)
//{
// (device as DmTxControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmRmcControllerBase)
//{
// (device as DmRmcControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is GenericRelayDevice)
//{
// (device as GenericRelayDevice).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is IRSetTopBoxBase)
//{
// (device as IRSetTopBoxBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is IDigitalInput)
//{
// (device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is AppleTV)
//{
// (device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is HdMdxxxCEController)
//{
// (device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is LightingBase)
//{
// (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DigitalLogger)
//{
// (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController)
//{
// (device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is StatusSignController)
//{
// (device as StatusSignController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is C2nRthsController)
//{
// (device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//}
});
}
@@ -332,4 +213,20 @@ namespace PepperDash.Essentials.Bridges
}
}
}
public class EiscApiFactory : EssentialsDeviceFactory<EiscApiAdvanced>
{
public EiscApiFactory()
{
TypeNames = new List<string>() { "eiscapi" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new EiscApi Device");
return new EiscApi(dc);
}
}
}

View File

@@ -1,5 +1,4 @@
using System;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Bridges
{
@@ -7,8 +6,7 @@ namespace PepperDash.Essentials.Bridges
/// Defines a device that uses the legacy JoinMapBase for its join map
/// </summary>
[Obsolete("IBridgeAdvanced should be used going forward with JoinMapBaseAdvanced")]
public interface IBridge
public interface IBridge:Core.Bridges.IBridge
{
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey);
}
}

View File

@@ -38,8 +38,12 @@ namespace PepperDash.Essentials.Bridges
/// Reports the EDID serial number value
/// </summary>
public uint EdidSerialNumber { get; set; }
#endregion
#endregion
#region Analogs
public uint AudioVideoSource { get; set; }
#endregion
public DmRmcControllerJoinMap()
{
// Digital
@@ -51,6 +55,9 @@ namespace PepperDash.Essentials.Bridges
EdidName = 3;
EdidPrefferedTiming = 4;
EdidSerialNumber = 5;
//Analog
AudioVideoSource = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
@@ -62,7 +69,8 @@ namespace PepperDash.Essentials.Bridges
EdidManufacturer = EdidManufacturer + joinOffset;
EdidName = EdidName + joinOffset;
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
EdidSerialNumber = EdidSerialNumber + joinOffset;
EdidSerialNumber = EdidSerialNumber + joinOffset;
AudioVideoSource = AudioVideoSource + joinOffset;
}
}
}

View File

@@ -26,6 +26,8 @@ namespace PepperDash.Essentials
{
HttpLogoServer LogoServer;
private CTimer _startTimer;
private const long StartupTime = 500;
public ControlSystem()
: base()
@@ -39,6 +41,11 @@ namespace PepperDash.Essentials
/// Entry point for the program
/// </summary>
public override void InitializeSystem()
{
_startTimer = new CTimer(StartSystem,StartupTime);
}
private void StartSystem(object obj)
{
DeterminePlatform();
@@ -75,18 +82,17 @@ namespace PepperDash.Essentials
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s =>
{
CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
"System URL: {0}\r" +
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
{
CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
"System URL: {0}\r" +
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
if (!Debug.DoNotLoadOnNextBoot)
GoWithLoad();
}
/// <summary>
/// Determines if the program is running on a processor (appliance) or server (VC-4).
///
@@ -162,13 +168,18 @@ namespace PepperDash.Essentials
public void GoWithLoad()
{
try
{
{
Debug.SetDoNotLoadOnNextBoot(false);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
PluginLoader.AddProgramAssemblies();
new Core.DeviceFactory();
new Devices.Common.DeviceFactory();
new DM.DeviceFactory();
new DeviceFactory();
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
var filesReady = SetupFilesystem();
if (filesReady)
{
@@ -291,9 +302,6 @@ namespace PepperDash.Essentials
/// </summary>
public void LoadDevices()
{
// Instantiate the Device Factories
new CoreDeviceFactory();
// Build the processor wrapper class
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
@@ -357,33 +365,15 @@ namespace PepperDash.Essentials
}
// Try local factories first
var newDev = DeviceFactory.GetDevice(devConf);
IKeyed newDev = null;
if (newDev == null)
newDev = BridgeFactory.GetDevice(devConf);
// Then associated library factories
if (newDev == null)
newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
if (newDev == null)
newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf);
if (newDev == null)
newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf);
if (newDev == null)
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
//if (newDev == null) // might want to consider the ability to override an essentials "type"
//{
// // iterate plugin factories
// foreach (var f in FactoryObjects)
// {
// var cresFactory = f as IGetCrestronDevice;
// if (cresFactory != null)
// {
// newDev = cresFactory.GetDevice(devConf, this);
// }
// }
//}
//
//if (newDev == null)
// newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
//
if (newDev != null)
DeviceManager.AddDevice(newDev);

View File

@@ -6,11 +6,12 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials
{
public class Amplifier : Device, IRoutingSinkNoSwitching
public class Amplifier : EssentialsDevice, IRoutingSinkNoSwitching
{
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -54,4 +55,18 @@ namespace PepperDash.Essentials
#endregion
}
public class AmplifierFactory : EssentialsDeviceFactory<Amplifier>
{
public AmplifierFactory()
{
TypeNames = new List<string>() { "amplifier" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Amplifier Device");
return new Amplifier(dc.Key, dc.Name);
}
}
}

View File

@@ -4,94 +4,45 @@ using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharpPro;
using Crestron.SimplSharp.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Room.MobileControl;
namespace PepperDash.Essentials
{
public class DeviceFactory
{
public static IKeyed GetDevice(DeviceConfig dc)
{
var key = dc.Key;
var name = dc.Name;
var type = dc.Type;
var properties = dc.Properties;
/// <summary>
/// Responsible for loading all of the device types for this library
/// </summary>
public class DeviceFactory
{
var typeName = dc.Type.ToLower();
public DeviceFactory()
{
var assy = Assembly.GetExecutingAssembly();
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
if (typeName == "amplifier")
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
if (types != null)
{
return new Amplifier(dc.Key, dc.Name);
}
else if (dc.Group.ToLower() == "touchpanel") // typeName.StartsWith("tsw"))
{
return UiDeviceFactory.GetUiDevice(dc);
foreach (var type in types)
{
try
{
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
factory.LoadTypeFactories();
}
catch (Exception e)
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
}
}
}
else if (typeName == "mockdisplay")
{
return new MockDisplay(key, name);
}
else if (typeName == "generic")
{
return new Device(key, name);
}
//// MOVE into something else???
//else if (typeName == "basicirdisplay")
//{
// var ir = IRPortHelper.GetIrPort(properties);
// if (ir != null)
// return new BasicIrDisplay(key, name, ir.Port, ir.FileName);
//}
else if (typeName == "commmock")
{
var comm = CommFactory.CreateCommForDevice(dc);
var props = JsonConvert.DeserializeObject<ConsoleCommMockDevicePropertiesConfig>(
properties.ToString());
return new ConsoleCommMockDevice(key, name, props, comm);
}
else if (typeName == "appserver")
{
var props = JsonConvert.DeserializeObject<MobileControlConfig>(properties.ToString());
return new MobileControlSystemController(key, name, props);
}
else if (typeName == "mobilecontrolbridge-ddvc01")
{
var comm = CommFactory.GetControlPropertiesConfig(dc);
var bridge = new PepperDash.Essentials.Room.MobileControl.MobileControlSIMPLRoomBridge(key, name, comm.IpIdInt);
bridge.AddPreActivationAction(() =>
{
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as MobileControlSystemController;
if (parent == null)
{
Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
}
Debug.Console(0, bridge, "Linking to parent controller");
bridge.AddParent(parent);
parent.AddBridge(bridge);
});
return bridge;
}
else if (typeName == "roomonwhenoccupancydetectedfeature")
{
return new RoomOnToDefaultSourceWhenOccupied(dc);
}
return null;
}
}
}
}
}

View File

@@ -1,191 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.UI;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.PageManagers;
using PepperDash.Essentials.DM.Endpoints.DGEs;
namespace PepperDash.Essentials
{
public class UiDeviceFactory
{
public static IKeyed GetUiDevice(DeviceConfig config)
{
var comm = CommFactory.GetControlPropertiesConfig(config);
var typeName = config.Type.ToLower();
EssentialsTouchpanelController panelController = null;
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(config.Properties.ToString());
if (typeName.Contains("dge"))
{
Dge100 dgeDevice = null;
if (typeName == "dge100")
dgeDevice = new Dge100(comm.IpIdInt, Global.ControlSystem);
else if (typeName == "dmdge200c")
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
if (dgeDevice == null)
{
Debug.Console(1, "Unable to create DGE device");
return null;
}
var dgeController = new DgeController(config.Key + "-comPorts", config.Name, dgeDevice, config, props);
DeviceManager.AddDevice(dgeController);
panelController = new EssentialsTouchpanelController(config.Key, config.Name, dgeController.DigitalGraphicsEngine,
props.ProjectName, props.SgdFile);
}
else
{
panelController = new EssentialsTouchpanelController(config.Key, config.Name, config.Type, props, comm.IpIdInt);
}
panelController.AddPostActivationAction(() =>
{
var mainDriver = new EssentialsPanelMainInterfaceDriver(panelController.Panel, props);
// Then the sub drivers
// spin up different room drivers depending on room type
var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
if (room is EssentialsHuddleSpaceRoom)
{
// Header Driver
Debug.Console(0, panelController, "Adding header driver");
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
// AV Driver
Debug.Console(0, panelController, "Adding huddle space AV driver");
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver;
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
// Environment Driver
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
{
Debug.Console(0, panelController, "Adding environment driver");
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
}
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
if (panelController.Panel is TswFt5ButtonSystem)
{
var tsw = panelController.Panel as TswFt5ButtonSystem;
// Wire up hard keys
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
if(mainDriver.EnvironmentDriver != null)
tsw.Lights.UserObject = new Action<bool>(b =>
{
if (!b)
{
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
mainDriver.EnvironmentDriver.Toggle();
}
});
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
}
}
//else if (room is EssentialsPresentationRoom)
//{
// Debug.Console(0, panelController, "Adding presentation room driver");
// var avDriver = new EssentialsPresentationPanelAvFunctionsDriver(mainDriver, props);
// avDriver.CurrentRoom = room as EssentialsPresentationRoom;
// avDriver.DefaultRoomKey = props.DefaultRoomKey;
// mainDriver.AvDriver = avDriver ;
// mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
// panelController.LoadAndShowDriver(mainDriver);
// if (panelController.Panel is TswFt5ButtonSystem)
// {
// var tsw = panelController.Panel as TswFt5ButtonSystem;
// // Wire up hard keys
// tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
// //tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
// tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
// tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
// }
//}
else if (room is EssentialsHuddleVtc1Room)
{
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
// Header Driver
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
// AV Driver
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
(room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
avDriver.SetVideoCodecDriver(codecDriver);
avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver;
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
// Environment Driver
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
{
Debug.Console(0, panelController, "Adding environment driver");
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
}
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
if (panelController.Panel is TswFt5ButtonSystem)
{
var tsw = panelController.Panel as TswFt5ButtonSystem;
// Wire up hard keys
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.EndMeetingPress(); });
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
if (mainDriver.EnvironmentDriver != null)
tsw.Lights.UserObject = new Action<bool>(b =>
{
if (!b)
{
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
mainDriver.EnvironmentDriver.Toggle();
}
});
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
}
}
else
{
Debug.Console(0, panelController, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", props.DefaultRoomKey);
}
});
return panelController;
}
}
}

View File

@@ -151,7 +151,6 @@
<Compile Include="Factory\DeviceFactory.cs" />
<Compile Include="Devices\Amplifier.cs" />
<Compile Include="ControlSystem.cs" />
<Compile Include="Factory\UiDeviceFactory.cs" />
<Compile Include="Fusion\EssentialsHuddleVtc1FusionController.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Room\Config\EssentialsDualDisplayRoomPropertiesConfig.cs" />

View File

@@ -9,11 +9,12 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.UI;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.PageManagers;
namespace PepperDash.Essentials
{
public class EssentialsTouchpanelController : Device, IHasBasicTriListWithSmartObject
public class EssentialsTouchpanelController : EssentialsDevice, IHasBasicTriListWithSmartObject
{
public BasicTriListWithSmartObject Panel { get; private set; }
@@ -197,4 +198,132 @@ namespace PepperDash.Essentials
(uo as Action<bool>)(args.Button.State == eButtonState.Pressed);
}
}
public class EssentialsTouchpanelControllerFactory : EssentialsDeviceFactory<EssentialsTouchpanelController>
{
public EssentialsTouchpanelControllerFactory()
{
TypeNames = new List<string>() { "tsw550", "tsw750", "tsw1050", "tsw560", "tsw760", "tsw1060", "xpanel" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
var comm = CommFactory.GetControlPropertiesConfig(dc);
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
var panelController = new EssentialsTouchpanelController(dc.Key, dc.Name, dc.Type, props, comm.IpIdInt);
panelController.AddPostActivationAction(() =>
{
var mainDriver = new EssentialsPanelMainInterfaceDriver(panelController.Panel, props);
// Then the sub drivers
// spin up different room drivers depending on room type
var room = DeviceManager.GetDeviceForKey(props.DefaultRoomKey);
if (room is EssentialsHuddleSpaceRoom)
{
// Header Driver
Debug.Console(0, panelController, "Adding header driver");
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
// AV Driver
Debug.Console(0, panelController, "Adding huddle space AV driver");
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver;
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
// Environment Driver
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
{
Debug.Console(0, panelController, "Adding environment driver");
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
}
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
if (panelController.Panel is TswFt5ButtonSystem)
{
var tsw = panelController.Panel as TswFt5ButtonSystem;
// Wire up hard keys
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.PowerButtonPressed(); });
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
if (mainDriver.EnvironmentDriver != null)
tsw.Lights.UserObject = new Action<bool>(b =>
{
if (!b)
{
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
mainDriver.EnvironmentDriver.Toggle();
}
});
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
}
}
else if (room is EssentialsHuddleVtc1Room)
{
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
// Header Driver
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
// AV Driver
var avDriver = new EssentialsHuddleVtc1PanelAvFunctionsDriver(mainDriver, props);
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
(room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
avDriver.SetVideoCodecDriver(codecDriver);
avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver;
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
// Environment Driver
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
{
Debug.Console(0, panelController, "Adding environment driver");
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
}
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
if (panelController.Panel is TswFt5ButtonSystem)
{
var tsw = panelController.Panel as TswFt5ButtonSystem;
// Wire up hard keys
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.EndMeetingPress(); });
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
if (mainDriver.EnvironmentDriver != null)
tsw.Lights.UserObject = new Action<bool>(b =>
{
if (!b)
{
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
mainDriver.EnvironmentDriver.Toggle();
}
});
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
}
}
else
{
Debug.Console(0, panelController, "ERROR: Cannot load AvFunctionsDriver for room '{0}'", props.DefaultRoomKey);
}
});
return panelController;
}
}
}

View File

@@ -10,7 +10,7 @@ PepperDash Essentials is an open source Crestron framework that can be configure
Essentials Framework is a collection of C# / Simpl# Pro libraries that can be utilized in several different manners. It is currently operating as a 100% configuration-driven system, and can be extended to add different workflows and behaviors, either through the addition of further device "types" or via the plug-in mechanism. The framework is a collection of "things" that are all related and interconnected, but in general do not have dependencies on each other.
## Minimum Requirements
- Essentials Framework runs on any Crestron 3-series processor or Crestron's VC-4 platform.
- Essentials Framework runs on any Crestron 3-series processor, **4-series** processor or Crestron's VC-4 platform.
- To edit and compile the source, Microsoft Visual Studio 2008 Professional with SP1 is required.
- Crestron's Simpl# Plugin is also required (must be obtained from Crestron).

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 KiB

View File

@@ -110,139 +110,27 @@ namespace PepperDash.Essentials.Core.Bridges
if (device == null) continue;
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
/*if (device is IBridge) // Check for this first to allow bridges in plugins to override existing bridges that apply to the same type.
if (typeof (IBridge).IsAssignableFrom(device.GetType().GetCType()))
{
Debug.Console(2, this, "'{0}' is IBridge", device.Key);
var basicBridge = device as IBridge;
if (basicBridge != null)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"Linking EiscApiAdvanced {0} to device {1} using obsolete join map. Please update the device's join map.",
Key, device.Key);
basicBridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
}
continue;
}
var dev = device as IBridge;
dev.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
}*/
if (!(device is IBridgeAdvanced)) continue;
Debug.Console(2, this, "'{0}' is IBridgeAdvanced", device.Key);
(device as IBridgeAdvanced).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
//if (device.GetType().GetCType().IsAssignableFrom(typeof (IBridge)))
//{
// var bridge = device as IBridge;
// if (bridge == null)
// continue;
// Debug.Console(2, this, "Linking device {0} as IBridge");
// bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//if (!device.GetType().GetCType().IsAssignableFrom(typeof (IBridgeAdvanced))) continue;
//var bridgeAdvanced = device as IBridgeAdvanced;
//if (bridgeAdvanced == null) continue;
//Debug.Console(2, this, "Linking device {0} as IBridgeAdvanced");
//bridgeAdvanced.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{
continue;
}
var bridge = device as IBridgeAdvanced;
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
}
Debug.Console(1, this, "Devices Linked.");
//
//else if (device is PepperDash.Essentials.Core.Monitoring.SystemMonitorController)
//{
// (device as PepperDash.Essentials.Core.Monitoring.SystemMonitorController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is GenericComm)
//{
// (device as GenericComm).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is CameraBase)
//{
// (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
// continue;
//}
//else if (device is PepperDash.Essentials.Core.DisplayBase)
//{
// (device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmChassisController)
//{
// (device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmBladeChassisController)
//{
// (device as DmBladeChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmpsRoutingController)
//{
// (device as DmpsRoutingController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmpsAudioOutputController)
//{
// (device as DmpsAudioOutputController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmTxControllerBase)
//{
// (device as DmTxControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DmRmcControllerBase)
//{
// (device as DmRmcControllerBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is GenericRelayDevice)
//{
// (device as GenericRelayDevice).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is IRSetTopBoxBase)
//{
// (device as IRSetTopBoxBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is IDigitalInput)
//{
// (device as IDigitalInput).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is AppleTV)
//{
// (device as AppleTV).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is HdMdxxxCEController)
//{
// (device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is LightingBase)
//{
// (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is DigitalLogger)
//{
// (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController)
//{
// (device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is StatusSignController)
//{
// (device as StatusSignController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//else if (device is C2nRthsController)
//{
// (device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
// continue;
//}
//}
});
@@ -411,5 +299,20 @@ namespace PepperDash.Essentials.Core.Bridges
}
public class EiscApiAdvancedFactory : EssentialsDeviceFactory<EiscApiAdvanced>
{
public EiscApiAdvancedFactory()
{
TypeNames = new List<string>() { "eiscapiadv", "eiscapiadvanced" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new EiscApiAdvanced Device");
return new EiscApiAdvanced(dc);
}
}
}

View File

@@ -1,13 +1,19 @@
using System;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.Bridges
{
/// <summary>
/// Defines a device that uses JoinMapBaseAdvanced for its join map
/// </summary>
public interface IBridgeAdvanced
public interface IBridgeAdvanced:IKeyed
{
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge);
}
public interface IBridge:IKeyed
{
void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey);
}
}

View File

@@ -1,110 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class AirMediaControllerJoinMap : JoinMapBase
{
#region Digitals
/// <summary>
/// Indicates that the device is online when high
/// </summary>
public uint IsOnline { get; set; }
/// <summary>
/// Indicates that the device is in session when high
/// </summary>
public uint IsInSession { get; set; }
/// <summary>
/// Indicates sync detected on HDMI input when high
/// </summary>
public uint HdmiVideoSync { get; set; }
/// <summary>
/// Set High to enable automatic input routing and low to disable. Feedback high when enabled
/// </summary>
public uint AutomaticInputRoutingEnabled { get; set; }
#endregion
#region Analogs
/// <summary>
/// Selects source and provides feedback
/// </summary>
public uint VideoOut { get; set; }
/// <summary>
/// Provided error feedback
/// </summary>
public uint ErrorFB { get; set; }
/// <summary>
/// Indicates the number of connected users as feedback
/// </summary>
public uint NumberOfUsersConnectedFB { get; set; }
/// <summary>
/// Sets the login code and provides the current code as feedback
/// </summary>
public uint LoginCode { get; set; }
#endregion
#region Serials
/// <summary>
/// Provides the name defined in config as feedback
/// </summary>
public uint Name { get; set; }
/// <summary>
/// Provides the connection address as feedback
/// </summary>
public uint ConnectionAddressFB { get; set; }
/// <summary>
/// Provides the hostname as feedback
/// </summary>
public uint HostnameFB { get; set; }
/// <summary>
/// Provides the serial number as feedback
/// </summary>
public uint SerialNumberFeedback { get; set; }
#endregion
public AirMediaControllerJoinMap()
{
// Digital
IsOnline = 1;
IsInSession = 2;
HdmiVideoSync = 3;
AutomaticInputRoutingEnabled = 4;
// Analog
VideoOut = 1;
ErrorFB = 2;
NumberOfUsersConnectedFB = 3;
LoginCode = 4;
// Serial
Name = 1;
ConnectionAddressFB = 2;
HostnameFB = 3;
SerialNumberFeedback = 4;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
IsInSession = IsInSession + joinOffset;
HdmiVideoSync = HdmiVideoSync + joinOffset;
AutomaticInputRoutingEnabled = AutomaticInputRoutingEnabled + joinOffset;
VideoOut = VideoOut + joinOffset;
ErrorFB = ErrorFB + joinOffset;
NumberOfUsersConnectedFB = NumberOfUsersConnectedFB + joinOffset;
LoginCode = LoginCode + joinOffset;
Name = Name + joinOffset;
ConnectionAddressFB = ConnectionAddressFB + joinOffset;
HostnameFB = HostnameFB + joinOffset;
SerialNumberFeedback = SerialNumberFeedback + joinOffset;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class AirMediaControllerJoinMap : JoinMapBaseAdvanced
{
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("IsInSession")]
public JoinDataComplete IsInSession = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media In Sharing Session", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("HdmiVideoSync")]
public JoinDataComplete HdmiVideoSync = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Has HDMI Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("AutomaticInputRoutingEnabled")]
public JoinDataComplete AutomaticInputRoutingEnabled = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Automatic Input Routing Enable(d)", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("VideoOut")]
public JoinDataComplete VideoOut = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Video Route Select / Feedback", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("ErrorFB")]
public JoinDataComplete ErrorFB = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Error Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("NumberOfUsersConnectedFB")]
public JoinDataComplete NumberOfUsersConnectedFB = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Number of Users Connected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("LoginCode")]
public JoinDataComplete LoginCode = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Login Code Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Name")]
public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Device Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("ConnectionAddressFB")]
public JoinDataComplete ConnectionAddressFB = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media IP Address", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("HostnameFB")]
public JoinDataComplete HostnameFB = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Hostname", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("SerialNumberFeedback")]
public JoinDataComplete SerialNumberFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Air Media Serial Number", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
public AirMediaControllerJoinMap(uint joinStart)
: base(joinStart, typeof(AirMediaControllerJoinMap))
{
}
}
}

View File

@@ -1,67 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class AppleTvJoinMap : JoinMapBase
{
#region Digitals
/// <summary>
/// Sends up arrow command while high
/// </summary>
public uint UpArrow { get; set; }
/// <summary>
/// Sends down arrow command while high
/// </summary>
public uint DnArrow { get; set; }
/// <summary>
/// Sends left arrow command while high
/// </summary>
public uint LeftArrow { get; set; }
/// <summary>
/// Sends right arrow command while high
/// </summary>
public uint RightArrow { get; set; }
/// <summary>
/// Sends menu command
/// </summary>
public uint Menu { get; set; }
/// <summary>
/// Sends select command
/// </summary>
public uint Select { get; set; }
/// <summary>
/// Sends play/pause command
/// </summary>
public uint PlayPause { get; set; }
#endregion
public AppleTvJoinMap()
{
UpArrow = 1;
DnArrow = 2;
LeftArrow = 3;
RightArrow = 4;
Menu = 5;
Select = 6;
PlayPause = 7;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
UpArrow = UpArrow + joinOffset;
DnArrow = DnArrow + joinOffset;
LeftArrow = LeftArrow + joinOffset;
RightArrow = RightArrow + joinOffset;
Menu = Menu + joinOffset;
Select = Select + joinOffset;
PlayPause = PlayPause + joinOffset;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class AppleTvJoinMap : JoinMapBaseAdvanced
{
[JoinName("UpArrow")]
public JoinDataComplete UpArrow = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "AppleTv Nav Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DnArrow")]
public JoinDataComplete DnArrow = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "AppleTv Nav Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("LeftArrow")]
public JoinDataComplete LeftArrow = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "AppleTv Nav Left", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("RightArrow")]
public JoinDataComplete RightArrow = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "AppleTv Nav Right", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Menu")]
public JoinDataComplete Menu = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "AppleTv Menu", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Select")]
public JoinDataComplete Select = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "AppleTv Select", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("PlayPause")]
public JoinDataComplete PlayPause = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "AppleTv Play/Pause", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
public AppleTvJoinMap(uint joinStart)
: base(joinStart, typeof(AppleTvJoinMap))
{
}
}
}

View File

@@ -1,43 +1,34 @@
using System.Linq;
using Crestron.SimplSharp.Reflection;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class C2nRthsControllerJoinMap:JoinMapBase
{
public uint IsOnline { get; set; }
public uint Name { get; set; }
public uint Temperature { get; set; }
public uint Humidity { get; set; }
public uint TemperatureFormat { get; set; }
public C2nRthsControllerJoinMap()
{
//digital
IsOnline = 1;
TemperatureFormat = 2;
//Analog
Temperature = 2;
Humidity = 3;
//serial
Name = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
var properties =
GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof(uint)).ToList();
foreach (var propertyInfo in properties)
{
propertyInfo.SetValue(this, (uint)propertyInfo.GetValue(this, null) + joinOffset, null);
}
}
}
using System.Linq;
using Crestron.SimplSharp.Reflection;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class C2nRthsControllerJoinMap : JoinMapBaseAdvanced
{
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Temp Sensor Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("TemperatureFormat")]
public JoinDataComplete TemperatureFormat = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Temp Sensor Unit Format", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Temperature")]
public JoinDataComplete Temperature = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Temp Sensor Temperature Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("Humidity")]
public JoinDataComplete Humidity = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Temp Sensor Humidity Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("Name")]
public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Temp Sensor Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
public C2nRthsControllerJoinMap(uint joinStart)
: base(joinStart, typeof(C2nRthsControllerJoinMap))
{
}
}
}

View File

@@ -0,0 +1,182 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class CenOdtOccupancySensorBaseJoinMap : JoinMapBaseAdvanced
{
#region Digitals
[JoinName("Online")]
public JoinDataComplete Online = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("ForceOccupied")]
public JoinDataComplete ForceOccupied = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Force Occupied", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ForceVacant")]
public JoinDataComplete ForceVacant = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Force Vacant", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableRawStates")]
public JoinDataComplete EnableRawStates = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Enable Raw States", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("RoomOccupiedFeedback")]
public JoinDataComplete RoomOccupiedFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Room Occupied Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("GraceOccupancyDetectedFeedback")]
public JoinDataComplete GraceOccupancyDetectedFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Grace Occupancy Detected Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RoomVacantFeedback")]
public JoinDataComplete RoomVacantFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Room Vacant Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RawOccupancyFeedback")]
public JoinDataComplete RawOccupancyFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Raw Occupancy Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RawOccupancyPirFeedback")]
public JoinDataComplete RawOccupancyPirFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "Raw Occupancy Pir Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RawOccupancyUsFeedback")]
public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "Raw Occupancy Us Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableLedFlash")]
public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "Enable Led Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisableLedFlash")]
public JoinDataComplete DisableLedFlash = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
new JoinMetadata() { Label = "Disable Led Flash", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableShortTimeout")]
public JoinDataComplete EnableShortTimeout = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
new JoinMetadata() { Label = "Enable Short Timeout", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisableShortTimeout")]
public JoinDataComplete DisableShortTimeout = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
new JoinMetadata() { Label = "Disable Short Timeout", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("OrWhenVacated")]
public JoinDataComplete OrWhenVacated = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
new JoinMetadata() { Label = "Or When Vacated", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("AndWhenVacated")]
public JoinDataComplete AndWhenVacated = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 1 },
new JoinMetadata() { Label = "AndWhenVacated", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableUsA")]
public JoinDataComplete EnableUsA = new JoinDataComplete(new JoinData() { JoinNumber = 17, JoinSpan = 1 },
new JoinMetadata() { Label = "Enable Us A", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisableUsA")]
public JoinDataComplete DisableUsA = new JoinDataComplete(new JoinData() { JoinNumber = 18, JoinSpan = 1 },
new JoinMetadata() { Label = "Disable Us A", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableUsB")]
public JoinDataComplete EnableUsB = new JoinDataComplete(new JoinData() { JoinNumber = 19, JoinSpan = 1 },
new JoinMetadata() { Label = "Enable Us B", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisableUsB")]
public JoinDataComplete DisableUsB = new JoinDataComplete(new JoinData() { JoinNumber = 20, JoinSpan = 1 },
new JoinMetadata() { Label = "Disable Us B", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnablePir")]
public JoinDataComplete EnablePir = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
new JoinMetadata() { Label = "Enable Pir", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisablePir")]
public JoinDataComplete DisablePir = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
new JoinMetadata() { Label = "Disable Pir", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IncrementUsInOccupiedState")]
public JoinDataComplete IncrementUsInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
new JoinMetadata() { Label = "Increment Us In OccupiedState", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DecrementUsInOccupiedState")]
public JoinDataComplete DecrementUsInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
new JoinMetadata() { Label = "Dencrement Us In Occupied State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IncrementUsInVacantState")]
public JoinDataComplete IncrementUsInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 25, JoinSpan = 1 },
new JoinMetadata() { Label = "Increment Us In VacantState", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DecrementUsInVacantState")]
public JoinDataComplete DecrementUsInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 26, JoinSpan = 1 },
new JoinMetadata() { Label = "Decrement Us In VacantState", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IncrementPirInOccupiedState")]
public JoinDataComplete IncrementPirInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 27, JoinSpan = 1 },
new JoinMetadata() { Label = "Increment Pir In Occupied State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DecrementPirInOccupiedState")]
public JoinDataComplete DecrementPirInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 28, JoinSpan = 1 },
new JoinMetadata() { Label = "Decrement Pir In OccupiedState", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IncrementPirInVacantState")]
public JoinDataComplete IncrementPirInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 29, JoinSpan = 1 },
new JoinMetadata() { Label = "Increment Pir In Vacant State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DecrementPirInVacantState")]
public JoinDataComplete DecrementPirInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 },
new JoinMetadata() { Label = "Decrement Pir In Vacant State", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
#endregion
#region Analog
[JoinName("Timeout")]
public JoinDataComplete Timeout = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Timeout", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("TimeoutLocalFeedback")]
public JoinDataComplete TimeoutLocalFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Timeout Local Feedback", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("InternalPhotoSensorValue")]
public JoinDataComplete InternalPhotoSensorValue = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Internal PhotoSensor Value", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("UsSensitivityInOccupiedState")]
public JoinDataComplete UsSensitivityInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Us Sensitivity In Occupied State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("UsSensitivityInVacantState")]
public JoinDataComplete UsSensitivityInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "Us Sensitivity In Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("PirSensitivityInOccupiedState")]
public JoinDataComplete PirSensitivityInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "Pir Sensitivity In Occupied State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("PirSensitivityInVacantState")]
public JoinDataComplete PirSensitivityInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
new JoinMetadata() { Label = "Pir Sensitivity In Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
#endregion
#region Serial
[JoinName("Name")]
public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
#endregion
public CenOdtOccupancySensorBaseJoinMap(uint joinStart)
: base(joinStart, typeof(CenOdtOccupancySensorBaseJoinMap))
{
}
}
}

View File

@@ -1,48 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DigitalLoggerJoinMap : JoinMapBase
{
public uint IsOnline { get; set; }
public uint CircuitNames { get; set; }
public uint CircuitState { get; set; }
public uint CircuitCycle { get; set; }
public uint CircuitIsCritical { get; set; }
public uint CircuitOnCmd { get; set; }
public uint CircuitOffCmd { get; set; }
public DigitalLoggerJoinMap()
{
// Digital
IsOnline = 9;
CircuitState = 0;
CircuitCycle = 0;
CircuitIsCritical = 10;
CircuitOnCmd = 10;
CircuitOffCmd = 20;
// Serial
CircuitNames = 0;
// Analog
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
CircuitNames = CircuitNames + joinOffset;
CircuitState = CircuitState + joinOffset;
CircuitCycle = CircuitCycle + joinOffset;
CircuitIsCritical = CircuitIsCritical + joinOffset;
CircuitOnCmd = CircuitOnCmd + joinOffset;
CircuitOffCmd = CircuitOffCmd + joinOffset;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Bridges
{
[Obsolete("This Device will be moved to a plugin in a future update")]
public class DigitalLoggerJoinMap : JoinMapBase
{
public uint IsOnline { get; set; }
public uint CircuitNames { get; set; }
public uint CircuitState { get; set; }
public uint CircuitCycle { get; set; }
public uint CircuitIsCritical { get; set; }
public uint CircuitOnCmd { get; set; }
public uint CircuitOffCmd { get; set; }
public DigitalLoggerJoinMap()
{
// Digital
IsOnline = 9;
CircuitState = 0;
CircuitCycle = 0;
CircuitIsCritical = 10;
CircuitOnCmd = 10;
CircuitOffCmd = 20;
// Serial
CircuitNames = 0;
// Analog
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
CircuitNames = CircuitNames + joinOffset;
CircuitState = CircuitState + joinOffset;
CircuitCycle = CircuitCycle + joinOffset;
CircuitIsCritical = CircuitIsCritical + joinOffset;
CircuitOnCmd = CircuitOnCmd + joinOffset;
CircuitOffCmd = CircuitOffCmd + joinOffset;
}
}
}

View File

@@ -1,117 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DisplayControllerJoinMap : JoinMapBase
{
#region Digitals
/// <summary>
/// Turns the display off and reports power off feedback
/// </summary>
public uint PowerOff { get; set; }
/// <summary>
/// Turns the display on and repots power on feedback
/// </summary>
public uint PowerOn { get; set; }
/// <summary>
/// Indicates that the display device supports two way communication when high
/// </summary>
public uint IsTwoWayDisplay { get; set; }
/// <summary>
/// Increments the volume while high
/// </summary>
public uint VolumeUp { get; set; }
/// <summary>
/// Decrements teh volume while high
/// </summary>
public uint VolumeDown { get; set; }
/// <summary>
/// Toggles the mute state. Feedback is high when volume is muted
/// </summary>
public uint VolumeMute { get; set; }
/// <summary>
/// Range of digital joins to select inputs and report current input as feedback
/// </summary>
public uint InputSelectOffset { get; set; }
/// <summary>
/// Range of digital joins to report visibility for input buttons
/// </summary>
public uint ButtonVisibilityOffset { get; set; }
/// <summary>
/// High if the device is online
/// </summary>
public uint IsOnline { get; set; }
#endregion
#region Analogs
/// <summary>
/// Analog join to set the input and report current input as feedback
/// </summary>
public uint InputSelect { get; set; }
/// <summary>
/// Sets the volume level and reports the current level as feedback
/// </summary>
public uint VolumeLevel { get; set; }
#endregion
#region Serials
/// <summary>
/// Reports the name of the display as defined in config as feedback
/// </summary>
public uint Name { get; set; }
/// <summary>
/// Range of serial joins that reports the names of the inputs as feedback
/// </summary>
public uint InputNamesOffset { get; set; }
#endregion
public DisplayControllerJoinMap()
{
// Digital
IsOnline = 50;
PowerOff = 1;
PowerOn = 2;
IsTwoWayDisplay = 3;
VolumeUp = 5;
VolumeDown = 6;
VolumeMute = 7;
ButtonVisibilityOffset = 40;
InputSelectOffset = 10;
// Analog
InputSelect = 11;
VolumeLevel = 5;
// Serial
Name = 1;
InputNamesOffset = 10;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
PowerOff = PowerOff + joinOffset;
PowerOn = PowerOn + joinOffset;
IsTwoWayDisplay = IsTwoWayDisplay + joinOffset;
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
Name = Name + joinOffset;
InputNamesOffset = InputNamesOffset + joinOffset;
InputSelectOffset = InputSelectOffset + joinOffset;
InputSelect = InputSelect + joinOffset;
VolumeUp = VolumeUp + joinOffset;
VolumeDown = VolumeDown + joinOffset;
VolumeMute = VolumeMute + joinOffset;
VolumeLevel = VolumeLevel + joinOffset;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DisplayControllerJoinMap : JoinMapBaseAdvanced
{
[JoinName("Name")]
public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("PowerOff")]
public JoinDataComplete PowerOff = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Power Off", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("PowerOn")]
public JoinDataComplete PowerOn = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Power On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IsTwoWayDisplay")]
public JoinDataComplete IsTwoWayDisplay = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Is Two Way Display", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("VolumeUp")]
public JoinDataComplete VolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Volume Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("VolumeLevel")]
public JoinDataComplete VolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Volume Level", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("VolumeDown")]
public JoinDataComplete VolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "Volume Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("VolumeMute")]
public JoinDataComplete VolumeMute = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "Volume Mute", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("VolumeMuteOn")]
public JoinDataComplete VolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
new JoinMetadata() { Label = "Volume Mute On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("VolumeMuteOff")]
public JoinDataComplete VolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 },
new JoinMetadata() { Label = "Volume Mute Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("InputSelectOffset")]
public JoinDataComplete InputSelectOffset = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 10 },
new JoinMetadata() { Label = "Input Select", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("InputNamesOffset")]
public JoinDataComplete InputNamesOffset = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 10 },
new JoinMetadata() { Label = "Input Names Offset", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("InputSelect")]
public JoinDataComplete InputSelect = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "Input Select", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("ButtonVisibilityOffset")]
public JoinDataComplete ButtonVisibilityOffset = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 10 },
new JoinMetadata() { Label = "Button Visibility Offset", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.DigitalSerial });
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 },
new JoinMetadata() { Label = "Is Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
public DisplayControllerJoinMap(uint joinStart)
: base(joinStart, typeof(DisplayControllerJoinMap))
{
}
}
}

View File

@@ -1,109 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges {
public class DmBladeChassisControllerJoinMap : JoinMapBase {
#region Digital/Analogs
#endregion
#region Digitals
/// <summary>
/// High when device is online
/// </summary>
public uint IsOnline { get; set; }
/// <summary>
/// Range reports video sync feedback for each input
/// </summary>
public uint VideoSyncStatus { get; set; }
/// <summary>
/// Range reports high if corresponding input's endpoint is online
/// </summary>
public uint InputEndpointOnline { get; set; }
/// <summary>
/// Range reports high if corresponding output's endpoint is online
/// </summary>
public uint OutputEndpointOnline { get; set; }
/// <summary>
/// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
/// </summary>
public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
#endregion
#region Analogs
/// <summary>
/// Range sets and reports the current video source for the corresponding output
/// </summary>
public uint OutputVideo { get; set; }
/// <summary>
/// Range sets and reports the current HDCP state for the corresponding input card
/// </summary>
public uint HdcpSupportState { get; set; }
/// <summary>
/// Range reports the highest supported HDCP state level for the corresponding input card
/// </summary>
public uint HdcpSupportCapability { get; set; }
#endregion
#region Serials
/// <summary>
/// Range sets and reports the name for the corresponding input card
/// </summary>
public uint InputNames { get; set; }
/// <summary>
/// Range sets and reports the name for the corresponding output card
/// </summary>
public uint OutputNames { get; set; }
/// <summary>
/// Range reports the name of the current video source for the corresponding output card
/// </summary>
public uint OutputCurrentVideoInputNames { get; set; }
/// <summary>
/// Range reports the current input resolution for each corresponding input card
/// </summary>
public uint InputCurrentResolution { get; set; }
#endregion
public DmBladeChassisControllerJoinMap() {
//Digital/Analog
//Digital
IsOnline = 11;
VideoSyncStatus = 100; //101-299
InputEndpointOnline = 500; //501-699
OutputEndpointOnline = 700; //701-899
TxAdvancedIsPresent = 1000; //1001-1199
//Analog
OutputVideo = 100; //101-299
HdcpSupportState = 1000; //1001-1199
HdcpSupportCapability = 1200; //1201-1399
//Serial
InputNames = 100; //101-299
OutputNames = 300; //301-499
OutputCurrentVideoInputNames = 2000; //2001-2199
InputCurrentResolution = 2400; // 2401-2599
}
public override void OffsetJoinNumbers(uint joinStart) {
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
OutputVideo = OutputVideo + joinOffset;
VideoSyncStatus = VideoSyncStatus + joinOffset;
InputNames = InputNames + joinOffset;
OutputNames = OutputNames + joinOffset;
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
InputCurrentResolution = InputCurrentResolution + joinOffset;
InputEndpointOnline = InputEndpointOnline + joinOffset;
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
HdcpSupportState = HdcpSupportState + joinOffset;
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges {
public class DmBladeChassisControllerJoinMap : JoinMapBaseAdvanced {
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "DM Blade Chassis Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("VideoSyncStatus")]
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("InputEndpointOnline")]
public JoinDataComplete InputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Input Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("OutputEndpointOnline")]
public JoinDataComplete OutputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Output Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("TxAdvancedIsPresent")]
public JoinDataComplete TxAdvancedIsPresent = new JoinDataComplete(new JoinData() { JoinNumber = 1001, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Tx Advanced Is Present", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("OutputVideo")]
public JoinDataComplete OutputVideo = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Output Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpSupportState")]
public JoinDataComplete HdcpSupportState = new JoinDataComplete(new JoinData() { JoinNumber = 1001, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Input HDCP Support State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpSupportCapability")]
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData() { JoinNumber = 1201, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
[JoinName("InputNames")]
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("OutputNames")]
public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("OutputCurrentVideoInputNames")]
public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2001, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("InputCurrentResolution")]
public JoinDataComplete InputCurrentResolution = new JoinDataComplete(new JoinData() { JoinNumber = 2401, JoinSpan = 128 },
new JoinMetadata() { Label = "DM Blade Chassis Input Current Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
public DmBladeChassisControllerJoinMap(uint joinStart)
: base(joinStart, typeof(DmBladeChassisControllerJoinMap))
{
}
}
}

View File

@@ -1,151 +1,109 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmChassisControllerJoinMap : JoinMapBase
{
#region Digital/Analogs
/// <summary>
/// Analog input sets System ID, output reports current ID as feedback.
/// Digital input applies System ID, output is high when applying busy.
/// </summary>
public uint SystemId { get; set; }
#endregion
#region Digitals
/// <summary>
/// High when device is online
/// </summary>
public uint IsOnline { get; set; }
/// <summary>
/// Range reports video sync feedback for each input
/// </summary>
public uint VideoSyncStatus { get; set; }
/// <summary>
/// Range reports high if corresponding input's endpoint is online
/// </summary>
public uint InputEndpointOnline { get; set; }
/// <summary>
/// Range reports high if corresponding output's endpoint is online
/// </summary>
public uint OutputEndpointOnline { get; set; }
/// <summary>
/// Range reports high if corresponding input's transmitter supports bridging as a separate device for detailed AV switching, HDCP control, etc.
/// </summary>
public uint TxAdvancedIsPresent { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
/// <summary>
/// Range reports high if corresponding output is disabled by HDCP.
/// </summary>
public uint OutputDisabledByHdcp { get; set; } // indicates that there is an attached transmitter that should be bridged to be interacted with
#endregion
#region Analogs
/// <summary>
/// Range sets and reports the current video source for the corresponding output
/// </summary>
public uint OutputVideo { get; set; }
/// <summary>
/// Range sets and reports the current audio source for the corresponding output
/// </summary>
public uint OutputAudio { get; set; }
/// <summary>
/// Range sets and reports the current Usb source for the corresponding output
/// </summary>
public uint OutputUsb { get; set; }
/// <summary>
/// Range sets and reports the current Usb source for the corresponding input
/// </summary>
public uint InputUsb { get; set; }
/// <summary>
/// Range sets and reports the current HDCP state for the corresponding input card
/// </summary>
public uint HdcpSupportState { get; set; }
/// <summary>
/// Range reports the highest supported HDCP state level for the corresponding input card
/// </summary>
public uint HdcpSupportCapability { get; set; }
#endregion
#region Serials
/// <summary>
/// Range sets and reports the name for the corresponding input card
/// </summary>
public uint InputNames { get; set; }
/// <summary>
/// Range sets and reports the name for the corresponding output card
/// </summary>
public uint OutputNames { get; set; }
/// <summary>
/// Range reports the name of the current video source for the corresponding output card
/// </summary>
public uint OutputCurrentVideoInputNames { get; set; }
/// <summary>
/// Range reports the name of the current audio source for the corresponding output card
/// </summary>
public uint OutputCurrentAudioInputNames { get; set; }
/// <summary>
/// Range reports the current input resolution for each corresponding input card
/// </summary>
public uint InputCurrentResolution { get; set; }
#endregion
public DmChassisControllerJoinMap()
{
//Digital/Analog
SystemId = 10; // Analog sets/gets SystemId, digital input applies and provides feedback of ID change busy
//Digital
IsOnline = 11;
VideoSyncStatus = 100; //101-299
InputEndpointOnline = 500; //501-699
OutputEndpointOnline = 700; //701-899
TxAdvancedIsPresent = 1000; //1001-1199
OutputDisabledByHdcp = 1200; //1201-1399
//Analog
OutputVideo = 100; //101-299
OutputAudio = 300; //301-499
OutputUsb = 500; //501-699
InputUsb = 700; //701-899
HdcpSupportState = 1000; //1001-1199
HdcpSupportCapability = 1200; //1201-1399
//Serial
InputNames = 100; //101-299
OutputNames = 300; //301-499
OutputCurrentVideoInputNames = 2000; //2001-2199
OutputCurrentAudioInputNames = 2200; //2201-2399
InputCurrentResolution = 2400; // 2401-2599
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
SystemId = SystemId + joinOffset;
IsOnline = IsOnline + joinOffset;
OutputVideo = OutputVideo + joinOffset;
OutputAudio = OutputAudio + joinOffset;
OutputUsb = OutputUsb + joinOffset;
InputUsb = InputUsb + joinOffset;
VideoSyncStatus = VideoSyncStatus + joinOffset;
InputNames = InputNames + joinOffset;
OutputNames = OutputNames + joinOffset;
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
InputCurrentResolution = InputCurrentResolution + joinOffset;
InputEndpointOnline = InputEndpointOnline + joinOffset;
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
HdcpSupportState = HdcpSupportState + joinOffset;
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
OutputDisabledByHdcp = OutputDisabledByHdcp + joinOffset;
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmChassisControllerJoinMap : JoinMapBaseAdvanced
{
[JoinName("EnableAudioBreakaway")]
public JoinDataComplete EnableAudioBreakaway = new JoinDataComplete(
new JoinData {JoinNumber = 4, JoinSpan = 1},
new JoinMetadata
{
Label = "DM Chassis enable audio breakaway routing",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("EnableUsbBreakaway")]
public JoinDataComplete EnableUsbBreakaway = new JoinDataComplete(
new JoinData { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata
{
Label = "DM Chassis enable USB breakaway routing",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("SystemId")]
public JoinDataComplete SystemId = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 },
new JoinMetadata() { Label = "DM Chassis SystemId Get/Set/Trigger/", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.DigitalAnalog });
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "DM Chassis Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("VideoSyncStatus")]
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("InputEndpointOnline")]
public JoinDataComplete InputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("OutputEndpointOnline")]
public JoinDataComplete OutputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("TxAdvancedIsPresent")]
public JoinDataComplete TxAdvancedIsPresent = new JoinDataComplete(new JoinData() { JoinNumber = 1001, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Tx Advanced Is Present", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("OutputDisabledByHdcp")]
public JoinDataComplete OutputDisabledByHdcp = new JoinDataComplete(new JoinData() { JoinNumber = 1201, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Disabled by HDCP", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("OutputVideo")]
public JoinDataComplete OutputVideo = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Video Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("OutputAudio")]
public JoinDataComplete OutputAudio = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Audio Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("OutputUsb")]
public JoinDataComplete OutputUsb = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output USB Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("InputUsb")]
public JoinDataComplete InputUsb = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input Usb Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpSupportState")]
public JoinDataComplete HdcpSupportState = new JoinDataComplete(new JoinData() { JoinNumber = 1001, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input HDCP Support State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpSupportCapability")]
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData() { JoinNumber = 1201, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
[JoinName("InputNames")]
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("OutputNames")]
public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("OutputCurrentVideoInputNames")]
public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2001, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("OutputCurrentAudioInputNames")]
public JoinDataComplete OutputCurrentAudioInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2201, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Audio Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("InputCurrentResolution")]
public JoinDataComplete InputCurrentResolution = new JoinDataComplete(new JoinData() { JoinNumber = 2401, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input Current Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
public DmChassisControllerJoinMap(uint joinStart)
: base(joinStart, typeof(DmChassisControllerJoinMap))
{
}
}
}

View File

@@ -1,67 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmRmcControllerJoinMap : JoinMapBase
{
#region Digitals
/// <summary>
/// High when device is online (if not attached to a DMP3 or DM chassis with a CPU3 card
/// </summary>
public uint IsOnline { get; set; }
#endregion
#region Serials
/// <summary>
/// Reports the current output resolution
/// </summary>
public uint CurrentOutputResolution { get; set; }
/// <summary>
/// Reports the EDID manufacturer value
/// </summary>
public uint EdidManufacturer { get; set; }
/// <summary>
/// Reports the EDID Name value
/// </summary>
public uint EdidName { get; set; }
/// <summary>
/// Reports the EDID preffered timing value
/// </summary>
public uint EdidPrefferedTiming { get; set; }
/// <summary>
/// Reports the EDID serial number value
/// </summary>
public uint EdidSerialNumber { get; set; }
#endregion
public DmRmcControllerJoinMap()
{
// Digital
IsOnline = 1;
// Serial
CurrentOutputResolution = 1;
EdidManufacturer = 2;
EdidName = 3;
EdidPrefferedTiming = 4;
EdidSerialNumber = 5;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
CurrentOutputResolution = CurrentOutputResolution + joinOffset;
EdidManufacturer = EdidManufacturer + joinOffset;
EdidName = EdidName + joinOffset;
EdidPrefferedTiming = EdidPrefferedTiming + joinOffset;
EdidSerialNumber = EdidSerialNumber + joinOffset;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmRmcControllerJoinMap : JoinMapBaseAdvanced
{
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "DM RMC Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("CurrentOutputResolution")]
public JoinDataComplete CurrentOutputResolution = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "DM RMC Current Output Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("EdidManufacturer")]
public JoinDataComplete EdidManufacturer = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "DM RMC EDID Manufacturer", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("EdidName")]
public JoinDataComplete EdidName = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "DM RMC EDID Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("EdidPrefferedTiming")]
public JoinDataComplete EdidPrefferedTiming = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "DM RMC EDID Preferred Timing", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("EdidSerialNumber")]
public JoinDataComplete EdidSerialNumber = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "DM RMC EDID Serial Number", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("AudioVideoSource")]
public JoinDataComplete AudioVideoSource = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "DM RMC Audio Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
public DmRmcControllerJoinMap(uint joinStart)
: base(joinStart, typeof(DmRmcControllerJoinMap))
{
}
}
}

View File

@@ -1,98 +1,69 @@
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmTxControllerJoinMap : JoinMapBase
{
#region Digitals
/// <summary>
/// High when device is online (if not attached to a DMP3 or DM chassis with a CPU3 card
/// </summary>
public uint IsOnline { get; set; }
/// <summary>
/// High when video sync is detected
/// </summary>
public uint VideoSyncStatus { get; set; }
/// <summary>
///
/// </summary>
public uint FreeRunEnabled { get; set; }
#endregion
#region Analogs
/// <summary>
/// Sets and reports the video source
/// </summary>
public uint VideoInput { get; set; }
/// <summary>
/// Sets and reports the audio source
/// </summary>
public uint AudioInput { get; set; }
/// <summary>
/// Reports the highest supported HDCP state level for the corresponding input card
/// </summary>
public uint HdcpSupportCapability { get; set; }
/// <summary>
/// Sets and reports the current HDCP state for the corresponding input port
/// </summary>
public uint Port1HdcpState { get; set; }
/// <summary>
/// Sets and reports the current HDCP state for the corresponding input port
/// </summary>
public uint Port2HdcpState { get; set; }
/// <summary>
/// Sets and reports the current VGA Brightness level
/// </summary>
public uint VgaBrightness { get; set; }
/// <summary>
/// Sets and reports the current VGA Contrast level
/// </summary>
public uint VgaContrast { get; set; }
#endregion
#region Serials
/// <summary>
/// Reports the current input resolution
/// </summary>
public uint CurrentInputResolution { get; set; }
#endregion
public DmTxControllerJoinMap()
{
// Digital
IsOnline = 1;
VideoSyncStatus = 2;
FreeRunEnabled = 3;
// Serial
CurrentInputResolution = 1;
// Analog
VideoInput = 1;
AudioInput = 2;
HdcpSupportCapability = 3;
Port1HdcpState = 4;
Port2HdcpState = 5;
VgaBrightness = 6;
VgaContrast = 7;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
VideoSyncStatus = VideoSyncStatus + joinOffset;
FreeRunEnabled = FreeRunEnabled + joinOffset;
CurrentInputResolution = CurrentInputResolution + joinOffset;
VideoInput = VideoInput + joinOffset;
AudioInput = AudioInput + joinOffset;
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
Port1HdcpState = Port1HdcpState + joinOffset;
Port2HdcpState = Port2HdcpState + joinOffset;
VgaBrightness = VgaBrightness + joinOffset;
VgaContrast = VgaContrast + joinOffset;
}
}
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmTxControllerJoinMap : JoinMapBaseAdvanced
{
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("VideoSyncStatus")]
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("FreeRunEnabled")]
public JoinDataComplete FreeRunEnabled = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Enable Free Run Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Input1VideoSyncStatus")]
public JoinDataComplete Input1VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Input 1 Video Sync Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("Input2VideoSyncStatus")]
public JoinDataComplete Input2VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Input 2 Video Sync Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("Input3VideoSyncStatus")]
public JoinDataComplete Input3VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "Input 3 Video Sync Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("CurrentInputResolution")]
public JoinDataComplete CurrentInputResolution = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Current Input Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("VideoInput")]
public JoinDataComplete VideoInput = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Video Input Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("AudioInput")]
public JoinDataComplete AudioInput = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Audio Input Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("HdcpSupportCapability")]
public JoinDataComplete HdcpSupportCapability = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX HDCP Support Capability", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Port1HdcpState")]
public JoinDataComplete Port1HdcpState = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Port 1 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Port2HdcpState")]
public JoinDataComplete Port2HdcpState = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Port 2 HDCP State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("VgaBrightness")]
public JoinDataComplete VgaBrightness = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX VGA Brightness", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("VgaContrast")]
public JoinDataComplete VgaContrast = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "DM TX Online", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
public DmTxControllerJoinMap(uint joinStart)
: base(joinStart, typeof(DmTxControllerJoinMap))
{
}
}
}

View File

@@ -1,69 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmpsAudioOutputControllerJoinMap : JoinMapBase
{
#region Digital/Analog
/// <summary>
/// Range of joins for Master Volume
/// Analog join 1 is volume level and feedback
/// Digital join 1 is Mute on and feedback
/// Digital join 2 is Mute off and feedback
/// Digital join 3 is volume up
/// Digital join 4 is volume down
/// </summary>
public uint MasterVolume { get; set; }
/// <summary>
/// Range of joins for Source Volume
/// Analog join 11 is volume level and feedback
/// Digital join 11 is Mute on and feedback
/// Digital join 12 is Mute off and feedback
/// Digital join 13 is volume up
/// Digital join 14 is volume down
/// </summary>
public uint SourceVolume { get; set; }
/// <summary>
/// Range of joins for Codec1 Volume (if applicable)
/// Analog join 21 is volume level and feedback
/// Digital join 21 is Mute on and feedback
/// Digital join 22 is Mute off and feedback
/// Digital join 23 is volume up
/// Digital join 24 is volume down
/// </summary>
public uint Codec1Volume { get; set; }
/// <summary>
/// Range of joins for Codec2 Volume (if applicable)
/// Analog join 31 is volume level and feedback
/// Digital join 31 is Mute on and feedback
/// Digital join 32 is Mute off and feedback
/// Digital join 33 is volume up
/// Digital join 34 is volume down
/// </summary>
public uint Codec2Volume { get; set; }
#endregion
public DmpsAudioOutputControllerJoinMap()
{
MasterVolume = 1; // 1-10
SourceVolume = 11; // 11-20
Codec1Volume = 21; // 21-30
Codec2Volume = 31; // 31-40
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart;
MasterVolume = MasterVolume + joinOffset;
SourceVolume = SourceVolume + joinOffset;
Codec1Volume = Codec1Volume + joinOffset;
Codec2Volume = Codec2Volume + joinOffset;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmpsAudioOutputControllerJoinMap : JoinMapBaseAdvanced
{
[JoinName("MasterVolumeLevel")]
public JoinDataComplete MasterVolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Master Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("MasterVolumeMuteOn")]
public JoinDataComplete MasterVolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Master Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("MasterVolumeMuteOff")]
public JoinDataComplete MasterVolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Master Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("MasterVolumeUp")]
public JoinDataComplete MasterVolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Master Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("MasterVolumeDown")]
public JoinDataComplete MasterVolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Master Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("SourceVolumeLevel")]
public JoinDataComplete SourceVolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "Source Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("SourceVolumeMuteOn")]
public JoinDataComplete SourceVolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "Source Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("SourceVolumeMuteOff")]
public JoinDataComplete SourceVolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
new JoinMetadata() { Label = "Source Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("SourceVolumeUp")]
public JoinDataComplete SourceVolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
new JoinMetadata() { Label = "Source Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("SourceVolumeDown")]
public JoinDataComplete SourceVolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
new JoinMetadata() { Label = "Source Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec1VolumeLevel")]
public JoinDataComplete Codec1VolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec1 Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Codec1VolumeMuteOn")]
public JoinDataComplete Codec1VolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec1 Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec1VolumeMuteOff")]
public JoinDataComplete Codec1VolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec1 Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec1VolumeUp")]
public JoinDataComplete Codec1VolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec1 Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec1VolumeDown")]
public JoinDataComplete Codec1VolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec1 Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec2VolumeLevel")]
public JoinDataComplete Codec2VolumeLevel = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec2 Volume Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("Codec2VolumeMuteOn")]
public JoinDataComplete Codec2VolumeMuteOn = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec2 Volume Mute On Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec2VolumeMuteOff")]
public JoinDataComplete Codec2VolumeMuteOff = new JoinDataComplete(new JoinData() { JoinNumber = 32, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec2 Volume Mute Off Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec2VolumeUp")]
public JoinDataComplete Codec2VolumeUp = new JoinDataComplete(new JoinData() { JoinNumber = 33, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec2 Volume Level Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Codec2VolumeDown")]
public JoinDataComplete Codec2VolumeDown = new JoinDataComplete(new JoinData() { JoinNumber = 34, JoinSpan = 1 },
new JoinMetadata() { Label = "Codec2 Volume Mute Level Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
public DmpsAudioOutputControllerJoinMap(uint joinStart)
: base(joinStart, typeof(DmpsAudioOutputControllerJoinMap))
{
}
}
}

View File

@@ -7,121 +7,51 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class DmpsRoutingControllerJoinMap : JoinMapBase
public class DmpsRoutingControllerJoinMap : JoinMapBaseAdvanced
{
#region Digitals
/// <summary>
/// Range reports video sync feedback for each input
/// </summary>
public uint VideoSyncStatus { get; set; }
/// <summary>
/// Range reports high if corresponding input's endpoint is online
/// </summary>
public uint InputEndpointOnline { get; set; }
/// <summary>
/// Range reports high if corresponding output's endpoint is online
/// </summary>
public uint OutputEndpointOnline { get; set; }
#endregion
#region Analogs
/// <summary>
/// Range sets and reports the current video source for the corresponding output
/// </summary>
public uint OutputVideo { get; set; }
/// <summary>
/// Range sets and reports the current audio source for the corresponding output
/// </summary>
public uint OutputAudio { get; set; }
/// <summary>
/// Range sets and reports the current Usb source for the corresponding output
/// </summary>
//public uint OutputUsb { get; set; }
///// <summary>
///// Range sets and reports the current Usb source for the corresponding input
///// </summary>
//public uint InputUsb { get; set; }
///// <summary>
///// Range sets and reports the current HDCP state for the corresponding input card
///// </summary>
//public uint HdcpSupportState { get; set; }
///// <summary>
///// Range reports the highest supported HDCP state level for the corresponding input card
///// </summary>
//public uint HdcpSupportCapability { get; set; }
#endregion
#region Serials
/// <summary>
/// Range sets and reports the name for the corresponding input card
/// </summary>
public uint InputNames { get; set; }
/// <summary>
/// Range sets and reports the name for the corresponding output card
/// </summary>
public uint OutputNames { get; set; }
/// <summary>
/// Range reports the name of the current video source for the corresponding output card
/// </summary>
public uint OutputCurrentVideoInputNames { get; set; }
/// <summary>
/// Range reports the name of the current audio source for the corresponding output card
/// </summary>
public uint OutputCurrentAudioInputNames { get; set; }
/// <summary>
/// Range reports the current input resolution for each corresponding input card
/// </summary>
public uint InputCurrentResolution { get; set; }
#endregion
public DmpsRoutingControllerJoinMap()
{
//Digital
VideoSyncStatus = 100; //101-299
InputEndpointOnline = 500; //501-699
OutputEndpointOnline = 700; //701-899
//Analog
OutputVideo = 100; //101-299
OutputAudio = 300; //301-499
//OutputUsb = 500; //501-699
//InputUsb = 700; //701-899
VideoSyncStatus = 100; //101-299
//HdcpSupportState = 1000; //1001-1199
//HdcpSupportCapability = 1200; //1201-1399
//Serial
InputNames = 100; //101-299
OutputNames = 300; //301-499
OutputCurrentVideoInputNames = 2000; //2001-2199
OutputCurrentAudioInputNames = 2200; //2201-2399
InputCurrentResolution = 2400; // 2401-2599
InputEndpointOnline = 500; //501-699
OutputEndpointOnline = 700; //701-899
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
OutputVideo = OutputVideo + joinOffset;
OutputAudio = OutputAudio + joinOffset;
//OutputUsb = OutputUsb + joinOffset;
//InputUsb = InputUsb + joinOffset;
VideoSyncStatus = VideoSyncStatus + joinOffset;
InputNames = InputNames + joinOffset;
OutputNames = OutputNames + joinOffset;
OutputCurrentVideoInputNames = OutputCurrentVideoInputNames + joinOffset;
OutputCurrentAudioInputNames = OutputCurrentAudioInputNames + joinOffset;
InputCurrentResolution = InputCurrentResolution + joinOffset;
InputEndpointOnline = InputEndpointOnline + joinOffset;
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
//HdcpSupportState = HdcpSupportState + joinOffset;
//HdcpSupportCapability = HdcpSupportCapability + joinOffset;
[JoinName("VideoSyncStatus")]
public JoinDataComplete VideoSyncStatus = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Input Video Sync", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("InputEndpointOnline")]
public JoinDataComplete InputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 501, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("OutputEndpointOnline")]
public JoinDataComplete OutputEndpointOnline = new JoinDataComplete(new JoinData() { JoinNumber = 701, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Endpoint Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("OutputVideo")]
public JoinDataComplete OutputVideo = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Video Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("OutputAudio")]
public JoinDataComplete OutputAudio = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Audio Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("InputNames")]
public JoinDataComplete InputNames = new JoinDataComplete(new JoinData() { JoinNumber = 101, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("OutputNames")]
public JoinDataComplete OutputNames = new JoinDataComplete(new JoinData() { JoinNumber = 301, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Output Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("OutputCurrentVideoInputNames")]
public JoinDataComplete OutputCurrentVideoInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2001, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Video Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("OutputCurrentAudioInputNames")]
public JoinDataComplete OutputCurrentAudioInputNames = new JoinDataComplete(new JoinData() { JoinNumber = 2201, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Audio Output Currently Routed Video Input Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("InputCurrentResolution")]
public JoinDataComplete InputCurrentResolution = new JoinDataComplete(new JoinData() { JoinNumber = 2401, JoinSpan = 32 },
new JoinMetadata() { Label = "DM Chassis Input Current Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
public DmpsRoutingControllerJoinMap(uint joinStart)
: base(joinStart, typeof(DmpsRoutingControllerJoinMap))
{
}
}
}

View File

@@ -9,33 +9,35 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class GenericLightingJoinMap : JoinMapBase
{
public uint IsOnline { get; set; }
public uint SelectScene { get; set; }
public uint LightingSceneOffset { get; set; }
public uint ButtonVisibilityOffset { get; set; }
public uint IntegrationIdSet { get; set; }
public GenericLightingJoinMap()
{
// Digital
IsOnline = 1;
SelectScene = 1;
IntegrationIdSet = 1;
LightingSceneOffset = 10;
ButtonVisibilityOffset = 40;
// Analog
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
SelectScene = SelectScene + joinOffset;
LightingSceneOffset = LightingSceneOffset + joinOffset;
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
public class GenericLightingJoinMap : JoinMapBaseAdvanced
{
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Lighting Controller Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("SelectScene")]
public JoinDataComplete SelectScene = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Lighting Controller Select Scene By Index", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("SelectSceneDirect")]
public JoinDataComplete SelectSceneDirect = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 10 },
new JoinMetadata() { Label = "Lighting Controller Select Scene", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.DigitalSerial });
[JoinName("ButtonVisibility")]
public JoinDataComplete ButtonVisibility = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 10 },
new JoinMetadata() { Label = "Lighting Controller Button Visibility", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("IntegrationIdSet")]
public JoinDataComplete IntegrationIdSet = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Lighting Controller Set Integration Id", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
public GenericLightingJoinMap(uint joinStart)
: base(joinStart, typeof(GenericLightingJoinMap))
{
}
}
}

View File

@@ -7,25 +7,17 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class GenericRelayControllerJoinMap : JoinMapBase
public class GenericRelayControllerJoinMap : JoinMapBaseAdvanced
{
#region Digitals
/// <summary>
/// Sets and reports the state of the relay (High = closed, Low = Open)
/// </summary>
public uint Relay { get; set; }
#endregion
public GenericRelayControllerJoinMap()
{
Relay = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
Relay = Relay + joinOffset;
[JoinName("Relay")]
public JoinDataComplete Relay = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Relay State Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
public GenericRelayControllerJoinMap(uint joinStart)
: base(joinStart, typeof(GenericRelayControllerJoinMap))
{
}
}
}

View File

@@ -1,238 +1,176 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class GlsOccupancySensorBaseJoinMap : JoinMapBase
{
#region Digitals
/// <summary>
/// High when device is online
/// </summary>
public uint IsOnline { get; set; }
/// <summary>
/// Forces the device to report occupied status
/// </summary>
public uint ForceOccupied { get; set; }
/// <summary>
/// Forces the device to report vacant status
/// </summary>
public uint ForceVacant { get; set; }
/// <summary>
/// Enables raw status reporting
/// </summary>
public uint EnableRawStates { get; set; }
/// <summary>
/// High when raw occupancy is detected
/// </summary>
public uint RawOccupancyFeedback { get; set; }
/// <summary>
/// High when PIR sensor detects motion
/// </summary>
public uint RawOccupancyPirFeedback { get; set; }
/// <summary>
/// High when US sensor detects motion
/// </summary>
public uint RawOccupancyUsFeedback { get; set; }
/// <summary>
/// High when occupancy is detected
/// </summary>
public uint RoomOccupiedFeedback { get; set; }
/// <summary>
/// Hich when occupancy is detected in the grace period
/// </summary>
public uint GraceOccupancyDetectedFeedback { get; set; }
/// <summary>
/// High when vacancy is detected
/// </summary>
public uint RoomVacantFeedback { get; set; }
/// <summary>
/// Enables the LED Flash when set high
/// </summary>
public uint EnableLedFlash { get; set; }
/// <summary>
/// Disables the LED flash when set high
/// </summary>
public uint DisableLedFlash { get; set; }
/// <summary>
/// Enables the Short Timeout
/// </summary>
public uint EnableShortTimeout { get; set; }
/// <summary>
/// Disables the Short Timout
/// </summary>
public uint DisableShortTimeout { get; set; }
/// <summary>
/// Set high to enable one technology to trigger occupancy
/// </summary>
public uint OrWhenVacated { get; set; }
/// <summary>
/// Set high to require both technologies to trigger occupancy
/// </summary>
public uint AndWhenVacated { get; set; }
/// <summary>
/// Enables Ultrasonic Sensor A
/// </summary>
public uint EnableUsA { get; set; }
/// <summary>
/// Disables Ultrasonic Sensor A
/// </summary>
public uint DisableUsA { get; set; }
/// <summary>
/// Enables Ultrasonic Sensor B
/// </summary>
public uint EnableUsB { get; set; }
/// <summary>
/// Disables Ultrasonic Sensor B
/// </summary>
public uint DisableUsB { get; set; }
/// <summary>
/// Enables Pir
/// </summary>
public uint EnablePir { get; set; }
/// <summary>
/// Disables Pir
/// </summary>
public uint DisablePir { get; set; }
public uint IncrementUsInOccupiedState { get; set; }
public uint DecrementUsInOccupiedState { get; set; }
public uint IncrementUsInVacantState { get; set; }
public uint DecrementUsInVacantState { get; set; }
public uint IncrementPirInOccupiedState { get; set; }
public uint DecrementPirInOccupiedState { get; set; }
public uint IncrementPirInVacantState { get; set; }
public uint DecrementPirInVacantState { get; set; }
#endregion
#region Analogs
/// <summary>
/// Sets adn reports the remote timeout value
/// </summary>
public uint Timeout { get; set; }
/// <summary>
/// Reports the local timeout value
/// </summary>
public uint TimeoutLocalFeedback { get; set; }
/// <summary>
/// Sets the minimum internal photo sensor value and reports the current level
/// </summary>
public uint InternalPhotoSensorValue { get; set; }
/// <summary>
/// Sets the minimum external photo sensor value and reports the current level
/// </summary>
public uint ExternalPhotoSensorValue { get; set; }
public uint UsSensitivityInOccupiedState { get; set; }
public uint UsSensitivityInVacantState { get; set; }
public uint PirSensitivityInOccupiedState { get; set; }
public uint PirSensitivityInVacantState { get; set; }
#endregion
#region Serial
public uint Name { get; set; }
#endregion
public GlsOccupancySensorBaseJoinMap()
{
IsOnline = 1;
ForceOccupied = 2;
ForceVacant = 3;
EnableRawStates = 4;
RoomOccupiedFeedback = 2;
GraceOccupancyDetectedFeedback = 3;
RoomVacantFeedback = 4;
RawOccupancyFeedback = 5;
RawOccupancyPirFeedback = 6;
RawOccupancyUsFeedback = 7;
EnableLedFlash = 11;
DisableLedFlash = 12;
EnableShortTimeout = 13;
DisableShortTimeout = 14;
OrWhenVacated = 15;
AndWhenVacated = 16;
EnableUsA = 17;
DisableUsA = 18;
EnableUsB = 19;
DisableUsB = 20;
EnablePir = 21;
DisablePir = 22;
IncrementUsInOccupiedState = 23;
DecrementUsInOccupiedState = 24;
IncrementUsInVacantState = 25;
DecrementUsInVacantState = 26;
IncrementPirInOccupiedState = 27;
DecrementPirInOccupiedState = 28;
IncrementPirInVacantState = 29;
DecrementPirInVacantState = 30;
Timeout = 1;
TimeoutLocalFeedback = 2;
InternalPhotoSensorValue = 3;
ExternalPhotoSensorValue = 4;
UsSensitivityInOccupiedState = 5;
UsSensitivityInVacantState = 6;
PirSensitivityInOccupiedState = 7;
PirSensitivityInVacantState = 8;
Name = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
ForceOccupied = ForceOccupied + joinOffset;
ForceVacant = ForceVacant + joinOffset;
EnableRawStates = EnableRawStates + joinOffset;
RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
RoomVacantFeedback = RoomVacantFeedback + joinOffset;
RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
RawOccupancyPirFeedback = RawOccupancyPirFeedback + joinOffset;
RawOccupancyUsFeedback = RawOccupancyUsFeedback + joinOffset;
EnableLedFlash = EnableLedFlash + joinOffset;
DisableLedFlash = DisableLedFlash + joinOffset;
EnableShortTimeout = EnableShortTimeout + joinOffset;
DisableShortTimeout = DisableShortTimeout + joinOffset;
OrWhenVacated = OrWhenVacated + joinOffset;
AndWhenVacated = AndWhenVacated + joinOffset;
EnableUsA = EnableUsA + joinOffset;
DisableUsA = DisableUsA + joinOffset;
EnableUsB = EnableUsB + joinOffset;
DisableUsB = DisableUsB + joinOffset;
EnablePir = EnablePir + joinOffset;
DisablePir = DisablePir + joinOffset;
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
DecrementUsInVacantState = DecrementUsInVacantState + joinOffset;
IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset;
DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset;
IncrementPirInVacantState = IncrementPirInVacantState + joinOffset;
DecrementPirInVacantState = DecrementPirInVacantState + joinOffset;
Timeout = Timeout + joinOffset;
TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset;
InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset;
ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset;
UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset;
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
Name = Name + joinOffset;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class GlsOccupancySensorBaseJoinMap : JoinMapBaseAdvanced
{
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Is Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("ForceOccupied")]
public JoinDataComplete ForceOccupied = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Set to Occupied", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ForceVacant")]
public JoinDataComplete ForceVacant = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Set to Vacant", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableRawStates")]
public JoinDataComplete EnableRawStates = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Enable Raw", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("RoomOccupiedFeedback")]
public JoinDataComplete RoomOccupiedFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Room Is Occupied", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("GraceOccupancyDetectedFeedback")]
public JoinDataComplete GraceOccupancyDetectedFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Grace Occupancy Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RoomVacantFeedback")]
public JoinDataComplete RoomVacantFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Room Is Vacant", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RawOccupancyFeedback")]
public JoinDataComplete RawOccupancyFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Raw Occupancy Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RawOccupancyPirFeedback")]
public JoinDataComplete RawOccupancyPirFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Raw PIR Occupancy Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RawOccupancyUsFeedback")]
public JoinDataComplete RawOccupancyUsFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Raw US Occupancy Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableLedFlash")]
public JoinDataComplete EnableLedFlash = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Enable LED Flash", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisableLedFlash")]
public JoinDataComplete DisableLedFlash = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Disable LED Flash", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableShortTimeout")]
public JoinDataComplete EnableShortTimeout = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Enable Short Timeout", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisableShortTimeout")]
public JoinDataComplete DisableShortTimeout = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Disable Short Timeout", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("OrWhenVacated")]
public JoinDataComplete OrWhenVacated = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Set To Vacant when Either Sensor is Vacant", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("AndWhenVacated")]
public JoinDataComplete AndWhenVacated = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Set To Vacant when Both Sensors are Vacant", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableUsA")]
public JoinDataComplete EnableUsA = new JoinDataComplete(new JoinData() { JoinNumber = 17, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Enable Ultrasonic Sensor A", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisableUsA")]
public JoinDataComplete DisableUsA = new JoinDataComplete(new JoinData() { JoinNumber = 18, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Disable Ultrasonic Sensor A", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnableUsB")]
public JoinDataComplete EnableUsB = new JoinDataComplete(new JoinData() { JoinNumber = 19, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Enable Ultrasonic Sensor B", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisableUsB")]
public JoinDataComplete DisableUsB = new JoinDataComplete(new JoinData() { JoinNumber = 20, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Disable Ultrasonic Sensor B", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("EnablePir")]
public JoinDataComplete EnablePir = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Enable IR Sensor", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DisablePir")]
public JoinDataComplete DisablePir = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Disable IR Sensor", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IncrementUsInOccupiedState")]
public JoinDataComplete IncrementUsInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Increment US Occupied State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DecrementUsInOccupiedState")]
public JoinDataComplete DecrementUsInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Decrement US Occupied State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IncrementUsInVacantState")]
public JoinDataComplete IncrementUsInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 25, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Increment US Vacant State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DecrementUsInVacantState")]
public JoinDataComplete DecrementUsInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 26, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Decrement US Vacant State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IncrementPirInOccupiedState")]
public JoinDataComplete IncrementPirInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 27, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Increment IR Occupied State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DecrementPirInOccupiedState")]
public JoinDataComplete DecrementPirInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 28, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Decrement IR Occupied State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("IncrementPirInVacantState")]
public JoinDataComplete IncrementPirInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 29, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Increment IR Vacant State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("DecrementPirInVacantState")]
public JoinDataComplete DecrementPirInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Decrement IR Vacant State Sensitivity", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Timeout")]
public JoinDataComplete Timeout = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Timeout Value", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("TimeoutLocalFeedback")]
public JoinDataComplete TimeoutLocalFeedback = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Local Timeout Value", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("InternalPhotoSensorValue")]
public JoinDataComplete InternalPhotoSensorValue = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Internal PhotoSensor Value", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("ExternalPhotoSensorValue")]
public JoinDataComplete ExternalPhotoSensorValue = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor External PhotoSensor Value", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("UsSensitivityInOccupiedState")]
public JoinDataComplete UsSensitivityInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Ultrasonic Sensitivity in Occupied State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("UsSensitivityInVacantState")]
public JoinDataComplete UsSensitivityInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Ultrasonic Sensitivity in Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("PirSensitivityInOccupiedState")]
public JoinDataComplete PirSensitivityInOccupiedState = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor PIR Sensitivity in Occupied State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("PirSensitivityInVacantState")]
public JoinDataComplete PirSensitivityInVacantState = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Ultrasonic Sensitivity in Vacant State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("Name")]
public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Occ Sensor Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
public GlsOccupancySensorBaseJoinMap(uint joinStart)
: base(joinStart, typeof(GlsOccupancySensorBaseJoinMap))
{
}
}
}

View File

@@ -7,113 +7,62 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class HdMdxxxCEControllerJoinMap : JoinMapBase
public class HdMdxxxCEControllerJoinMap : JoinMapBaseAdvanced
{
#region Digitals
/// <summary>
/// High when the pair is online
/// </summary>
public uint IsOnline { get; set; }
/// <summary>
/// High when the remote end device is online
/// </summary>
public uint RemoteEndDetected { get; set; }
/// <summary>
/// Sets Auto Route On and provides feedback
/// </summary>
public uint AutoRouteOn { get; set; }
/// <summary>
/// Sets Auto Route Off and provides feedback
/// </summary>
public uint AutoRouteOff { get; set; }
/// <summary>
/// Sets Priority Routing On and provides feedback
/// </summary>
public uint PriorityRoutingOn { get; set; }
/// <summary>
/// Sets Priority Routing Off and provides feedback
/// </summary>
public uint PriorityRoutingOff { get; set; }
/// <summary>
/// Enables OSD and provides feedback
/// </summary>
public uint InputOnScreenDisplayEnabled { get; set; }
/// <summary>
/// Disables OSD and provides feedback
/// </summary>
public uint InputOnScreenDisplayDisabled { get; set; }
/// <summary>
/// Provides Video Sync Detected feedback for each input
/// </summary>
public uint SyncDetected { get; set; }
#endregion
#region Analogs
/// <summary>
/// Sets the video source for the receiver's HDMI out and provides feedback
/// </summary>
public uint VideoSource { get; set; }
/// <summary>
/// Indicates the number of sources supported by the Tx/Rx pair
/// </summary>
public uint SourceCount { get; set; }
#endregion
#region Serials
/// <summary>
/// Indicates the name of each input port
/// </summary>
public uint SourceNames { get; set; }
#endregion
public HdMdxxxCEControllerJoinMap()
{
//Digital
IsOnline = 1;
RemoteEndDetected = 2;
AutoRouteOn = 3;
AutoRouteOff = 4;
PriorityRoutingOn = 5;
PriorityRoutingOff = 6;
InputOnScreenDisplayEnabled = 7;
InputOnScreenDisplayDisabled = 8;
SyncDetected = 10; // 11-15
//Analog
VideoSource = 1;
SourceCount = 2;
//Serials
SourceNames = 10; // 11-15
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
IsOnline = IsOnline + joinOffset;
RemoteEndDetected = RemoteEndDetected + joinOffset;
AutoRouteOn = AutoRouteOn + joinOffset;
AutoRouteOff = AutoRouteOff + joinOffset;
PriorityRoutingOn = PriorityRoutingOn + joinOffset;
PriorityRoutingOff = PriorityRoutingOff + joinOffset;
InputOnScreenDisplayEnabled = InputOnScreenDisplayEnabled + joinOffset;
InputOnScreenDisplayDisabled = InputOnScreenDisplayDisabled + joinOffset;
SyncDetected = SyncDetected + joinOffset;
VideoSource = VideoSource + joinOffset;
SourceCount = SourceCount + joinOffset;
SourceNames = SourceNames + joinOffset;
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("RemoteEndDetected")]
public JoinDataComplete RemoteEndDetected = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Remote End Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("AutoRouteOn")]
public JoinDataComplete AutoRouteOn = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Auto Route On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("AutoRouteOff")]
public JoinDataComplete AutoRouteOff = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Auto Route Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("PriorityRoutingOn")]
public JoinDataComplete PriorityRoutingOn = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Priority Routing On", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("PriorityRoutingOff")]
public JoinDataComplete PriorityRoutingOff = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Priority Routing Off", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("InputOnScreenDisplayEnabled")]
public JoinDataComplete InputOnScreenDisplayEnabled = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Input OSD Enabled", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("InputOnScreenDisplayDisabled")]
public JoinDataComplete InputOnScreenDisplayDisabled = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
new JoinMetadata() { Label = "Device Input OSD Disabled", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("SyncDetected")]
public JoinDataComplete SyncDetected = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 5 },
new JoinMetadata() { Label = "Device Sync Detected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("VideoSource")]
public JoinDataComplete VideoSource = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 5 },
new JoinMetadata() { Label = "Device Video Source Set / Get", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("SourceCount")]
public JoinDataComplete SourceCount = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 5 },
new JoinMetadata() { Label = "Device Video Source Count", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("SourceNames")]
public JoinDataComplete SourceNames = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 5 },
new JoinMetadata() { Label = "Device Video Source Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
public HdMdxxxCEControllerJoinMap(uint joinStart)
: base(joinStart, typeof(HdMdxxxCEControllerJoinMap))
{
}
}
}

View File

@@ -1,67 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class IBasicCommunicationJoinMap : JoinMapBase
{
#region Digitals
/// <summary>
/// Set High to connect, Low to disconnect
/// </summary>
public uint Connect { get; set; }
/// <summary>
/// Reports Connected State (High = Connected)
/// </summary>
public uint Connected { get; set; }
#endregion
#region Analogs
/// <summary>
/// Reports the connections status value
/// </summary>
public uint Status { get; set; }
#endregion
#region Serials
/// <summary>
/// Data back from port
/// </summary>
public uint TextReceived { get; set; }
/// <summary>
/// Sends data to the port
/// </summary>
public uint SendText { get; set; }
/// <summary>
/// Takes a JSON serialized string that sets a COM port's parameters
/// </summary>
public uint SetPortConfig { get; set; }
#endregion
public IBasicCommunicationJoinMap()
{
TextReceived = 1;
SendText = 1;
SetPortConfig = 2;
Connect = 1;
Connected = 1;
Status = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
TextReceived = TextReceived + joinOffset;
SendText = SendText + joinOffset;
SetPortConfig = SetPortConfig + joinOffset;
Connect = Connect + joinOffset;
Connected = Connected + joinOffset;
Status = Status + joinOffset;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class IBasicCommunicationJoinMap : JoinMapBaseAdvanced
{
[JoinName("TextReceived")]
public JoinDataComplete TextReceived = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Text Received From Remote Device", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("SendText")]
public JoinDataComplete SendText = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Text Sent To Remote Device", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
[JoinName("SetPortConfig")]
public JoinDataComplete SetPortConfig = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Set Port Config", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Serial });
[JoinName("Connect")]
public JoinDataComplete Connect = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Connect", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Connected")]
public JoinDataComplete Connected = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Connected", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("Status")]
public JoinDataComplete Status = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
public IBasicCommunicationJoinMap(uint joinStart)
: base(joinStart, typeof(IBasicCommunicationJoinMap))
{
}
}
}

View File

@@ -7,25 +7,17 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class IDigitalInputJoinMap : JoinMapBase
public class IDigitalInputJoinMap : JoinMapBaseAdvanced
{
#region Digitals
/// <summary>
/// Reports the state of the digital input
/// </summary>
public uint InputState { get; set; }
#endregion
public IDigitalInputJoinMap()
{
InputState = 1;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
InputState = InputState + joinOffset;
[JoinName("InputState")]
public JoinDataComplete InputState = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Room Email Url", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
public IDigitalInputJoinMap(uint joinStart)
: base(joinStart, typeof(IDigitalInputJoinMap))
{
}
}
}

View File

@@ -9,204 +9,225 @@ using Crestron.SimplSharp.Reflection;
namespace PepperDash.Essentials.Core.Bridges
{
public class SetTopBoxControllerJoinMap : JoinMapBase
public class SetTopBoxControllerJoinMap : JoinMapBaseAdvanced
{
#region Digitals
public uint DvrList { get; set; } //
public uint Replay { get; set; }
public uint Up { get; set; } //
public uint Down { get; set; } //
public uint Left { get; set; } //
public uint Right { get; set; } //
public uint Select { get; set; } //
public uint Menu { get; set; } //
public uint Exit { get; set; } //
public uint Digit0 { get; set; } //
public uint Digit1 { get; set; } //
public uint Digit2 { get; set; } //
public uint Digit3 { get; set; } //
public uint Digit4 { get; set; } //
public uint Digit5 { get; set; } //
public uint Digit6 { get; set; } //
public uint Digit7 { get; set; } //
public uint Digit8 { get; set; } //
public uint Digit9 { get; set; } //
public uint Dash { get; set; } //
public uint KeypadEnter { get; set; } //
public uint ChannelUp { get; set; } //
public uint ChannelDown { get; set; } //
public uint LastChannel { get; set; } //
public uint Guide { get; set; } //
public uint Info { get; set; } //
public uint Red { get; set; } //
public uint Green { get; set; } //
public uint Yellow { get; set; } //
public uint Blue { get; set; } //
public uint ChapMinus { get; set; }
public uint ChapPlus { get; set; }
public uint FFwd { get; set; } //
public uint Pause { get; set; } //
public uint Play { get; set; } //
public uint Record { get; set; }
public uint Rewind { get; set; } //
public uint Stop { get; set; } //
public uint PowerOn { get; set; } //
public uint PowerOff { get; set; } //
public uint PowerToggle { get; set; } //
public uint HasKeypadAccessoryButton1 { get; set; }
public uint HasKeypadAccessoryButton2 { get; set; }
public uint KeypadAccessoryButton1Press { get; set; }
public uint KeypadAccessoryButton2Press { get; set; }
public uint HasDvr { get; set; }
public uint HasPresets { get; set; }
public uint HasNumeric { get; set; }
public uint HasDpad { get; set; }
#endregion
#region Analogs
#endregion
#region Strings
public uint Name { get; set; }
public uint LoadPresets { get; set; }
public uint KeypadAccessoryButton1Label { get; set; }
public uint KeypadAccessoryButton2Label { get; set; }
#endregion
public SetTopBoxControllerJoinMap()
{
PowerOn = 1;
PowerOff = 2;
PowerToggle = 3;
HasDpad = 4;
Up = 4;
Down = 5;
Left = 6;
Right = 7;
Select = 8;
Menu = 9;
Exit = 10;
HasNumeric = 11;
Digit0 = 11;
Digit1 = 12;
Digit2 = 13;
Digit3 = 14;
Digit4 = 15;
Digit5 = 16;
Digit6 = 17;
Digit7 = 18;
Digit8 = 19;
Digit9 = 20;
Dash = 21;
KeypadEnter = 22;
ChannelUp = 23;
ChannelDown = 24;
LastChannel = 25;
Guide = 26;
Info = 27;
Red = 28;
Green = 29;
Yellow = 30;
Blue = 31;
HasDvr = 32;
DvrList = 32;
Play = 33;
Pause = 34;
Stop = 35;
FFwd = 36;
Rewind = 37;
ChapPlus = 38;
ChapMinus = 39;
Replay = 40;
Record = 41;
HasKeypadAccessoryButton1 = 42;
KeypadAccessoryButton1Press = 42;
HasKeypadAccessoryButton2 = 43;
KeypadAccessoryButton2Press = 43;
Name = 1;
KeypadAccessoryButton1Label = 42;
KeypadAccessoryButton2Label = 43;
LoadPresets = 50;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
PowerOn += joinOffset;
PowerOff += joinOffset;
PowerToggle += joinOffset;
HasDpad += joinOffset;
Up += joinOffset;
Down += joinOffset;
Left += joinOffset;
Right += joinOffset;
Select += joinOffset;
Menu += joinOffset;
Exit += joinOffset;
HasNumeric += joinOffset;
Digit0 += joinOffset;
Digit1 += joinOffset;
Digit2 += joinOffset;
Digit3 += joinOffset;
Digit4 += joinOffset;
Digit5 += joinOffset;
Digit6 += joinOffset;
Digit7 += joinOffset;
Digit8 += joinOffset;
Digit9 += joinOffset;
Dash += joinOffset;
KeypadEnter += joinOffset;
ChannelUp += joinOffset;
ChannelDown += joinOffset;
LastChannel += joinOffset;
Guide += joinOffset;
Info += joinOffset;
Red += joinOffset;
Green += joinOffset;
Yellow += joinOffset;
Blue += joinOffset;
HasDvr += joinOffset;
DvrList += joinOffset;
Play += joinOffset;
Pause += joinOffset;
Stop += joinOffset;
FFwd += joinOffset;
Rewind += joinOffset;
ChapPlus += joinOffset;
ChapMinus += joinOffset;
Replay += joinOffset;
Record += joinOffset;
HasKeypadAccessoryButton1 += joinOffset;
KeypadAccessoryButton1Press += joinOffset;
HasKeypadAccessoryButton2 += joinOffset;
KeypadAccessoryButton2Press += joinOffset;
Name += joinOffset;
KeypadAccessoryButton1Label += joinOffset;
KeypadAccessoryButton2Label += joinOffset;
LoadPresets += joinOffset;
}
[JoinName("PowerOn")]
public JoinDataComplete PowerOn = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Power On", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("PowerOff")]
public JoinDataComplete PowerOff = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Power Off", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("PowerToggle")]
public JoinDataComplete PowerToggle = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Power Toggle", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("HasDpad")]
public JoinDataComplete HasDpad = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Has DPad", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("Up")]
public JoinDataComplete Up = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Nav Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Down")]
public JoinDataComplete Down = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Nav Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Left")]
public JoinDataComplete Left = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Nav Left", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Right")]
public JoinDataComplete Right = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Nav Right", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Select")]
public JoinDataComplete Select = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Select", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Menu")]
public JoinDataComplete Menu = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Menu", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Exit")]
public JoinDataComplete Exit = new JoinDataComplete(new JoinData() { JoinNumber = 10, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Exit", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("HasNumeric")]
public JoinDataComplete HasNumeric = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Has Numeric", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit0")]
public JoinDataComplete Digit0 = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 0", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit1")]
public JoinDataComplete Digit1 = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 1", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit2")]
public JoinDataComplete Digit2 = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 2", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit3")]
public JoinDataComplete Digit3 = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 3", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit4")]
public JoinDataComplete Digit4 = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 4", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit5")]
public JoinDataComplete Digit5 = new JoinDataComplete(new JoinData() { JoinNumber = 16, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 5", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit6")]
public JoinDataComplete Digit6 = new JoinDataComplete(new JoinData() { JoinNumber = 17, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 6", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit7")]
public JoinDataComplete Digit7 = new JoinDataComplete(new JoinData() { JoinNumber = 18, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 7", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit8")]
public JoinDataComplete Digit8 = new JoinDataComplete(new JoinData() { JoinNumber = 19, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 8", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Digit9")]
public JoinDataComplete Digit9 = new JoinDataComplete(new JoinData() { JoinNumber = 20, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Digit 9", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Dash")]
public JoinDataComplete Dash = new JoinDataComplete(new JoinData() { JoinNumber = 21, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Dash", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("KeypadEnter")]
public JoinDataComplete KeypadEnter = new JoinDataComplete(new JoinData() { JoinNumber = 22, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Keypad Enter", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ChannelUp")]
public JoinDataComplete ChannelUp = new JoinDataComplete(new JoinData() { JoinNumber = 23, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Channel Up", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ChannelDown")]
public JoinDataComplete ChannelDown = new JoinDataComplete(new JoinData() { JoinNumber = 24, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Channel Down", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("LastChannel")]
public JoinDataComplete LastChannel = new JoinDataComplete(new JoinData() { JoinNumber = 25, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Last Channel", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Guide")]
public JoinDataComplete Guide = new JoinDataComplete(new JoinData() { JoinNumber = 26, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Guide", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Info")]
public JoinDataComplete Info = new JoinDataComplete(new JoinData() { JoinNumber = 27, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Info", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Red")]
public JoinDataComplete Red = new JoinDataComplete(new JoinData() { JoinNumber = 28, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Red", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Green")]
public JoinDataComplete Green = new JoinDataComplete(new JoinData() { JoinNumber = 29, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Green", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Yellow")]
public JoinDataComplete Yellow = new JoinDataComplete(new JoinData() { JoinNumber = 30, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Yellow", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Blue")]
public JoinDataComplete Blue = new JoinDataComplete(new JoinData() { JoinNumber = 31, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Blue", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("HasDvr")]
public JoinDataComplete HasDvr = new JoinDataComplete(new JoinData() { JoinNumber = 32, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Has DVR", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("DvrList")]
public JoinDataComplete DvrList = new JoinDataComplete(new JoinData() { JoinNumber = 32, JoinSpan = 1 },
new JoinMetadata() { Label = "STB DvrList", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Play")]
public JoinDataComplete Play = new JoinDataComplete(new JoinData() { JoinNumber = 33, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Play", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Pause")]
public JoinDataComplete Pause = new JoinDataComplete(new JoinData() { JoinNumber = 34, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Pause", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Stop")]
public JoinDataComplete Stop = new JoinDataComplete(new JoinData() { JoinNumber = 35, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Stop", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("FFwd")]
public JoinDataComplete FFwd = new JoinDataComplete(new JoinData() { JoinNumber = 36, JoinSpan = 1 },
new JoinMetadata() { Label = "STB FFwd", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Rewind")]
public JoinDataComplete Rewind = new JoinDataComplete(new JoinData() { JoinNumber = 37, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Rewind", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ChapPlus")]
public JoinDataComplete ChapPlus = new JoinDataComplete(new JoinData() { JoinNumber = 38, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Chapter Plus", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ChapMinus")]
public JoinDataComplete ChapMinus = new JoinDataComplete(new JoinData() { JoinNumber = 39, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Chapter Minus", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Replay")]
public JoinDataComplete Replay = new JoinDataComplete(new JoinData() { JoinNumber = 40, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Replay", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Record")]
public JoinDataComplete Record = new JoinDataComplete(new JoinData() { JoinNumber = 41, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Record", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("HasKeypadAccessoryButton1")]
public JoinDataComplete HasKeypadAccessoryButton1 = new JoinDataComplete(new JoinData() { JoinNumber = 42, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Has Keypad Accessory Button 1", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("HasKeypadAccessoryButton2")]
public JoinDataComplete HasKeypadAccessoryButton2 = new JoinDataComplete(new JoinData() { JoinNumber = 43, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Has Keypad Accessory Button 2", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("KeypadAccessoryButton1Press")]
public JoinDataComplete KeypadAccessoryButton1Press = new JoinDataComplete(new JoinData() { JoinNumber = 42, JoinSpan = 2 },
new JoinMetadata() { Label = "STB Keypad Accessory Button 1 Press", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("KeypadAccessoryButton2Press")]
public JoinDataComplete KeypadAccessoryButton2Press = new JoinDataComplete(new JoinData() { JoinNumber = 43, JoinSpan = 2 },
new JoinMetadata() { Label = "STB Keypad Accessory Button 2 Press", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("Name")]
public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("KeypadAccessoryButton1Label")]
public JoinDataComplete KeypadAccessoryButton1Label = new JoinDataComplete(new JoinData() { JoinNumber = 42, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Keypad Accessory Button 1 Label", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("KeypadAccessoryButton2Label")]
public JoinDataComplete KeypadAccessoryButton2Label = new JoinDataComplete(new JoinData() { JoinNumber = 43, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Keypad Accessory Button 1 Label", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("LoadPresets")]
public JoinDataComplete LoadPresets = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Load Presets", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
[JoinName("HasPresets")]
public JoinDataComplete HasPresets = new JoinDataComplete(new JoinData() { JoinNumber = 50, JoinSpan = 1 },
new JoinMetadata() { Label = "STB Load Presets", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
public SetTopBoxControllerJoinMap(uint joinStart)
: base(joinStart, typeof(SetTopBoxControllerJoinMap))
{
}
}
}

View File

@@ -4,46 +4,45 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class StatusSignControllerJoinMap:JoinMapBase
public class StatusSignControllerJoinMap : JoinMapBaseAdvanced
{
public uint IsOnline { get; set; }
public uint Name { get; set; }
public uint RedLed { get; set; }
public uint GreenLed { get; set; }
public uint BlueLed { get; set; }
public uint RedControl { get; set; }
public uint GreenControl { get; set; }
public uint BlueControl { get; set; }
public StatusSignControllerJoinMap()
{
//digital
IsOnline = 1;
RedControl = 2;
GreenControl = 3;
BlueControl = 4;
//Analog
RedLed = 2;
GreenLed = 3;
BlueLed = 4;
//string
Name = 1;
[JoinName("IsOnline")]
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Status Sign Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
[JoinName("Name")]
public JoinDataComplete Name = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Status Sign Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("RedControl")]
public JoinDataComplete RedControl = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Status Red LED Enable / Disable", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("RedLed")]
public JoinDataComplete RedLed = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Status Red LED Intensity", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("GreenControl")]
public JoinDataComplete GreenControl = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Status Green LED Enable / Disable", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("GreenLed")]
public JoinDataComplete GreenLed = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Status Green LED Intensity", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
[JoinName("BlueControl")]
public JoinDataComplete BlueControl = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Status Blue LED Enable / Disable", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("BlueLed")]
public JoinDataComplete BlueLed = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Status Blue LED Intensity", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
public StatusSignControllerJoinMap(uint joinStart)
: base(joinStart, typeof(StatusSignControllerJoinMap))
{
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
var properties =
GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof (uint)).ToList();
foreach (var propertyInfo in properties)
{
propertyInfo.SetValue(this, (uint) propertyInfo.GetValue(this, null) + joinOffset, null);
}
}
}
}

View File

@@ -1,225 +1,141 @@
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class SystemMonitorJoinMap : JoinMapBase
{
/// <summary>
/// Offset to indicate where the range of iterated program joins will start
/// </summary>
public uint ProgramStartJoin { get; set; }
/// <summary>
/// Offset to indicate where the range of iterated Ethernet joins will start
/// </summary>
public uint EthernetStartJoin { get; set; }
/// <summary>
/// Offset between each program join set
/// </summary>
public uint ProgramOffsetJoin { get; set; }
/// <summary>
/// Offset between each Ethernet Interface join set
/// </summary>
public uint EthernetOffsetJoin { get; set; }
#region Digitals
/// <summary>
/// Range Sets and reports whether the corresponding program slot is started
/// </summary>
public uint ProgramStart { get; set; }
/// <summary>
/// Range Sets and reports whether the corresponding program slot is stopped
/// </summary>
public uint ProgramStop { get; set; }
/// <summary>
/// Range Sets and reports whether the corresponding program is registered
/// </summary>
public uint ProgramRegister { get; set; }
/// <summary>
/// Range Sets and reports whether the corresponding program is unregistered
/// </summary>
public uint ProgramUnregister { get; set; }
#endregion
#region Analogs
/// <summary>
/// Sets and reports the time zone
/// </summary>
public uint TimeZone { get; set; }
#endregion
#region Serials
/// <summary>
/// Reports the time zone name
/// </summary>
public uint TimeZoneName { get; set; }
/// <summary>
/// Reports the IO Controller Version
/// </summary>
public uint IOControllerVersion { get; set; }
/// <summary>
/// Reports the SNMP App Version
/// </summary>
public uint SnmpAppVersion { get; set; }
/// <summary>
/// Reports the BACnet App Version
/// </summary>
public uint BACnetAppVersion { get; set; }
/// <summary>
/// Reports the firmware version
/// </summary>
public uint ControllerVersion { get; set; }
/// <summary>
/// Reports the name of the corresponding program
/// </summary>
public uint ProgramName { get; set; }
/// <summary>
/// Reports the compile time of the corresponding program
/// </summary>
public uint ProgramCompiledTime { get; set; }
/// <summary>
/// Reports the Crestron Database version of the corresponding program
/// </summary>
public uint ProgramCrestronDatabaseVersion { get; set; }
/// <summary>
/// Reports the Environment Version of the corresponding program
/// </summary>
public uint ProgramEnvironmentVersion { get; set; }
/// <summary>
/// Serialized JSON output that aggregates the program info of the corresponding program
/// </summary>
public uint AggregatedProgramInfo { get; set; }
/// <summary>
/// Reports the controller serial number
/// </summary>
public uint SerialNumber { get; set; }
/// <summary>
/// Reports the controller model
/// </summary>
public uint Model { get; set; }
/// <summary>
/// Reports the Host name set on the corresponding interface
/// </summary>
public uint HostName { get; set; }
/// <summary>
/// Reports the Current IP address set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned address.
/// </summary>
public uint CurrentIpAddress { get; set; }
/// <summary>
/// Reporst the Current Default Gateway set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned gateway
/// </summary>
public uint CurrentDefaultGateway { get; set; }
/// <summary>
/// Reports the Current Subnet Mask set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned subnet mask
/// </summary>
public uint CurrentSubnetMask { get; set; }
/// <summary>
/// Reports the Static IP address set on the corresponding interface. If DHCP is disabled, this will match the Current IP address
/// </summary>
public uint StaticIpAddress { get; set; }
/// <summary>
/// Reporst the Static Default Gateway set on the corresponding interface. If DHCP is disabled, this will match the Current gateway
/// </summary>
public uint StaticDefaultGateway { get; set; }
/// <summary>
/// Reports the Current Subnet Mask set on the corresponding interface. If DHCP is enabled, this will be the DHCP assigned subnet mask
/// </summary>
public uint StaticSubnetMask { get; set; }
/// <summary>
/// Reports the current DomainFeedback on the corresponding interface
/// </summary>
public uint Domain { get; set; }
/// <summary>
/// Reports the current DNS Servers on the corresponding interface
/// </summary>
public uint DnsServer { get; set; }
/// <summary>
/// Reports the MAC Address of the corresponding interface
/// </summary>
public uint MacAddress { get; set; }
/// <summary>
/// Reports the DHCP Status of the corresponding interface
/// </summary>
public uint DhcpStatus { get; set; }
/// <summary>
/// Reports the current uptime. Updated in 5 minute intervals.
/// </summary>
public uint Uptime { get; set; }
/// <summary>
/// Reports the date of the last boot
/// </summary>
public uint LastBoot { get; set; }
#endregion
public SystemMonitorJoinMap()
{
TimeZone = 1;
TimeZoneName = 1;
IOControllerVersion = 2;
SnmpAppVersion = 3;
BACnetAppVersion = 4;
ControllerVersion = 5;
SerialNumber = 6;
Model = 7;
Uptime = 8;
LastBoot = 9;
ProgramStartJoin = 10;
ProgramOffsetJoin = 5;
// Offset in groups of 5 joins
ProgramStart = 1;
ProgramStop = 2;
ProgramRegister = 3;
ProgramUnregister = 4;
ProgramName = 1;
ProgramCompiledTime = 2;
ProgramCrestronDatabaseVersion = 3;
ProgramEnvironmentVersion = 4;
AggregatedProgramInfo = 5;
EthernetStartJoin = 75;
EthernetOffsetJoin = 15;
// Offset in groups of 15
HostName = 1;
CurrentIpAddress = 2;
CurrentSubnetMask = 3;
CurrentDefaultGateway = 4;
StaticIpAddress = 5;
StaticSubnetMask = 6;
StaticDefaultGateway = 7;
Domain = 8;
DnsServer = 9;
MacAddress = 10;
DhcpStatus = 11;
}
public override void OffsetJoinNumbers(uint joinStart)
{
var joinOffset = joinStart - 1;
TimeZone = TimeZone + joinOffset;
TimeZoneName = TimeZoneName + joinOffset;
IOControllerVersion = IOControllerVersion + joinOffset;
SnmpAppVersion = SnmpAppVersion + joinOffset;
BACnetAppVersion = BACnetAppVersion + joinOffset;
ControllerVersion = ControllerVersion + joinOffset;
// Sets the initial join value where the iterated program joins will begin
ProgramStartJoin = ProgramStartJoin + joinOffset;
EthernetStartJoin = EthernetStartJoin + joinOffset;
}
}
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.Bridges
{
public class SystemMonitorJoinMap : JoinMapBaseAdvanced
{
[JoinName("TimeZone")]
public JoinDataComplete TimeZone = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Timezone", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
[JoinName("TimeZoneName")]
public JoinDataComplete TimeZoneName = new JoinDataComplete(new JoinData() { JoinNumber = 1, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Timezone Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("IOControllerVersion")]
public JoinDataComplete IOControllerVersion = new JoinDataComplete(new JoinData() { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor IO Controller Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("SnmpAppVersion")]
public JoinDataComplete SnmpAppVersion = new JoinDataComplete(new JoinData() { JoinNumber = 3, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor SNMP App Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("BACnetAppVersion")]
public JoinDataComplete BACnetAppVersion = new JoinDataComplete(new JoinData() { JoinNumber = 4, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor BACNet App Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("ControllerVersion")]
public JoinDataComplete ControllerVersion = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Controller Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("SerialNumber")]
public JoinDataComplete SerialNumber = new JoinDataComplete(new JoinData() { JoinNumber = 6, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Serial Number", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("Model")]
public JoinDataComplete Model = new JoinDataComplete(new JoinData() { JoinNumber = 7, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Model", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("Uptime")]
public JoinDataComplete Uptime = new JoinDataComplete(new JoinData() { JoinNumber = 8, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Uptime", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("LastBoot")]
public JoinDataComplete LastBoot = new JoinDataComplete(new JoinData() { JoinNumber = 9, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Last Boot", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("ProgramOffsetJoin")]
public JoinDataComplete ProgramOffsetJoin = new JoinDataComplete(new JoinData() { JoinNumber = 5, JoinSpan = 1 },
new JoinMetadata() { Label = "All Program Data is offset between slots by 5 - First Joins Start at 11", JoinCapabilities = eJoinCapabilities.None, JoinType = eJoinType.None });
[JoinName("ProgramStart")]
public JoinDataComplete ProgramStart = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program Start / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ProgramStop")]
public JoinDataComplete ProgramStop = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program Stop / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ProgramRegister")]
public JoinDataComplete ProgramRegister = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program Register / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ProgramUnregister")]
public JoinDataComplete ProgramUnregister = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program UnRegister / Fb", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
[JoinName("ProgramName")]
public JoinDataComplete ProgramName = new JoinDataComplete(new JoinData() { JoinNumber = 11, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("ProgramCompiledTime")]
public JoinDataComplete ProgramCompiledTime = new JoinDataComplete(new JoinData() { JoinNumber = 12, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program Compile Time", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("ProgramCrestronDatabaseVersion")]
public JoinDataComplete ProgramCrestronDatabaseVersion = new JoinDataComplete(new JoinData() { JoinNumber = 13, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program Database Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("ProgramEnvironmentVersion")]
public JoinDataComplete ProgramEnvironmentVersion = new JoinDataComplete(new JoinData() { JoinNumber = 14, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program Environment Version", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("AggregatedProgramInfo")]
public JoinDataComplete AggregatedProgramInfo = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Program Aggregate Info Json", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("EthernetOffsetJoin")]
public JoinDataComplete EthernetOffsetJoin = new JoinDataComplete(new JoinData() { JoinNumber = 15, JoinSpan = 1 },
new JoinMetadata() { Label = "All Ethernet Data is offset between Nics by 5 - First Joins Start at 76", JoinCapabilities = eJoinCapabilities.None, JoinType = eJoinType.None });
[JoinName("HostName")]
public JoinDataComplete HostName = new JoinDataComplete(new JoinData() { JoinNumber = 76, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Hostname", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("CurrentIpAddress")]
public JoinDataComplete CurrentIpAddress = new JoinDataComplete(new JoinData() { JoinNumber = 77, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Current Ip Address", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("CurrentSubnetMask")]
public JoinDataComplete CurrentSubnetMask = new JoinDataComplete(new JoinData() { JoinNumber = 78, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Current Subnet Mask", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("CurrentDefaultGateway")]
public JoinDataComplete CurrentDefaultGateway = new JoinDataComplete(new JoinData() { JoinNumber = 79, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Current Default Gateway", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("StaticIpAddress")]
public JoinDataComplete StaticIpAddress = new JoinDataComplete(new JoinData() { JoinNumber = 80, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Static Ip Address", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("StaticSubnetMask")]
public JoinDataComplete StaticSubnetMask = new JoinDataComplete(new JoinData() { JoinNumber = 81, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Static Subnet Mask", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("StaticDefaultGateway")]
public JoinDataComplete StaticDefaultGateway = new JoinDataComplete(new JoinData() { JoinNumber = 82, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Static Default Gateway", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("Domain")]
public JoinDataComplete Domain = new JoinDataComplete(new JoinData() { JoinNumber = 83, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Domain", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("DnsServer")]
public JoinDataComplete DnsServer = new JoinDataComplete(new JoinData() { JoinNumber = 84, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Dns Server", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("MacAddress")]
public JoinDataComplete MacAddress = new JoinDataComplete(new JoinData() { JoinNumber = 85, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Mac Address", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
[JoinName("DhcpStatus")]
public JoinDataComplete DhcpStatus = new JoinDataComplete(new JoinData() { JoinNumber = 86, JoinSpan = 1 },
new JoinMetadata() { Label = "Processor Ethernet Dhcp Status", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
public SystemMonitorJoinMap(uint joinStart)
: base(joinStart, typeof(SystemMonitorJoinMap))
{
}
}
}

View File

@@ -20,6 +20,17 @@ namespace PepperDash.Essentials.Core
ICec Port;
public CecPortController(string key, Func<EssentialsControlPropertiesConfig, ICec> postActivationFunc,
EssentialsControlPropertiesConfig config):base(key)
{
AddPostActivationAction(() =>
{
Port = postActivationFunc(config);
Port.StreamCec.CecChange += StreamCec_CecChange;
});
}
public CecPortController(string key, ICec port)
: base(key)
{

View File

@@ -21,6 +21,19 @@ namespace PepperDash.Essentials.Core
ComPort Port;
ComPort.ComPortSpec Spec;
public ComPortController(string key, Func<EssentialsControlPropertiesConfig, ComPort> postActivationFunc,
ComPort.ComPortSpec spec, EssentialsControlPropertiesConfig config) : base(key)
{
Spec = spec;
AddPostActivationAction(() =>
{
Port = postActivationFunc(config);
RegisterAndConfigureComPort();
});
}
public ComPortController(string key, ComPort port, ComPort.ComPortSpec spec)
: base(key)
{
@@ -34,27 +47,31 @@ namespace PepperDash.Essentials.Core
Spec = spec;
//IsConnected = new BoolFeedback(CommonBoolCue.IsConnected, () => true);
if (Port.Parent is CrestronControlSystem)
{
var result = Port.Register();
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(0, this, "ERROR: Cannot register Com port: {0}", result);
return; // false
}
}
var specResult = Port.SetComPortSpec(Spec);
if (specResult != 0)
{
Debug.Console(0, this, "WARNING: Cannot set comspec");
return; // false
}
Port.SerialDataReceived += new ComPortDataReceivedEvent(Port_SerialDataReceived);
RegisterAndConfigureComPort();
}
~ComPortController()
private void RegisterAndConfigureComPort()
{
if (Port.Parent is CrestronControlSystem)
{
var result = Port.Register();
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(0, this, "ERROR: Cannot register Com port: {0}", result);
return; // false
}
}
var specResult = Port.SetComPortSpec(Spec);
if (specResult != 0)
{
Debug.Console(0, this, "WARNING: Cannot set comspec");
return;
}
Port.SerialDataReceived += Port_SerialDataReceived;
}
~ComPortController()
{
Port.SerialDataReceived -= Port_SerialDataReceived;
}

View File

@@ -48,10 +48,10 @@ namespace PepperDash.Essentials.Core
switch (controlConfig.Method)
{
case eControlMethod.Com:
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort(controlConfig), controlConfig.ComParams);
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort, controlConfig.ComParams, controlConfig);
break;
case eControlMethod.Cec:
comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort(controlConfig));
comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort, controlConfig);
break;
case eControlMethod.IR:
break;

View File

@@ -5,10 +5,12 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
public class ConsoleCommMockDevice : Device, ICommunicationMonitor
public class ConsoleCommMockDevice : EssentialsDevice, ICommunicationMonitor
{
public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; }
@@ -71,4 +73,21 @@ namespace PepperDash.Essentials.Core
}
}
public class ConsoleCommMockDeviceFactory : EssentialsDeviceFactory<ConsoleCommMockDevice>
{
public ConsoleCommMockDeviceFactory()
{
TypeNames = new List<string>() { "commmock" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Comm Mock Device");
var comm = CommFactory.CreateCommForDevice(dc);
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<ConsoleCommMockDevicePropertiesConfig>(
dc.Properties.ToString());
return new ConsoleCommMockDevice(dc.Key, dc.Name, props, comm);
}
}
}

View File

@@ -1,124 +1,135 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharp.CrestronSockets;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Serves as a generic wrapper class for all styles of IBasicCommuncation ports
/// </summary>
public class GenericComm : ReconfigurableBridgableDevice
{
EssentialsControlPropertiesConfig PropertiesConfig;
public IBasicCommunication CommPort { get; private set; }
public GenericComm(DeviceConfig config)
: base(config)
{
PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
CommPort = CommFactory.CreateCommForDevice(config);
}
public static IKeyed BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
return new GenericComm(dc);
}
public void SetPortConfig(string portConfig)
{
// TODO: Deserialize new EssentialsControlPropertiesConfig and handle as necessary
try
{
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsControlPropertiesConfig>
(portConfig);
}
catch (Exception e)
{
Debug.Console(2, this, "Error deserializing port config: {0}", e);
}
}
protected override void CustomSetConfig(DeviceConfig config)
{
PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
ConfigWriter.UpdateDeviceConfig(config);
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new IBasicCommunicationJoinMap();
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<IBasicCommunicationJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
if (CommPort == null)
{
Debug.Console(1, this, "Unable to link device '{0}'. CommPort is null", Key);
return;
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
// this is a permanent event handler. This cannot be -= from event
CommPort.TextReceived += (s, a) =>
{
Debug.Console(2, this, "RX: {0}", a.Text);
trilist.SetString(joinMap.TextReceived, a.Text);
};
trilist.SetStringSigAction(joinMap.SendText, s => CommPort.SendText(s));
trilist.SetStringSigAction(joinMap.SetPortConfig, SetPortConfig);
var sComm = this as ISocketStatus;
if (sComm == null) return;
sComm.ConnectionChange += (s, a) =>
{
trilist.SetUshort(joinMap.Status, (ushort)(a.Client.ClientStatus));
trilist.SetBool(joinMap.Connected, a.Client.ClientStatus ==
SocketStatus.SOCKET_STATUS_CONNECTED);
};
trilist.SetBoolSigAction(joinMap.Connect, b =>
{
if (b)
{
sComm.Connect();
}
else
{
sComm.Disconnect();
}
});
}
}
public class GenericCommFactory : EssentialsDeviceFactory<GenericComm>
{
public GenericCommFactory()
{
TypeNames = new List<string>() { "genericComm" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
return new GenericComm(dc);
}
}
using System;
using System.Collections.Generic;
using Crestron.SimplSharp.CrestronSockets;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Devices;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Serves as a generic wrapper class for all styles of IBasicCommuncation ports
/// </summary>
[Description("Generic communication wrapper class for any IBasicCommunication type")]
public class GenericComm : ReconfigurableBridgableDevice
{
EssentialsControlPropertiesConfig PropertiesConfig;
public IBasicCommunication CommPort { get; private set; }
public GenericComm(DeviceConfig config)
: base(config)
{
PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
var commPort = CommFactory.CreateCommForDevice(config);
//Fixing decision to require '-comPorts' in delcaration for DGE in order to get a device with comports included
if (commPort == null)
{
config.Key = config.Key + "-comPorts";
commPort = CommFactory.CreateCommForDevice(config);
}
CommPort = commPort;
}
public static IKeyed BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
return new GenericComm(dc);
}
public void SetPortConfig(string portConfig)
{
// TODO: Deserialize new EssentialsControlPropertiesConfig and handle as necessary
try
{
PropertiesConfig = JsonConvert.DeserializeObject<EssentialsControlPropertiesConfig>
(portConfig);
}
catch (Exception e)
{
Debug.Console(2, this, "Error deserializing port config: {0}", e);
}
}
protected override void CustomSetConfig(DeviceConfig config)
{
PropertiesConfig = CommFactory.GetControlPropertiesConfig(config);
ConfigWriter.UpdateDeviceConfig(config);
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new IBasicCommunicationJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<IBasicCommunicationJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (CommPort == null)
{
Debug.Console(1, this, "Unable to link device '{0}'. CommPort is null", Key);
return;
}
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
// this is a permanent event handler. This cannot be -= from event
CommPort.TextReceived += (s, a) =>
{
Debug.Console(2, this, "RX: {0}", a.Text);
trilist.SetString(joinMap.TextReceived.JoinNumber, a.Text);
};
trilist.SetStringSigAction(joinMap.SendText.JoinNumber, s => CommPort.SendText(s));
trilist.SetStringSigAction(joinMap.SetPortConfig.JoinNumber, SetPortConfig);
var sComm = CommPort as ISocketStatus;
if (sComm == null) return;
sComm.ConnectionChange += (s, a) =>
{
trilist.SetUshort(joinMap.Status.JoinNumber, (ushort)(a.Client.ClientStatus));
trilist.SetBool(joinMap.Connected.JoinNumber, a.Client.ClientStatus ==
SocketStatus.SOCKET_STATUS_CONNECTED);
};
trilist.SetBoolSigAction(joinMap.Connect.JoinNumber, b =>
{
if (b)
{
sComm.Connect();
}
else
{
sComm.Disconnect();
}
});
}
}
public class GenericCommFactory : EssentialsDeviceFactory<GenericComm>
{
public GenericCommFactory()
{
TypeNames = new List<string>() { "genericComm" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
return new GenericComm(dc);
}
}
}

View File

@@ -1,68 +1,92 @@
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core.CrestronIO
{
public class C2nRthsController:CrestronGenericBridgeableBaseDevice
{
private readonly C2nRths _device;
public IntFeedback TemperatureFeedback { get; private set; }
public IntFeedback HumidityFeedback { get; private set; }
public C2nRthsController(string key, string name, GenericBase hardware) : base(key, name, hardware)
{
_device = hardware as C2nRths;
TemperatureFeedback = new IntFeedback(() => _device.TemperatureFeedback.UShortValue);
HumidityFeedback = new IntFeedback(() => _device.HumidityFeedback.UShortValue);
if (_device != null) _device.BaseEvent += DeviceOnBaseEvent;
}
private void DeviceOnBaseEvent(GenericBase device, BaseEventArgs args)
{
switch (args.EventId)
{
case C2nRths.TemperatureFeedbackEventId:
TemperatureFeedback.FireUpdate();
break;
case C2nRths.HumidityFeedbackEventId:
HumidityFeedback.FireUpdate();
break;
}
}
public void SetTemperatureFormat(bool setToC)
{
_device.TemperatureFormat.BoolValue = setToC;
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new C2nRthsControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<C2nRthsControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
trilist.SetBoolSigAction(joinMap.TemperatureFormat, SetTemperatureFormat);
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
TemperatureFeedback.LinkInputSig(trilist.UShortInput[joinMap.Temperature]);
HumidityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Humidity]);
trilist.StringInput[joinMap.Name].StringValue = Name;
}
}
using System.Collections.Generic;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
[Description("Wrapper class for the C2N-RTHS sensor")]
public class C2nRthsController : CrestronGenericBridgeableBaseDevice
{
private readonly C2nRths _device;
public IntFeedback TemperatureFeedback { get; private set; }
public IntFeedback HumidityFeedback { get; private set; }
public C2nRthsController(string key, string name, GenericBase hardware) : base(key, name, hardware)
{
_device = hardware as C2nRths;
TemperatureFeedback = new IntFeedback(() => _device.TemperatureFeedback.UShortValue);
HumidityFeedback = new IntFeedback(() => _device.HumidityFeedback.UShortValue);
if (_device != null) _device.BaseEvent += DeviceOnBaseEvent;
}
private void DeviceOnBaseEvent(GenericBase device, BaseEventArgs args)
{
switch (args.EventId)
{
case C2nRths.TemperatureFeedbackEventId:
TemperatureFeedback.FireUpdate();
break;
case C2nRths.HumidityFeedbackEventId:
HumidityFeedback.FireUpdate();
break;
}
}
public void SetTemperatureFormat(bool setToC)
{
_device.TemperatureFormat.BoolValue = setToC;
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new C2nRthsControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<C2nRthsControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
trilist.SetBoolSigAction(joinMap.TemperatureFormat.JoinNumber, SetTemperatureFormat);
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
TemperatureFeedback.LinkInputSig(trilist.UShortInput[joinMap.Temperature.JoinNumber]);
HumidityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Humidity.JoinNumber]);
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
}
}
public class C2nRthsControllerFactory : EssentialsDeviceFactory<C2nRthsController>
{
public C2nRthsControllerFactory()
{
TypeNames = new List<string>() { "c2nrths" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new C2N-RTHS Device");
var control = CommFactory.GetControlPropertiesConfig(dc);
var cresnetId = control.CresnetIdInt;
return new C2nRthsController(dc.Key, dc.Name, new C2nRths(cresnetId, Global.ControlSystem));
}
}
}

View File

@@ -5,6 +5,8 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Essentials.Core.Config;
using PepperDash.Core;
@@ -13,7 +15,8 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Wrapper class for CEN-IO-DIGIN-104 digital input module
/// </summary>
public class CenIoDigIn104Controller : Device, IDigitalInputPorts
[Description("Wrapper class for the CEN-IO-DIGIN-104 diginal input module")]
public class CenIoDigIn104Controller : EssentialsDevice, IDigitalInputPorts
{
public CenIoDi104 Di104 { get; private set; }
@@ -37,4 +40,23 @@ namespace PepperDash.Essentials.Core
#endregion
}
public class CenIoDigIn104ControllerFactory : EssentialsDeviceFactory<CenIoDigIn104Controller>
{
public CenIoDigIn104ControllerFactory()
{
TypeNames = new List<string>() { "ceniodigin104" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new CEN-DIGIN-104 Device");
var control = CommFactory.GetControlPropertiesConfig(dc);
var ipid = control.IpIdInt;
return new CenIoDigIn104Controller(dc.Key, dc.Name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem));
}
}
}

View File

@@ -8,6 +8,8 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
@@ -42,22 +44,22 @@ namespace PepperDash.Essentials.Core.CrestronIO
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new IDigitalInputJoinMap();
{
var joinMap = new IDigitalInputJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<IDigitalInputJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap = JsonConvert.DeserializeObject<IDigitalInputJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
try
{
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
// Link feedback for input state
InputStateFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputState]);
InputStateFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputState.JoinNumber]);
}
catch (Exception e)
{
@@ -66,4 +68,95 @@ namespace PepperDash.Essentials.Core.CrestronIO
}
}
}
public class GenericDigitalInputDeviceFactory : EssentialsDeviceFactory<GenericDigitalInputDevice>
{
public GenericDigitalInputDeviceFactory()
{
TypeNames = new List<string>() { "digitalinput" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Digtal Input Device");
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
IDigitalInputPorts portDevice;
if (props.PortDeviceKey == "processor")
portDevice = Global.ControlSystem as IDigitalInputPorts;
else
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IDigitalInputPorts;
if (portDevice == null)
Debug.Console(0, "ERROR: Unable to add digital input device with key '{0}'. Port Device does not support digital inputs", dc.Key);
else
{
var cs = (portDevice as CrestronControlSystem);
if (cs == null)
{
Debug.Console(0, "ERROR: Port device for [{0}] is not control system", props.PortDeviceKey);
return null;
}
if (cs.SupportsVersiport)
{
Debug.Console(1, "Attempting to add Digital Input device to Versiport port '{0}'", props.PortNumber);
if (props.PortNumber > cs.NumberOfVersiPorts)
{
Debug.Console(0, "WARNING: Cannot add Vesiport {0} on {1}. Out of range",
props.PortNumber, props.PortDeviceKey);
return null;
}
Versiport vp = cs.VersiPorts[props.PortNumber];
if (!vp.Registered)
{
var regSuccess = vp.Register();
if (regSuccess == eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(1, "Successfully Created Digital Input Device on Versiport");
return new GenericVersiportDigitalInputDevice(dc.Key, vp, props);
}
else
{
Debug.Console(0, "WARNING: Attempt to register versiport {0} on device with key '{1}' failed: {2}",
props.PortNumber, props.PortDeviceKey, regSuccess);
return null;
}
}
}
else if (cs.SupportsDigitalInput)
{
Debug.Console(1, "Attempting to add Digital Input device to Digital Input port '{0}'", props.PortNumber);
if (props.PortNumber > cs.NumberOfDigitalInputPorts)
{
Debug.Console(0, "WARNING: Cannot register DIO port {0} on {1}. Out of range",
props.PortNumber, props.PortDeviceKey);
return null;
}
DigitalInput digitalInput = cs.DigitalInputPorts[props.PortNumber];
if (!digitalInput.Registered)
{
if (digitalInput.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(1, "Successfully Created Digital Input Device on Digital Input");
return new GenericDigitalInputDevice(dc.Key, digitalInput);
}
else
Debug.Console(0, "WARNING: Attempt to register digital input {0} on device with key '{1}' failed.",
props.PortNumber, props.PortDeviceKey);
}
}
}
return null;
}
}
}

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
/// <summary>
/// Represents a generic digital input deviced tied to a versiport
/// </summary>
public class GenericVersiportDigitalInputDevice : Device, IDigitalInput
public class GenericVersiportDigitalInputDevice : EssentialsDevice, IDigitalInput
{
public Versiport InputPort { get; private set; }

View File

@@ -8,6 +8,7 @@ using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
@@ -69,15 +70,15 @@ namespace PepperDash.Essentials.Core.CrestronIO
#endregion
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new GenericRelayControllerJoinMap();
{
var joinMap = new GenericRelayControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GenericRelayControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap = JsonConvert.DeserializeObject<GenericRelayControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
if (RelayOutput == null)
{
@@ -87,7 +88,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
trilist.SetBoolSigAction(joinMap.Relay, b =>
trilist.SetBoolSigAction(joinMap.Relay.JoinNumber, b =>
{
if (b)
CloseRelay();
@@ -97,7 +98,77 @@ namespace PepperDash.Essentials.Core.CrestronIO
// feedback for relay state
OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay]);
OutputIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.Relay.JoinNumber]);
}
}
public class GenericRelayDeviceFactory : EssentialsDeviceFactory<GenericRelayDevice>
{
public GenericRelayDeviceFactory()
{
TypeNames = new List<string>() { "relayoutput" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic Relay Device");
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
var key = dc.Key;
IRelayPorts portDevice;
if (props.PortDeviceKey == "processor")
portDevice = Global.ControlSystem as IRelayPorts;
else
portDevice = DeviceManager.GetDeviceForKey(props.PortDeviceKey) as IRelayPorts;
if (portDevice == null)
Debug.Console(0, "Unable to add relay device with key '{0}'. Port Device does not support relays", key);
else
{
var cs = (portDevice as CrestronControlSystem);
if (cs != null)
{
// The relay is on a control system processor
if (!cs.SupportsRelay || props.PortNumber > cs.NumberOfRelayPorts)
{
Debug.Console(0, "Port Device: {0} does not support relays or does not have enough relays");
return null;
}
}
else
{
// The relay is on another device type
if (props.PortNumber > portDevice.NumberOfRelayPorts)
{
Debug.Console(0, "Port Device: {0} does not have enough relays");
return null;
}
}
Relay relay = portDevice.RelayPorts[props.PortNumber];
if (!relay.Registered)
{
if (relay.Register() == eDeviceRegistrationUnRegistrationResponse.Success)
return new GenericRelayDevice(key, relay);
else
Debug.Console(0, "Attempt to register relay {0} on device with key '{1}' failed.", props.PortNumber, props.PortDeviceKey);
}
else
{
return new GenericRelayDevice(key, relay);
}
// Future: Check if portDevice is 3-series card or other non control system that supports versiports
}
return null;
}
}
}

View File

@@ -1,161 +1,182 @@
using System;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core.CrestronIO
{
public class StatusSignController:CrestronGenericBridgeableBaseDevice
{
private readonly StatusSign _device;
public BoolFeedback RedLedEnabledFeedback { get; private set; }
public BoolFeedback GreenLedEnabledFeedback { get; private set; }
public BoolFeedback BlueLedEnabledFeedback { get; private set; }
public IntFeedback RedLedBrightnessFeedback { get; private set; }
public IntFeedback GreenLedBrightnessFeedback { get; private set; }
public IntFeedback BlueLedBrightnessFeedback { get; private set; }
public StatusSignController(string key, string name, GenericBase hardware) : base(key, name, hardware)
{
_device = hardware as StatusSign;
RedLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Red]
.ControlFeedback.BoolValue);
GreenLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Green]
.ControlFeedback.BoolValue);
BlueLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Blue]
.ControlFeedback.BoolValue);
RedLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Red].BrightnessFeedback);
GreenLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Green].BrightnessFeedback);
BlueLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Blue].BrightnessFeedback);
if (_device != null) _device.BaseEvent += _device_BaseEvent;
}
void _device_BaseEvent(GenericBase device, BaseEventArgs args)
{
switch (args.EventId)
{
case StatusSign.LedBrightnessFeedbackEventId:
RedLedBrightnessFeedback.FireUpdate();
GreenLedBrightnessFeedback.FireUpdate();
BlueLedBrightnessFeedback.FireUpdate();
break;
case StatusSign.LedControlFeedbackEventId:
RedLedEnabledFeedback.FireUpdate();
GreenLedEnabledFeedback.FireUpdate();
BlueLedEnabledFeedback.FireUpdate();
break;
}
}
public void EnableLedControl(bool red, bool green, bool blue)
{
_device.Leds[(uint) StatusSign.Led.eLedColor.Red].Control.BoolValue = red;
_device.Leds[(uint)StatusSign.Led.eLedColor.Green].Control.BoolValue = green;
_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Control.BoolValue = blue;
}
public void SetColor(uint red, uint green, uint blue)
{
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Red].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(red);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Red LED brightness. value: {0}", red);
}
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Green].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(green);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Green LED brightness. value: {0}", green);
}
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(blue);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Blue LED brightness. value: {0}", blue);
}
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new StatusSignControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<StatusSignControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, this));
trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, this));
trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, this));
trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, this));
trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, this));
trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, this));
trilist.StringInput[joinMap.Name].StringValue = Name;
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
}
private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
StatusSignController device)
{
var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
device.EnableLedControl(redEnable, greenEnable, blueEnable);
}
private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
StatusSignController device)
{
var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
device.SetColor(redBrightness, greenBrightness, blueBrightness);
}
}
using System;
using System.Collections.Generic;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.GeneralIO;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
[Description("Wrapper class for the Crestron StatusSign device")]
public class StatusSignController : CrestronGenericBridgeableBaseDevice
{
private readonly StatusSign _device;
public BoolFeedback RedLedEnabledFeedback { get; private set; }
public BoolFeedback GreenLedEnabledFeedback { get; private set; }
public BoolFeedback BlueLedEnabledFeedback { get; private set; }
public IntFeedback RedLedBrightnessFeedback { get; private set; }
public IntFeedback GreenLedBrightnessFeedback { get; private set; }
public IntFeedback BlueLedBrightnessFeedback { get; private set; }
public StatusSignController(string key, string name, GenericBase hardware) : base(key, name, hardware)
{
_device = hardware as StatusSign;
RedLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Red]
.ControlFeedback.BoolValue);
GreenLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Green]
.ControlFeedback.BoolValue);
BlueLedEnabledFeedback =
new BoolFeedback(
() =>
_device.Leds[(uint) StatusSign.Led.eLedColor.Blue]
.ControlFeedback.BoolValue);
RedLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Red].BrightnessFeedback);
GreenLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Green].BrightnessFeedback);
BlueLedBrightnessFeedback =
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Blue].BrightnessFeedback);
if (_device != null) _device.BaseEvent += _device_BaseEvent;
}
void _device_BaseEvent(GenericBase device, BaseEventArgs args)
{
switch (args.EventId)
{
case StatusSign.LedBrightnessFeedbackEventId:
RedLedBrightnessFeedback.FireUpdate();
GreenLedBrightnessFeedback.FireUpdate();
BlueLedBrightnessFeedback.FireUpdate();
break;
case StatusSign.LedControlFeedbackEventId:
RedLedEnabledFeedback.FireUpdate();
GreenLedEnabledFeedback.FireUpdate();
BlueLedEnabledFeedback.FireUpdate();
break;
}
}
public void EnableLedControl(bool red, bool green, bool blue)
{
_device.Leds[(uint) StatusSign.Led.eLedColor.Red].Control.BoolValue = red;
_device.Leds[(uint)StatusSign.Led.eLedColor.Green].Control.BoolValue = green;
_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Control.BoolValue = blue;
}
public void SetColor(uint red, uint green, uint blue)
{
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Red].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(red);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Red LED brightness. value: {0}", red);
}
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Green].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(green);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Green LED brightness. value: {0}", green);
}
try
{
_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Brightness =
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(blue);
}
catch (InvalidOperationException)
{
Debug.Console(1, this, "Error converting value to Blue LED brightness. value: {0}", blue);
}
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new StatusSignControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<StatusSignControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
trilist.SetBoolSigAction(joinMap.RedControl.JoinNumber, b => EnableControl(trilist, joinMap, this));
trilist.SetBoolSigAction(joinMap.GreenControl.JoinNumber, b => EnableControl(trilist, joinMap, this));
trilist.SetBoolSigAction(joinMap.BlueControl.JoinNumber, b => EnableControl(trilist, joinMap, this));
trilist.SetUShortSigAction(joinMap.RedLed.JoinNumber, u => SetColor(trilist, joinMap, this));
trilist.SetUShortSigAction(joinMap.GreenLed.JoinNumber, u => SetColor(trilist, joinMap, this));
trilist.SetUShortSigAction(joinMap.BlueLed.JoinNumber, u => SetColor(trilist, joinMap, this));
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl.JoinNumber]);
BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl.JoinNumber]);
GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl.JoinNumber]);
RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed.JoinNumber]);
BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed.JoinNumber]);
GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed.JoinNumber]);
}
private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
StatusSignController device)
{
var redEnable = triList.BooleanOutput[joinMap.RedControl.JoinNumber].BoolValue;
var greenEnable = triList.BooleanOutput[joinMap.GreenControl.JoinNumber].BoolValue;
var blueEnable = triList.BooleanOutput[joinMap.BlueControl.JoinNumber].BoolValue;
device.EnableLedControl(redEnable, greenEnable, blueEnable);
}
private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
StatusSignController device)
{
var redBrightness = triList.UShortOutput[joinMap.RedLed.JoinNumber].UShortValue;
var greenBrightness = triList.UShortOutput[joinMap.GreenLed.JoinNumber].UShortValue;
var blueBrightness = triList.UShortOutput[joinMap.BlueLed.JoinNumber].UShortValue;
device.SetColor(redBrightness, greenBrightness, blueBrightness);
}
}
public class StatusSignControllerFactory : EssentialsDeviceFactory<StatusSignController>
{
public StatusSignControllerFactory()
{
TypeNames = new List<string>() { "statussign" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new StatusSign Device");
var control = CommFactory.GetControlPropertiesConfig(dc);
var cresnetId = control.CresnetIdInt;
return new StatusSignController(dc.Key, dc.Name, new StatusSign(cresnetId, Global.ControlSystem));
}
}
}

View File

@@ -5,10 +5,6 @@ using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.EthernetCommunication;
using Crestron.SimplSharpPro.UI;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
@@ -17,18 +13,23 @@ namespace PepperDash.Essentials.Core
{
public static class DeviceManager
{
private static readonly CCriticalSection DeviceCriticalSection = new CCriticalSection();
private static readonly CEvent AllowAddDevicesCEvent = new CEvent(false, true);
//public static List<Device> Devices { get { return _Devices; } }
//static List<Device> _Devices = new List<Device>();
static Dictionary<string, IKeyed> Devices = new Dictionary<string, IKeyed>(StringComparer.OrdinalIgnoreCase);
static readonly Dictionary<string, IKeyed> Devices = new Dictionary<string, IKeyed>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Returns a copy of all the devices in a list
/// </summary>
public static List<IKeyed> AllDevices { get { return new List<IKeyed>(Devices.Values); } }
public static bool AddDeviceEnabled;
public static void Initialize(CrestronControlSystem cs)
{
AddDeviceEnabled = true;
CrestronConsole.AddNewConsoleCommand(ListDeviceCommStatuses, "devcommstatus", "Lists the communication status of all devices",
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ListDeviceFeedbacks, "devfb", "Lists current feedbacks",
@@ -37,18 +38,9 @@ namespace PepperDash.Essentials.Core
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(DeviceJsonApi.DoDeviceActionWithJson, "devjson", "",
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s =>
{
CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetProperties(s));
}, "devprops", "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s =>
{
CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetMethods(s));
}, "devmethods", "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s =>
{
CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetApiMethods(s));
}, "apimethods", "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetProperties(s)), "devprops", "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetMethods(s)), "devmethods", "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetApiMethods(s)), "apimethods", "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(SimulateComReceiveOnDevice, "devsimreceive",
"Simulates incoming data on a com device", ConsoleAccessLevelEnum.AccessOperator);
}
@@ -58,47 +50,56 @@ namespace PepperDash.Essentials.Core
/// </summary>
public static void ActivateAll()
{
// PreActivate all devices
foreach (var d in Devices.Values)
{
try
{
if (d is Device)
(d as Device).PreActivate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device PreActivation failure:\r{0}", e);
}
}
try
{
DeviceCriticalSection.Enter();
AddDeviceEnabled = false;
// PreActivate all devices
foreach (var d in Devices.Values)
{
try
{
if (d is Device)
(d as Device).PreActivate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device PreActivation failure:\r{0}", e);
}
}
// Activate all devices
foreach (var d in Devices.Values)
{
try
{
if (d is Device)
(d as Device).Activate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device Activation failure:\r{0}", e);
}
}
// Activate all devices
foreach (var d in Devices.Values)
{
try
{
if (d is Device)
(d as Device).Activate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device Activation failure:\r{0}", e);
}
}
// PostActivate all devices
foreach (var d in Devices.Values)
{
try
{
if (d is Device)
(d as Device).PostActivate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
}
}
// PostActivate all devices
foreach (var d in Devices.Values)
{
try
{
if (d is Device)
(d as Device).PostActivate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device PostActivation failure:\r{0}", e);
}
}
}
finally
{
DeviceCriticalSection.Leave();
}
}
/// <summary>
@@ -106,11 +107,18 @@ namespace PepperDash.Essentials.Core
/// </summary>
public static void DeactivateAll()
{
foreach (var d in Devices.Values)
{
if (d is Device)
(d as Device).Deactivate();
}
try
{
DeviceCriticalSection.Enter();
foreach (var d in Devices.Values.OfType<Device>())
{
d.Deactivate();
}
}
finally
{
DeviceCriticalSection.Leave();
}
}
//static void ListMethods(string devKey)
@@ -134,37 +142,37 @@ namespace PepperDash.Essentials.Core
// }
//}
static void ListDevices(string s)
{
Debug.Console(0, "{0} Devices registered with Device Mangager:",Devices.Count);
var sorted = Devices.Values.ToList();
sorted.Sort((a, b) => a.Key.CompareTo(b.Key));
private static void ListDevices(string s)
{
Debug.Console(0, "{0} Devices registered with Device Manager:", Devices.Count);
var sorted = Devices.Values.ToList();
sorted.Sort((a, b) => a.Key.CompareTo(b.Key));
foreach (var d in sorted)
{
var name = d is IKeyName ? (d as IKeyName).Name : "---";
Debug.Console(0, " [{0}] {1}", d.Key, name);
}
}
foreach (var d in sorted)
{
var name = d is IKeyName ? (d as IKeyName).Name : "---";
Debug.Console(0, " [{0}] {1}", d.Key, name);
}
}
static void ListDeviceFeedbacks(string devKey)
{
var dev = GetDeviceForKey(devKey);
if(dev == null)
{
Debug.Console(0, "Device '{0}' not found", devKey);
return;
}
var statusDev = dev as IHasFeedback;
if(statusDev == null)
{
Debug.Console(0, "Device '{0}' does not have visible feedbacks", devKey);
return;
}
statusDev.DumpFeedbacksToConsole(true);
}
private static void ListDeviceFeedbacks(string devKey)
{
var dev = GetDeviceForKey(devKey);
if (dev == null)
{
Debug.Console(0, "Device '{0}' not found", devKey);
return;
}
var statusDev = dev as IHasFeedback;
if (statusDev == null)
{
Debug.Console(0, "Device '{0}' does not have visible feedbacks", devKey);
return;
}
statusDev.DumpFeedbacksToConsole(true);
}
//static void ListDeviceCommands(string devKey)
//static void ListDeviceCommands(string devKey)
//{
// var dev = GetDeviceForKey(devKey);
// if (dev == null)
@@ -175,70 +183,97 @@ namespace PepperDash.Essentials.Core
// Debug.Console(0, "This needs to be reworked. Stay tuned.", devKey);
//}
static void ListDeviceCommStatuses(string input)
{
var sb = new StringBuilder();
foreach (var dev in Devices.Values)
{
if (dev is ICommunicationMonitor)
sb.Append(string.Format("{0}: {1}\r", dev.Key, (dev as ICommunicationMonitor).CommunicationMonitor.Status));
}
CrestronConsole.ConsoleCommandResponse(sb.ToString());
}
private static void ListDeviceCommStatuses(string input)
{
var sb = new StringBuilder();
foreach (var dev in Devices.Values.OfType<ICommunicationMonitor>())
{
sb.Append(string.Format("{0}: {1}\r", dev,
dev.CommunicationMonitor.Status));
}
CrestronConsole.ConsoleCommandResponse(sb.ToString());
}
//static void DoDeviceCommand(string command)
//static void DoDeviceCommand(string command)
//{
// Debug.Console(0, "Not yet implemented. Stay tuned");
//}
public static void AddDevice(IKeyed newDev)
{
// Check for device with same key
//var existingDevice = _Devices.FirstOrDefault(d => d.Key.Equals(newDev.Key, StringComparison.OrdinalIgnoreCase));
////// If it exists, remove or warn??
//if (existingDevice != null)
if(Devices.ContainsKey(newDev.Key))
{
Debug.Console(0, newDev, "WARNING: A device with this key already exists. Not added to manager");
return;
}
Devices.Add(newDev.Key, newDev);
//if (!(_Devices.Contains(newDev)))
// _Devices.Add(newDev);
try
{
if (!DeviceCriticalSection.TryEnter())
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Currently unable to add devices to Device Manager. Please try again");
return;
}
// Check for device with same key
//var existingDevice = _Devices.FirstOrDefault(d => d.Key.Equals(newDev.Key, StringComparison.OrdinalIgnoreCase));
////// If it exists, remove or warn??
//if (existingDevice != null)
if (!AddDeviceEnabled)
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "All devices have been activated. Adding new devices is not allowed.");
return;
}
if (Devices.ContainsKey(newDev.Key))
{
Debug.Console(0, newDev, "WARNING: A device with this key already exists. Not added to manager");
return;
}
Devices.Add(newDev.Key, newDev);
//if (!(_Devices.Contains(newDev)))
// _Devices.Add(newDev);
}
finally
{
DeviceCriticalSection.Leave();
}
}
public static void RemoveDevice(IKeyed newDev)
{
if(newDev == null)
return;
if (Devices.ContainsKey(newDev.Key))
Devices.Remove(newDev.Key);
//if (_Devices.Contains(newDev))
// _Devices.Remove(newDev);
else
Debug.Console(0, "Device manager: Device '{0}' does not exist in manager. Cannot remove", newDev.Key);
try
{
DeviceCriticalSection.Enter();
if (newDev == null)
return;
if (Devices.ContainsKey(newDev.Key))
Devices.Remove(newDev.Key);
//if (_Devices.Contains(newDev))
// _Devices.Remove(newDev);
else
Debug.Console(0, "Device manager: Device '{0}' does not exist in manager. Cannot remove", newDev.Key);
}
finally
{
DeviceCriticalSection.Leave();
}
}
public static IEnumerable<string> GetDeviceKeys()
{
//return _Devices.Select(d => d.Key).ToList();
return Devices.Keys;
//return _Devices.Select(d => d.Key).ToList();
return Devices.Keys;
}
public static IEnumerable<IKeyed> GetDevices()
{
//return _Devices.Select(d => d.Key).ToList();
return Devices.Values;
//return _Devices.Select(d => d.Key).ToList();
return Devices.Values;
}
public static IKeyed GetDeviceForKey(string key)
{
//return _Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
if (key != null && Devices.ContainsKey(key))
return Devices[key];
//return _Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
if (key != null && Devices.ContainsKey(key))
return Devices[key];
return null;
return null;
}
/// <summary>
@@ -256,7 +291,7 @@ namespace PepperDash.Essentials.Core
}
//Debug.Console(2, "**** {0} - {1} ****", match.Groups[1].Value, match.Groups[2].Value);
ComPortController com = GetDeviceForKey(match.Groups[1].Value) as ComPortController;
var com = GetDeviceForKey(match.Groups[1].Value) as ComPortController;
if (com == null)
{
CrestronConsole.ConsoleCommandResponse("'{0}' is not a comm port device", match.Groups[1].Value);

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
@@ -12,6 +13,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// Defines the basic needs for an EssentialsDevice to enable it to be build by an IDeviceFactory class
/// </summary>
[Description("The base Essentials Device Class")]
public abstract class EssentialsDevice : Device
{
protected EssentialsDevice(string key)
@@ -27,6 +29,40 @@ namespace PepperDash.Essentials.Core
}
}
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
public class DescriptionAttribute : Attribute
{
private string _Description;
public DescriptionAttribute(string description)
{
Debug.Console(2, "Setting Description: {0}", description);
_Description = description;
}
public string Description
{
get { return _Description; }
}
}
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = true)]
public class ConfigSnippetAttribute : Attribute
{
private string _ConfigSnippet;
public ConfigSnippetAttribute(string configSnippet)
{
Debug.Console(2, "Setting Description {0}", configSnippet);
_ConfigSnippet = configSnippet;
}
public string ConfigSnippet
{
get { return _ConfigSnippet; }
}
}
/// <summary>
/// Devices the basic needs for a Device Factory
/// </summary>
@@ -46,7 +82,10 @@ namespace PepperDash.Essentials.Core
{
foreach (var typeName in TypeNames)
{
DeviceFactory.AddFactoryForType(typeName, BuildDevice);
Debug.Console(2, "Getting Description Attribute from class: '{0}'", typeof(T).FullName);
var attributes = typeof(T).GetCustomAttributes(typeof(DescriptionAttribute), true) as DescriptionAttribute[];
string description = attributes[0].Description;
DeviceFactory.AddFactoryForType(typeName.ToLower(), description, typeof(T), BuildDevice);
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using Crestron.SimplSharpPro;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Core;
@@ -12,7 +13,7 @@ namespace PepperDash.Essentials.Core.Devices
/// <summary>
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
/// </summary>
public class InRoomPc : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
public class InRoomPc : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
{
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
public string IconName { get; set; }
@@ -63,4 +64,19 @@ namespace PepperDash.Essentials.Core.Devices
#endregion
}
public class InRoomPcFactory : EssentialsDeviceFactory<InRoomPc>
{
public InRoomPcFactory()
{
TypeNames = new List<string>() { "inroompc" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new InRoomPc Device");
return new InRoomPc(dc.Key, dc.Name);
}
}
}

View File

@@ -4,6 +4,7 @@ using System.Linq;
using Crestron.SimplSharpPro;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Core;
@@ -12,7 +13,7 @@ namespace PepperDash.Essentials.Core.Devices
/// <summary>
/// This DVD class should cover most IR, one-way DVD and Bluray fuctions
/// </summary>
public class Laptop : Device, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
public class Laptop : EssentialsDevice, IHasFeedback, IRoutingOutputs, IAttachVideoStatus, IUiDisplayInfo, IUsageTracking
{
public uint DisplayUiType { get { return DisplayUiConstants.TypeLaptop; } }
public string IconName { get; set; }
@@ -63,4 +64,18 @@ namespace PepperDash.Essentials.Core.Devices
#endregion
}
public class LaptopFactory : EssentialsDeviceFactory<Laptop>
{
public LaptopFactory()
{
TypeNames = new List<string>() { "laptop" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Laptop Device");
return new Core.Devices.Laptop(dc.Key, dc.Name);
}
}
}

View File

@@ -8,12 +8,13 @@ using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Core
{
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IPower, IWarmingCooling
public class BasicIrDisplay : DisplayBase, IBasicVolumeControls, IBridgeAdvanced
{
public IrOutputPortController IrPort { get; private set; }
public ushort IrPulseTime { get; set; }
@@ -203,9 +204,32 @@ namespace PepperDash.Essentials.Core
#endregion
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
}
}
public class BasicIrDisplayFactory : EssentialsDeviceFactory<BasicIrDisplay>
{
public BasicIrDisplayFactory()
{
TypeNames = new List<string>() { "basicirdisplay" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new BasicIrDisplay Device");
var ir = IRPortHelper.GetIrPort(dc.Properties);
if (ir != null)
{
var display = new BasicIrDisplay(dc.Key, dc.Name, ir.Port, ir.FileName);
display.IrPulseTime = 200; // Set default pulse time for IR commands.
return display;
}
return null;
}
}
}

View File

@@ -18,7 +18,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
///
/// </summary>
public abstract class DisplayBase : EssentialsBridgeableDevice, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
{
public event SourceInfoChangeHandler CurrentSourceChange;
@@ -121,24 +121,24 @@ namespace PepperDash.Essentials.Core
var inputNumber = 0;
var inputKeys = new List<string>();
var joinMap = new DisplayControllerJoinMap();
var joinMap = new DisplayControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DisplayControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap = JsonConvert.DeserializeObject<DisplayControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
trilist.StringInput[joinMap.Name].StringValue = displayDevice.Name;
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = displayDevice.Name;
var commMonitor = displayDevice as ICommunicationMonitor;
if (commMonitor != null)
{
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
}
var inputNumberFeedback = new IntFeedback(() => inputNumber);
@@ -148,16 +148,16 @@ namespace PepperDash.Essentials.Core
if (twoWayDisplay != null)
{
trilist.SetBool(joinMap.IsTwoWayDisplay, true);
trilist.SetBool(joinMap.IsTwoWayDisplay.JoinNumber, true);
twoWayDisplay.CurrentInputFeedback.OutputChange += (o, a) => Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", a.StringValue);
inputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect]);
inputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect.JoinNumber]);
}
// Power Off
trilist.SetSigTrueAction(joinMap.PowerOff, () =>
trilist.SetSigTrueAction(joinMap.PowerOff.JoinNumber, () =>
{
inputNumber = 102;
inputNumberFeedback.FireUpdate();
@@ -179,10 +179,10 @@ namespace PepperDash.Essentials.Core
}
};
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff.JoinNumber]);
// PowerOn
trilist.SetSigTrueAction(joinMap.PowerOn, () =>
trilist.SetSigTrueAction(joinMap.PowerOn.JoinNumber, () =>
{
inputNumber = 0;
inputNumberFeedback.FireUpdate();
@@ -190,21 +190,27 @@ namespace PepperDash.Essentials.Core
});
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn.JoinNumber]);
var count = 1;
foreach (var input in displayDevice.InputPorts)
for (int i = 0; i < displayDevice.InputPorts.Count; i++)
{
inputKeys.Add(input.Key);
var tempKey = inputKeys.ElementAt(count - 1);
trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset + count), () => displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector));
Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}", joinMap.InputSelectOffset + count, displayDevice.InputPorts[tempKey].Key.ToString());
trilist.StringInput[(ushort)(joinMap.InputNamesOffset + count)].StringValue = input.Key.ToString();
count++;
if (i < joinMap.InputNamesOffset.JoinSpan)
{
inputKeys.Add(displayDevice.InputPorts[i].Key);
var tempKey = inputKeys.ElementAt(i);
trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset.JoinNumber + i),
() => displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector));
Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}",
joinMap.InputSelectOffset.JoinNumber + i, displayDevice.InputPorts[tempKey].Key.ToString());
trilist.StringInput[(ushort)(joinMap.InputNamesOffset.JoinNumber + i)].StringValue = displayDevice.InputPorts[i].Key.ToString();
}
else
Debug.Console(0, displayDevice, Debug.ErrorLogLevel.Warning, "Device has {0} inputs. The Join Map allows up to {1} inputs. Discarding inputs {2} - {3} from bridge.",
displayDevice.InputPorts.Count, joinMap.InputNamesOffset.JoinSpan, i + 1, displayDevice.InputPorts.Count);
}
Debug.Console(2, displayDevice, "Setting Input Select Action on Analog Join {0}", joinMap.InputSelect);
trilist.SetUShortSigAction(joinMap.InputSelect, (a) =>
trilist.SetUShortSigAction(joinMap.InputSelect.JoinNumber, (a) =>
{
if (a == 0)
{
@@ -229,17 +235,22 @@ namespace PepperDash.Essentials.Core
var volumeDisplay = displayDevice as IBasicVolumeControls;
if (volumeDisplay == null) return;
trilist.SetBoolSigAction(joinMap.VolumeUp, volumeDisplay.VolumeUp);
trilist.SetBoolSigAction(joinMap.VolumeDown, volumeDisplay.VolumeDown);
trilist.SetSigTrueAction(joinMap.VolumeMute, volumeDisplay.MuteToggle);
trilist.SetBoolSigAction(joinMap.VolumeUp.JoinNumber, volumeDisplay.VolumeUp);
trilist.SetBoolSigAction(joinMap.VolumeDown.JoinNumber, volumeDisplay.VolumeDown);
trilist.SetSigTrueAction(joinMap.VolumeMute.JoinNumber, volumeDisplay.MuteToggle);
var volumeDisplayWithFeedback = volumeDisplay as IBasicVolumeWithFeedback;
if (volumeDisplayWithFeedback == null) return;
trilist.SetSigTrueAction(joinMap.VolumeMuteOn.JoinNumber, volumeDisplayWithFeedback.MuteOn);
trilist.SetSigTrueAction(joinMap.VolumeMuteOff.JoinNumber, volumeDisplayWithFeedback.MuteOff);
trilist.SetUShortSigAction(joinMap.VolumeLevel, volumeDisplayWithFeedback.SetVolume);
volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevel]);
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute]);
trilist.SetUShortSigAction(joinMap.VolumeLevel.JoinNumber, volumeDisplayWithFeedback.SetVolume);
volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevel.JoinNumber]);
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute.JoinNumber]);
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMuteOn.JoinNumber]);
volumeDisplayWithFeedback.MuteFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.VolumeMuteOff.JoinNumber]);
}
}

View File

@@ -12,14 +12,14 @@ using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced
{
public RoutingInputPort HdmiIn1 { get; private set; }
@@ -177,9 +177,24 @@ namespace PepperDash.Essentials.Core
#endregion
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
public void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
}
}
public class MockDisplayFactory : EssentialsDeviceFactory<MockDisplay>
{
public MockDisplayFactory()
{
TypeNames = new List<string>() { "mockdisplay" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Mock Display Device");
return new MockDisplay(dc.Key, dc.Name);
}
}
}

View File

@@ -5,6 +5,7 @@ using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
@@ -13,26 +14,77 @@ using PepperDash.Essentials.Core.Touchpanels;
namespace PepperDash.Essentials.Core
{
public class DeviceFactoryWrapper
{
public CType CType { get; set; }
public string Description { get; set; }
public Func<DeviceConfig, IKeyed> FactoryMethod { get; set; }
public DeviceFactoryWrapper()
{
CType = null;
Description = "Not Available";
}
}
public class DeviceFactory
{
public DeviceFactory()
{
var assy = Assembly.GetExecutingAssembly();
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
if (types != null)
{
foreach (var type in types)
{
try
{
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
factory.LoadTypeFactories();
}
catch (Exception e)
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
}
}
}
}
/// <summary>
/// A dictionary of factory methods, keyed by config types, added by plugins.
/// These methods are looked up and called by GetDevice in this class.
/// </summary>
static Dictionary<string, Func<DeviceConfig, IKeyed>> FactoryMethods =
new Dictionary<string, Func<DeviceConfig, IKeyed>>(StringComparer.OrdinalIgnoreCase);
static Dictionary<string, DeviceFactoryWrapper> FactoryMethods =
new Dictionary<string, DeviceFactoryWrapper>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Adds a plugin factory method
/// </summary>
/// <param name="dc"></param>
/// <returns></returns>
public static void AddFactoryForType(string type, Func<DeviceConfig, IKeyed> method)
public static void AddFactoryForType(string typeName, Func<DeviceConfig, IKeyed> method)
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", type);
DeviceFactory.FactoryMethods.Add(type, method);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
DeviceFactory.FactoryMethods.Add(typeName, new DeviceFactoryWrapper() { FactoryMethod = method});
}
public static void AddFactoryForType(string typeName, string description, CType cType, Func<DeviceConfig, IKeyed> method)
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Adding factory method for type '{0}'", typeName);
if(FactoryMethods.ContainsKey(typeName))
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to add type: '{0}'. Already exists in DeviceFactory", typeName);
return;
}
var wrapper = new DeviceFactoryWrapper() { CType = cType, Description = description, FactoryMethod = method };
DeviceFactory.FactoryMethods.Add(typeName, wrapper);
}
/// <summary>
/// The factory method for Core "things". Also iterates the Factory methods that have
/// been loaded from plugins
@@ -52,76 +104,46 @@ namespace PepperDash.Essentials.Core
if (FactoryMethods.ContainsKey(typeName))
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Loading '{0}' from plugin", dc.Type);
return FactoryMethods[typeName](dc);
return FactoryMethods[typeName].FactoryMethod(dc);
}
// Check "core" types
//if (typeName == "genericcomm")
//{
// Debug.Console(1, "Factory Attempting to create new Generic Comm Device");
// return new GenericComm(dc);
//}
if (typeName == "ceniodigin104")
{
var control = CommFactory.GetControlPropertiesConfig(dc);
var ipid = control.IpIdInt;
return new CenIoDigIn104Controller(key, name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem));
}
if (typeName == "statussign")
{
var control = CommFactory.GetControlPropertiesConfig(dc);
var cresnetId = control.CresnetIdInt;
return new StatusSignController(key, name, new StatusSign(cresnetId, Global.ControlSystem));
}
if (typeName == "c2nrths")
{
var control = CommFactory.GetControlPropertiesConfig(dc);
var cresnetId = control.CresnetIdInt;
return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem));
}
return null;
}
/// <summary>
/// Prints the type names fromt the FactoryMethods collection.
/// Prints the type names and associated metadata from the FactoryMethods collection.
/// </summary>
/// <param name="command"></param>
public static void GetDeviceFactoryTypes(string filter)
{
List<string> typeNames = new List<string>();
Dictionary<string, DeviceFactoryWrapper> types = new Dictionary<string, DeviceFactoryWrapper>();
if (!string.IsNullOrEmpty(filter))
{
typeNames = FactoryMethods.Keys.Where(k => k.Contains(filter)).ToList();
types = FactoryMethods.Where(k => k.Key.Contains(filter)).ToDictionary(k => k.Key, k => k.Value);
}
else
{
typeNames = FactoryMethods.Keys.ToList();
types = FactoryMethods;
}
Debug.Console(0, "Device Types:");
foreach (var type in typeNames)
foreach (var type in types.OrderBy(t => t.Key))
{
Debug.Console(0, "type: '{0}'", type);
var description = type.Value.Description;
var cType = "Not Specified by Plugin";
if(type.Value.CType != null)
{
cType = type.Value.CType.FullName;
}
Debug.Console(0,
@"Type: '{0}'
CType: '{1}'
Description: {2}", type.Key, cType, description);
}
}
}
/// <summary>
/// Responsible for loading all of the device types
/// </summary>
public class CoreDeviceFactory
{
public CoreDeviceFactory()
{
var genComm = new GenericCommFactory() as IDeviceFactory;
genComm.LoadTypeFactories();
}
}
}

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.Core
public interface IDeviceFactory
{
/// <summary>
/// Will be called when the plugin is loaded by Essentials. Must add any new types to the DeviceFactory using DeviceFactory.AddFactoryForType() for each new type
/// Loads all the types to the DeviceFactory
/// </summary>
void LoadTypeFactories();
}

View File

@@ -98,25 +98,47 @@ namespace PepperDash.Essentials.Core
{
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);
// Check for beta build version
if (runtimeVersionMajor == 0)
var runtimeVer = new Version(runtimeVersionMajor, runtimeVersionMinor, runtimeVersionBuild);
Version minimumVer;
try
{
Debug.Console(2, "Running Local Build. Bypassing Dependency Check.");
return true;
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)
{
Debug.Console(2, "minimumVersion String does not match format xx.yy.zz");
return false;
}
var minVersionMajor = Int16.Parse(minVersion.Groups[1].Value);
@@ -135,6 +157,7 @@ namespace PepperDash.Essentials.Core
return false;
return true;
*/
}
static Global()

View File

@@ -27,6 +27,16 @@ namespace PepperDash.Essentials.Core
return joinMap;
}
/// <summary>
/// Attempts to get the serialized join map from config
/// </summary>
/// <param name="joinMapKey"></param>
/// <returns></returns>
public static string GetJoinMapForDevice(string joinMapKey)
{
return GetSerializedJoinMapForDevice(joinMapKey);
}
/// <summary>
/// Attempts to find a custom join map by key and returns it deserialized if found
/// </summary>

View File

@@ -72,36 +72,33 @@ namespace PepperDash.Essentials.Core.Lighting
protected GenericLightingJoinMap LinkLightingToApi(LightingBase lightingDevice, BasicTriList trilist, uint joinStart,
string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new GenericLightingJoinMap();
{
var joinMap = new GenericLightingJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap = JsonConvert.DeserializeObject<GenericLightingJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Lighting Type {0}", lightingDevice.GetType().Name.ToString());
// GenericLighitng Actions & FeedBack
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
// GenericLighitng Actions & FeedBack
trilist.SetUShortSigAction(joinMap.SelectScene.JoinNumber, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
var sceneIndex = 1;
var sceneIndex = 0;
foreach (var scene in lightingDevice.LightingScenes)
{
var tempIndex = sceneIndex - 1;
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
{
trilist.SetSigTrueAction((uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[sceneIndex]));
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)]);
trilist.StringInput[(uint)(joinMap.SelectSceneDirect.JoinNumber + sceneIndex)].StringValue = scene.Name;
trilist.BooleanInput[(uint)(joinMap.ButtonVisibility.JoinNumber + sceneIndex)].BoolValue = true;
sceneIndex++;
}
return joinMap;
}

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.CrestronIO;
@@ -15,7 +16,7 @@ namespace PepperDash.Essentials.Core.Privacy
/// Used for applications where one or more microphones with momentary contact closure outputs are used to
/// toggle the privacy state of the room. Privacy state feedback is represented
/// </summary>
public class MicrophonePrivacyController : Device
public class MicrophonePrivacyController : EssentialsDevice
{
MicrophonePrivacyControllerConfig Config;
@@ -225,4 +226,21 @@ namespace PepperDash.Essentials.Core.Privacy
}
}
}
public class MicrophonePrivacyControllerFactory : EssentialsDeviceFactory<MicrophonePrivacyController>
{
public MicrophonePrivacyControllerFactory()
{
TypeNames = new List<string>() { "microphoneprivacycontroller" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new MIcrophonePrivacyController Device");
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Core.Privacy.MicrophonePrivacyControllerConfig>(dc.Properties.ToString());
return new Core.Privacy.MicrophonePrivacyController(dc.Key, props);
}
}
}

View File

@@ -201,30 +201,30 @@ namespace PepperDash.Essentials.Core.Monitoring
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new SystemMonitorJoinMap();
{
var joinMap = new SystemMonitorJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<SystemMonitorJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap = JsonConvert.DeserializeObject<SystemMonitorJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(2, this, "Linking API starting at join: {0}", joinStart);
TimeZoneFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeZone]);
TimeZoneTextFeedback.LinkInputSig(trilist.StringInput[joinMap.TimeZoneName]);
IoControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.IOControllerVersion]);
SnmpVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.SnmpAppVersion]);
BaCnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion]);
ControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.ControllerVersion]);
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumber]);
ModelFeedback.LinkInputSig(trilist.StringInput[joinMap.Model]);
UptimeFeedback.LinkInputSig(trilist.StringInput[joinMap.Uptime]);
LastStartFeedback.LinkInputSig(trilist.StringInput[joinMap.LastBoot]);
TimeZoneFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeZone.JoinNumber]);
TimeZoneTextFeedback.LinkInputSig(trilist.StringInput[joinMap.TimeZoneName.JoinNumber]);
IoControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.IOControllerVersion.JoinNumber]);
SnmpVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.SnmpAppVersion.JoinNumber]);
BaCnetAppVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.BACnetAppVersion.JoinNumber]);
ControllerVersionFeedback.LinkInputSig(trilist.StringInput[joinMap.ControllerVersion.JoinNumber]);
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumber.JoinNumber]);
ModelFeedback.LinkInputSig(trilist.StringInput[joinMap.Model.JoinNumber]);
UptimeFeedback.LinkInputSig(trilist.StringInput[joinMap.Uptime.JoinNumber]);
LastStartFeedback.LinkInputSig(trilist.StringInput[joinMap.LastBoot.JoinNumber]);
// iterate the program status feedback collection and map all the joins
LinkProgramInfoJoins(this, trilist, joinMap);
@@ -233,65 +233,64 @@ namespace PepperDash.Essentials.Core.Monitoring
}
private static void LinkEthernetInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist, SystemMonitorJoinMap joinMap)
{
var ethernetSlotJoinStart = joinMap.EthernetStartJoin;
{
uint ethernetSlotJoinStart = 0;
foreach (var fb in systemMonitorController.EthernetStatusFeedbackCollection)
{
fb.Value.CurrentIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentIpAddress]);
fb.Value.CurrentSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentSubnetMask]);
fb.Value.CurrentDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentDefaultGateway]);
fb.Value.StaticIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticIpAddress]);
fb.Value.StaticSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticSubnetMask]);
fb.Value.StaticDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticDefaultGateway]);
fb.Value.HostNameFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.HostName]);
fb.Value.MacAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.MacAddress]);
fb.Value.DomainFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.Domain]);
fb.Value.DnsServerFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DnsServer]);
fb.Value.DhcpStatusFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DhcpStatus]);
{
fb.Value.CurrentIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentIpAddress.JoinNumber]);
fb.Value.CurrentSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentSubnetMask.JoinNumber]);
fb.Value.CurrentDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.CurrentDefaultGateway.JoinNumber]);
fb.Value.StaticIpAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticIpAddress.JoinNumber]);
fb.Value.StaticSubnetMaskFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticSubnetMask.JoinNumber]);
fb.Value.StaticDefaultGatewayFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.StaticDefaultGateway.JoinNumber]);
fb.Value.HostNameFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.HostName.JoinNumber]);
fb.Value.MacAddressFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.MacAddress.JoinNumber]);
fb.Value.DomainFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.Domain.JoinNumber]);
fb.Value.DnsServerFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DnsServer.JoinNumber]);
fb.Value.DhcpStatusFeedback.LinkInputSig(trilist.StringInput[ethernetSlotJoinStart + joinMap.DhcpStatus.JoinNumber]);
ethernetSlotJoinStart += joinMap.EthernetOffsetJoin;
ethernetSlotJoinStart += joinMap.EthernetOffsetJoin.JoinNumber;
}
}
private static void LinkProgramInfoJoins(SystemMonitorController systemMonitorController, BasicTriList trilist,
SystemMonitorJoinMap joinMap)
{
var programSlotJoinStart = joinMap.ProgramStartJoin;
{
uint programSlotJoinStart = 0;
foreach (var p in systemMonitorController.ProgramStatusFeedbackCollection)
{
var programNumber = p.Value.Program.Number;
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart,
b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start);
p.Value.ProgramStartedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStart]);
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStop,
b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Stop);
p.Value.ProgramStoppedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStop]);
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramRegister,
var programNumber = p.Value.Program.Number;
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStart.JoinNumber,
b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Start);
p.Value.ProgramStartedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStart.JoinNumber]);
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramStop.JoinNumber,
b => SystemMonitor.ProgramCollection[programNumber].OperatingState = eProgramOperatingState.Stop);
p.Value.ProgramStoppedFeedback.LinkInputSig(trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramStop.JoinNumber]);
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramRegister.JoinNumber,
b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Register);
p.Value.ProgramRegisteredFeedback.LinkInputSig(
trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramRegister]);
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramUnregister,
p.Value.ProgramRegisteredFeedback.LinkInputSig(
trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramRegister.JoinNumber]);
trilist.SetBoolSigAction(programSlotJoinStart + joinMap.ProgramUnregister.JoinNumber,
b => SystemMonitor.ProgramCollection[programNumber].RegistrationState = eProgramRegistrationState.Unregister);
p.Value.ProgramUnregisteredFeedback.LinkInputSig(
trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramUnregister]);
p.Value.ProgramNameFeedback.LinkInputSig(trilist.StringInput[programSlotJoinStart + joinMap.ProgramName]);
p.Value.ProgramCompileTimeFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.ProgramCompiledTime]);
p.Value.CrestronDataBaseVersionFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.ProgramCrestronDatabaseVersion]);
p.Value.EnvironmentVersionFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.ProgramEnvironmentVersion]);
p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo]);
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin;
p.Value.ProgramUnregisteredFeedback.LinkInputSig(
trilist.BooleanInput[programSlotJoinStart + joinMap.ProgramUnregister.JoinNumber]);
p.Value.ProgramNameFeedback.LinkInputSig(trilist.StringInput[programSlotJoinStart + joinMap.ProgramName.JoinNumber]);
p.Value.ProgramCompileTimeFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.ProgramCompiledTime.JoinNumber]);
p.Value.CrestronDataBaseVersionFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.ProgramCrestronDatabaseVersion.JoinNumber]);
p.Value.EnvironmentVersionFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.ProgramEnvironmentVersion.JoinNumber]);
p.Value.AggregatedProgramInfoFeedback.LinkInputSig(
trilist.StringInput[programSlotJoinStart + joinMap.AggregatedProgramInfo.JoinNumber]);
programSlotJoinStart = programSlotJoinStart + joinMap.ProgramOffsetJoin.JoinNumber;
}
}

View File

@@ -117,6 +117,7 @@
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\CameraControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\CenOdtOccupancySensorBaseJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DigitalLoggerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DisplayControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />

View File

@@ -68,12 +68,21 @@ namespace PepperDash.Essentials
case ("PepperDashEssentials.dll"):
{
version = Global.AssemblyVersion;
assembly = Assembly.GetExecutingAssembly();
break;
}
case ("PepperDashEssentialsBase.dll"):
case ("PepperDash_Essentials_Core.dll"):
{
version = Global.AssemblyVersion;
break;
}
case ("PepperDash_Essentials_DM.dll"):
{
version = Global.AssemblyVersion;
break;
}
case ("Essentials Devices Common.dll"):
{
version = Global.AssemblyVersion;
break;
}
case ("PepperDash_Core.dll"):
@@ -97,6 +106,17 @@ namespace PepperDash.Essentials
}
}
public static void SetEssentialsAssembly(string name, Assembly assembly)
{
var loadedAssembly = LoadedAssemblies.FirstOrDefault(la => la.Name.Equals(name));
if (loadedAssembly != null)
{
loadedAssembly.SetAssembly(assembly);
}
}
/// <summary>
/// Loads an assembly via Reflection and adds it to the list of loaded assemblies
/// </summary>
@@ -490,5 +510,10 @@ namespace PepperDash.Essentials
Version = version;
Assembly = assembly;
}
public void SetAssembly(Assembly assembly)
{
Assembly = assembly;
}
}
}

View File

@@ -522,4 +522,19 @@ namespace PepperDash.Essentials.Core
[JsonProperty("enableSaturday")]
public bool EnableSaturday { get; set; }
}
public class RoomOnToDefaultSourceWhenOccupiedFactory : EssentialsDeviceFactory<RoomOnToDefaultSourceWhenOccupied>
{
public RoomOnToDefaultSourceWhenOccupiedFactory()
{
TypeNames = new List<string>() { "roomonwhenoccupancydetectedfeature" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new RoomOnToDefaultSourceWhenOccupied Device");
return new RoomOnToDefaultSourceWhenOccupied(dc);
}
}
}

View File

@@ -89,6 +89,15 @@ namespace PepperDash.Essentials.Core
IntFeedback VideoSourceNumericFeedback { get; }
IntFeedback AudioSourceNumericFeedback { get; }
void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
}
/// <summary>
/// Defines a receiver that has internal routing (DM-RMC-4K-Z-SCALER-C)
/// </summary>
public interface IRmcRouting : IRouting
{
IntFeedback AudioVideoSourceNumericFeedback { get; }
void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type);
}
/// <summary>

View File

@@ -29,11 +29,12 @@ namespace PepperDash.Essentials.Core
}
}
[Flags]
public enum eRoutingSignalType
{
Audio = 1,
Video = 2,
AudioVideo = 4,
AudioVideo = Audio | Video,
UsbOutput = 8,
UsbInput = 16
}

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.Shades
/// <summary>
/// Base class for a shade device
/// </summary>
public abstract class ShadeBase : Device, IShadesOpenClose
public abstract class ShadeBase : EssentialsDevice, IShadesOpenClose
{
public ShadeBase(string key, string name)
: base(key, name)

View File

@@ -5,13 +5,14 @@ using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.Shades
{
/// <summary>
/// Class that contains the shades to be controlled in a room
/// </summary>
public class ShadeController : Device, IShades
public class ShadeController : EssentialsDevice, IShades
{
ShadeControllerConfigProperties Config;
@@ -55,4 +56,21 @@ namespace PepperDash.Essentials.Core.Shades
public string Key { get; set; }
}
}
public class ShadeControllerFactory : EssentialsDeviceFactory<ShadeController>
{
public ShadeControllerFactory()
{
TypeNames = new List<string>() { "shadecontroller" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new ShadeController Device");
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<Core.Shades.ShadeControllerConfigProperties>(dc.Properties.ToString());
return new Core.Shades.ShadeController(dc.Key, dc.Name, props);
}
}
}

View File

@@ -103,43 +103,43 @@ namespace PepperDash.Essentials.DM.AirMedia
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new AirMediaControllerJoinMap();
var joinMap = new AirMediaControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<AirMediaControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
Debug.Console(0, "Linking to Airmedia: {0}", Name);
trilist.StringInput[joinMap.Name].StringValue = Name;
trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
var commMonitor = this as ICommunicationMonitor;
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
IsInSessionFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsInSession]);
HdmiVideoSyncDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiVideoSync]);
IsInSessionFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsInSession.JoinNumber]);
HdmiVideoSyncDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.HdmiVideoSync.JoinNumber]);
trilist.SetSigTrueAction(joinMap.AutomaticInputRoutingEnabled, AirMedia.DisplayControl.EnableAutomaticRouting);
trilist.SetSigFalseAction(joinMap.AutomaticInputRoutingEnabled, AirMedia.DisplayControl.DisableAutomaticRouting);
AutomaticInputRoutingEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutomaticInputRoutingEnabled]);
trilist.SetSigTrueAction(joinMap.AutomaticInputRoutingEnabled.JoinNumber, AirMedia.DisplayControl.EnableAutomaticRouting);
trilist.SetSigFalseAction(joinMap.AutomaticInputRoutingEnabled.JoinNumber, AirMedia.DisplayControl.DisableAutomaticRouting);
AutomaticInputRoutingEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutomaticInputRoutingEnabled.JoinNumber]);
trilist.SetUShortSigAction(joinMap.VideoOut, (u) => SelectVideoOut(u));
trilist.SetUShortSigAction(joinMap.VideoOut.JoinNumber, (u) => SelectVideoOut(u));
VideoOutFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoOut]);
ErrorFeedback.LinkInputSig(trilist.UShortInput[joinMap.ErrorFB]);
NumberOfUsersConnectedFeedback.LinkInputSig(trilist.UShortInput[joinMap.NumberOfUsersConnectedFB]);
VideoOutFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoOut.JoinNumber]);
ErrorFeedback.LinkInputSig(trilist.UShortInput[joinMap.ErrorFB.JoinNumber]);
NumberOfUsersConnectedFeedback.LinkInputSig(trilist.UShortInput[joinMap.NumberOfUsersConnectedFB.JoinNumber]);
trilist.SetUShortSigAction(joinMap.LoginCode, (u) => AirMedia.AirMedia.LoginCode.UShortValue = u);
LoginCodeFeedback.LinkInputSig(trilist.UShortInput[joinMap.LoginCode]);
trilist.SetUShortSigAction(joinMap.LoginCode.JoinNumber, (u) => AirMedia.AirMedia.LoginCode.UShortValue = u);
LoginCodeFeedback.LinkInputSig(trilist.UShortInput[joinMap.LoginCode.JoinNumber]);
ConnectionAddressFeedback.LinkInputSig(trilist.StringInput[joinMap.ConnectionAddressFB]);
HostnameFeedback.LinkInputSig(trilist.StringInput[joinMap.HostnameFB]);
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback]);
ConnectionAddressFeedback.LinkInputSig(trilist.StringInput[joinMap.ConnectionAddressFB.JoinNumber]);
HostnameFeedback.LinkInputSig(trilist.StringInput[joinMap.HostnameFB.JoinNumber]);
SerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.SerialNumberFeedback.JoinNumber]);
}
void AirMedia_AirMediaChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
@@ -260,4 +260,29 @@ namespace PepperDash.Essentials.DM.AirMedia
}
public class AirMediaControllerFactory : EssentialsDeviceFactory<AirMediaController>
{
public AirMediaControllerFactory()
{
TypeNames = new List<string>() { "am200", "am300" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
var type = dc.Type.ToLower();
Debug.Console(1, "Factory Attempting to create new AirMedia Device");
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(dc.Properties.ToString());
AmX00 amDevice = null;
if (type == "am200")
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
else if (type == "am300")
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
return new AirMediaController(dc.Key, dc.Name, amDevice, dc, props);
}
}
}

View File

@@ -573,65 +573,65 @@ namespace PepperDash.Essentials.DM {
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new DmBladeChassisControllerJoinMap();
var joinMap = new DmBladeChassisControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmBladeChassisControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
// Link up outputs
for (uint i = 1; i <= Chassis.NumberOfOutputs; i++)
{
var ioSlot = i;
var ioSlotJoin = ioSlot - 1;
// Control
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
if (TxDictionary.ContainsKey(ioSlot))
{
Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
var txKey = TxDictionary[ioSlot];
var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as DmTxControllerBase;
var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as BasicDmTxControllerBase;
var advancedTxDevice = basicTxDevice as DmTxControllerBase;
if (Chassis is DmMd128x128 || Chassis is DmMd64x64)
{
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
}
else
{
if (advancedTxDevice != null)
{
advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
}
else if (InputEndpointOnlineFeedbacks[ioSlot] != null)
{
Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
}
}
if (basicTxDevice != null && advancedTxDevice == null)
trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
trilist.BooleanInput[joinMap.TxAdvancedIsPresent.JoinNumber + ioSlotJoin].BoolValue = true;
if (advancedTxDevice != null)
{
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
}
else
{
Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
if (inputPort != null)
@@ -649,15 +649,15 @@ namespace PepperDash.Essentials.DM {
if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
{
SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
}
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
else
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
}
}
}
@@ -675,14 +675,14 @@ namespace PepperDash.Essentials.DM {
var dmInPortWCec = port as DMInputPortWithCec;
SetHdcpStateAction(PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
SetHdcpStateAction(PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
else
trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
trilist.UShortInput[joinMap.HdcpSupportCapability.JoinNumber + ioSlotJoin].UShortValue = 1;
}
}
}
@@ -690,7 +690,7 @@ namespace PepperDash.Essentials.DM {
}
else
{
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
if (inputPort != null)
@@ -699,8 +699,8 @@ namespace PepperDash.Essentials.DM {
if (hdmiPort != null)
{
SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist);
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState.JoinNumber + ioSlotJoin, trilist);
InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState.JoinNumber + ioSlotJoin]);
}
}
}
@@ -711,7 +711,7 @@ namespace PepperDash.Essentials.DM {
//var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
//var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
//if (hdBaseTDevice != null) {
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
//}
//else if (rxDevice != null) {
// rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
@@ -719,12 +719,12 @@ namespace PepperDash.Essentials.DM {
}
// Feedback
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
}
}

View File

@@ -103,36 +103,36 @@ namespace PepperDash.Essentials.DM
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new DmpsAudioOutputControllerJoinMap();
{
var joinMap = new DmpsAudioOutputControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmpsAudioOutputControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap = JsonConvert.DeserializeObject<DmpsAudioOutputControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
if (MasterVolumeLevel != null)
{
SetUpDmpsAudioOutputJoins(trilist, MasterVolumeLevel, joinMap.MasterVolume);
SetUpDmpsAudioOutputJoins(trilist, MasterVolumeLevel, joinMap.MasterVolumeLevel.JoinNumber);
}
if (SourceVolumeLevel != null)
{
SetUpDmpsAudioOutputJoins(trilist, SourceVolumeLevel, joinMap.SourceVolume);
SetUpDmpsAudioOutputJoins(trilist, SourceVolumeLevel, joinMap.SourceVolumeLevel.JoinNumber);
}
if (Codec1VolumeLevel != null)
{
SetUpDmpsAudioOutputJoins(trilist, Codec1VolumeLevel, joinMap.Codec1Volume);
SetUpDmpsAudioOutputJoins(trilist, Codec1VolumeLevel, joinMap.Codec1VolumeLevel.JoinNumber);
}
if (Codec2VolumeLevel != null)
{
SetUpDmpsAudioOutputJoins(trilist, Codec2VolumeLevel, joinMap.Codec2Volume);
SetUpDmpsAudioOutputJoins(trilist, Codec2VolumeLevel, joinMap.Codec2VolumeLevel.JoinNumber);
}
}

View File

@@ -155,15 +155,15 @@ namespace PepperDash.Essentials.DM
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new DmpsRoutingControllerJoinMap();
{
var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap = JsonConvert.DeserializeObject<DmpsRoutingControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
@@ -172,7 +172,8 @@ namespace PepperDash.Essentials.DM
{
Debug.Console(2, this, "Linking Input Card {0}", i);
var ioSlot = i;
var ioSlot = i;
var ioSlotJoin = ioSlot - 1;
//if (TxDictionary.ContainsKey(ioSlot))
//{
@@ -190,13 +191,13 @@ namespace PepperDash.Essentials.DM
// // dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
//}
if (VideoInputSyncFeedbacks[ioSlot] != null)
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + 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 + ioSlot]);
trilist.SetStringSigAction(joinMap.InputNames + ioSlot, new Action<string>(s =>
if (InputNameFeedbacks[ioSlot] != null)
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, new Action<string>(s =>
{
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
@@ -209,20 +210,22 @@ namespace PepperDash.Essentials.DM
}));
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
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;
// Control
trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
trilist.SetUShortSigAction(joinMap.OutputAudio + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
var ioSlot = i;
var ioSlotJoin = ioSlot - 1;
trilist.SetStringSigAction(joinMap.OutputNames + ioSlot, s =>
// 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.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
{
var outputCard = Dmps.SwitcherOutputs[ioSlot] as DMOutput;
@@ -248,18 +251,18 @@ namespace PepperDash.Essentials.DM
});
// Feedback
if (VideoOutputFeedbacks[ioSlot] != null)
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);
if (AudioOutputFeedbacks[ioSlot] != null)
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio + ioSlot]);
if (OutputNameFeedbacks[ioSlot] != null)
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames + ioSlot]);
if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
if (VideoOutputFeedbacks[ioSlot] != null)
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
if (AudioOutputFeedbacks[ioSlot] != null)
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
if (OutputNameFeedbacks[ioSlot] != null)
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
@@ -6,6 +7,7 @@ using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.AirMedia;
using Crestron.SimplSharpPro.UI;
using Crestron.SimplSharp.Reflection;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -17,86 +19,33 @@ using PepperDash.Essentials.DM.Endpoints.DGEs;
namespace PepperDash.Essentials.DM
{
public class DeviceFactory
{
public static IKeyed GetDevice(DeviceConfig dc)
{
var key = dc.Key;
var name = dc.Name;
var type = dc.Type;
var properties = dc.Properties;
/// <summary>
/// Responsible for loading the type factories for this library
/// </summary>
public class DeviceFactory
{
public DeviceFactory()
{
var assy = Assembly.GetExecutingAssembly();
PluginLoader.SetEssentialsAssembly(assy.GetName().Name, assy);
var types = assy.GetTypes().Where(ct => typeof(IDeviceFactory).IsAssignableFrom(ct) && !ct.IsInterface && !ct.IsAbstract);
var typeName = dc.Type.ToLower();
if (typeName.StartsWith("am"))
if (types != null)
{
if (typeName == "am200" || typeName == "am300")
foreach (var type in types)
{
var props = JsonConvert.DeserializeObject<AirMediaPropertiesConfig>(properties.ToString());
AmX00 amDevice = null;
if (typeName == "am200")
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am200(props.Control.IpIdInt, Global.ControlSystem);
else if (typeName == "am300")
amDevice = new Crestron.SimplSharpPro.DM.AirMedia.Am300(props.Control.IpIdInt, Global.ControlSystem);
return new AirMediaController(key, name, amDevice, dc, props);
try
{
var factory = (IDeviceFactory)Crestron.SimplSharp.Reflection.Activator.CreateInstance(type);
factory.LoadTypeFactories();
}
catch (Exception e)
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Unable to load type: '{1}' DeviceFactory: {0}", e, type.Name);
}
}
}
else if (typeName.StartsWith("dmmd8x") || typeName.StartsWith("dmmd16x") || typeName.StartsWith("dmmd32x"))
{
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.DmChassisController.
GetDmChassisController(key, name, type, props);
}
else if (typeName.StartsWith("dmmd128x") || typeName.StartsWith("dmmd64x")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DMChassisPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.DmBladeChassisController.
GetDmChassisController(key, name, type, props);
}
// Hand off to DmTxHelper class
else if (typeName.StartsWith("dmtx")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DmTxPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.DmTxHelper.GetDmTxController(key, name, type, props);
}
// Hand off to DmRmcHelper class
else if (typeName.StartsWith("dmrmc")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.DmRmcPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.DmRmcHelper.GetDmRmcController(key, name, type, props);
}
else if (typeName.Equals("hdmd4x14ke")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.Config.HdMdNxM4kEPropertiesConfig>(properties.ToString());
return PepperDash.Essentials.DM.Chassis.HdMdNxM4kEController.GetController(key, name, type, props);
}
else if (typeName.Equals("hdmd400ce") || typeName.Equals("hdmd300ce") || typeName.Equals("hdmd200ce") || typeName.Equals("hdmd200c1ge")) {
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(properties.ToString());
if (typeName.Equals("hdmd400ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd300ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd200ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd200c1ge"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
}
return null;
}
}
}
}
}

View File

@@ -12,12 +12,14 @@ using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM
{
/// <summary>
/// Represent both a transmitter and receiver pair of the HD-MD-400-C-E / HD-MD-300-C-E / HD-MD-200-C-E kits
/// </summary>
[Description("Wrapper class for all HD-MD variants")]
public class HdMdxxxCEController : CrestronGenericBridgeableBaseDevice, IRouting//, IComPorts
{
/// <summary>
@@ -220,46 +222,47 @@ namespace PepperDash.Essentials.DM
//public int NumberOfComPorts { get { return 1; } }
//#endregion
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new HdMdxxxCEControllerJoinMap();
{
var joinMap = new HdMdxxxCEControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<HdMdxxxCEControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
joinMap = JsonConvert.DeserializeObject<HdMdxxxCEControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
RemoteEndDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RemoteEndDetected]);
trilist.SetSigTrueAction(joinMap.AutoRouteOn, AutoRouteOn);
AutoRouteOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoRouteOn]);
trilist.SetSigTrueAction(joinMap.AutoRouteOff, AutoRouteOff);
AutoRouteOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoRouteOff]);
trilist.SetSigTrueAction(joinMap.PriorityRoutingOn, PriorityRouteOn);
PriorityRoutingOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOn]);
trilist.SetSigTrueAction(joinMap.PriorityRoutingOff, PriorityRouteOff);
PriorityRoutingOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOff]);
trilist.SetSigTrueAction(joinMap.InputOnScreenDisplayEnabled, OnScreenDisplayEnable);
InputOnScreenDisplayEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayEnabled]);
trilist.SetSigTrueAction(joinMap.AutoRouteOff, OnScreenDisplayDisable);
InputOnScreenDisplayEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayDisabled]);
trilist.SetUShortSigAction(joinMap.VideoSource, (i) => ExecuteSwitch(i, null, eRoutingSignalType.Video | eRoutingSignalType.Audio));
VideoSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoSource]);
trilist.UShortInput[joinMap.SourceCount].UShortValue = (ushort)InputPorts.Count;
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
RemoteEndDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RemoteEndDetected.JoinNumber]);
trilist.SetSigTrueAction(joinMap.AutoRouteOn.JoinNumber, AutoRouteOn);
AutoRouteOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoRouteOn.JoinNumber]);
trilist.SetSigTrueAction(joinMap.AutoRouteOff.JoinNumber, AutoRouteOff);
AutoRouteOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoRouteOff.JoinNumber]);
trilist.SetSigTrueAction(joinMap.PriorityRoutingOn.JoinNumber, PriorityRouteOn);
PriorityRoutingOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOn.JoinNumber]);
trilist.SetSigTrueAction(joinMap.PriorityRoutingOff.JoinNumber, PriorityRouteOff);
PriorityRoutingOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOff.JoinNumber]);
trilist.SetSigTrueAction(joinMap.InputOnScreenDisplayEnabled.JoinNumber, OnScreenDisplayEnable);
InputOnScreenDisplayEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayEnabled.JoinNumber]);
trilist.SetSigTrueAction(joinMap.AutoRouteOff.JoinNumber, OnScreenDisplayDisable);
InputOnScreenDisplayEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayDisabled.JoinNumber]);
trilist.SetUShortSigAction(joinMap.VideoSource.JoinNumber, (i) => ExecuteSwitch(i, null, eRoutingSignalType.Video | eRoutingSignalType.Audio));
VideoSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoSource.JoinNumber]);
trilist.UShortInput[joinMap.SourceCount.JoinNumber].UShortValue = (ushort)InputPorts.Count;
foreach (var input in InputPorts)
{
var number = Convert.ToUInt16(input.Selector);
SyncDetectedFeedbacks[number].LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected + number]);
trilist.StringInput[joinMap.SourceNames + number].StringValue = input.Key;
var number = Convert.ToUInt16(input.Selector);
var numberJoin = (UInt16)(number - 1);
SyncDetectedFeedbacks[number].LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected.JoinNumber + numberJoin]);
trilist.StringInput[joinMap.SourceNames.JoinNumber + numberJoin].StringValue = input.Key;
}
}
}
@@ -268,4 +271,40 @@ namespace PepperDash.Essentials.DM
{
public ControlPropertiesConfig Control { get; set; }
}
public class HdMdxxxCEControllerFactory : EssentialsDeviceFactory<HdMdxxxCEController>
{
public HdMdxxxCEControllerFactory()
{
TypeNames = new List<string>() { "hdmd400ce", "hdmd300ce", "hdmd200ce", "hdmd200c1ge"};
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
var typeName = dc.Type.ToLower();
var key = dc.Key;
var name = dc.Name;
Debug.Console(1, "Factory Attempting to create new HD-MD Device");
var props = JsonConvert.DeserializeObject
<PepperDash.Essentials.DM.HdMdxxxCEPropertiesConfig>(dc.Properties.ToString());
if (typeName.Equals("hdmd400ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd400CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd300ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd300CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd200ce"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd200CE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else if (typeName.Equals("hdmd200c1ge"))
return new PepperDash.Essentials.DM.HdMdxxxCEController(key, name,
new HdMd200C1GE(props.Control.IpIdInt, props.Control.TcpSshProperties.Address, Global.ControlSystem));
else
return null;
}
}
}

View File

@@ -0,0 +1,108 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.UI;
using Crestron.SimplSharpPro.DM;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.DM.Endpoints.DGEs
{
/// <summary>
/// Wrapper class for DGE-100 and DM-DGE-200-C
/// </summary>
public class Dge100Controller : CrestronGenericBaseDevice, IComPorts, IIROutputPorts, IHasBasicTriListWithSmartObject, ICec
{
private readonly Dge100 _dge;
public BasicTriListWithSmartObject Panel { get { return _dge; } }
private DeviceConfig _dc;
CrestronTouchpanelPropertiesConfig PropertiesConfig;
public Dge100Controller(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
:base(key, name, device)
{
_dge = device;
_dc = dc;
PropertiesConfig = props;
}
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts
{
get { return _dge.ComPorts; }
}
public int NumberOfComPorts
{
get { return _dge.NumberOfComPorts; }
}
#endregion
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts
{
get { return _dge.IROutputPorts; }
}
public int NumberOfIROutputPorts
{
get { return _dge.NumberOfIROutputPorts; }
}
#endregion
#region ICec Members
public Cec StreamCec { get { return _dge.HdmiOut.StreamCec; } }
#endregion
}
public class Dge100ControllerFactory : EssentialsDeviceFactory<Dge100Controller>
{
public Dge100ControllerFactory()
{
TypeNames = new List<string>() { "dge100" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
var typeName = dc.Type.ToLower();
var comm = CommFactory.GetControlPropertiesConfig(dc);
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
Debug.Console(1, "Factory Attempting to create new DgeController Device");
Dge100 dgeDevice = null;
if (typeName == "dge100")
dgeDevice = new Dge100(comm.IpIdInt, Global.ControlSystem);
if (dgeDevice == null)
{
Debug.Console(1, "Unable to create DGE device");
return null;
}
var dgeController = new Dge100Controller(dc.Key, dc.Name, dgeDevice, dc, props);
return dgeController;
}
}
}

View File

@@ -1,66 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.UI;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM.Endpoints.DGEs
{
/// <summary>
/// Wrapper class for DGE-100 and DM-DGE-200-C
/// </summary>
public class DgeController : CrestronGenericBaseDevice, IComPorts, IIROutputPorts
{
public Dge100 DigitalGraphicsEngine { get; private set; }
public DeviceConfig DeviceConfig { get; private set; }
CrestronTouchpanelPropertiesConfig PropertiesConfig;
public DgeController(string key, string name, Dge100 device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
:base(key, name, device)
{
DigitalGraphicsEngine = device;
DeviceConfig = dc;
PropertiesConfig = props;
}
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts
{
get { return DigitalGraphicsEngine.ComPorts; }
}
public int NumberOfComPorts
{
get { return DigitalGraphicsEngine.NumberOfComPorts; }
}
#endregion
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts
{
get { return DigitalGraphicsEngine.IROutputPorts; }
}
public int NumberOfIROutputPorts
{
get { return DigitalGraphicsEngine.NumberOfIROutputPorts; }
}
#endregion
}
}

View File

@@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.UI;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
namespace PepperDash.Essentials.DM.Endpoints.DGEs
{
/// <summary>
/// Wrapper class for DGE-100 and DM-DGE-200-C
/// </summary>
public class DmDge200CController : Dge100Controller, IRoutingInputsOutputs
{
private readonly DmDge200C _dge;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get;
private set;
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get;
private set;
}
public DmDge200CController(string key, string name, DmDge200C device, DeviceConfig dc, CrestronTouchpanelPropertiesConfig props)
: base(key, name, device, dc, props)
{
_dge = device;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
InputPorts = new RoutingPortCollection<RoutingInputPort> { DmIn };
OutputPorts = new RoutingPortCollection<RoutingOutputPort> { HdmiOut };
// Set Ports for CEC
HdmiOut.Port = _dge.HdmiOut; ;
}
public class DmDge200CControllerFactory : EssentialsDeviceFactory<DmDge200CController>
{
public DmDge200CControllerFactory()
{
TypeNames = new List<string>() { "dmdge200c" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
var typeName = dc.Type.ToLower();
var comm = CommFactory.GetControlPropertiesConfig(dc);
var props = JsonConvert.DeserializeObject<CrestronTouchpanelPropertiesConfig>(dc.Properties.ToString());
Debug.Console(1, "Factory Attempting to create new DgeController Device");
DmDge200C dgeDevice = null;
if (typeName == "dmdge200c")
dgeDevice = new DmDge200C(comm.IpIdInt, Global.ControlSystem);
if (dgeDevice == null)
{
Debug.Console(1, "Unable to create DGE device");
return null;
}
var dgeController = new DmDge200CController(dc.Key , dc.Name, dgeDevice, dc, props);
return dgeController;
}
}
}
}

View File

@@ -1,11 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Ssh;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
@@ -13,32 +7,25 @@ using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.DM
{
public class HDBaseTRxController : DmHdBaseTControllerBase, IRoutingInputsOutputs,
IComPorts
IComPorts
{
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HDBaseTSink { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HDBaseTSink }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
public HDBaseTRxController(string key, string name, HDRx3CB rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HDBaseTSink = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this);
HDBaseTSink = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this) {Port = Rmc};
// Set Ports for CEC
HDBaseTSink.Port = Rmc; // Unique case, this class has no HdmiOutput port and ICec is implemented on the receiver class itself
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HDBaseTSink};
}
#region IComPorts Members

View File

@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
@@ -21,20 +15,14 @@ namespace PepperDash.Essentials.DM
public class DmRmc100SController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
public DmRmc100S Rmc { get; private set; }
private readonly DmRmc100S _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
/// Make a Crestron RMC and put it in here
@@ -42,20 +30,15 @@ namespace PepperDash.Essentials.DM
public DmRmc100SController(string key, string name, DmRmc100S rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this) {Port = _rmc};
// Set Ports for CEC
HdmiOut.Port = Rmc; // Unique case, this class has no HdmiOutput port and ICec is implemented on the receiver class itself
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
@@ -64,17 +47,17 @@ namespace PepperDash.Essentials.DM
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}

View File

@@ -1,12 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
@@ -21,19 +15,20 @@ namespace PepperDash.Essentials.DM
public class DmRmc150SController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
public DmRmc150S Rmc { get; private set; }
private readonly DmRmc150S _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
get; private set;
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
get;
private set ;
}
/// <summary>
@@ -42,59 +37,43 @@ namespace PepperDash.Essentials.DM
public DmRmc150SController(string key, string name, DmRmc150S rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
//VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
//Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
//void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
//{
// if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
// args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
// {
// VideoOutputResolutionFeedback.FireUpdate();
// }
//}
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
@@ -103,17 +82,17 @@ namespace PepperDash.Essentials.DM
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
@@ -21,19 +16,19 @@ namespace PepperDash.Essentials.DM
public class DmRmc200CController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
public DmRmc200C Rmc { get; private set; }
private readonly DmRmc200C _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
get; private set;
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
get; private set;
}
/// <summary>
@@ -42,24 +37,27 @@ namespace PepperDash.Essentials.DM
public DmRmc200CController(string key, string name, DmRmc200C rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -73,47 +71,40 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
@@ -21,20 +16,14 @@ namespace PepperDash.Essentials.DM
public class DmRmc200S2Controller : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
public DmRmc200S2 Rmc { get; private set; }
private readonly DmRmc200S2 _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
/// Make a Crestron RMC and put it in here
@@ -42,24 +31,27 @@ namespace PepperDash.Essentials.DM
public DmRmc200S2Controller(string key, string name, DmRmc200S2 rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -73,28 +65,21 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
@@ -103,17 +88,17 @@ namespace PepperDash.Essentials.DM
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
@@ -21,19 +16,16 @@ namespace PepperDash.Essentials.DM
public class DmRmc200SController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
public DmRmc200S Rmc { get; private set; }
private readonly DmRmc200S _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
get; private set;
}
/// <summary>
@@ -42,24 +34,27 @@ namespace PepperDash.Essentials.DM
public DmRmc200SController(string key, string name, DmRmc200S rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -73,47 +68,40 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}

View File

@@ -1,14 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
@@ -21,21 +16,15 @@ namespace PepperDash.Essentials.DM
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts
{
public DmRmc4kScalerC Rmc { get; private set; }
private readonly DmRmc4kScalerC _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingOutputPort BalancedAudioOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut, BalancedAudioOut }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
/// Make a Crestron RMC and put it in here
@@ -43,30 +32,35 @@ namespace PepperDash.Essentials.DM
public DmRmc4kScalerCController(string key, string name, DmRmc4kScalerC rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
eRoutingPortConnectionType.LineAudio, null, this);
MuteFeedback = new BoolFeedback(() => false);
VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
rmc.AudioOutput.VolumeFeedback.UShortValue);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut};
Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -80,62 +74,55 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
/// <summary>
/// Gets the CEC stream directly from the HDMI port.
/// </summary>
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
#region IRelayPorts Members
public int NumberOfRelayPorts
{
get { return Rmc.NumberOfRelayPorts; }
get { return _rmc.NumberOfRelayPorts; }
}
public CrestronCollection<Relay> RelayPorts
{
get { return Rmc.RelayPorts; }
get { return _rmc.RelayPorts; }
}
#endregion
@@ -153,6 +140,7 @@ namespace PepperDash.Essentials.DM
/// </summary>
public void MuteOff()
{
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
/// <summary>
@@ -160,11 +148,12 @@ namespace PepperDash.Essentials.DM
/// </summary>
public void MuteOn()
{
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
public void SetVolume(ushort level)
{
Rmc.AudioOutput.Volume.UShortValue = level;
_rmc.AudioOutput.Volume.UShortValue = level;
}
public IntFeedback VolumeLevelFeedback
@@ -182,22 +171,23 @@ namespace PepperDash.Essentials.DM
/// </summary>
public void MuteToggle()
{
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 0, 4000);
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 0, 4000);
else
Rmc.AudioOutput.Volume.StopRamp();
_rmc.AudioOutput.Volume.StopRamp();
}
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 65535, 4000);
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 65535, 4000);
else
Rmc.AudioOutput.Volume.StopRamp();
_rmc.AudioOutput.Volume.StopRamp();
}
#endregion

View File

@@ -1,11 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
@@ -16,44 +10,39 @@ namespace PepperDash.Essentials.DM
public class DmRmc4k100C1GController : DmHdBaseTControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
private readonly DmRmc4K100C1G _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
public DmRmc4k100C1GController(string key, string name, DmRmc4K100C1G rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this) {Port = _rmc};
// Set Ports for CEC
HdmiOut.Port = Rmc; // Unique case, this class has no HdmiOutput port and ICec is implemented on the receiver class itself
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return (Rmc as DmRmc4K100C1G).IROutputPorts; } }
public int NumberOfIROutputPorts { get { return (Rmc as DmRmc4K100C1G).NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
public Cec StreamCec { get { return (Rmc as DmRmc4K100C1G).StreamCec; } }
public Cec StreamCec { get { return _rmc.StreamCec; } }
#endregion
}
}

View File

@@ -1,14 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
@@ -21,21 +16,15 @@ namespace PepperDash.Essentials.DM
public class DmRmc4kScalerCDspController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
IIROutputPorts, IComPorts, ICec, IRelayPorts
{
public DmRmc4kScalerCDsp Rmc { get; private set; }
private readonly DmRmc4kScalerCDsp _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingOutputPort BalancedAudioOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut, BalancedAudioOut }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
/// Make a Crestron RMC and put it in here
@@ -43,10 +32,11 @@ namespace PepperDash.Essentials.DM
public DmRmc4kScalerCDspController(string key, string name, DmRmc4kScalerCDsp rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
BalancedAudioOut = new RoutingOutputPort(DmPortName.BalancedAudioOut, eRoutingSignalType.Audio,
eRoutingPortConnectionType.LineAudio, null, this);
@@ -55,18 +45,21 @@ namespace PepperDash.Essentials.DM
VolumeLevelFeedback = new IntFeedback("MainVolumeLevelFeedback", () =>
rmc.AudioOutput.VolumeFeedback.UShortValue);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut, BalancedAudioOut};
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -80,28 +73,21 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
@@ -110,32 +96,32 @@ namespace PepperDash.Essentials.DM
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
/// <summary>
/// Gets the CEC stream directly from the HDMI port.
/// </summary>
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
#region IRelayPorts Members
public int NumberOfRelayPorts
{
get { return Rmc.NumberOfRelayPorts; }
get { return _rmc.NumberOfRelayPorts; }
}
public CrestronCollection<Relay> RelayPorts
{
get { return Rmc.RelayPorts; }
get { return _rmc.RelayPorts; }
}
#endregion
@@ -153,6 +139,7 @@ namespace PepperDash.Essentials.DM
/// </summary>
public void MuteOff()
{
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
/// <summary>
@@ -160,11 +147,12 @@ namespace PepperDash.Essentials.DM
/// </summary>
public void MuteOn()
{
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
public void SetVolume(ushort level)
{
Rmc.AudioOutput.Volume.UShortValue = level;
_rmc.AudioOutput.Volume.UShortValue = level;
}
public IntFeedback VolumeLevelFeedback
@@ -182,22 +170,23 @@ namespace PepperDash.Essentials.DM
/// </summary>
public void MuteToggle()
{
Debug.Console(2, this, "DM Endpoint {0} does not have a mute function", Key);
}
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 0, 4000);
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 0, 4000);
else
Rmc.AudioOutput.Volume.StopRamp();
_rmc.AudioOutput.Volume.StopRamp();
}
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
SigHelper.RampTimeScaled(Rmc.AudioOutput.Volume, 65535, 4000);
SigHelper.RampTimeScaled(_rmc.AudioOutput.Volume, 65535, 4000);
else
Rmc.AudioOutput.Volume.StopRamp();
_rmc.AudioOutput.Volume.StopRamp();
}
#endregion

View File

@@ -0,0 +1,75 @@
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.DM
{
public class DmRmc4kZ100CController : DmRmcX100CController
{
private readonly DmRmc4kz100C _rmc;
public DmRmc4kZ100CController(string key, string name, DmRmc4kz100C rmc)
: base(key, name, rmc)
{
_rmc = rmc;
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
//removed to prevent NullReferenceException
//_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
{
switch (args.EventId)
{
case EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId:
case EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId:
case EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId:
VideoOutputResolutionFeedback.FireUpdate();
break;
case EndpointOutputStreamEventIds.HotplugDetectedEventId:
if (_rmc.HdmiOutput.ConnectedDevice == null) return;
EdidManufacturerFeedback.FireUpdate();
EdidNameFeedback.FireUpdate();
EdidPreferredTimingFeedback.FireUpdate();
EdidSerialNumberFeedback.FireUpdate();
break;
}
}
/*
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
switch (args.EventId)
{
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
}*/
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
}
}

View File

@@ -0,0 +1,137 @@
using System;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Core;
namespace PepperDash.Essentials.DM
{
public class DmRmc4kZScalerCController : DmRmcControllerBase, IRmcRouting,
IIROutputPorts, IComPorts, ICec
{
private readonly DmRmc4kzScalerC _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingInputPort HdmiIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
/// <summary>
/// The value of the current video source for the HDMI output on the receiver
/// </summary>
public IntFeedback AudioVideoSourceNumericFeedback { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
public DmRmc4kZScalerCController(string key, string name, DmRmc4kzScalerC rmc)
: base(key, name, rmc)
{
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiIn = new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn, HdmiIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
// Set Ports for CEC
HdmiOut.Port = _rmc.HdmiOutput;
AudioVideoSourceNumericFeedback = new IntFeedback(() => (ushort)(_rmc.SelectedSourceFeedback));
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
{
if (args.EventId == EndpointOutputStreamEventIds.HorizontalResolutionFeedbackEventId || args.EventId == EndpointOutputStreamEventIds.VerticalResolutionFeedbackEventId ||
args.EventId == EndpointOutputStreamEventIds.FramesPerSecondFeedbackEventId)
{
VideoOutputResolutionFeedback.FireUpdate();
}
if (args.EventId == EndpointOutputStreamEventIds.SelectedSourceFeedbackEventId)
{
AudioVideoSourceNumericFeedback.FireUpdate();
}
}
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
switch (args.EventId)
{
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
/// <summary>
/// Gets the CEC stream directly from the HDMI port.
/// </summary>
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
#region IRmcRouting Members
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{
Debug.Console(2, this, "Attempting a route from input {0} to HDMI Output", inputSelector);
var number = Convert.ToUInt16(inputSelector);
_rmc.AudioVideoSource = (DmRmc4kzScalerC.eAudioVideoSource)number;
}
public void ExecuteNumericSwitch(ushort inputSelector, ushort outputSelector, eRoutingSignalType signalType)
{
Debug.Console(2, this, "Attempting a route from input {0} to HDMI Output", inputSelector);
_rmc.AudioVideoSource = (DmRmc4kzScalerC.eAudioVideoSource)inputSelector;
}
#endregion
}
}

View File

@@ -1,284 +1,326 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM
{
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
{
public virtual StringFeedback VideoOutputResolutionFeedback { get; protected set; }
public virtual StringFeedback EdidManufacturerFeedback { get; protected set; }
public virtual StringFeedback EdidNameFeedback { get; protected set; }
public virtual StringFeedback EdidPreferredTimingFeedback { get; protected set; }
public virtual StringFeedback EdidSerialNumberFeedback { get; protected set; }
public DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
: base(key, name, device)
{
// if wired to a chassis, skip registration step in base class
if (device.DMOutput != null)
{
this.PreventRegistration = true;
}
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
}
protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new DmRmcControllerJoinMap();
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmRmcControllerJoinMap>(joinMapSerialized);
joinMap.OffsetJoinNumbers(joinStart);
Debug.Console(1, rmc, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
rmc.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
if (rmc.VideoOutputResolutionFeedback != null)
rmc.VideoOutputResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentOutputResolution]);
if (rmc.EdidManufacturerFeedback != null)
rmc.EdidManufacturerFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidManufacturer]);
if (rmc.EdidNameFeedback != null)
rmc.EdidNameFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidName]);
if (rmc.EdidPreferredTimingFeedback != null)
rmc.EdidPreferredTimingFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidPrefferedTiming]);
if (rmc.EdidSerialNumberFeedback != null)
rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber]);
}
}
public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
{
public HDBaseTBase Rmc { get; protected set; }
/// <summary>
/// Make a Crestron RMC and put it in here
/// </summary>
public DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
: base(key, name, rmc)
{
}
}
public class DmRmcHelper
{
/// <summary>
/// A factory method for various DmTxControllers
/// </summary>
/// <param name="key"></param>
/// <param name="name"></param>
/// <param name="props"></param>
/// <returns></returns>
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
{
// switch on type name... later...
typeName = typeName.ToLower();
uint ipid = props.Control.IpIdInt; // Convert.ToUInt16(props.Id, 16);
// right here, we need to grab the tie line that associates this
// RMC with a chassis or processor. If the RMC input's tie line is not
// connected to a chassis, then it's parent is the processor.
// If the RMC is connected to a chassis, then we need to grab the
// output number from the tie line and use that to plug it in.
// Example of chassis-connected:
//{
// "sourceKey": "dmMd8x8-1",
// "sourcePort": "anyOut2",
// "destinationKey": "dmRmc100C-2",
// "destinationPort": "DmIn"
//}
// Tx -> RMC link:
//{
// "sourceKey": "dmTx201C-1",
// "sourcePort": "DmOut",
// "destinationKey": "dmRmc100C-2",
// "destinationPort": "DmIn"
//}
var tlc = TieLineCollection.Default;
// grab the tie line that has this key as
// THIS DOESN'T WORK BECAUSE THE RMC THAT WE NEED (THIS) HASN'T BEEN MADE
// YET AND THUS WILL NOT HAVE A TIE LINE...
var inputTieLine = tlc.FirstOrDefault(t =>
{
var d = t.DestinationPort.ParentDevice;
return d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)
&& d is DmChassisController;
});
var pKey = props.ParentDeviceKey.ToLower();
// Non-DM-chassis endpoints
if (pKey == "processor")
{
// Catch constructor failures, mainly dues to IPID
try
{
if (typeName.StartsWith("dmrmc100c"))
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc100s"))
return new DmRmc100SController(key, name, new DmRmc100S(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc4k100c"))
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc4kz100c"))
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc150s"))
return new DmRmc150SController(key, name, new DmRmc150S(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc200c"))
return new DmRmc200CController(key, name, new DmRmc200C(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc200s"))
return new DmRmc200SController(key, name, new DmRmc200S(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc200s2"))
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmcscalerc"))
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmcscalers"))
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmcscalers2"))
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc4kscalerc"))
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, Global.ControlSystem));
if (typeName.StartsWith("dmrmc4kscalercdsp"))
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, Global.ControlSystem));
}
catch (Exception e)
{
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
}
Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
}
// Endpoints attached to DM Chassis
else
{
var parentDev = DeviceManager.GetDeviceForKey(pKey);
if (!(parentDev is IDmSwitch))
{
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
key, pKey);
return null;
}
var chassis = (parentDev as IDmSwitch).Chassis;
var num = props.ParentOutputNumber;
if (num <= 0 || num > chassis.NumberOfOutputs)
{
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
key, num);
return null;
}
else
{
var controller = (parentDev as IDmSwitch);
controller.RxDictionary.Add(num, key);
}
// Catch constructor failures, mainly dues to IPID
try
{
// Must use different constructor for CPU3 chassis types. No IPID
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
chassis is DmMd128x128 || chassis is DmMd64x64)
{
if (typeName.StartsWith("hdbasetrx"))
return new HDBaseTRxController(key, name, new HDRx3CB(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4k100c1g"))
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc100c"))
return new DmRmcX100CController(key, name, new DmRmc100C(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc100s"))
return new DmRmc100SController(key, name, new DmRmc100S(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4k100c"))
return new DmRmcX100CController(key, name, new DmRmc4k100C(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4kz100c"))
return new DmRmcX100CController(key, name, new DmRmc4kz100C(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc150s"))
return new DmRmc150SController(key, name, new DmRmc150S(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc200c"))
return new DmRmc200CController(key, name, new DmRmc200C(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc200s"))
return new DmRmc200SController(key, name, new DmRmc200S(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc200s2"))
return new DmRmc200S2Controller(key, name, new DmRmc200S2(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmcscalerc"))
return new DmRmcScalerCController(key, name, new DmRmcScalerC(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmcscalers"))
return new DmRmcScalerSController(key, name, new DmRmcScalerS(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmcscalers2"))
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4kscalerc"))
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4kscalercdsp"))
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(chassis.Outputs[num]));
}
else
{
if (typeName.StartsWith("hdbasetrx"))
return new HDBaseTRxController(key, name, new HDRx3CB(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4k100c1g"))
return new DmRmc4k100C1GController(key, name, new DmRmc4K100C1G(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc100c"))
return new DmRmcX100CController(key, name, new DmRmc100C(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc100s"))
return new DmRmc100SController(key, name, new DmRmc100S(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4k100c"))
return new DmRmcX100CController(key, name, new DmRmc4k100C(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4kz100c"))
return new DmRmcX100CController(key, name, new DmRmc4kz100C(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc150s"))
return new DmRmc150SController(key, name, new DmRmc150S(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc200c"))
return new DmRmc200CController(key, name, new DmRmc200C(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc200s"))
return new DmRmc200SController(key, name, new DmRmc200S(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc200s2"))
return new DmRmc200S2Controller(key, name, new DmRmc200S2(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmcscalerc"))
return new DmRmcScalerCController(key, name, new DmRmcScalerC(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmcscalers"))
return new DmRmcScalerSController(key, name, new DmRmcScalerS(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmcscalers2"))
return new DmRmcScalerS2Controller(key, name, new DmRmcScalerS2(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4kscalerc"))
return new DmRmc4kScalerCController(key, name, new DmRmc4kScalerC(ipid, chassis.Outputs[num]));
if (typeName.StartsWith("dmrmc4kscalercdsp"))
return new DmRmc4kScalerCDspController(key, name, new DmRmc4kScalerCDsp(ipid, chassis.Outputs[num]));
}
}
catch (Exception e)
{
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
}
}
return null;
}
}
using System;
using System.Collections.Generic;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.DM.Config;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.DM
{
[Description("Wrapper class for all DM-RMC variants")]
public abstract class DmRmcControllerBase : CrestronGenericBridgeableBaseDevice
{
private readonly EndpointReceiverBase _rmc; //kept here just in case. Only property or method on this class that's not device-specific is the DMOutput that it's attached to.
public StringFeedback VideoOutputResolutionFeedback { get; protected set; }
public StringFeedback EdidManufacturerFeedback { get; protected set; }
public StringFeedback EdidNameFeedback { get; protected set; }
public StringFeedback EdidPreferredTimingFeedback { get; protected set; }
public StringFeedback EdidSerialNumberFeedback { get; protected set; }
protected DmRmcControllerBase(string key, string name, EndpointReceiverBase device)
: base(key, name, device)
{
_rmc = device;
// if wired to a chassis, skip registration step in base class
PreventRegistration = _rmc.DMOutput != null;
AddToFeedbackList(VideoOutputResolutionFeedback, EdidManufacturerFeedback, EdidSerialNumberFeedback, EdidNameFeedback, EdidPreferredTimingFeedback);
}
protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
var joinMap = new DmRmcControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<DmRmcControllerJoinMap>(joinMapSerialized);
bridge.AddJoinMap(Key, joinMap);
Debug.Console(1, rmc, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
rmc.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
if (rmc.VideoOutputResolutionFeedback != null)
rmc.VideoOutputResolutionFeedback.LinkInputSig(trilist.StringInput[joinMap.CurrentOutputResolution.JoinNumber]);
if (rmc.EdidManufacturerFeedback != null)
rmc.EdidManufacturerFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidManufacturer.JoinNumber]);
if (rmc.EdidNameFeedback != null)
rmc.EdidNameFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidName.JoinNumber]);
if (rmc.EdidPreferredTimingFeedback != null)
rmc.EdidPreferredTimingFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidPrefferedTiming.JoinNumber]);
if (rmc.EdidSerialNumberFeedback != null)
rmc.EdidSerialNumberFeedback.LinkInputSig(trilist.StringInput[joinMap.EdidSerialNumber.JoinNumber]);
//If the device is an DM-RMC-4K-Z-SCALER-C
var routing = rmc as IRmcRouting;
if (routing == null)
{
return;
}
if (routing.AudioVideoSourceNumericFeedback != null)
routing.AudioVideoSourceNumericFeedback.LinkInputSig(trilist.UShortInput[joinMap.AudioVideoSource.JoinNumber]);
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber, a => routing.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
}
}
public abstract class DmHdBaseTControllerBase : CrestronGenericBaseDevice
{
protected HDBaseTBase Rmc;
/// <summary>
/// Make a Crestron RMC and put it in here
/// </summary>
protected DmHdBaseTControllerBase(string key, string name, HDBaseTBase rmc)
: base(key, name, rmc)
{
Rmc = rmc;
}
}
public class DmRmcHelper
{
private static readonly Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>> ProcessorFactoryDict;
private static readonly Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>> ChassisCpu3Dict;
private static readonly Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>>
ChassisDict;
static DmRmcHelper()
{
ProcessorFactoryDict = new Dictionary<string, Func<string, string, uint, CrestronGenericBaseDevice>>
{
{"dmrmc100c", (k, n, i) => new DmRmcX100CController(k, n, new DmRmc100C(i, Global.ControlSystem))},
{"dmrmc100s", (k, n, i) => new DmRmc100SController(k, n, new DmRmc100S(i, Global.ControlSystem))},
{"dmrmc4k100c", (k, n, i) => new DmRmcX100CController(k, n, new DmRmc4k100C(i, Global.ControlSystem))},
{"dmrmc4kz100c", (k, n, i) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(i, Global.ControlSystem))},
{"dmrmc150s", (k, n, i) => new DmRmc150SController(k, n, new DmRmc150S(i, Global.ControlSystem))},
{"dmrmc200c", (k, n, i) => new DmRmc200CController(k, n, new DmRmc200C(i, Global.ControlSystem))},
{"dmrmc200s", (k, n, i) => new DmRmc200SController(k, n, new DmRmc200S(i, Global.ControlSystem))},
{"dmrmc200s2", (k, n, i) => new DmRmc200S2Controller(k, n, new DmRmc200S2(i, Global.ControlSystem))},
{"dmrmcscalerc", (k, n, i) => new DmRmcScalerCController(k, n, new DmRmcScalerC(i, Global.ControlSystem))},
{"dmrmcscalers", (k, n, i) => new DmRmcScalerSController(k, n, new DmRmcScalerS(i, Global.ControlSystem))},
{
"dmrmcscalers2",
(k, n, i) => new DmRmcScalerS2Controller(k, n, new DmRmcScalerS2(i, Global.ControlSystem))
},
{
"dmrmc4kscalerc",
(k, n, i) => new DmRmc4kScalerCController(k, n, new DmRmc4kScalerC(i, Global.ControlSystem))
},
{
"dmrmc4kscalercdsp",
(k, n, i) => new DmRmc4kScalerCDspController(k, n, new DmRmc4kScalerCDsp(i, Global.ControlSystem))
},
{
"dmrmc4kzscalerc",
(k, n, i) => new DmRmc4kZScalerCController(k, n, new DmRmc4kzScalerC(i, Global.ControlSystem))
}
};
ChassisCpu3Dict = new Dictionary<string, Func<string, string, DMOutput, CrestronGenericBaseDevice>>
{
{"dmrmc100c", (k, n, d) => new DmRmcX100CController(k, n, new DmRmc100C(d))},
{"dmrmc100s", (k, n, d) => new DmRmc100SController(k, n, new DmRmc100S(d))},
{"dmrmc4k100c", (k, n, d) => new DmRmcX100CController(k, n, new DmRmc4k100C(d))},
{"dmrmc4kz100c", (k, n, d) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(d))},
{"dmrmc150s", (k, n, d) => new DmRmc150SController(k, n, new DmRmc150S(d))},
{"dmrmc200c", (k, n, d) => new DmRmc200CController(k, n, new DmRmc200C(d))},
{"dmrmc200s", (k, n, d) => new DmRmc200SController(k, n, new DmRmc200S(d))},
{"dmrmc200s2", (k, n, d) => new DmRmc200S2Controller(k, n, new DmRmc200S2(d))},
{"dmrmcscalerc", (k, n, d) => new DmRmcScalerCController(k, n, new DmRmcScalerC(d))},
{"dmrmcscalers", (k, n, d) => new DmRmcScalerSController(k, n, new DmRmcScalerS(d))},
{
"dmrmcscalers2",
(k, n, d) => new DmRmcScalerS2Controller(k, n, new DmRmcScalerS2(d))
},
{
"dmrmc4kscalerc",
(k, n, d) => new DmRmc4kScalerCController(k, n, new DmRmc4kScalerC(d))
},
{
"dmrmc4kscalercdsp",
(k, n, d) => new DmRmc4kScalerCDspController(k, n, new DmRmc4kScalerCDsp(d))
},
{
"dmrmc4kzscalerc",
(k, n, d) => new DmRmc4kZScalerCController(k, n, new DmRmc4kzScalerC(d))
},
{"hdbasetrx", (k,n,d) => new HDBaseTRxController(k,n, new HDRx3CB(d))},
{"dmrmc4k100c1g", (k,n,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(d))}
};
ChassisDict = new Dictionary<string, Func<string, string, uint, DMOutput, CrestronGenericBaseDevice>>
{
{"dmrmc100c", (k, n, i, d) => new DmRmcX100CController(k, n, new DmRmc100C(i,d))},
{"dmrmc100s", (k, n,i, d) => new DmRmc100SController(k, n, new DmRmc100S(i,d))},
{"dmrmc4k100c", (k, n,i, d) => new DmRmcX100CController(k, n, new DmRmc4k100C(i,d))},
{"dmrmc4kz100c", (k, n,i, d) => new DmRmc4kZ100CController(k, n, new DmRmc4kz100C(i,d))},
{"dmrmc150s", (k, n,i, d) => new DmRmc150SController(k, n, new DmRmc150S(i,d))},
{"dmrmc200c", (k, n,i, d) => new DmRmc200CController(k, n, new DmRmc200C(i,d))},
{"dmrmc200s", (k, n,i, d) => new DmRmc200SController(k, n, new DmRmc200S(i,d))},
{"dmrmc200s2", (k, n,i, d) => new DmRmc200S2Controller(k, n, new DmRmc200S2(i,d))},
{"dmrmcscalerc", (k, n,i, d) => new DmRmcScalerCController(k, n, new DmRmcScalerC(i,d))},
{"dmrmcscalers", (k, n,i, d) => new DmRmcScalerSController(k, n, new DmRmcScalerS(i,d))},
{
"dmrmcscalers2",
(k, n,i, d) => new DmRmcScalerS2Controller(k, n, new DmRmcScalerS2(d))
},
{
"dmrmc4kscalerc",
(k, n,i, d) => new DmRmc4kScalerCController(k, n, new DmRmc4kScalerC(d))
},
{
"dmrmc4kscalercdsp",
(k, n,i, d) => new DmRmc4kScalerCDspController(k, n, new DmRmc4kScalerCDsp(d))
},
{
"dmrmc4kzscalerc",
(k, n,i, d) => new DmRmc4kZScalerCController(k, n, new DmRmc4kzScalerC(d))
},
{"hdbasetrx", (k,n,i,d) => new HDBaseTRxController(k,n, new HDRx3CB(d))},
{"dmrmc4k100c1g", (k,n,i,d) => new DmRmc4k100C1GController(k,n, new DmRmc4K100C1G(d))}
};
}
/// <summary>
/// A factory method for various DmRmcControllers
/// </summary>
/// <param name="key">device key. Used to uniquely identify device</param>
/// <param name="name">device name</param>
/// <param name="typeName">device type name. Used to retrived the correct device</param>
/// <param name="props">Config from config file</param>
/// <returns></returns>
public static CrestronGenericBaseDevice GetDmRmcController(string key, string name, string typeName, DmRmcPropertiesConfig props)
{
typeName = typeName.ToLower();
var ipid = props.Control.IpIdInt;
var pKey = props.ParentDeviceKey.ToLower();
// Non-DM-chassis endpoints
return pKey == "processor" ? GetDmRmcControllerForProcessor(key, name, typeName, ipid) : GetDmRmcControllerForChassis(key, name, typeName, props, pKey, ipid);
}
private static CrestronGenericBaseDevice GetDmRmcControllerForChassis(string key, string name, string typeName,
DmRmcPropertiesConfig props, string pKey, uint ipid)
{
var parentDev = DeviceManager.GetDeviceForKey(pKey);
if (!(parentDev is IDmSwitch))
{
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
key, pKey);
return null;
}
var chassis = (parentDev as IDmSwitch).Chassis;
var num = props.ParentOutputNumber;
if (num <= 0 || num > chassis.NumberOfOutputs)
{
Debug.Console(0, "Cannot create DM device '{0}'. Output number '{1}' is out of range",
key, num);
return null;
}
var controller = parentDev as IDmSwitch;
controller.RxDictionary.Add(num, key);
// Catch constructor failures, mainly dues to IPID
try
{
// Must use different constructor for CPU3 chassis types. No IPID
if (chassis is DmMd8x8Cpu3 || chassis is DmMd16x16Cpu3 ||
chassis is DmMd32x32Cpu3 || chassis is DmMd8x8Cpu3rps ||
chassis is DmMd16x16Cpu3rps || chassis is DmMd32x32Cpu3rps ||
chassis is DmMd128x128 || chassis is DmMd64x64)
{
return GetDmRmcControllerForCpu3Chassis(key, name, typeName, chassis, num, parentDev);
}
return GetDmRmcControllerForCpu2Chassis(key, name, typeName, ipid, chassis, num, parentDev);
}
catch (Exception e)
{
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
return null;
}
}
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu2Chassis(string key, string name, string typeName,
uint ipid, Switch chassis, uint num, IKeyed parentDev)
{
Func<string, string, uint, DMOutput, CrestronGenericBaseDevice> handler;
if (ChassisDict.TryGetValue(typeName.ToLower(), out handler))
{
return handler(key, name, ipid, chassis.Outputs[num]);
}
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
return null;
}
private static CrestronGenericBaseDevice GetDmRmcControllerForCpu3Chassis(string key, string name, string typeName,
Switch chassis, uint num, IKeyed parentDev)
{
Func<string, string, DMOutput, CrestronGenericBaseDevice> cpu3Handler;
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out cpu3Handler))
{
return cpu3Handler(key, name, chassis.Outputs[num]);
}
Debug.Console(0, "Cannot create DM-RMC of type '{0}' with parent device {1}", typeName, parentDev.Key);
return null;
}
private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
{
try
{
Func<string, string, uint, CrestronGenericBaseDevice> handler;
if (ProcessorFactoryDict.TryGetValue(typeName.ToLower(), out handler))
{
return handler(key, name, ipid);
}
Debug.Console(0, "Cannot create DM-RMC of type: '{0}'", typeName);
return null;
}
catch (Exception e)
{
Debug.Console(0, "[{0}] WARNING: Cannot create DM-RMC device: {1}", key, e.Message);
return null;
}
}
}
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>
{
public DmRmcControllerFactory()
{
TypeNames = new List<string>
{ "hdbasetrx", "dmrmc4k100c1g", "dmrmc100c", "dmrmc100s", "dmrmc4k100c", "dmrmc150s",
"dmrmc200c", "dmrmc200s", "dmrmc200s2", "dmrmcscalerc", "dmrmcscalers", "dmrmcscalers2", "dmrmc4kscalerc", "dmrmc4kscalercdsp",
"dmrmc4kz100c", "dmrmckzscalerc" };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
var type = dc.Type.ToLower();
Debug.Console(1, "Factory Attempting to create new DM-RMC Device");
var props = JsonConvert.DeserializeObject
<DmRmcPropertiesConfig>(dc.Properties.ToString());
return DmRmcHelper.GetDmRmcController(dc.Key, dc.Name, type, props);
}
}
}

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
@@ -21,20 +16,14 @@ namespace PepperDash.Essentials.DM
public class DmRmcScalerCController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
public DmRmcScalerC Rmc { get; private set; }
private readonly DmRmcScalerC _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
/// Make a Crestron RMC and put it in here
@@ -42,24 +31,27 @@ namespace PepperDash.Essentials.DM
public DmRmcScalerCController(string key, string name, DmRmcScalerC rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -73,50 +65,43 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
LinkDmRmcToApi(this, trilist, joinStart, joinMapKey, bridge);
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
/// <summary>
/// Gets the CEC stream directly from the HDMI port.
/// </summary>
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
@@ -21,20 +16,14 @@ namespace PepperDash.Essentials.DM
public class DmRmcScalerS2Controller : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
public DmRmcScalerS2 Rmc { get; private set; }
private readonly DmRmcScalerS2 _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
/// Make a Crestron RMC and put it in here
@@ -42,24 +31,27 @@ namespace PepperDash.Essentials.DM
public DmRmcScalerS2Controller(string key, string name, DmRmcScalerS2 rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -73,29 +65,23 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
@@ -103,20 +89,20 @@ namespace PepperDash.Essentials.DM
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
/// <summary>
/// Gets the CEC stream directly from the HDMI port.
/// </summary>
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}

View File

@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
@@ -21,20 +16,14 @@ namespace PepperDash.Essentials.DM
public class DmRmcScalerSController : DmRmcControllerBase, IRoutingInputsOutputs,
IIROutputPorts, IComPorts, ICec
{
public DmRmcScalerS Rmc { get; private set; }
private readonly DmRmcScalerS _rmc;
public RoutingInputPort DmIn { get; private set; }
public RoutingOutputPort HdmiOut { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts
{
get { return new RoutingPortCollection<RoutingInputPort> { DmIn }; }
}
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort> { HdmiOut }; }
}
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
/// Make a Crestron RMC and put it in here
@@ -42,24 +31,27 @@ namespace PepperDash.Essentials.DM
public DmRmcScalerSController(string key, string name, DmRmcScalerS rmc)
: base(key, name, rmc)
{
Rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
_rmc = rmc;
DmIn = new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DmCat, 0, this);
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
HdmiOut = new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this);
EdidManufacturerFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => Rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
EdidManufacturerFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Manufacturer.StringValue);
EdidNameFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.Name.StringValue);
EdidPreferredTimingFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.PreferredTiming.StringValue);
EdidSerialNumberFeedback = new StringFeedback(() => _rmc.HdmiOutput.ConnectedDevice.SerialNumber.StringValue);
VideoOutputResolutionFeedback = new StringFeedback(() => Rmc.HdmiOutput.GetVideoResolutionString());
VideoOutputResolutionFeedback = new StringFeedback(() => _rmc.HdmiOutput.GetVideoResolutionString());
Rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
Rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
InputPorts = new RoutingPortCollection<RoutingInputPort> {DmIn};
OutputPorts = new RoutingPortCollection<RoutingOutputPort> {HdmiOut};
// Set Ports for CEC
HdmiOut.Port = Rmc.HdmiOutput;
HdmiOut.Port = _rmc.HdmiOutput;
}
void HdmiOutput_OutputStreamChange(EndpointOutputStream outputStream, EndpointOutputStreamEventArgs args)
@@ -73,28 +65,21 @@ namespace PepperDash.Essentials.DM
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
{
if (args.EventId == ConnectedDeviceEventIds.ManufacturerEventId)
switch (args.EventId)
{
EdidManufacturerFeedback.FireUpdate();
case ConnectedDeviceEventIds.ManufacturerEventId:
EdidManufacturerFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.NameEventId:
EdidNameFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.PreferredTimingEventId:
EdidPreferredTimingFeedback.FireUpdate();
break;
case ConnectedDeviceEventIds.SerialNumberEventId:
EdidSerialNumberFeedback.FireUpdate();
break;
}
else if (args.EventId == ConnectedDeviceEventIds.NameEventId)
{
EdidNameFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.PreferredTimingEventId)
{
EdidPreferredTimingFeedback.FireUpdate();
}
else if (args.EventId == ConnectedDeviceEventIds.SerialNumberEventId)
{
EdidSerialNumberFeedback.FireUpdate();
}
}
public override bool CustomActivate()
{
// Base does register and sets up comm monitoring.
return base.CustomActivate();
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
@@ -103,20 +88,20 @@ namespace PepperDash.Essentials.DM
}
#region IIROutputPorts Members
public CrestronCollection<IROutputPort> IROutputPorts { get { return Rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return Rmc.NumberOfIROutputPorts; } }
public CrestronCollection<IROutputPort> IROutputPorts { get { return _rmc.IROutputPorts; } }
public int NumberOfIROutputPorts { get { return _rmc.NumberOfIROutputPorts; } }
#endregion
#region IComPorts Members
public CrestronCollection<ComPort> ComPorts { get { return Rmc.ComPorts; } }
public int NumberOfComPorts { get { return Rmc.NumberOfComPorts; } }
public CrestronCollection<ComPort> ComPorts { get { return _rmc.ComPorts; } }
public int NumberOfComPorts { get { return _rmc.NumberOfComPorts; } }
#endregion
#region ICec Members
/// <summary>
/// Gets the CEC stream directly from the HDMI port.
/// </summary>
public Cec StreamCec { get { return Rmc.HdmiOutput.StreamCec; } }
public Cec StreamCec { get { return _rmc.HdmiOutput.StreamCec; } }
#endregion
}
}

Some files were not shown because too many files have changed in this diff Show More