Compare commits

...

337 Commits
v1.0 ... v1.2.0

Author SHA1 Message Date
Heath Volmer
ca9da1ef79 Merge pull request #7 in PEC/essentials from feature/ecs-747 to development
* commit 'e0bfb8f0915de0597a05bc658bf9b9a235566b38':
  Fixed issue preventing lighting scene feedback from updating correctly.
  Bug fix for LutronQuantumArea class that caused crash when debug level was set to 2 and data was received from device.  Updates EssentialsEnvironmentDriver to only include environment devices in UI container columns if a matching UI driver can be constructed (ignores DIN8SW8)
2018-06-26 14:51:18 -04:00
Neil Dorin
e0bfb8f091 Fixed issue preventing lighting scene feedback from updating correctly. 2018-06-26 11:53:18 -06:00
Neil Dorin
97db1f35a1 Bug fix for LutronQuantumArea class that caused crash when debug level was set to 2 and data was received from device. Updates EssentialsEnvironmentDriver to only include environment devices in UI container columns if a matching UI driver can be constructed (ignores DIN8SW8) 2018-06-26 10:41:43 -06:00
Heath Volmer
2b6a13271f Renabled GoWithLoad, lost in merge 2018-06-15 15:34:52 -06:00
Heath Volmer
4686799371 Compiled, for review 2018-06-15 14:30:34 -06:00
Heath Volmer
cb750a2fd0 Merge branch 'development' of http://code.pepperdash.net/scm/pec/essentials into development 2018-06-15 14:11:17 -06:00
Heath Volmer
6d81e8d21e Merge branch 'feature/ecs-684' into development 2018-06-15 14:05:00 -06:00
Heath Volmer
600b9f11ff Merge pull request #6 in PEC/essentials from feature/ecs-711 to development
* commit 'c20036cfe95f0940d378dfa6db402cd61a48b54e':
  Updates to add IncludeInFusionRoomHealth config property for UI devices to allow them to be excluded from the Fusion error rollup.  Implement ICommunicationMonitor on EssentialsTouchpanelControler class. Updated Fusion class to better handle mapping digital online joins to ICommunicationMonitor classes.
2018-06-15 15:42:47 -04:00
Neil Dorin
c20036cfe9 Updates to add IncludeInFusionRoomHealth config property for UI devices to allow them to be excluded from the Fusion error rollup. Implement ICommunicationMonitor on EssentialsTouchpanelControler class. Updated Fusion class to better handle mapping digital online joins to ICommunicationMonitor classes. 2018-06-07 16:00:53 -06:00
Heath Volmer
005b3f0843 v 1.1.8; mob-303, fixed swapped template and system uuid fields in server delivered config 2018-06-06 11:09:58 -06:00
Neil Dorin
fbe5df84be Updated to allow for middle shade button to have label driven from config. 2018-06-05 16:47:07 -06:00
Heath Volmer
8e4c84dd02 Ignore tie lines if none present in config 2018-06-01 11:48:27 -06:00
Heath Volmer
dace2a57c2 1.1.7. Changed app server device types to match config tool: appServer, mobileControlBridge-ddvc01 2018-06-01 09:29:06 -06:00
Neil Dorin
3cf188f820 Completed Environment UI effort. Tested with EssentialsHuddleRoom type 2018-05-24 09:44:13 -06:00
Neil Dorin
80377a41d0 Environment Driver now showing and correct background subpage is appearing 2018-05-22 23:15:08 -06:00
Neil Dorin
a0ebc08838 Corrected issue in ShowSetupButtons method. Environment icon is displaying correctly when config defined. 2018-05-21 22:13:07 -06:00
Neil Dorin
0de4fbb69c Strange issue in HeaderDriver.SetupHeaderButtons with avDriver being null. Need to investigate further 2018-05-17 14:42:57 -06:00
Neil Dorin
c88b259c71 Significant refactoring of DeviceFactory for touchpanel device building. Moved SetupHeaderButtons() out of AV driver classes and into new EssentialsHeaderDriver class. 2018-05-17 12:33:20 -06:00
Heath Volmer
20660c561a v 1.1.6 2018-05-14 12:36:56 -06:00
Neil Dorin
b44613b91f Refactored method names for better consistency. Built out Din8sw8 and Din8sw8Output classes. Added logic for RelayControlledShade class to operate relays based on open/close/stop method calls 2018-05-03 10:23:30 -06:00
Heath Volmer
58de8ce8ad Will now identify in console when auth fails due to UUID or code 2018-05-01 21:06:59 -06:00
Neil Dorin
33f0a1fe32 More progress on relay based shade control 2018-05-01 16:45:18 -06:00
Heath Volmer
4b0f8abd9f 1.1.6 Added TryEnter to VTC room routing to prevent multiple source routes from accidentally running simultaneously (NYU bug); Restructuring MOBILEHTTPREQUEST to do post and get 2018-05-01 10:27:16 -06:00
Heath Volmer
4defea55f0 1.1.4, added clientAppUrl property to config, passed through to DDVC01 EISC 2018-04-27 14:44:54 -06:00
Neil Dorin
9c8f85555e Adds initial Shade interfaces and Shade Base Class 2018-04-27 10:28:41 -06:00
Heath Volmer
62e2c3d19f 1.1.1 Added MOBILEHTTPDEBUG command to help track failed http requests 2018-04-26 12:29:15 -06:00
Heath Volmer
e1c8b54434 1.1.0 Added verbose logging to http failure on MC initial connect 2018-04-26 09:46:15 -06:00
Neil Dorin
6d913e8a72 Updates to LutronQuantum.cs 2018-04-05 17:08:42 -06:00
Neil Dorin
afa1cff0e0 v1.0.48 - Updates all code that uses file paths to work on windows or linux platforms. Updates to add compatability for running on XiO Edge platform. 2018-03-29 10:36:22 -06:00
Neil Dorin
ce6cecbb79 Refactored how configuration, IR and SGD file path prefixes are handled, in order to be able to handle a different file structure if running on XiO Edge 2018-03-27 16:39:23 -06:00
Heath Volmer
69314bb1f1 Changed websocket sendAysnc to send in order to allow rapid messages to go out. Not sure if this is a valid fix, but it works 2018-03-22 16:45:14 -06:00
Neil Dorin
fb19b5894b Added lighting interfaces and base class 2018-03-22 16:07:18 -06:00
Neil Dorin
82fad55c1e Removed all HTTP Post logic from CotijaSystemController and switched to websockets for sending data to server 2018-03-21 12:59:41 -06:00
Heath Volmer
8d03e81431 Not sure of modification 2018-03-21 10:18:05 -06:00
Heath Volmer
fa8ea4cef6 Added mobileinfo command to help with mobile control debugging 2018-03-16 14:46:52 -06:00
Heath Volmer
97a44ffa4f 1.0.46 2018-03-13 18:34:05 -06:00
Heath Volmer
ee55be86e0 Fixed startup crash when device has out-of-range com port 2018-03-13 18:33:16 -06:00
Heath Volmer
ced1efdb47 Remove 'v' from assemblyVersion info object
, cotija
2018-03-12 16:21:41 -06:00
Neil Dorin
5129b19748 Adds RuntimeInfo class to InfoConfig and populates values when CotijaController class calls RegisterSystemToServer() 2018-03-12 15:19:31 -06:00
Heath Volmer
525881ebe1 Bugfixes: HDMD4k4x1 code around toggle-switching; add source list evaluation when pressing share 2018-03-09 15:40:02 -07:00
Heath Volmer
856a81ded4 Hotfix for TD - Null ref in incoming call. Thought this was fixed. 2018-03-09 09:10:25 -07:00
Heath Volmer
ef8298ccd6 Added Event locking to system registration to help prevent multiple registrations when network lost or dns changed. 2018-03-08 13:55:21 -07:00
Heath Volmer
cdbab152f6 System - server reconnecting ! 2018-03-07 14:09:37 -07:00
Heath Volmer
359bd508e5 Attached Parse method to websocket receive 2018-03-07 12:44:58 -07:00
Heath Volmer
62e5e6f176 Getting websocket -> cotija going 2018-03-07 12:33:10 -07:00
Heath Volmer
2d375ed2d7 Fixed null ref when in call changed and system is off 2018-03-05 09:55:27 -07:00
Heath Volmer
2e78191e33 Messages in SSE receive to help debug missing data - no progress yet 2018-03-02 13:32:48 -07:00
Heath Volmer
45ac17622a cotija fixes 2018-02-21 13:56:06 -07:00
Heath Volmer
e7e6ae98cf Added server URL and mobile user code 2018-02-16 14:20:02 -07:00
Heath Volmer
2fbd645bf0 Re-enabled cotija for huddle room: 2018-02-14 08:52:47 -07:00
Heath Volmer
2a4ed67bee DDVC bridge 2018-02-13 17:42:28 -07:00
Heath Volmer
17c448e309 Pulling in 670 branch changes 2018-02-08 12:35:08 -07:00
Heath Volmer
5afa626fb3 Removed thread/timer from touchpanel creation. Hopefully will fix disappearing panels 2018-02-07 16:29:06 -07:00
Heath Volmer
ba1e8646e5 HDCP disables from config on HDMD4x1. Appears to be working 2018-02-07 16:17:41 -07:00
Heath Volmer
88e82fb398 HDCP Disable in from config 2018-02-07 13:55:56 -07:00
Heath Volmer
53ee87c9be Initial successful tests of non-sharable source derouting and redraw of source list when in/out of call 2018-02-07 09:59:12 -07:00
Heath Volmer
032bb2b8e5 Added in source list filtering based on in-call and current mode of UI driver (call or present) 2018-02-06 17:03:11 -07:00
Heath Volmer
6ee56dd66c Loaded new PD.Core with proper cresnet and ipidTcp comm enums; Loaded spark room with HDMI4x1. Testing forthcoming: 2018-02-06 13:23:40 -07:00
Heath Volmer
d887b448c9 Added Crestron HDMD4x14kE switcher. Awaiting testing 2018-02-06 09:48:29 -07:00
Heath Volmer
f099c88352 Added framework classes for 4x1 2018-02-05 14:40:25 -07:00
Heath Volmer
f98a429b55 Building config from DDVC but no values are present... 2018-02-02 15:53:26 -07:00
Heath Volmer
645816c75f Trying to force config values to load in lieu of proper signalling from Simpl code 2018-02-02 15:34:37 -07:00
Heath Volmer
491fff2793 Rearranged how cotija bridge are brought up in relation to parent; adding ddvd01 bridge 2018-02-02 13:37:48 -07:00
Heath Volmer
952e7f4083 Trying to make bridge base happy with DDVC01 2018-02-01 15:41:36 -07:00
Heath Volmer
56c418580c Have multi-volume with recall ready for test. Pausing dependent on conversation with NYU 2018-01-31 12:36:57 -07:00
Heath Volmer
4134622b28 Added volume control switching to VTC1 class. Added volume zero/restore code to VTC1 and base classes. Related config 2018-01-31 10:58:43 -07:00
Heath Volmer
09b3f7c5e7 Preparing DDVCO1 cotija bridge to send configuration - incomplete 2018-01-30 09:19:51 -07:00
Heath Volmer
9fa2b22448 Adding ddvc01 properties from EISC into config objects 2018-01-29 19:22:08 -07:00
Heath Volmer
62d8190eef Restored missing release package cpz 2018-01-26 09:55:05 -07:00
Heath Volmer
19284b171a Post-merge 344, compile and warning cleanup 2018-01-26 09:46:53 -07:00
Neil Dorin
29c60548cc v1.0.34.* Updated Device Factory to consume portal generated config format 2018-01-23 16:12:38 -07:00
Heath Volmer
17f147b5e0 Added cresnet to comm config 2018-01-23 13:21:50 -07:00
Heath Volmer
7aa3d50cd6 Merge of ecs-342-neil, v.33 2018-01-23 10:14:35 -07:00
Neil Dorin
b85abe1b79 v1.0.33.* -Fixed issues with versiport configuration for pull up resistor based on feedback from Alex onsite. Corrected issue with RoomIsOccupiedFeedback_OutputChange method in EssentialsRoomBase. Updated Fusion Remote Occ sensor logic. 2018-01-22 16:37:27 -07:00
Heath Volmer
b7bab6cfd1 Added Activate cycle try/catch for individual devices; added test abilities to feedbacks 2018-01-22 14:53:09 -07:00
Neil Dorin
b83b3737e9 Committing missed file 2018-01-22 14:25:58 -07:00
Neil Dorin
42c4c705c9 Added ability to disable pull up resistor on versiports from config. 2018-01-22 14:25:37 -07:00
Heath Volmer
cb41b31018 Wrap up Friday - null ref in RoomBase on Occ sensor event 2018-01-22 11:31:23 -07:00
Heath Volmer
6f028c06ae Debugging on privacy buttons 2018-01-19 15:44:14 -07:00
Heath Volmer
bc25c31860 Added versiport creation to factory; rearrange success/failure cases to be more descriptive and easier to follow in code 2018-01-18 15:52:51 -07:00
Heath Volmer
32b548eba0 Room off timing on spark room; debug on load failures; testing on occ sensor and mics 2018-01-18 14:35:39 -07:00
Heath Volmer
f83e64ee7e Merge ecs-665 2018-01-18 11:09:40 -07:00
Neil Dorin
2ee365447c Added occupacy debug console messages and linked crestron sensor event to generic interface event 2018-01-18 06:51:27 -07:00
Heath Volmer
e5ac725b85 Compile for release v -> 1.0.18 2018-01-17 15:24:10 -07:00
Heath Volmer
d0cbb8d096 Join changes on DDVC 2018-01-17 15:21:42 -07:00
Heath Volmer
91f6235441 Merge pull request #4 in PEC/essentials from feature/ecs-665 to development
* commit '3c256564c6b333dc232c1fb67040d2bbc39471ac':
  Added code to Device Factory to build Cresnet Occupancy Sensors from config.
2018-01-17 17:19:19 -05:00
Neil Dorin
3c256564c6 Added code to Device Factory to build Cresnet Occupancy Sensors from config. 2018-01-17 14:54:35 -07:00
Heath Volmer
53de4f32eb Merge of mob-136 2018-01-17 11:57:34 -07:00
Heath Volmer
9effa78fdf Tested basic messaging with Simpl code; worked out join ranges for most messages; adding config data 2018-01-15 15:53:32 -07:00
Heath Volmer
ba5036e400 Fixed SetStringSigAction stack overflow ;-); Added DDVC room bridge class with basic actions attached and messages prepared 2018-01-15 11:35:04 -07:00
Heath Volmer
cd747a01ea v1.0.17 - initial setup of file system 2018-01-09 16:00:49 -07:00
Heath Volmer
ac4ef972fe Added initial filesystem set up that puts all folders in place on initial run 2018-01-09 15:58:38 -07:00
Heath Volmer
857d10f0b2 Added shutdown-related api to CotijaRoomController 2018-01-04 17:28:38 -07:00
Heath Volmer
b45fb57cb2 1.0.15; Huddle space end meeting display power fixes 2018-01-04 11:12:34 -07:00
Heath Volmer
e1e2627f56 added further delay to end meeting steps to allow for default source restoration and power off 2018-01-04 11:00:09 -07:00
Heath Volmer
d1646f8216 1.0.14 Removed extra volume set from cooldown; removed room-on/source-on check from RunDefaultRoute in HuddleRoom 2018-01-04 10:47:50 -07:00
Heath Volmer
02cfc46f90 Added Async fire to Feedbacks; fixed mock display to use async feedback 2018-01-03 16:19:06 -07:00
Heath Volmer
0fb946c7d5 Added CEvent semaphore to PostToServer to sequence posts 2018-01-02 19:58:39 -07:00
Heath Volmer
026ab438ad Fixed unknown_error http post problems with retry on new client; working on mutex around post to handle simultaneous posts 2018-01-02 18:16:41 -07:00
Heath Volmer
51afb966d5 Re-added api for volume and mute 2018-01-01 05:00:33 -07:00
Heath Volmer
68fb82f801 Manual add IHasCodecLayouts 2017-12-29 10:35:02 -07:00
Heath Volmer
0830fb8943 Finishing troublesome merge from development 2017-12-29 10:25:51 -07:00
Heath Volmer
2ed63e7c84 Manual copy of cisco codec from developmet 2017-12-29 10:23:44 -07:00
Heath Volmer
08a4497f2c Moved VCDriver manually from development 2017-12-29 10:16:30 -07:00
Heath Volmer
85d79c5265 Merge, compile for release 2017-12-22 12:45:37 -07:00
Heath Volmer
fe76b257b2 v -> v1.0.10; fixes on remote view button 2017-12-22 12:13:32 -07:00
Heath Volmer
800de511ce Merge remote-tracking branch 'origin/feature/ecs-663' into feature/mob-108 2017-12-22 10:07:11 -07:00
Neil Dorin
82784f00a4 Coded changes as per email 2017-12-21 15:35:17 -07:00
Heath Volmer
289a33451f Relay warming, cooling and shutdown messages 2017-12-13 14:36:13 -07:00
Heath Volmer
ae496f556b Changed incoming messages for a few features. Added default source select 2017-12-12 11:11:33 -07:00
Heath Volmer
762f13c708 Build after merge 2017-12-07 15:47:44 -07:00
Heath Volmer
a61bfc4173 Cisco codec layout and min/max buttons for single display. v1.0.7 2017-12-07 15:45:54 -07:00
Heath Volmer
c3d455a7c2 Heartbeat problem resolved; much logging 2017-12-05 16:53:20 -07:00
Heath Volmer
864e65fe92 SO join; closing for weekend 2017-11-22 14:41:02 -07:00
Heath Volmer
385dd8a482 Meeting popup fixes; calendar list event and update fixes 2017-11-22 14:01:01 -07:00
Heath Volmer
19860be486 ecs-649, exceptions on boot with call connected 2017-11-20 16:07:45 -07:00
Neil Dorin
4d6a680f23 ecs-646 Daily Fusion server time query. 2017-11-15 15:59:35 -07:00
Neil Dorin
f9cb4e8a34 Added default source and volume levels recall to EndShutdown() methods in huddle and huddleVtc1 room types. Added mute control and feedback to Avocor display driver (using volume level discrete commands, no mute available in API). 2017-11-15 15:20:25 -07:00
Neil Dorin
07e77f2ce4 EOD Commit. Updates to Avocor display class. Fixes to Tech Page Driver to add feedback for display power status 2017-11-10 15:10:23 -07:00
Neil Dorin
6dbc152810 Adds Avocor Display driver class 2017-11-09 16:13:03 -07:00
Neil Dorin
a3580ca15c Fixes ecs-638 (Default Volume recall in huddle room) 2017-11-08 20:02:55 -07:00
Neil Dorin
7a1ead7b56 Fixed bug with InputStateFeedback event handler in MicrophonePrivacyController. Tested OK with Digital Inputs on RMC3 triggering privacy toggle 2017-11-08 10:33:30 -07:00
Neil Dorin
f9d1a737c4 Added behaviour options for MicrophonePrivacyController to track either room power state or room call state from config 2017-11-06 15:20:50 -07:00
Neil Dorin
d9013157ad MIcrophone Privacy feature tested and working as far as relay switching. Needs someone to short the digital inputs on the office RMC and load to PRO3 or other versiport compatible processor to test mic button contact closure input. 2017-11-03 17:13:44 -06:00
Neil Dorin
43f0ae0533 Merge branch 'bugfix/ecs-629' into feature/ecs-497
Conflicts:
	Essentials Devices Common/Essentials Devices Common/Display/SamsungMDCDisplay.cs
	Essentials Devices Common/Essentials Devices Common/Essentials Devices Common.csproj
	Release Package/PepperDashEssentials.cpz
	Release Package/PepperDashEssentials.dll
2017-11-03 13:04:11 -06:00
Neil Dorin
6d66c7d896 Updated SamsungMDC driver to default to 0x21/0x23 for Hdmi1 and Hdmi2 commands and added Hdmi1PC and Hdmi2PC (0x22/0x24) as new input options.
Remapped DisplayPort command on tech driver display control SRL to match UI buttons
2017-11-03 11:45:50 -06:00
Neil Dorin
f327ab1590 Temp commit to capture progress on MicrophonePrivacy before switching branches to help debug Samsung MDC driver 2017-11-03 09:50:44 -06:00
Neil Dorin
47fc2f3371 Updates to how the EssentialsVideoCodecUIDriver retrieves the codec phone number/SIP URI from the CodecInfo object. It now attempts to get the values from the SIP registration, if present. If not, it pulls them from the H323 configuration (E.164 alias and H323 ID). 2017-11-02 11:20:14 -06:00
Neil Dorin
d1197329f3 Temp commit to save progress before switching branches to debug NYU items. 2017-11-02 10:54:15 -06:00
Neil Dorin
a0817307b1 Moved MicrophonePrivacyController to Devices Common. Fixed references 2017-11-01 14:20:13 -06:00
Neil Dorin
43c3b83637 Updated warmup timer for SamsungMDC back to 10s 2017-11-01 10:30:42 -06:00
Neil Dorin
2a485e36c8 updatest to deal with ecs.629 by adding delay in SamsungMDC to commands sent after volume 2017-11-01 09:50:05 -06:00
Neil Dorin
bc47c65e48 MicrophonePrivacyController progress 2017-10-31 13:17:00 -06:00
Heath Volmer
1ad5bc68e5 Merge pull request #2 in PEC/essentials from feature/ecs-497 to development
* commit '8a9a8ac6a77201784c96996a5de1149ac589cb5f':
  Updated AssemblyVersion to 1.0.2.*
  Prep for merge into development for NYU deployment
  Updated PhoneNumber property name to SipPhoneNumber
  General code cleanup and updates to Huddle UI drivers to comply with Vtc1 changes
2017-10-31 14:02:36 -04:00
Neil Dorin
8a9a8ac6a7 Updated AssemblyVersion to 1.0.2.* 2017-10-31 12:01:24 -06:00
Neil Dorin
b1742675c2 Prep for merge into development for NYU deployment 2017-10-31 11:57:01 -06:00
Neil Dorin
f564a2f554 Updated PhoneNumber property name to SipPhoneNumber 2017-10-30 11:57:13 -06:00
Neil Dorin
0ede2e9973 General code cleanup and updates to Huddle UI drivers to comply with Vtc1 changes 2017-10-30 11:50:22 -06:00
Neil Dorin
5f5c963fa4 Fixes StartSharing() method in CiscoSparkCodec to only execute if the PresentationSource is > 0
Fixes ecs-612 by adding property to UsageTracking object to determing if the usage tracker is already running.
2017-10-24 15:45:05 -06:00
Neil Dorin
3d7fb1a804 resolves ecs-611 and all other known bugs from onsite testing at NYU 2017-10-24 14:55:15 -06:00
Neil Dorin
dc36386c0d Update debug messages for SIP phone number extraction 2017-10-24 13:00:46 -06:00
Neil Dorin
88a60b06e6 Added objects back to xStatus lost in merge and fixed regex pattern for extracting phone number.
Added formatting call to room phone number when displayed on header
2017-10-24 12:35:29 -06:00
Neil Dorin
7273646be0 Merge remote-tracking branch 'origin/bugfix/ecs-610' into bugfix/ecs-541-1
Conflicts:
	Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xConfiguration.cs
	Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/xStatus.cs
2017-10-24 11:59:29 -06:00
Heath Volmer
61883e5d4a Additional fix to top next meeting warning popups when room is on 2017-10-24 11:57:20 -06:00
Neil Dorin
90c12a97fa Updated getters for SIP URI and phone number to use correct status properties. Updates to xConfiguration and xStatus classes to address differences between Spark and Spark Plus 2017-10-24 11:56:28 -06:00
Neil Dorin
17fd9488f2 Fixed Stop Sharing button method to use the room route action method to sync source fb. Updated xStatus, xConfiguration, booking and phonebook deserialization classes in codec to match onsite return results from NYU room kit plus codec 2017-10-24 10:16:28 -06:00
Neil Dorin
84262c782d Merge remote-tracking branch 'origin/release' into bugfix/ecs-541-1
Conflicts:
	Essentials/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs

Fixed Presentation source selection on Spark codec to use original Source 1/2 values rather than connectorId
2017-10-23 15:53:46 -06:00
Neil Dorin
8dbb3fd898 Resolved ecs-582,602,608 2017-10-23 15:34:28 -06:00
Heath Volmer
01d462d553 Release 1.0.1 for NYU deploy 2017-10-23 07:30:46 -06:00
Heath Volmer
1d8924bc48 Merge remote-tracking branch 'origin/bugfix/ecs-541-1' into bugfix/ecs-535 2017-10-23 07:26:06 -06:00
Heath Volmer
0ac439be14 Cleaning up debug messages 2017-10-23 07:26:01 -06:00
Neil Dorin
23fb8311fe Added try/catch to VideoCodecUiDriver constructor. Seems to resolve errant NullRef 2017-10-23 07:16:53 -06:00
Neil Dorin
65adc5de1c Fixed bug with NullRef in ComputeHeaderCallStatus() method. However, some unknown Null Ref in the EssentialsVideoCodecUiDriver Constructor is preventing the UI from loading. 2017-10-23 00:02:13 -06:00
Neil Dorin
13a8876a61 Merge remote-tracking branch 'origin/bugfix/ecs-535' into bugfix/ecs-541-1 2017-10-22 12:40:09 -06:00
Neil Dorin
3897a41dd1 Fixed Stop Sharing button visible feedback on call list 2017-10-22 12:39:57 -06:00
Heath Volmer
8c47c5ed65 ecs-582, cancel incoming dialog 2017-10-22 11:11:42 -06:00
Neil Dorin
3e39210cc0 Merge remote-tracking branch 'origin/bugfix/ecs-535' into bugfix/ecs-541-1 2017-10-22 10:05:55 -06:00
Neil Dorin
2e98e8d146 Rebuit Changes from dead ecs-541 branch 2017-10-22 10:05:26 -06:00
Heath Volmer
1aea817f93 Working on next meeting notification 2017-10-22 10:05:24 -06:00
Heath Volmer
897d568032 Fixing header list icons 2017-10-20 11:24:44 -06:00
Heath Volmer
a16ea3f034 Merge remote-tracking branch 'origin/bugfix/ecs-541' into bugfix/ecs-535 2017-10-20 08:20:29 -06:00
Heath Volmer
c959f20204 TONS of UI misbehaviors. Lost track of issues 2017-10-19 20:00:10 -06:00
Heath Volmer
8dfa05293c ecs-600; ecs-601; ecs-573 2017-10-19 16:58:55 -06:00
Neil Dorin
4685850eff Merge remote-tracking branch 'origin/bugfix/ecs-535' into bugfix/ecs-541 2017-10-19 15:12:55 -06:00
Neil Dorin
dc53b293f1 Added Fusion support for EssentialsHuddleVtc1Room (Cisco Spark) 2017-10-19 15:12:25 -06:00
Heath Volmer
1d9490c46f ecs-567, 595 2017-10-19 14:59:18 -06:00
Neil Dorin
b301df6910 Merge remote-tracking branch 'origin/bugfix/ecs-535' into bugfix/ecs-541 2017-10-19 09:59:59 -06:00
Neil Dorin
50a6bde4f2 Fixed call status header icon mode to black phone down. Fixed issue with keyboard not launching on keypad w/ favorites icon. 2017-10-19 09:59:24 -06:00
Heath Volmer
dd5253301b ecs 561, 593, 594 2017-10-19 09:59:22 -06:00
Neil Dorin
b423d1cb58 Various bug fixes 2017-10-18 22:25:02 -06:00
Heath Volmer
91cc452e03 esc-544, initial fixes to routing and de-routing 2017-10-18 10:25:06 -06:00
Heath Volmer
07168f0f5b Merge remote-tracking branch 'origin/bugfix/ecs-541' into bugfix/ecs-535 2017-10-18 08:22:09 -06:00
Neil Dorin
08e528220c Bug fixing... 2017-10-17 22:19:34 -06:00
Neil Dorin
f5626fcd8b Commit before merging in Heath's branch 2017-10-17 21:10:23 -06:00
Heath Volmer
6482bbe6f4 ecs-542, 545, 547, 548 2017-10-17 18:09:45 -06:00
Neil Dorin
b9fceb830f Fixed bug with directory browsing not returning to root from 2 layers deep. Added message to first item of meetings SRL to indicate no meeting that day. 2017-10-17 10:46:45 -06:00
Neil Dorin
f37d1e18b2 fixes ecs-521 ecs-522 ecs-526 2017-10-13 16:09:22 -06:00
Neil Dorin
bff6d9e68d Progress on header call status label 2017-10-13 13:13:04 -06:00
Neil Dorin
41b42dbc8f Added Directory Search, bug fixes and updates to recents and meeting list. Made Meeting list modal/srl reusable for directory dial contact method modal. 2017-10-12 17:51:04 -06:00
Neil Dorin
fb0a91b454 Worked on VC directory and favorites. Fixed various bugs. 2017-10-11 21:43:14 -06:00
Heath Volmer
2def648596 It's Tuesday morning and I don't know what I'm doing. 2017-10-10 10:23:15 -06:00
Heath Volmer
dc04e04f96 Recent calls fixes; Directory browsing work 2017-10-09 16:38:42 -06:00
Neil Dorin
6f5d74a44e Fixed bug where booking results from Cisco Codec were being converted to generic meeting but never added to the list. 2017-10-06 15:33:03 -06:00
Heath Volmer
ce4f3dfff1 post 342 merge 2017-10-06 13:49:47 -06:00
Neil Dorin
cae86d1943 Tied in Room Occupancy Timer to Shutdown timer in EssentialsRoomBase 2017-10-06 12:53:34 -06:00
Heath Volmer
0196997a4e Tech PIN from config 2017-10-06 10:19:01 -06:00
Heath Volmer
f9d320e2b2 Changes for layout and selfview 2017-10-05 17:43:10 -06:00
Heath Volmer
af33aa41bf Merge remote-tracking branch 'origin/feature/ecs-342' into feature/ecs-500 2017-10-05 16:18:47 -06:00
Heath Volmer
f682793bbb Buttons for self view layout 2017-10-05 16:16:11 -06:00
Neil Dorin
3c3fca7766 Updates to Room Occupancy and added additional interfaces for codec layouts, selfview 2017-10-05 16:04:45 -06:00
Heath Volmer
4efc4d4e6e Merge remote-tracking branch 'origin/feature/cisco-spark-2' into feature/ecs-407 2017-10-05 15:55:29 -06:00
Heath Volmer
d52c629085 Starting self-view/layout controls 2017-10-05 15:55:12 -06:00
Heath Volmer
3e923ff41f favorites through to UI: 2017-10-05 13:29:48 -06:00
Heath Volmer
54f23eeb9f Call favorites start on mock; Fixed OBTP dialogs to match NYU 2017-10-05 12:10:51 -06:00
Neil Dorin
c3c7948990 Started working on Room Occupancy 2017-10-03 23:34:23 -06:00
Heath Volmer
c7cfcbe69e Short start on directory browsing 2017-10-03 17:59:00 -06:00
Heath Volmer
01a9503f47 Calendar; ribbon with meeting info; fire up from either 2017-10-03 17:38:41 -06:00
Neil Dorin
e6eafdaf14 Merge branch 'feature/ecs-407' of http://code.pepperdash.net/scm/pec/essentials into feature/cisco-spark-2
Conflicts:
	Essentials Devices Common/Essentials Devices Common/Codec/iHasScheduleAwareness.cs
2017-10-03 15:09:31 -06:00
Heath Volmer
c53a14f05e Meetings list on-screen with Mock VC 2017-10-03 14:47:37 -06:00
Heath Volmer
db4b5e863b Restructured header into icon list depending on features available 2017-10-03 11:49:56 -06:00
Neil Dorin
b929113ea6 Added mechanism for Meetings list to notify UI layer of meeting events 2017-10-02 16:24:36 -06:00
Heath Volmer
183112987e ecs-464 recent calls list, no deletion or confirmation 2017-10-02 16:10:46 -06:00
Heath Volmer
6bbd11c59b Merge remote-tracking branch 'origin/feature/cisco-spark-2' into feature/ecs-407 2017-10-02 15:28:15 -06:00
Heath Volmer
1274c74807 Premerge call history 2017-10-02 15:26:12 -06:00
Neil Dorin
412dca0459 Updated interface name case to have capital I prefix for consistency 2017-10-02 14:04:05 -06:00
Heath Volmer
ae2725f6d1 ecs-482 address; ecs-415 shutdown on contact; ecs-484 displays on tech 2017-10-02 10:51:00 -06:00
Heath Volmer
6b9b6bbd68 PIN dialog for tech page 2017-09-29 19:43:56 -06:00
Neil Dorin
a8e5e2f763 Added generic meeting classes to convert from deserialized Cisco booking data to generic meetings 2017-09-29 16:47:03 -06:00
Heath Volmer
bdde968c61 ecs-397, default volume on power up 2017-09-29 10:39:46 -06:00
Heath Volmer
5d2022549d ecs-481 swapped call/share; ecs-483 phone number and address text code (with backing codec modifications) 2017-09-29 10:12:09 -06:00
Neil Dorin
3e6f345b8b Fixed issue with corporate phonebook contact entries missing some properties 2017-09-28 16:14:24 -06:00
Neil Dorin
bde56a22d1 Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark-2 2017-09-28 15:26:28 -06:00
Neil Dorin
0bcb776ac5 Fixed incoming call popup issue with CiscoCodec call direction value not being stored to ActiveCallItem 2017-09-28 14:05:13 -06:00
Heath Volmer
0f41f3ce50 Added none source to share list 2017-09-28 13:53:16 -06:00
Neil Dorin
46cce6559c Added CodecInfo object to VideoCodecBase 2017-09-28 13:42:41 -06:00
Heath Volmer
b57582feea Various tech page framework items 2017-09-27 20:19:28 -06:00
Neil Dorin
13d15388f0 codec phonebook logic working and printing to console. Fixed bug wtih call status and tested with UI 2017-09-27 17:44:31 -06:00
Heath Volmer
58d22abd5a ecs-427 logo server on cs 2017-09-27 13:38:17 -06:00
Neil Dorin
214a740345 Merge branch 'feature/ecs-407' of http://code.pepperdash.net/scm/pec/essentials into feature/cisco-spark-2
Conflicts:
	Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs
2017-09-27 12:37:53 -06:00
Heath Volmer
a5eb61ef0e ecs-444, 458, 474, 475, 477 2017-09-27 12:26:36 -06:00
Neil Dorin
12683551a4 Phonebook results successfully converted to flat list and printed to console for Root, folder contents and search results 2017-09-27 12:23:32 -06:00
Neil Dorin
68427af337 Merge branch 'feature/ecs-407' of http://code.pepperdash.net/scm/pec/essentials into feature/cisco-spark-2 2017-09-26 23:56:55 -06:00
Neil Dorin
33ceff861f updates to phonebook search methods 2017-09-26 23:55:10 -06:00
Neil Dorin
a2d42dc77b Added booking class and phonebook sync logic 2017-09-26 09:17:47 -06:00
Heath Volmer
1abf56474e Notification ribbon; keyboard touchups 2017-09-25 18:01:13 -06:00
Heath Volmer
a262dfdf5b Extensive keyboard development 2017-09-25 17:23:04 -06:00
Neil Dorin
26907acb56 Added generic codec directory interface and cisco specific phonebook classes for deserialization 2017-09-22 17:30:10 -06:00
Neil Dorin
0ee35dfbd9 Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark-2 2017-09-22 15:44:00 -06:00
Neil Dorin
a71e991383 set up program to load Cisco Codec from config, not just manually 2017-09-22 15:40:08 -06:00
Heath Volmer
1c63e506b8 Fixed end all not working - many hours chasing error 2017-09-22 13:20:50 -06:00
Heath Volmer
f498d55dd6 ecs-411: Most of keyboard driver 2017-09-21 21:23:48 -06:00
Neil Dorin
1d46f8520d Updates to call status tracking and Call History. Added CiscoCodecPropertiesConfig class 2017-09-21 18:00:43 -06:00
Neil Dorin
3b3ea98dea Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark-2
Conflicts:
	Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs
	Essentials Devices Common/Essentials Devices Common/Codec/eCodecCallStatus.cs
	Essentials Devices Common/Essentials Devices Common/VideoCodec/CiscoCodec/CiscoCodec.cs
	Essentials Devices Common/Essentials Devices Common/VideoCodec/VideoCodecBase.cs
2017-09-21 11:57:48 -06:00
Neil Dorin
75ff8ea88a updates to iCallHistory and changed CallHIstoryEntry to extend CodecActiveCallItem 2017-09-21 11:53:13 -06:00
Heath Volmer
69e76bdb3a Moved ListCalls into VideoCodecBase 2017-09-21 11:29:13 -06:00
Heath Volmer
639e1810db Fixed connected enum; Call status header button 2017-09-21 10:56:37 -06:00
Neil Dorin
ff5fab4984 Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark-2
Conflicts:
	Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs
2017-09-20 18:19:03 -06:00
Heath Volmer
ca3f6d4d14 Tuning up InCall statuses, removed ActiveCallCountFB 2017-09-20 16:57:49 -06:00
Neil Dorin
c045c8e7a6 Minor updates to Codec Interfaces 2017-09-20 09:55:18 -06:00
Heath Volmer
82465e8789 Moved some enums into separate files; modifying simulation methods on MockVC; Added Connecting state to eCodecStatus; ... 2017-09-20 09:51:48 -06:00
Neil Dorin
c0d3c92495 Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark-2
Conflicts:
	Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs
2017-09-19 18:13:58 -06:00
Neil Dorin
5c6ba60d51 Updated enum values in CodecActiveCallItem 2017-09-19 18:06:30 -06:00
Heath Volmer
f13978368f merge cisco-spark-2, see previous commit note 2017-09-19 17:54:21 -06:00
Neil Dorin
3d811c6979 Commit before merge with Heath 2017-09-19 17:50:06 -06:00
Heath Volmer
a6f0163264 Moved around base class items and interfaces. Added CodecStatusItems to many methods. 2017-09-19 17:49:25 -06:00
Heath Volmer
b33273e6d3 Fixing up basic UI switchs 2017-09-19 12:09:20 -06:00
Heath Volmer
fed06bc025 cisco-spark-2 merge 2017-09-18 17:42:18 -06:00
Heath Volmer
cc6e555f25 ? 2017-09-18 17:38:05 -06:00
Neil Dorin
b0fd837cdc Updates to codec interfaces to handle active calls 2017-09-18 17:23:05 -06:00
Heath Volmer
95a6f3948f Replaced incallfeedback with activecallcount.... 2017-09-18 14:27:49 -06:00
Heath Volmer
8df353ab75 Fixed wrecked merge by sleepy fool 2017-09-18 13:38:05 -06:00
Heath Volmer
535fce5f33 Merge with o/f/cisco-spark 2017-09-18 10:45:29 -06:00
Heath Volmer
b588a8c325 Not clear change 2017-09-18 10:42:48 -06:00
Neil Dorin
253095cb93 EOD commit. Working on integrating Crestron OBTP library 2017-09-15 17:02:22 -06:00
Neil Dorin
9b85456f2e Updated ICodecAudio interface to break out individual functions to their own interfaces and not assume all to be applied to VideoCodecBase. Updated affected classes as a result. 2017-09-15 11:47:45 -06:00
Neil Dorin
f6a9ecca03 Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark 2017-09-15 11:30:04 -06:00
Neil Dorin
2028fa308a Updates to xStatus an CiscoCodec to remove compile errors (duplicate objects, InputPort actions) 2017-09-15 11:13:59 -06:00
Heath Volmer
a63e8b394f merge ecs-407 2017-09-15 10:06:21 -06:00
Heath Volmer
16e1185fdf Very elusive null ref in routing/usage tracking; adding bits and pieces to codecs 2017-09-15 10:01:18 -06:00
Neil Dorin
9e4f34acd5 Added command for CiscoCodec methods implemented by standard interfaces. Renamed data class files. 2017-09-14 23:05:33 -06:00
Heath Volmer
dc3cc1d4eb Added various things to mock. Trying to find exception in routing 2017-09-14 20:29:15 -06:00
Heath Volmer
e8a9282180 Merge remote-tracking branch 'origin/feature/cisco-spark' into feature/ecs-407 2017-09-14 10:52:42 -06:00
Neil Dorin
58ed6b450f Added References to Crestron Cisco Classes 2017-09-14 10:50:40 -06:00
Heath Volmer
741d6a4a87 Merge remote-tracking branch 'origin/feature/cisco-spark' into feature/ecs-407 2017-09-14 10:23:15 -06:00
Heath Volmer
d2680298ff Further mock testing into UI 2017-09-14 10:22:35 -06:00
Neil Dorin
1ad1c5404f Started working on property feedback mechansism to trigger codec feedbacks automatically when feedback values are deserialized 2017-09-14 10:21:29 -06:00
Neil Dorin
a9424cde22 JSON feedback deserialization working 2017-09-14 09:16:18 -06:00
Neil Dorin
9b145d6dfc Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark
Conflicts:
	Essentials Devices Common/Essentials Devices Common/VC/MockVC/MockVC.cs
2017-09-13 16:07:15 -06:00
Neil Dorin
b6965fac0b Re-added VC/CiscoCodec classes 2017-09-13 16:05:19 -06:00
Neil Dorin
57dee6153b Merge remote-tracking branch 'origin/feature/ecs-407' into feature/cisco-spark
Conflicts:
	Essentials Devices Common/Essentials Devices Common/VC/VideoCodecBase.cs
2017-09-13 14:07:56 -06:00
Heath Volmer
d65ff7add0 Mock testing: Connect/End UI behavior start 2017-09-13 11:39:22 -06:00
Neil Dorin
849675c539 Updates to Video Codec Interfaces 2017-09-12 14:04:20 -06:00
Heath Volmer
fd14eeb9a7 Added VC Mock and some interaction in UI layer 2017-09-12 13:52:25 -06:00
Heath Volmer
2196f5e67a Merge with feature/cisco-spark 2017-09-12 11:12:52 -06:00
Neil Dorin
830093da3b Push before merge with Heath 2017-09-12 11:09:27 -06:00
Heath Volmer
fb70dac224 Trying to fix broken routing on hud-vtc 2017-09-12 11:08:35 -06:00
Heath Volmer
2180521004 Basic scaffold of VC driver. 2017-09-11 20:37:38 -06:00
Heath Volmer
682c21f37c Added Huddle-vtc room; Adding hud-vtc driver; adding vc driver 2017-09-11 19:57:03 -06:00
Heath Volmer
b81c667e5f Added many UI Joins. 2017-09-11 16:08:55 -06:00
Neil Dorin
4b4bf1a1c8 Working HTTP Server and Client communicating with codec. Need to fix issue with deserializing configuration.xml upon connection (null ref exception). 2017-09-08 15:00:16 -06:00
Neil Dorin
65819cf723 Added HTTP server for receiving feedback from Cisco codec. Added data classes for desiralization of responses from codec. 2017-09-07 17:58:44 -06:00
Heath Volmer
cb5dcc5088 PageDriver for VtcHuddle AV funcs; PageDriver for Spark 2017-09-06 18:07:37 -06:00
Neil Dorin
0d071e6e82 Updated class names to not use VC abbreviation. Defined additional interfaces 2017-09-06 08:52:53 -06:00
Heath Volmer
9aad840a78 NYU AV Driver start 2017-09-05 18:51:15 -06:00
Neil Dorin
617e2bdc4f Defined VcCodecBase, new Vc interfaces and started CiscoCodec class 2017-08-31 18:12:52 -06:00
Neil Dorin
88de2a2ee0 Updates to Fusion SetUpCommunicationMonitors() method to properly link TPs vs Xpanels by base class type. 2017-08-31 16:41:31 -06:00
Heath Volmer
f502432fcc Merge from feature/fusion-nyc 2017-08-28 15:02:11 -05:00
Neil Dorin
a052700934 Updates to source switching digitals and added processor reboot attribute to Fusion 2017-08-28 13:37:43 -06:00
Heath Volmer
74d48a0427 Default volume; hide setup gear for ipad 2017-08-28 14:26:41 -05:00
Neil Dorin
e344e05857 Bug fixes to device usage string syntax. Tested and working with Fusion Reporting. 2017-08-25 18:05:19 -06:00
Neil Dorin
0b5681842e Device Usage working when switching sources 2017-08-25 17:00:58 -06:00
Heath Volmer
6ab5f06fc9 Minor friday afternoon changes 2017-08-25 15:50:17 -06:00
Heath Volmer
d55d30be3f Fixed share button sync issues around power off dialogs 2017-08-25 15:16:21 -06:00
Heath Volmer
efd630c8f1 Hopefully fixed standby/power off glitch on Sammy; Removed some debugging; Removed duplicate routing on huddle room 2017-08-25 10:03:35 -06:00
Heath Volmer
2a1c9dbaf6 Added code to ignore power off state on general status messages when input is <10 2017-08-24 21:56:57 -06:00
Heath Volmer
7801a980b5 Testing ANOTHER power off/standby catch 2017-08-24 21:28:27 -06:00
Heath Volmer
0d42a41af3 Try catch on some Fusion usage bugs; Fixed press-hold on TriListExtensions 2017-08-24 20:29:30 -06:00
Neil Dorin
ba6fdb83ae Removes .projectinfo files for cleaner merges 2017-08-24 16:25:38 -06:00
Heath Volmer
12d9ad1183 Test removing projectinfo 2017-08-24 16:24:34 -06:00
Heath Volmer
75fb5bc9d6 Merged in ecs-355-neil 2017-08-24 16:10:46 -06:00
Heath Volmer
841af73248 Logo loading; troublshooting power/sleep hiccuo 2017-08-24 16:03:45 -06:00
Neil Dorin
2fd4bbc8b3 Commit before merge. Updates to source device usage triggers based on room source routing 2017-08-24 15:43:12 -06:00
Heath Volmer
6aad62ee6b Changed back temporary gear join after UI fix 2017-08-24 10:00:47 -06:00
Heath Volmer
de8c7477b8 Countdown timer seconds on modal 390; 359 auto-on source 2017-08-23 22:41:01 -06:00
Heath Volmer
057d8ac5f5 Added sig held helper function 2017-08-23 22:03:54 -06:00
Heath Volmer
d5dddade85 press with hold on gear button 2017-08-23 21:46:23 -06:00
Heath Volmer
78529a4d56 Gear button and setup page 2017-08-23 21:28:33 -06:00
Heath Volmer
f87e0a7888 376, 377, 383. Resolving multi UI-sync issues 2017-08-23 20:14:23 -06:00
Heath Volmer
2c8259e350 Warming, cooling synced with display. 2017-08-23 15:43:30 -06:00
Heath Volmer
19f3b10f90 Adding warming and cooling modal. Warming seems to occasionally not happen 2017-08-23 14:14:35 -06:00
Heath Volmer
85c2c448d1 Finished merge with 307 2017-08-22 10:48:27 -06:00
Neil Dorin
2b29bf6aa5 Minor updates to Fusion Occ before merge 2017-08-22 10:28:00 -06:00
Heath Volmer
87e5e9bbe0 projectinfos 2017-08-22 10:26:20 -06:00
Neil Dorin
ce3de2baeb Added DeviceUsage logic. Requires testing on NYC program with real hardware. Ready for Merge. 2017-08-21 18:04:47 -06:00
Heath Volmer
f10e20b78a Lots of f-words 2017-08-21 16:41:18 -06:00
Heath Volmer
6656e67085 Refining power off dialog; added helpers to TPController for console-signal debugging 2017-08-21 14:22:59 -06:00
Heath Volmer
5c08c7d65e Fixing shutdown timers; removing Timer from ModalDialog 2017-08-21 12:46:09 -06:00
Heath Volmer
0becff5320 Working on adding shutdown timing to room, not UI 2017-08-19 11:41:30 -06:00
Heath Volmer
4cda13f004 Added countdown timer. Currently counts seconds from n to 0 with various events and callbacks 2017-08-18 16:55:54 -06:00
Neil Dorin
710bfa3e8f Implemented Device Usage feature for Fusion. 2017-08-18 12:37:09 -06:00
Heath Volmer
25122abed1 Fixed volume up/down; Working on linking display power fb to room on fb 2017-08-18 12:20:22 -06:00
Neil Dorin
1d54214c55 Working Fusion Time Sync feature 2017-08-17 18:03:56 -06:00
Neil Dorin
0f449801e4 Updates to Fusion classes to support NYU deployment 2017-08-17 00:39:11 -06:00
Heath Volmer
394be710a4 Fixed Touchpanel controller to spin up a 560 2017-08-16 15:54:39 -06:00
Heath Volmer
85683ea9fa esc-337, found errant timer resets on comm monitor and Sammy display 2017-08-16 15:26:46 -06:00
Heath Volmer
17b0373c73 Saved same commands 2017-08-16 14:04:13 -06:00
Heath Volmer
7320f47d60 Added Simulate receive on com port 2017-08-16 11:15:49 -06:00
Heath Volmer
667c511515 Touching up comms on Sammy MDC 2017-08-15 19:30:48 -06:00
Heath Volmer
8586796a6d Added properties and feedbacks debugging; Working on buffering socket on Sammy 2017-08-14 18:19:49 -06:00
Heath Volmer
a3d499accf End of friday compile 2017-08-14 09:44:29 -06:00
Heath Volmer
9e9b8628a4 Heavy touch ups to comms (324); Fixed source display on turn-on (322); Added gear visibility in code (336) 2017-08-11 15:14:38 -06:00
Heath Volmer
efd5b59bda Moving commands into byte representations. Working on Volume 2017-08-10 15:29:53 -06:00
Neil Dorin
6d21950180 Uncommnedt GoWithLoad() in ControlSystem.cs 2017-07-27 14:34:35 -06:00
Neil Dorin
5d0f50677a Updates to complete SamsungMDC driver addition 2017-07-27 14:33:06 -06:00
Neil Dorin
7abccd8865 Continued work on SamsungMDC Display driver class 2017-07-26 23:17:41 -06:00
Neil Dorin
c2d961505e Started on Samsung MDC driver 2017-07-25 17:41:52 -06:00
Neil Dorin
b65064a124 Added Release Package Folder 2017-07-07 15:15:36 -07:00
256 changed files with 140499 additions and 7502 deletions

3
.gitignore vendored
View File

@@ -19,4 +19,5 @@ Thumbs.db
obj/
[Rr]elease*/
_ReSharper*/
SIMPLSharpLogs/
SIMPLSharpLogs/
*.projectinfo

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
@@ -25,16 +26,24 @@ namespace PepperDash.Essentials.Core
public ComPortController(string key, ComPort port, ComPort.ComPortSpec spec)
: base(key)
{
if (port == null)
{
Debug.Console(0, this, "ERROR: Invalid com port, continuing but comms will not function");
return;
}
Port = port;
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, "WARNING: Cannot register Com port: {0}", result);
Debug.Console(0, this, "ERROR: Cannot register Com port: {0}", result);
return; // false
}
}
@@ -54,17 +63,22 @@ namespace PepperDash.Essentials.Core
void Port_SerialDataReceived(ComPort ReceivingComPort, ComPortSerialDataEventArgs args)
{
var bytesHandler = BytesReceived;
if (bytesHandler != null)
{
var bytes = Encoding.GetEncoding(28591).GetBytes(args.SerialData);
bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
}
var textHandler = TextReceived;
if (textHandler != null)
textHandler(this, new GenericCommMethodReceiveTextArgs(args.SerialData));
OnDataReceived(args.SerialData);
}
void OnDataReceived(string s)
{
var bytesHandler = BytesReceived;
if (bytesHandler != null)
{
var bytes = Encoding.GetEncoding(28591).GetBytes(s);
bytesHandler(this, new GenericCommMethodReceiveBytesArgs(bytes));
}
var textHandler = TextReceived;
if (textHandler != null)
textHandler(this, new GenericCommMethodReceiveTextArgs(s));
}
public override bool Deactivate()
{
return Port.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
@@ -74,17 +88,19 @@ namespace PepperDash.Essentials.Core
public void SendText(string text)
{
if (Port == null)
return;
Port.Send(text);
}
public void SendBytes(byte[] bytes)
{
if (Port == null)
return;
var text = Encoding.GetEncoding(28591).GetString(bytes, 0, bytes.Length);
Port.Send(text);
}
//public BoolFeedback IsConnected { get; private set; }
public void Connect()
{
}
@@ -94,5 +110,25 @@ namespace PepperDash.Essentials.Core
}
#endregion
/// <summary>
///
/// </summary>
/// <param name="s"></param>
public void SimulateReceive(string s)
{
// split out hex chars and build string
var split = Regex.Split(s, @"(\\[Xx][0-9a-fA-F][0-9a-fA-F])");
StringBuilder b = new StringBuilder();
foreach (var t in split)
{
if (t.StartsWith(@"\") && t.Length == 4)
b.Append((char)(Convert.ToByte(t.Substring(2, 2), 16)));
else
b.Append(t);
}
OnDataReceived(b.ToString());
}
}
}

View File

@@ -1,178 +1,198 @@
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public class CommFactory
{
public static EssentialsControlPropertiesConfig GetControlPropertiesConfig(DeviceConfig deviceConfig)
{
try
{
return JsonConvert.DeserializeObject<EssentialsControlPropertiesConfig>
(deviceConfig.Properties["control"].ToString());
//Debug.Console(2, "Control TEST: {0}", JsonConvert.SerializeObject(controlConfig));
}
catch (Exception e)
{
Debug.Console(0, "ERROR: [{0}] Control properties deserialize failed:\r{1}", deviceConfig.Key, e);
return null;
}
}
/// <summary>
/// Returns a comm method of either com port, TCP, SSH
/// </summary>
/// <param name="deviceConfig">The Device config object</param>
public static IBasicCommunication CreateCommForDevice(DeviceConfig deviceConfig)
{
EssentialsControlPropertiesConfig controlConfig = GetControlPropertiesConfig(deviceConfig);
if (controlConfig == null)
return null;
IBasicCommunication comm = null;
try
{
var c = controlConfig.TcpSshProperties;
switch (controlConfig.Method)
{
case eControlMethod.Com:
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort(controlConfig), controlConfig.ComParams);
break;
case eControlMethod.IR:
break;
case eControlMethod.Ssh:
{
var ssh = new GenericSshClient(deviceConfig.Key + "-ssh", c.Address, c.Port, c.Username, c.Password);
ssh.AutoReconnect = c.AutoReconnect;
if(ssh.AutoReconnect)
ssh.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = ssh;
break;
}
case eControlMethod.Tcpip:
{
var tcp = new GenericTcpIpClient(deviceConfig.Key + "-tcp", c.Address, c.Port, c.BufferSize);
tcp.AutoReconnect = c.AutoReconnect;
if (tcp.AutoReconnect)
tcp.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = tcp;
break;
}
case eControlMethod.Telnet:
break;
default:
break;
}
}
catch (Exception e)
{
Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}",
deviceConfig.Properties.ToString(), e);
}
// put it in the device manager if it's the right flavor
var comDev = comm as Device;
if (comDev != null)
DeviceManager.AddDevice(comDev);
return comm;
}
public static ComPort GetComPort(EssentialsControlPropertiesConfig config)
{
var comPar = config.ComParams;
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
return dev.ComPorts[config.ControlPortNumber];
Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
return null;
}
/// <summary>
/// Helper to grab the IComPorts device for this PortDeviceKey. Key "controlSystem" will
/// return the ControlSystem object from the Global class.
/// </summary>
/// <returns>IComPorts device or null if the device is not found or does not implement IComPorts</returns>
public static IComPorts GetIComPortsDeviceFromManagedDevice(string ComPortDevKey)
{
if ((ComPortDevKey.Equals("controlSystem", System.StringComparison.OrdinalIgnoreCase)
|| ComPortDevKey.Equals("processor", System.StringComparison.OrdinalIgnoreCase))
&& Global.ControlSystem is IComPorts)
return Global.ControlSystem;
else
{
var dev = DeviceManager.GetDeviceForKey(ComPortDevKey) as IComPorts;
if (dev == null)
Debug.Console(0, "ComPortConfig: Cannot find com port device '{0}'", ComPortDevKey);
return dev;
}
}
}
/// <summary>
///
/// </summary>
public class EssentialsControlPropertiesConfig :
PepperDash.Core.ControlPropertiesConfig
{
// ****** All of these things, except for #Pro-specific com stuff, were
// moved into PepperDash.Core to help non-pro PortalSync.
//public eControlMethod Method { get; set; }
//public string ControlPortDevKey { get; set; }
//[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] // In case "null" is present in config on this value
//public uint ControlPortNumber { get; set; }
//public TcpSshPropertiesConfig TcpSshProperties { get; set; }
//public string IrFile { get; set; }
//public ComPortConfig ComParams { get; set; }
[JsonConverter(typeof(ComSpecJsonConverter))]
public ComPort.ComPortSpec ComParams { get; set; }
//public string IpId { get; set; }
//[JsonIgnore]
//public uint IpIdInt { get { return Convert.ToUInt32(IpId, 16); } }
//public char EndOfLineChar { get; set; }
///// <summary>
///// Defaults to Environment.NewLine;
///// </summary>
//public string EndOfLineString { get; set; }
//public string DeviceReadyResponsePattern { get; set; }
//public EssentialsControlPropertiesConfig()
//{
// EndOfLineString = CrestronEnvironment.NewLine;
//}
}
public class IrControlSpec
{
public string PortDeviceKey { get; set; }
public uint PortNumber { get; set; }
public string File { get; set; }
}
//public enum eControlMethod
//{
// None = 0, Com, IpId, IR, Ssh, Tcpip, Telnet
//}
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public class CommFactory
{
public static EssentialsControlPropertiesConfig GetControlPropertiesConfig(DeviceConfig deviceConfig)
{
try
{
return JsonConvert.DeserializeObject<EssentialsControlPropertiesConfig>
(deviceConfig.Properties["control"].ToString());
//Debug.Console(2, "Control TEST: {0}", JsonConvert.SerializeObject(controlConfig));
}
catch (Exception e)
{
Debug.Console(0, "ERROR: [{0}] Control properties deserialize failed:\r{1}", deviceConfig.Key, e);
return null;
}
}
/// <summary>
/// Returns a comm method of either com port, TCP, SSH
/// </summary>
/// <param name="deviceConfig">The Device config object</param>
public static IBasicCommunication CreateCommForDevice(DeviceConfig deviceConfig)
{
EssentialsControlPropertiesConfig controlConfig = GetControlPropertiesConfig(deviceConfig);
if (controlConfig == null)
return null;
IBasicCommunication comm = null;
try
{
var c = controlConfig.TcpSshProperties;
switch (controlConfig.Method)
{
case eControlMethod.Com:
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort(controlConfig), controlConfig.ComParams);
break;
case eControlMethod.IR:
break;
case eControlMethod.Ssh:
{
var ssh = new GenericSshClient(deviceConfig.Key + "-ssh", c.Address, c.Port, c.Username, c.Password);
ssh.AutoReconnect = c.AutoReconnect;
if(ssh.AutoReconnect)
ssh.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = ssh;
break;
}
case eControlMethod.Tcpip:
{
var tcp = new GenericTcpIpClient(deviceConfig.Key + "-tcp", c.Address, c.Port, c.BufferSize);
tcp.AutoReconnect = c.AutoReconnect;
if (tcp.AutoReconnect)
tcp.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = tcp;
break;
}
case eControlMethod.Telnet:
break;
default:
break;
}
}
catch (Exception e)
{
Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}",
deviceConfig.Properties.ToString(), e);
}
// put it in the device manager if it's the right flavor
var comDev = comm as Device;
if (comDev != null)
DeviceManager.AddDevice(comDev);
return comm;
}
public static ComPort GetComPort(EssentialsControlPropertiesConfig config)
{
var comPar = config.ComParams;
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
return dev.ComPorts[config.ControlPortNumber];
Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
return null;
}
/// <summary>
/// Helper to grab the IComPorts device for this PortDeviceKey. Key "controlSystem" will
/// return the ControlSystem object from the Global class.
/// </summary>
/// <returns>IComPorts device or null if the device is not found or does not implement IComPorts</returns>
public static IComPorts GetIComPortsDeviceFromManagedDevice(string ComPortDevKey)
{
if ((ComPortDevKey.Equals("controlSystem", System.StringComparison.OrdinalIgnoreCase)
|| ComPortDevKey.Equals("processor", System.StringComparison.OrdinalIgnoreCase))
&& Global.ControlSystem is IComPorts)
return Global.ControlSystem;
else
{
var dev = DeviceManager.GetDeviceForKey(ComPortDevKey) as IComPorts;
if (dev == null)
Debug.Console(0, "ComPortConfig: Cannot find com port device '{0}'", ComPortDevKey);
return dev;
}
}
}
/// <summary>
///
/// </summary>
public class EssentialsControlPropertiesConfig :
PepperDash.Core.ControlPropertiesConfig
{
// ****** All of these things, except for #Pro-specific com stuff, were
// moved into PepperDash.Core to help non-pro PortalSync.
//public eControlMethod Method { get; set; }
//public string ControlPortDevKey { get; set; }
//[JsonProperty(NullValueHandling = NullValueHandling.Ignore)] // In case "null" is present in config on this value
//public uint ControlPortNumber { get; set; }
//public TcpSshPropertiesConfig TcpSshProperties { get; set; }
//public string IrFile { get; set; }
//public ComPortConfig ComParams { get; set; }
[JsonConverter(typeof(ComSpecJsonConverter))]
public ComPort.ComPortSpec ComParams { get; set; }
public string CresnetId { get; set; }
/// <summary>
/// Attempts to provide uint conversion of string CresnetId
/// </summary>
public uint CresnetIdInt
{
get
{
try
{
return Convert.ToUInt32(CresnetId, 16);
}
catch (Exception)
{
throw new FormatException(string.Format("ERROR:Unable to convert Cresnet ID: {0} to hex. Error:\n{1}", CresnetId));
}
}
}
//public string IpId { get; set; }
//[JsonIgnore]
//public uint IpIdInt { get { return Convert.ToUInt32(IpId, 16); } }
//public char EndOfLineChar { get; set; }
///// <summary>
///// Defaults to Environment.NewLine;
///// </summary>
//public string EndOfLineString { get; set; }
//public string DeviceReadyResponsePattern { get; set; }
//public EssentialsControlPropertiesConfig()
//{
// EndOfLineString = CrestronEnvironment.NewLine;
//}
}
public class IrControlSpec
{
public string PortDeviceKey { get; set; }
public uint PortNumber { get; set; }
public string File { get; set; }
}
//public enum eControlMethod
//{
// None = 0, Com, IpId, IR, Ssh, Tcpip, Telnet
//}
}

View File

@@ -20,7 +20,7 @@ namespace PepperDash.Essentials.Core
{
get
{
return string.Format(@"\NVRAM\Program{0}\IR\", InitialParametersClass.ApplicationNumber);
return Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
}
}

View File

@@ -17,9 +17,6 @@ namespace PepperDash.Essentials.Core.Config
[JsonProperty("info")]
public InfoConfig Info { get; set; }
//[JsonProperty("roomLists")]
//public Dictionary<string, List<string>> RoomLists { get; set; }
[JsonProperty("devices")]
public List<DeviceConfig> Devices { get; set; }

View File

@@ -16,6 +16,9 @@ namespace PepperDash.Essentials.Core.Config
[JsonProperty("key")]
public string Key { get; set; }
[JsonProperty("uid")]
public int Uid { get; set; }
[JsonProperty("name")]
public string Name { get; set; }

View File

@@ -1,4 +1,6 @@
using System;
using System;
using Crestron.SimplSharp.Reflection;
using Newtonsoft.Json;
@@ -19,7 +21,10 @@ namespace PepperDash.Essentials.Core.Config
public string Type { get; set; }
[JsonProperty("version")]
public string Version { get; set; }
public string Version { get; set; }
[JsonProperty("runtimeInfo")]
public RuntimeInfo RuntimeInfo { get; set; }
[JsonProperty("comment")]
public string Comment { get; set; }
@@ -30,7 +35,34 @@ namespace PepperDash.Essentials.Core.Config
Date = DateTime.Now;
Type = "";
Version = "";
Comment = "";
Comment = "";
RuntimeInfo = new RuntimeInfo();
}
}
}
/// <summary>
/// Represents runtime information about the program/processor
/// </summary>
public class RuntimeInfo
{
/// <summary>
/// The name of the running application
/// </summary>
[JsonProperty("appName")]
public string AppName { get; set; }
/// <summary>
/// The Assembly version of the running application
/// </summary>
[JsonProperty("assemblyVersion")]
public string AssemblyVersion { get; set; }
/// <summary>
/// The OS Version of the processor (Firmware Version)
/// </summary>
[JsonProperty("osVersion")]
public string OsVersion { get; set; }
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Config
{
public class SourceDevicePropertiesConfigBase
{
public bool DisableSharing { get; set; }
}
}

View File

@@ -1,128 +1,127 @@
using Crestron.SimplSharpPro;
namespace PepperDash.Essentials.Core
{
public static class CommonBoolCue
{
public static readonly Cue Power = new Cue("Power", 101, eCueType.Bool);
public static readonly Cue PowerOn = new Cue("PowerOn", 102, eCueType.Bool);
public static readonly Cue PowerOff = new Cue("PowerOff", 103, eCueType.Bool);
public static readonly Cue HasPowerFeedback = new Cue("HasPowerFeedback", 101, eCueType.Bool);
public static readonly Cue PowerOnFeedback = new Cue("PowerOnFeedback", 102, eCueType.Bool);
public static readonly Cue IsOnlineFeedback = new Cue("IsOnlineFeedback", 104, eCueType.Bool);
public static readonly Cue IsWarmingUp = new Cue("IsWarmingUp", 105, eCueType.Bool);
public static readonly Cue IsCoolingDown = new Cue("IsCoolingDown", 106, eCueType.Bool);
public static readonly Cue Dash = new Cue("Dash", 109, eCueType.Bool);
public static readonly Cue Digit0 = new Cue("Digit0", 110, eCueType.Bool);
public static readonly Cue Digit1 = new Cue("Digit1", 111, eCueType.Bool);
public static readonly Cue Digit2 = new Cue("Digit2", 112, eCueType.Bool);
public static readonly Cue Digit3 = new Cue("Digit3", 113, eCueType.Bool);
public static readonly Cue Digit4 = new Cue("Digit4", 114, eCueType.Bool);
public static readonly Cue Digit5 = new Cue("Digit5", 115, eCueType.Bool);
public static readonly Cue Digit6 = new Cue("Digit6", 116, eCueType.Bool);
public static readonly Cue Digit7 = new Cue("Digit7", 117, eCueType.Bool);
public static readonly Cue Digit8 = new Cue("Digit8", 118, eCueType.Bool);
public static readonly Cue Digit9 = new Cue("Digit9", 119, eCueType.Bool);
public static readonly Cue KeypadMisc1 = new Cue("KeypadMisc1", 120, eCueType.Bool);
public static readonly Cue KeypadMisc2 = new Cue("KeypadMisc2", 121, eCueType.Bool);
public static readonly Cue NumericEnter = new Cue("Enter", 122, eCueType.Bool);
public static readonly Cue ChannelUp = new Cue("ChannelUp", 123, eCueType.Bool);
public static readonly Cue ChannelDown = new Cue("ChannelDown", 124, eCueType.Bool);
public static readonly Cue Last = new Cue("Last", 125, eCueType.Bool);
public static readonly Cue OpenClose = new Cue("OpenClose", 126, eCueType.Bool);
public static readonly Cue Subtitle = new Cue("Subtitle", 127, eCueType.Bool);
public static readonly Cue Audio = new Cue("Audio", 128, eCueType.Bool);
public static readonly Cue Info = new Cue("Info", 129, eCueType.Bool);
public static readonly Cue Menu = new Cue("Menu", 130, eCueType.Bool);
public static readonly Cue DeviceMenu = new Cue("DeviceMenu", 131, eCueType.Bool);
public static readonly Cue Return = new Cue("Return", 132, eCueType.Bool);
public static readonly Cue Back = new Cue("Back", 133, eCueType.Bool);
public static readonly Cue Exit = new Cue("Exit", 134, eCueType.Bool);
public static readonly Cue Clear = new Cue("Clear", 135, eCueType.Bool);
public static readonly Cue List = new Cue("List", 136, eCueType.Bool);
public static readonly Cue Guide = new Cue("Guide", 137, eCueType.Bool);
public static readonly Cue Am = new Cue("Am", 136, eCueType.Bool);
public static readonly Cue Fm = new Cue("Fm", 137, eCueType.Bool);
public static readonly Cue Up = new Cue("Up", 138, eCueType.Bool);
public static readonly Cue Down = new Cue("Down", 139, eCueType.Bool);
public static readonly Cue Left = new Cue("Left", 140, eCueType.Bool);
public static readonly Cue Right = new Cue("Right", 141, eCueType.Bool);
public static readonly Cue Select = new Cue("Select", 142, eCueType.Bool);
public static readonly Cue SmartApps = new Cue("SmartApps", 143, eCueType.Bool);
public static readonly Cue Dvr = new Cue("Dvr", 144, eCueType.Bool);
public static readonly Cue Play = new Cue("Play", 145, eCueType.Bool);
public static readonly Cue Pause = new Cue("Pause", 146, eCueType.Bool);
public static readonly Cue Stop = new Cue("Stop", 147, eCueType.Bool);
public static readonly Cue ChapNext = new Cue("ChapNext", 148, eCueType.Bool);
public static readonly Cue ChapPrevious = new Cue("ChapPrevious", 149, eCueType.Bool);
public static readonly Cue Rewind = new Cue("Rewind", 150, eCueType.Bool);
public static readonly Cue Ffwd = new Cue("Ffwd", 151, eCueType.Bool);
public static readonly Cue Replay = new Cue("Replay", 152, eCueType.Bool);
public static readonly Cue Advance = new Cue("Advance", 153, eCueType.Bool);
public static readonly Cue Record = new Cue("Record", 154, eCueType.Bool);
public static readonly Cue Red = new Cue("Red", 155, eCueType.Bool);
public static readonly Cue Green = new Cue("Green", 156, eCueType.Bool);
public static readonly Cue Yellow = new Cue("Yellow", 157, eCueType.Bool);
public static readonly Cue Blue = new Cue("Blue", 158, eCueType.Bool);
public static readonly Cue Home = new Cue("Home", 159, eCueType.Bool);
public static readonly Cue PopUp = new Cue("PopUp", 160, eCueType.Bool);
public static readonly Cue PageUp = new Cue("PageUp", 161, eCueType.Bool);
public static readonly Cue PageDown = new Cue("PageDown", 162, eCueType.Bool);
public static readonly Cue Search = new Cue("Search", 163, eCueType.Bool);
public static readonly Cue Setup = new Cue("Setup", 164, eCueType.Bool);
public static readonly Cue RStep = new Cue("RStep", 165, eCueType.Bool);
public static readonly Cue FStep = new Cue("FStep", 166, eCueType.Bool);
public static readonly Cue IsConnected = new Cue("IsConnected", 281, eCueType.Bool);
public static readonly Cue IsOk = new Cue("IsOk", 282, eCueType.Bool);
public static readonly Cue InWarning = new Cue("InWarning", 283, eCueType.Bool);
public static readonly Cue InError = new Cue("InError", 284, eCueType.Bool);
public static readonly Cue StatusUnknown = new Cue("StatusUnknown", 285, eCueType.Bool);
public static readonly Cue VolumeUp = new Cue("VolumeUp", 401, eCueType.Bool);
public static readonly Cue VolumeDown = new Cue("VolumeDown", 402, eCueType.Bool);
public static readonly Cue MuteOn = new Cue("MuteOn", 403, eCueType.Bool);
public static readonly Cue MuteOff = new Cue("MuteOff", 404, eCueType.Bool);
public static readonly Cue MuteToggle = new Cue("MuteToggle", 405, eCueType.Bool);
public static readonly Cue ShowVolumeButtons = new Cue("ShowVolumeButtons", 406, eCueType.Bool);
public static readonly Cue ShowVolumeSlider = new Cue("ShowVolumeSlider", 407, eCueType.Bool);
public static readonly Cue Hdmi1 = new Cue("Hdmi1", 451, eCueType.Bool);
public static readonly Cue Hdmi2 = new Cue("Hdmi2", 452, eCueType.Bool);
public static readonly Cue Hdmi3 = new Cue("Hdmi3", 453, eCueType.Bool);
public static readonly Cue Hdmi4 = new Cue("Hdmi4", 454, eCueType.Bool);
public static readonly Cue Hdmi5 = new Cue("Hdmi5", 455, eCueType.Bool);
public static readonly Cue Hdmi6 = new Cue("Hdmi6", 456, eCueType.Bool);
public static readonly Cue DisplayPort1 = new Cue("DisplayPort1", 457, eCueType.Bool);
public static readonly Cue DisplayPort2 = new Cue("DisplayPort2", 458, eCueType.Bool);
public static readonly Cue Dvi1 = new Cue("Dvi1", 459, eCueType.Bool);
public static readonly Cue Dvi2 = new Cue("Dvi2", 460, eCueType.Bool);
public static readonly Cue Video1 = new Cue("Video1", 461, eCueType.Bool);
public static readonly Cue Video2 = new Cue("Video2", 462, eCueType.Bool);
public static readonly Cue Component1 = new Cue("Component1", 463, eCueType.Bool);
public static readonly Cue Component2 = new Cue("Component2", 464, eCueType.Bool);
public static readonly Cue Vga1 = new Cue("Vga1", 465, eCueType.Bool);
public static readonly Cue Vga2 = new Cue("Vga2", 466, eCueType.Bool);
public static readonly Cue Rgb1 = new Cue("Rgb1", 467, eCueType.Bool);
public static readonly Cue Rgb2 = new Cue("Rgb2", 468, eCueType.Bool);
public static readonly Cue Antenna = new Cue("Antenna", 469, eCueType.Bool);
}
public static class CommonIntCue
{
public static readonly Cue MainVolumeLevel = new Cue("MainVolumeLevel", 401, eCueType.Int);
public static readonly Cue MainVolumeLevelFeedback = new Cue("MainVolumeLevelFeedback", 401, eCueType.Int);
}
public static class CommonStringCue
{
public static readonly Cue IpConnectionsText = new Cue("IpConnectionsText", 9999, eCueType.String);
}
using Crestron.SimplSharpPro;
namespace PepperDash.Essentials.Core
{
public static class CommonBoolCue
{
public static readonly Cue Power = new Cue("Power", 101, eCueType.Bool);
public static readonly Cue PowerOn = new Cue("PowerOn", 102, eCueType.Bool);
public static readonly Cue PowerOff = new Cue("PowerOff", 103, eCueType.Bool);
public static readonly Cue HasPowerFeedback = new Cue("HasPowerFeedback", 101, eCueType.Bool);
public static readonly Cue PowerOnFeedback = new Cue("PowerOnFeedback", 102, eCueType.Bool);
public static readonly Cue IsOnlineFeedback = new Cue("IsOnlineFeedback", 104, eCueType.Bool);
public static readonly Cue IsWarmingUp = new Cue("IsWarmingUp", 105, eCueType.Bool);
public static readonly Cue IsCoolingDown = new Cue("IsCoolingDown", 106, eCueType.Bool);
public static readonly Cue Dash = new Cue("Dash", 109, eCueType.Bool);
public static readonly Cue Digit0 = new Cue("Digit0", 110, eCueType.Bool);
public static readonly Cue Digit1 = new Cue("Digit1", 111, eCueType.Bool);
public static readonly Cue Digit2 = new Cue("Digit2", 112, eCueType.Bool);
public static readonly Cue Digit3 = new Cue("Digit3", 113, eCueType.Bool);
public static readonly Cue Digit4 = new Cue("Digit4", 114, eCueType.Bool);
public static readonly Cue Digit5 = new Cue("Digit5", 115, eCueType.Bool);
public static readonly Cue Digit6 = new Cue("Digit6", 116, eCueType.Bool);
public static readonly Cue Digit7 = new Cue("Digit7", 117, eCueType.Bool);
public static readonly Cue Digit8 = new Cue("Digit8", 118, eCueType.Bool);
public static readonly Cue Digit9 = new Cue("Digit9", 119, eCueType.Bool);
public static readonly Cue KeypadMisc1 = new Cue("KeypadMisc1", 120, eCueType.Bool);
public static readonly Cue KeypadMisc2 = new Cue("KeypadMisc2", 121, eCueType.Bool);
public static readonly Cue NumericEnter = new Cue("Enter", 122, eCueType.Bool);
public static readonly Cue ChannelUp = new Cue("ChannelUp", 123, eCueType.Bool);
public static readonly Cue ChannelDown = new Cue("ChannelDown", 124, eCueType.Bool);
public static readonly Cue Last = new Cue("Last", 125, eCueType.Bool);
public static readonly Cue OpenClose = new Cue("OpenClose", 126, eCueType.Bool);
public static readonly Cue Subtitle = new Cue("Subtitle", 127, eCueType.Bool);
public static readonly Cue Audio = new Cue("Audio", 128, eCueType.Bool);
public static readonly Cue Info = new Cue("Info", 129, eCueType.Bool);
public static readonly Cue Menu = new Cue("Menu", 130, eCueType.Bool);
public static readonly Cue DeviceMenu = new Cue("DeviceMenu", 131, eCueType.Bool);
public static readonly Cue Return = new Cue("Return", 132, eCueType.Bool);
public static readonly Cue Back = new Cue("Back", 133, eCueType.Bool);
public static readonly Cue Exit = new Cue("Exit", 134, eCueType.Bool);
public static readonly Cue Clear = new Cue("Clear", 135, eCueType.Bool);
public static readonly Cue List = new Cue("List", 136, eCueType.Bool);
public static readonly Cue Guide = new Cue("Guide", 137, eCueType.Bool);
public static readonly Cue Am = new Cue("Am", 136, eCueType.Bool);
public static readonly Cue Fm = new Cue("Fm", 137, eCueType.Bool);
public static readonly Cue Up = new Cue("Up", 138, eCueType.Bool);
public static readonly Cue Down = new Cue("Down", 139, eCueType.Bool);
public static readonly Cue Left = new Cue("Left", 140, eCueType.Bool);
public static readonly Cue Right = new Cue("Right", 141, eCueType.Bool);
public static readonly Cue Select = new Cue("Select", 142, eCueType.Bool);
public static readonly Cue SmartApps = new Cue("SmartApps", 143, eCueType.Bool);
public static readonly Cue Dvr = new Cue("Dvr", 144, eCueType.Bool);
public static readonly Cue Play = new Cue("Play", 145, eCueType.Bool);
public static readonly Cue Pause = new Cue("Pause", 146, eCueType.Bool);
public static readonly Cue Stop = new Cue("Stop", 147, eCueType.Bool);
public static readonly Cue ChapNext = new Cue("ChapNext", 148, eCueType.Bool);
public static readonly Cue ChapPrevious = new Cue("ChapPrevious", 149, eCueType.Bool);
public static readonly Cue Rewind = new Cue("Rewind", 150, eCueType.Bool);
public static readonly Cue Ffwd = new Cue("Ffwd", 151, eCueType.Bool);
public static readonly Cue Replay = new Cue("Replay", 152, eCueType.Bool);
public static readonly Cue Advance = new Cue("Advance", 153, eCueType.Bool);
public static readonly Cue Record = new Cue("Record", 154, eCueType.Bool);
public static readonly Cue Red = new Cue("Red", 155, eCueType.Bool);
public static readonly Cue Green = new Cue("Green", 156, eCueType.Bool);
public static readonly Cue Yellow = new Cue("Yellow", 157, eCueType.Bool);
public static readonly Cue Blue = new Cue("Blue", 158, eCueType.Bool);
public static readonly Cue Home = new Cue("Home", 159, eCueType.Bool);
public static readonly Cue PopUp = new Cue("PopUp", 160, eCueType.Bool);
public static readonly Cue PageUp = new Cue("PageUp", 161, eCueType.Bool);
public static readonly Cue PageDown = new Cue("PageDown", 162, eCueType.Bool);
public static readonly Cue Search = new Cue("Search", 163, eCueType.Bool);
public static readonly Cue Setup = new Cue("Setup", 164, eCueType.Bool);
public static readonly Cue RStep = new Cue("RStep", 165, eCueType.Bool);
public static readonly Cue FStep = new Cue("FStep", 166, eCueType.Bool);
public static readonly Cue IsConnected = new Cue("IsConnected", 281, eCueType.Bool);
public static readonly Cue IsOk = new Cue("IsOk", 282, eCueType.Bool);
public static readonly Cue InWarning = new Cue("InWarning", 283, eCueType.Bool);
public static readonly Cue InError = new Cue("InError", 284, eCueType.Bool);
public static readonly Cue StatusUnknown = new Cue("StatusUnknown", 285, eCueType.Bool);
public static readonly Cue VolumeUp = new Cue("VolumeUp", 401, eCueType.Bool);
public static readonly Cue VolumeDown = new Cue("VolumeDown", 402, eCueType.Bool);
public static readonly Cue MuteOn = new Cue("MuteOn", 403, eCueType.Bool);
public static readonly Cue MuteOff = new Cue("MuteOff", 404, eCueType.Bool);
public static readonly Cue MuteToggle = new Cue("MuteToggle", 405, eCueType.Bool);
public static readonly Cue ShowVolumeButtons = new Cue("ShowVolumeButtons", 406, eCueType.Bool);
public static readonly Cue ShowVolumeSlider = new Cue("ShowVolumeSlider", 407, eCueType.Bool);
public static readonly Cue Hdmi1 = new Cue("Hdmi1", 451, eCueType.Bool);
public static readonly Cue Hdmi2 = new Cue("Hdmi2", 452, eCueType.Bool);
public static readonly Cue Hdmi3 = new Cue("Hdmi3", 453, eCueType.Bool);
public static readonly Cue Hdmi4 = new Cue("Hdmi4", 454, eCueType.Bool);
public static readonly Cue Hdmi5 = new Cue("Hdmi5", 455, eCueType.Bool);
public static readonly Cue Hdmi6 = new Cue("Hdmi6", 456, eCueType.Bool);
public static readonly Cue DisplayPort1 = new Cue("DisplayPort1", 457, eCueType.Bool);
public static readonly Cue DisplayPort2 = new Cue("DisplayPort2", 458, eCueType.Bool);
public static readonly Cue Dvi1 = new Cue("Dvi1", 459, eCueType.Bool);
public static readonly Cue Dvi2 = new Cue("Dvi2", 460, eCueType.Bool);
public static readonly Cue Video1 = new Cue("Video1", 461, eCueType.Bool);
public static readonly Cue Video2 = new Cue("Video2", 462, eCueType.Bool);
public static readonly Cue Component1 = new Cue("Component1", 463, eCueType.Bool);
public static readonly Cue Component2 = new Cue("Component2", 464, eCueType.Bool);
public static readonly Cue Vga1 = new Cue("Vga1", 465, eCueType.Bool);
public static readonly Cue Vga2 = new Cue("Vga2", 466, eCueType.Bool);
public static readonly Cue Rgb1 = new Cue("Rgb1", 467, eCueType.Bool);
public static readonly Cue Rgb2 = new Cue("Rgb2", 468, eCueType.Bool);
public static readonly Cue Antenna = new Cue("Antenna", 469, eCueType.Bool);
public static readonly Cue InCall = new Cue("InCall", 501, eCueType.Bool);
}
public static class CommonIntCue
{
public static readonly Cue MainVolumeLevel = new Cue("MainVolumeLevel", 401, eCueType.Int);
public static readonly Cue MainVolumeLevelFeedback = new Cue("MainVolumeLevelFeedback", 401, eCueType.Int);
}
public static class CommonStringCue
{
public static readonly Cue IpConnectionsText = new Cue("IpConnectionsText", 9999, eCueType.String);
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.CrestronIO
{
public class IOPortConfig
{
public string PortDeviceKey { get; set; }
public uint PortNumber { get; set; }
public bool DisablePullUpResistor { get; set; }
}
}

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.CrestronIO
{
public class GenericDigitalInputDevice : Device, IDigitalInput
{
public DigitalInput InputPort { get; private set; }
public BoolFeedback InputStateFeedback { get; private set; }
Func<bool> InputStateFeedbackFunc
{
get
{
return () => InputPort.State;
}
}
public GenericDigitalInputDevice(string key, DigitalInput inputPort):
base(key)
{
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
InputPort = inputPort;
InputPort.StateChange += new DigitalInputEventHandler(InputPort_StateChange);
}
void InputPort_StateChange(DigitalInput digitalInput, DigitalInputEventArgs args)
{
InputStateFeedback.FireUpdate();
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.CrestronIO
{
/// <summary>
/// Represents a generic digital input deviced tied to a versiport
/// </summary>
public class GenericVersiportDigitalInputDevice : Device, IDigitalInput
{
public Versiport InputPort { get; private set; }
public BoolFeedback InputStateFeedback { get; private set; }
Func<bool> InputStateFeedbackFunc
{
get
{
return () => InputPort.DigitalIn;
}
}
public GenericVersiportDigitalInputDevice(string key, Versiport inputPort, IOPortConfig props):
base(key)
{
InputStateFeedback = new BoolFeedback(InputStateFeedbackFunc);
InputPort = inputPort;
InputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalInput);
if (props.DisablePullUpResistor)
InputPort.DisablePullUpResistor = true;
InputPort.VersiportChange += new VersiportEventHandler(InputPort_VersiportChange);
Debug.Console(1, this, "Created GenericVersiportDigitalInputDevice on port '{0}'. DisablePullUpResistor: '{1}'", props.PortNumber, InputPort.DisablePullUpResistor);
}
void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
{
Debug.Console(1, this, "Versiport change: {0}", args.Event);
if(args.Event == eVersiportEvent.DigitalInChange)
InputStateFeedback.FireUpdate();
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.CrestronIO
{
/// <summary>
/// Represents a device that provides digital input
/// </summary>
public interface IDigitalInput
{
BoolFeedback InputStateFeedback { get; }
}
}

View File

@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.CrestronIO
{
/// <summary>
/// Represents a generic device controlled by relays
/// </summary>
public class GenericRelayDevice : Device, ISwitchedOutput
{
public Relay RelayOutput { get; private set; }
public BoolFeedback OutputIsOnFeedback { get; private set; }
public GenericRelayDevice(string key, Relay relay):
base(key)
{
OutputIsOnFeedback = new BoolFeedback(new Func<bool>(() => RelayOutput.State));
if (relay.AvailableForUse)
RelayOutput = relay;
RelayOutput.StateChange += new RelayEventHandler(RelayOutput_StateChange);
}
void RelayOutput_StateChange(Relay relay, RelayEventArgs args)
{
OutputIsOnFeedback.FireUpdate();
}
public void OpenRelay()
{
RelayOutput.State = false;
}
public void CloseRelay()
{
RelayOutput.State = true;
}
public void ToggleRelayState()
{
if (RelayOutput.State == true)
OpenRelay();
else
CloseRelay();
}
#region ISwitchedOutput Members
void ISwitchedOutput.On()
{
CloseRelay();
}
void ISwitchedOutput.Off()
{
OpenRelay();
}
#endregion
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Core.CrestronIO
{
/// <summary>
/// Describes an output capable of switching on and off
/// </summary>
public interface ISwitchedOutput
{
BoolFeedback OutputIsOnFeedback {get;}
void On();
void Off();
}
public interface ISwitchedOutputCollection
{
Dictionary<uint, ISwitchedOutput> SwitchedOutputs { get; }
}
}

View File

@@ -1,116 +1,122 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// A bridge class to cover the basic features of GenericBase hardware
/// </summary>
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor
{
public virtual GenericBase Hardware { get; protected set; }
public BoolFeedback IsOnline { get; private set; }
public BoolFeedback IsRegistered { get; private set; }
public StringFeedback IpConnectionsText { get; private set; }
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name)
{
Hardware = hardware;
IsOnline = new BoolFeedback(CommonBoolCue.IsOnlineFeedback, () => Hardware.IsOnline);
IsRegistered = new BoolFeedback(new Cue("IsRegistered", 0, eCueType.Bool), () => Hardware.Registered);
IpConnectionsText = new StringFeedback(CommonStringCue.IpConnectionsText, () =>
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
}
/// <summary>
/// Make sure that overriding classes call this!
/// Registers the Crestron device, connects up to the base events, starts communication monitor
/// </summary>
public override bool CustomActivate()
{
new CTimer(o =>
{
Debug.Console(1, this, "Activating");
var response = Hardware.RegisterWithLogging(Key);
if (response == eDeviceRegistrationUnRegistrationResponse.Success)
{
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
CommunicationMonitor.Start();
}
}, 0);
return true;
}
/// <summary>
/// This disconnects events and unregisters the base hardware device.
/// </summary>
/// <returns></returns>
public override bool Deactivate()
{
CommunicationMonitor.Stop();
Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange;
return Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
}
/// <summary>
/// Returns a list containing the Outputs that we want to expose.
/// </summary>
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
IsOnline,
IsRegistered,
IpConnectionsText
};
}
}
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
IsOnline.FireUpdate();
}
#region IStatusMonitor Members
public StatusMonitorBase CommunicationMonitor { get; private set; }
#endregion
}
//***********************************************************************************
public class CrestronGenericBaseDeviceEventIds
{
public const uint IsOnline = 1;
public const uint IpConnectionsText =2;
}
/// <summary>
/// Adds logging to Register() failure
/// </summary>
public static class GenericBaseExtensions
{
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
{
var result = device.Register();
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot register device '{0}': {1}", key, result);
}
return result;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// A bridge class to cover the basic features of GenericBase hardware
/// </summary>
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
{
public virtual GenericBase Hardware { get; protected set; }
public BoolFeedback IsOnline { get; private set; }
public BoolFeedback IsRegistered { get; private set; }
public StringFeedback IpConnectionsText { get; private set; }
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name)
{
Hardware = hardware;
IsOnline = new BoolFeedback(CommonBoolCue.IsOnlineFeedback, () => Hardware.IsOnline);
IsRegistered = new BoolFeedback(new Cue("IsRegistered", 0, eCueType.Bool), () => Hardware.Registered);
IpConnectionsText = new StringFeedback(CommonStringCue.IpConnectionsText, () =>
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
}
/// <summary>
/// Make sure that overriding classes call this!
/// Registers the Crestron device, connects up to the base events, starts communication monitor
/// </summary>
public override bool CustomActivate()
{
Debug.Console(0, this, "Activating");
var response = Hardware.RegisterWithLogging(Key);
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
return false;
}
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
CommunicationMonitor.Start();
return true;
}
/// <summary>
/// This disconnects events and unregisters the base hardware device.
/// </summary>
/// <returns></returns>
public override bool Deactivate()
{
CommunicationMonitor.Stop();
Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange;
return Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
}
/// <summary>
/// Returns a list containing the Outputs that we want to expose.
/// </summary>
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
IsOnline,
IsRegistered,
IpConnectionsText
};
}
}
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
IsOnline.FireUpdate();
}
#region IStatusMonitor Members
public StatusMonitorBase CommunicationMonitor { get; private set; }
#endregion
#region IUsageTracking Members
public UsageTracking UsageTracker { get; set; }
#endregion
}
//***********************************************************************************
public class CrestronGenericBaseDeviceEventIds
{
public const uint IsOnline = 1;
public const uint IpConnectionsText =2;
}
/// <summary>
/// Adds logging to Register() failure
/// </summary>
public static class GenericBaseExtensions
{
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
{
var result = device.Register();
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot register device '{0}': {1}", key, result);
}
return result;
}
}
}

View File

@@ -0,0 +1,128 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// A bridge class to cover the basic features of GenericBase hardware
/// </summary>
public class CrestronGenericBaseDevice : Device, IOnline, IHasFeedback, ICommunicationMonitor, IUsageTracking
{
public virtual GenericBase Hardware { get; protected set; }
public BoolFeedback IsOnline { get; private set; }
public BoolFeedback IsRegistered { get; private set; }
public StringFeedback IpConnectionsText { get; private set; }
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
: base(key, name)
{
Hardware = hardware;
IsOnline = new BoolFeedback(CommonBoolCue.IsOnlineFeedback, () => Hardware.IsOnline);
IsRegistered = new BoolFeedback(new Cue("IsRegistered", 0, eCueType.Bool), () => Hardware.Registered);
IpConnectionsText = new StringFeedback(CommonStringCue.IpConnectionsText, () =>
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, hardware, 120000, 300000);
}
/// <summary>
/// Make sure that overriding classes call this!
/// Registers the Crestron device, connects up to the base events, starts communication monitor
/// </summary>
public override bool CustomActivate()
{
Debug.Console(0, this, "Activating");
var response = Hardware.RegisterWithLogging(Key);
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
{
<<<<<<< HEAD
Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
return false;
}
=======
Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
return false;
}
>>>>>>> origin/feature/ecs-342-neil
Hardware.OnlineStatusChange += new OnlineStatusChangeEventHandler(Hardware_OnlineStatusChange);
CommunicationMonitor.Start();
return true;
}
/// <summary>
/// This disconnects events and unregisters the base hardware device.
/// </summary>
/// <returns></returns>
public override bool Deactivate()
{
CommunicationMonitor.Stop();
Hardware.OnlineStatusChange -= Hardware_OnlineStatusChange;
return Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
}
/// <summary>
/// Returns a list containing the Outputs that we want to expose.
/// </summary>
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
IsOnline,
IsRegistered,
IpConnectionsText
};
}
}
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
{
IsOnline.FireUpdate();
}
#region IStatusMonitor Members
public StatusMonitorBase CommunicationMonitor { get; private set; }
#endregion
#region IUsageTracking Members
public UsageTracking UsageTracker { get; set; }
#endregion
}
//***********************************************************************************
public class CrestronGenericBaseDeviceEventIds
{
public const uint IsOnline = 1;
public const uint IpConnectionsText =2;
}
/// <summary>
/// Adds logging to Register() failure
/// </summary>
public static class GenericBaseExtensions
{
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
{
var result = device.Register();
if (result != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot register device '{0}': {1}", key, result);
}
return result;
}
}
}

View File

@@ -1,46 +1,48 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public interface IPower
{
void PowerOn();
void PowerOff();
void PowerToggle();
BoolFeedback PowerIsOnFeedback { get; }
}
/// <summary>
///
/// </summary>
public static class IPowerExtensions
{
public static void LinkButtons(this IPower dev, BasicTriList triList)
{
triList.SetSigFalseAction(101, dev.PowerOn);
triList.SetSigFalseAction(102, dev.PowerOff);
triList.SetSigFalseAction(103, dev.PowerToggle);
dev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
}
public static void UnlinkButtons(this IPower dev, BasicTriList triList)
{
triList.ClearBoolSigAction(101);
triList.ClearBoolSigAction(102);
triList.ClearBoolSigAction(103);
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
}
}
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.Fusion;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public interface IPower
{
void PowerOn();
void PowerOff();
void PowerToggle();
BoolFeedback PowerIsOnFeedback { get; }
}
/// <summary>
///
/// </summary>
public static class IPowerExtensions
{
public static void LinkButtons(this IPower dev, BasicTriList triList)
{
triList.SetSigFalseAction(101, dev.PowerOn);
triList.SetSigFalseAction(102, dev.PowerOff);
triList.SetSigFalseAction(103, dev.PowerToggle);
dev.PowerIsOnFeedback.LinkInputSig(triList.BooleanInput[101]);
}
public static void UnlinkButtons(this IPower dev, BasicTriList triList)
{
triList.ClearBoolSigAction(101);
triList.ClearBoolSigAction(102);
triList.ClearBoolSigAction(103);
dev.PowerIsOnFeedback.UnlinkInputSig(triList.BooleanInput[101]);
}
}
}

View File

@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Adds control of codec receive volume
/// </summary>
public interface IReceiveVolume
{
// Break this out into 3 interfaces
void SetReceiveVolume(ushort level);
void ReceiveMuteOn();
void ReceiveMuteOff();
void ReceiveMuteToggle();
IntFeedback ReceiveLevelFeedback { get; }
BoolFeedback ReceiveMuteIsOnFeedback { get; }
}
/// <summary>
/// Adds control of codec transmit volume
/// </summary>
public interface ITransmitVolume
{
void SetTransmitVolume(ushort level);
void TransmitMuteOn();
void TransmitMuteOff();
void TransmitMuteToggle();
IntFeedback TransmitLevelFeedback { get; }
BoolFeedback TransmitMuteIsOnFeedback { get; }
}
/// <summary>
/// Adds control of codec privacy function (microphone mute)
/// </summary>
public interface IPrivacy
{
void PrivacyModeOn();
void PrivacyModeOff();
void PrivacyModeToggle();
BoolFeedback PrivacyModeIsOnFeedback { get; }
}
}

View File

@@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Requirements for a device that has dialing capabilities
/// </summary>
public interface IHasDialer
{
// Add requirements for Dialer functionality
void Dial(string number);
<<<<<<< HEAD
void EndCall(string number);
=======
void EndCall(object activeCall);
void EndAllCalls();
>>>>>>> origin/feature/cisco-spark-2
void AcceptCall();
void RejectCall();
void SendDtmf(string digit);
IntFeedback ActiveCallCountFeedback { get; }
BoolFeedback IncomingCallFeedback { get; }
}
/// <summary>
/// Defines minimum volume controls for a codec device with dialing capabilities
/// </summary>
public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy
{
}
/// <summary>
/// Adds control of codec receive volume
/// </summary>
public interface IReceiveVolume
{
// Break this out into 3 interfaces
void SetReceiveVolume(ushort level);
void ReceiveMuteOn();
void ReceiveMuteOff();
void ReceiveMuteToggle();
IntFeedback ReceiveLevelFeedback { get; }
BoolFeedback ReceiveMuteIsOnFeedback { get; }
}
/// <summary>
/// Adds control of codec transmit volume
/// </summary>
public interface ITransmitVolume
{
void SetTransmitVolume(ushort level);
void TransmitMuteOn();
void TransmitMuteOff();
void TransmitMuteToggle();
IntFeedback TransmitLevelFeedback { get; }
BoolFeedback TransmitMuteIsOnFeedback { get; }
}
/// <summary>
/// Adds control of codec privacy function (microphone mute)
/// </summary>
public interface IPrivacy
{
void PrivacyModeOn();
void PrivacyModeOff();
void PrivacyModeToggle();
BoolFeedback PrivacyModeIsOnFeedback { get; }
}
public interface IHasCallHistory
{
// Add recent calls list
}
public interface IHasDirectory
{
}
public interface IHasObtp
{
// Upcoming Meeting warning event
}
}

View File

@@ -56,8 +56,6 @@ namespace PepperDash.Essentials.Core
System.Globalization.CultureInfo.InvariantCulture))
.ToArray();
object ret = method.Invoke(obj, convertedParams);
//Debug.Console(0, JsonConvert.SerializeObject(ret));
// return something?
}
/// <summary>
@@ -73,7 +71,7 @@ namespace PepperDash.Essentials.Core
CType t = obj.GetType();
// get the properties and set them into a new collection of NameType wrappers
var props = t.GetProperties().Select(p => new PropertyNameType(p));
var props = t.GetProperties().Select(p => new PropertyNameType(p, obj));
return JsonConvert.SerializeObject(props, Formatting.Indented);
}
@@ -197,6 +195,27 @@ namespace PepperDash.Essentials.Core
}
return obj;
}
/// <summary>
/// Sets a property on an object.
/// </summary>
/// <param name="deviceObjectPath"></param>
/// <returns></returns>
public static string SetProperty(string deviceObjectPath)
{
throw new NotImplementedException("This could be really useful. Finish it please");
//var obj = FindObjectOnPath(deviceObjectPath);
//if (obj == null)
// return "{\"error\":\"No object found\"}";
//CType t = obj.GetType();
//// get the properties and set them into a new collection of NameType wrappers
//var props = t.GetProperties().Select(p => new PropertyNameType(p, obj));
//return JsonConvert.SerializeObject(props, Formatting.Indented);
}
}
public class DeviceActionWrapper
@@ -208,14 +227,37 @@ namespace PepperDash.Essentials.Core
public class PropertyNameType
{
object Parent;
[JsonIgnore]
public PropertyInfo PropInfo { get; private set; }
public string Name { get { return PropInfo.Name; } }
public string Type { get { return PropInfo.PropertyType.Name; } }
public string Value { get
{
if (PropInfo.CanRead)
{
try
{
return PropInfo.GetValue(Parent, null).ToString();
}
catch (Exception)
{
return null;
}
}
else
return null;
} }
public PropertyNameType(PropertyInfo info)
public bool CanRead { get { return PropInfo.CanRead; } }
public bool CanWrite { get { return PropInfo.CanWrite; } }
public PropertyNameType(PropertyInfo info, object parent)
{
PropInfo = info;
Parent = parent;
}
}

View File

@@ -29,10 +29,6 @@ namespace PepperDash.Essentials.Core
public static void Initialize(CrestronControlSystem cs)
{
CrestronConsole.AddNewConsoleCommand(ListDeviceCommands, "devcmdlist", "Lists commands",
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(DoDeviceCommand, "devcmd", "Runs a command on device - key Name value",
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ListDeviceCommStatuses, "devcommstatus", "Lists the communication status of all devices",
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ListDeviceFeedbacks, "devfb", "Lists current feedbacks",
@@ -53,6 +49,8 @@ namespace PepperDash.Essentials.Core
{
CrestronConsole.ConsoleCommandResponse(DeviceJsonApi.GetApiMethods(s));
}, "apimethods", "", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(SimulateComReceiveOnDevice, "devsimreceive",
"Simulates incoming data on a com device", ConsoleAccessLevelEnum.AccessOperator);
}
/// <summary>
@@ -62,8 +60,15 @@ namespace PepperDash.Essentials.Core
{
foreach (var d in Devices.Values)
{
if (d is Device)
(d as Device).Activate();
try
{
if (d is Device)
(d as Device).Activate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device activation failure:\r{0}", e);
}
}
}
@@ -105,7 +110,6 @@ namespace PepperDash.Essentials.Core
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));
//var devs = Devices.Values.Where(d => d is IKeyed).Select(d => d as IKeyed);
foreach (var d in sorted)
{
@@ -131,16 +135,16 @@ namespace PepperDash.Essentials.Core
statusDev.DumpFeedbacksToConsole(true);
}
static void ListDeviceCommands(string devKey)
{
var dev = GetDeviceForKey(devKey);
if (dev == null)
{
Debug.Console(0, "Device '{0}' not found", devKey);
return;
}
Debug.Console(0, "This needs to be reworked. Stay tuned.", devKey);
}
//static void ListDeviceCommands(string devKey)
//{
// var dev = GetDeviceForKey(devKey);
// if (dev == null)
// {
// Debug.Console(0, "Device '{0}' not found", devKey);
// return;
// }
// Debug.Console(0, "This needs to be reworked. Stay tuned.", devKey);
//}
static void ListDeviceCommStatuses(string input)
{
@@ -154,10 +158,10 @@ namespace PepperDash.Essentials.Core
}
static void DoDeviceCommand(string command)
{
Debug.Console(0, "Not yet implemented. Stay tuned");
}
//static void DoDeviceCommand(string command)
//{
// Debug.Console(0, "Not yet implemented. Stay tuned");
//}
public static void AddDevice(IKeyed newDev)
{
@@ -167,7 +171,7 @@ namespace PepperDash.Essentials.Core
//if (existingDevice != null)
if(Devices.ContainsKey(newDev.Key))
{
Debug.Console(0, newDev, "A device with this key already exists. Not added to manager");
Debug.Console(0, newDev, "WARNING: A device with this key already exists. Not added to manager");
return;
}
Devices.Add(newDev.Key, newDev);
@@ -207,5 +211,29 @@ namespace PepperDash.Essentials.Core
return null;
}
/// <summary>
/// Console handler that simulates com port data receive
/// </summary>
/// <param name="s"></param>
public static void SimulateComReceiveOnDevice(string s)
{
// devcomsim:1 xyzabc
var match = Regex.Match(s, @"(\S*)\s*(.*)");
if (match.Groups.Count < 3)
{
CrestronConsole.ConsoleCommandResponse(" Format: devsimreceive:P <device key> <string to send>");
return;
}
//Debug.Console(2, "**** {0} - {1} ****", match.Groups[1].Value, match.Groups[2].Value);
ComPortController com = GetDeviceForKey(match.Groups[1].Value) as ComPortController;
if (com == null)
{
CrestronConsole.ConsoleCommandResponse("'{0}' is not a comm port device", match.Groups[1].Value);
return;
}
com.SimulateReceive(match.Groups[2].Value);
}
}
}

View File

@@ -0,0 +1,253 @@
using System;
using System.Collections.Generic;
using System.Linq;
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;
namespace PepperDash.Essentials.Core
{
public static class DeviceManager
{
//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);
/// <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 void Initialize(CrestronControlSystem cs)
{
CrestronConsole.AddNewConsoleCommand(ListDeviceCommStatuses, "devcommstatus", "Lists the communication status of all devices",
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ListDeviceFeedbacks, "devfb", "Lists current feedbacks",
ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(ListDevices, "devlist", "Lists current managed devices",
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(SimulateComReceiveOnDevice, "devsimreceive",
"Simulates incoming data on a com device", ConsoleAccessLevelEnum.AccessOperator);
}
/// <summary>
/// Calls activate on all Device class items
/// </summary>
public static void ActivateAll()
{
foreach (var d in Devices.Values)
<<<<<<< HEAD
{
try
{
if (d is Device)
(d as Device).Activate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device activation failure:\r{0}", e);
}
}
=======
{
try
{
if (d is Device)
(d as Device).Activate();
}
catch (Exception e)
{
Debug.Console(0, d, "ERROR: Device activation failure:\r{0}", e);
}
}
>>>>>>> origin/feature/ecs-342-neil
}
/// <summary>
/// Calls activate on all Device class items
/// </summary>
public static void DeactivateAll()
{
foreach (var d in Devices.Values)
{
if (d is Device)
(d as Device).Deactivate();
}
}
//static void ListMethods(string devKey)
//{
// var dev = GetDeviceForKey(devKey);
// if(dev != null)
// {
// var type = dev.GetType().GetCType();
// var methods = type.GetMethods(BindingFlags.Public|BindingFlags.Instance);
// var sb = new StringBuilder();
// sb.AppendLine(string.Format("{2} methods on [{0}] ({1}):", dev.Key, type.Name, methods.Length));
// foreach (var m in methods)
// {
// sb.Append(string.Format("{0}(", m.Name));
// var pars = m.GetParameters();
// foreach (var p in pars)
// sb.Append(string.Format("({1}){0} ", p.Name, p.ParameterType.Name));
// sb.AppendLine(")");
// }
// CrestronConsole.ConsoleCommandResponse(sb.ToString());
// }
//}
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));
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);
}
//static void ListDeviceCommands(string devKey)
//{
// var dev = GetDeviceForKey(devKey);
// if (dev == null)
// {
// Debug.Console(0, "Device '{0}' not found", devKey);
// return;
// }
// 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());
}
//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);
}
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);
}
public static IEnumerable<string> GetDeviceKeys()
{
//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;
}
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 null;
}
/// <summary>
/// Console handler that simulates com port data receive
/// </summary>
/// <param name="s"></param>
public static void SimulateComReceiveOnDevice(string s)
{
// devcomsim:1 xyzabc
var match = Regex.Match(s, @"(\S*)\s*(.*)");
if (match.Groups.Count < 3)
{
CrestronConsole.ConsoleCommandResponse(" Format: devsimreceive:P <device key> <string to send>");
return;
}
//Debug.Console(2, "**** {0} - {1} ****", match.Groups[1].Value, match.Groups[2].Value);
ComPortController com = GetDeviceForKey(match.Groups[1].Value) as ComPortController;
if (com == null)
{
CrestronConsole.ConsoleCommandResponse("'{0}' is not a comm port device", match.Groups[1].Value);
return;
}
com.SimulateReceive(match.Groups[2].Value);
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
@@ -21,32 +22,40 @@ namespace PepperDash.Essentials.Core
{
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
{
var outputs = source.Feedbacks.OrderBy(x => x.Type);
if (outputs != null)
CType t = source.GetType();
// get the properties and set them into a new collection of NameType wrappers
var props = t.GetProperties().Select(p => new PropertyNameType(p, t));
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
if (feedbacks != null)
{
Debug.Console(0, source, "\n\nAvailable outputs:");
foreach (var o in outputs)
Debug.Console(0, source, "\n\nAvailable feedbacks:");
foreach (var f in feedbacks)
{
string val = "";
string type = "";
if (getCurrentStates)
{
switch (o.Type)
{
case eCueType.Bool:
val = " = " + o.BoolValue;
break;
case eCueType.Int:
val = " = " + o.IntValue;
break;
case eCueType.String:
val = " = " + o.StringValue;
break;
//case eOutputType.Other:
// break;
}
if (f is BoolFeedback)
{
val = f.BoolValue.ToString();
type = "boolean";
}
else if (f is IntFeedback)
{
val = f.IntValue.ToString();
type = "integer";
}
else if (f is StringFeedback)
{
val = f.StringValue;
type = "string";
}
}
Debug.Console(0, "{0,-8} {1,5} {2}{3}", o.Type, o.Cue.Number,
(string.IsNullOrEmpty(o.Cue.Name) ? "-none-" : o.Cue.Name), val);
Debug.Console(0, "{0,-12} {1, -25} {2}", type,
(string.IsNullOrEmpty(f.Cue.Name) ? "-no name-" : f.Cue.Name), val);
}
}
else

View File

@@ -0,0 +1,135 @@
<<<<<<< HEAD
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public interface IHasFeedback : IKeyed
{
/// <summary>
/// This method shall return a list of all Output objects on a device,
/// including all "aggregate" devices.
/// </summary>
List<Feedback> Feedbacks { get; }
}
public static class IHasFeedbackExtensions
{
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
{
CType t = source.GetType();
// get the properties and set them into a new collection of NameType wrappers
var props = t.GetProperties().Select(p => new PropertyNameType(p, t));
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
if (feedbacks != null)
{
Debug.Console(0, source, "\n\nAvailable feedbacks:");
foreach (var f in feedbacks)
{
string val = "";
string type = "";
if (getCurrentStates)
{
if (f is BoolFeedback)
{
val = f.BoolValue.ToString();
type = "boolean";
}
else if (f is IntFeedback)
{
val = f.IntValue.ToString();
type = "integer";
}
else if (f is StringFeedback)
{
val = f.StringValue;
type = "string";
}
}
Debug.Console(0, "{0,-12} {1, -25} {2}", type,
(string.IsNullOrEmpty(f.Cue.Name) ? "-no name-" : f.Cue.Name), val);
}
}
else
Debug.Console(0, source, "No available outputs:");
}
}
=======
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public interface IHasFeedback : IKeyed
{
/// <summary>
/// This method shall return a list of all Output objects on a device,
/// including all "aggregate" devices.
/// </summary>
List<Feedback> Feedbacks { get; }
}
public static class IHasFeedbackExtensions
{
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
{
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
if (feedbacks != null)
{
Debug.Console(0, source, "\n\nAvailable feedbacks:");
foreach (var f in feedbacks)
{
string val = "";
if (getCurrentStates)
{
if (f is BoolFeedback)
val = " = " + f.BoolValue;
else if(f is IntFeedback)
val = " = " + f.IntValue;
else if(f is StringFeedback)
val = " = " + f.StringValue;
//switch (f.Type)
//{
// case eCueType.Bool:
// val = " = " + f.BoolValue;
// break;
// case eCueType.Int:
// val = " = " + f.IntValue;
// break;
// case eCueType.String:
// val = " = " + f.StringValue;
// break;
// //case eOutputType.Other:
// // break;
//}
}
Debug.Console(0, "{0,-8} {1}{2}", f.GetType(),
(string.IsNullOrEmpty(f.Cue.Name) ? "-none-" : f.Cue.Name), val);
}
}
else
Debug.Console(0, source, "No available outputs:");
}
}
public static class IHasFeedbackFusionExtensions
{
}
>>>>>>> origin/feature/ecs-307
}

View File

@@ -0,0 +1,63 @@
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public interface IHasFeedback : IKeyed
{
/// <summary>
/// This method shall return a list of all Output objects on a device,
/// including all "aggregate" devices.
/// </summary>
List<Feedback> Feedbacks { get; }
}
public static class IHasFeedbackExtensions
{
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
{
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
if (feedbacks != null)
{
Debug.Console(0, source, "\n\nAvailable feedbacks:");
foreach (var f in feedbacks)
{
string val = "";
if (getCurrentStates)
{
if (f is BoolFeedback)
val = " = " + f.BoolValue;
else if(f is IntFeedback)
val = " = " + f.IntValue;
else if(f is StringFeedback)
val = " = " + f.StringValue;
//switch (f.Type)
//{
// case eCueType.Bool:
// val = " = " + f.BoolValue;
// break;
// case eCueType.Int:
// val = " = " + f.IntValue;
// break;
// case eCueType.String:
// val = " = " + f.StringValue;
// break;
// //case eOutputType.Other:
// // break;
//}
}
Debug.Console(0, "{0,-8} {1}{2}", f.GetType(),
(string.IsNullOrEmpty(f.Cue.Name) ? "-none-" : f.Cue.Name), val);
}
}
else
Debug.Console(0, source, "No available outputs:");
}
}
}

View File

@@ -0,0 +1,65 @@
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public interface IHasFeedback : IKeyed
{
/// <summary>
/// This method shall return a list of all Output objects on a device,
/// including all "aggregate" devices.
/// </summary>
List<Feedback> Feedbacks { get; }
}
public static class IHasFeedbackExtensions
{
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
{
CType t = source.GetType();
// get the properties and set them into a new collection of NameType wrappers
var props = t.GetProperties().Select(p => new PropertyNameType(p, t));
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
if (feedbacks != null)
{
Debug.Console(0, source, "\n\nAvailable feedbacks:");
foreach (var f in feedbacks)
{
string val = "";
string type = "";
if (getCurrentStates)
{
if (f is BoolFeedback)
{
val = f.BoolValue.ToString();
type = "boolean";
}
else if (f is IntFeedback)
{
val = f.IntValue.ToString();
type = "integer";
}
else if (f is StringFeedback)
{
val = f.StringValue;
type = "string";
}
}
Debug.Console(0, "{0,-12} {1, -25} {2}", type,
(string.IsNullOrEmpty(f.Cue.Name) ? "-no name-" : f.Cue.Name), val);
}
}
else
Debug.Console(0, source, "No available outputs:");
}
}
}

View File

@@ -0,0 +1,68 @@
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public interface IHasFeedback : IKeyed
{
/// <summary>
/// This method shall return a list of all Output objects on a device,
/// including all "aggregate" devices.
/// </summary>
List<Feedback> Feedbacks { get; }
}
public static class IHasFeedbackExtensions
{
public static void DumpFeedbacksToConsole(this IHasFeedback source, bool getCurrentStates)
{
var feedbacks = source.Feedbacks.OrderBy(x => x.Type);
if (feedbacks != null)
{
Debug.Console(0, source, "\n\nAvailable feedbacks:");
foreach (var f in feedbacks)
{
string val = "";
if (getCurrentStates)
{
if (f is BoolFeedback)
val = " = " + f.BoolValue;
else if(f is IntFeedback)
val = " = " + f.IntValue;
else if(f is StringFeedback)
val = " = " + f.StringValue;
//switch (f.Type)
//{
// case eCueType.Bool:
// val = " = " + f.BoolValue;
// break;
// case eCueType.Int:
// val = " = " + f.IntValue;
// break;
// case eCueType.String:
// val = " = " + f.StringValue;
// break;
// //case eOutputType.Other:
// // break;
//}
}
Debug.Console(0, "{0,-8} {1}{2}", f.GetType(),
(string.IsNullOrEmpty(f.Cue.Name) ? "-none-" : f.Cue.Name), val);
}
}
else
Debug.Console(0, source, "No available outputs:");
}
}
public static class IHasFeedbackFusionExtensions
{
}
}

View File

@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public interface IUsageTracking
{
UsageTracking UsageTracker { get; set; }
}
//public static class IUsageTrackingExtensions
//{
// public static void EnableUsageTracker(this IUsageTracking device)
// {
// device.UsageTracker = new UsageTracking();
// }
//}
public class UsageTracking
{
public event EventHandler<DeviceUsageEventArgs> DeviceUsageEnded;
public InUseTracking InUseTracker { get; protected set; }
public bool UsageIsTracked { get; set; }
public bool UsageTrackingStarted { get; protected set; }
public DateTime UsageStartTime { get; protected set; }
public DateTime UsageEndTime { get; protected set; }
public Device Parent { get; private set; }
public UsageTracking(Device parent)
{
Parent = parent;
InUseTracker = new InUseTracking();
InUseTracker.InUseFeedback.OutputChange +=new EventHandler<EventArgs>(InUseFeedback_OutputChange);
}
void InUseFeedback_OutputChange(object sender, EventArgs e)
{
if(InUseTracker.InUseFeedback.BoolValue)
{
StartDeviceUsage();
}
else
{
EndDeviceUsage();
}
}
/// <summary>
/// Stores the usage start time
/// </summary>
public void StartDeviceUsage()
{
UsageTrackingStarted = true;
UsageStartTime = DateTime.Now;
}
/// <summary>
/// Calculates the difference between the usage start and end times, gets the total minutes used and fires an event to pass that info to a consumer
/// </summary>
public void EndDeviceUsage()
{
try
{
UsageTrackingStarted = false;
UsageEndTime = DateTime.Now;
if (UsageStartTime != null)
{
var timeUsed = UsageEndTime - UsageStartTime;
var handler = DeviceUsageEnded;
if (handler != null)
{
Debug.Console(1, "Device Usage Ended for: {0} at {1}. In use for {2} minutes.", Parent.Name, UsageEndTime, timeUsed.Minutes);
handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes });
}
}
}
catch (Exception e)
{
Debug.Console(1, "Error ending device usage: {0}", e);
}
}
}
public class DeviceUsageEventArgs : EventArgs
{
public DateTime UsageEndTime { get; set; }
public int MinutesUsed { get; set; }
}
}

View File

@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public interface IUsageTracking
{
UsageTracking UsageTracker { get; set; }
}
//public static class IUsageTrackingExtensions
//{
// public static void EnableUsageTracker(this IUsageTracking device)
// {
// device.UsageTracker = new UsageTracking();
// }
//}
public class UsageTracking
{
public event EventHandler<DeviceUsageEventArgs> DeviceUsageEnded;
public InUseTracking InUseTracker { get; protected set; }
public bool UsageIsTracked { get; set; }
public DateTime UsageStartTime { get; protected set; }
public DateTime UsageEndTime { get; protected set; }
public Device Parent { get; private set; }
public UsageTracking(Device parent)
{
Parent = parent;
InUseTracker = new InUseTracking();
InUseTracker.InUseFeedback.OutputChange +=new EventHandler<EventArgs>(InUseFeedback_OutputChange);
}
void InUseFeedback_OutputChange(object sender, EventArgs e)
{
if(InUseTracker.InUseFeedback.BoolValue)
{
StartDeviceUsage();
}
else
{
EndDeviceUsage();
}
}
/// <summary>
/// Stores the usage start time
/// </summary>
public void StartDeviceUsage()
{
UsageStartTime = DateTime.Now;
}
/// <summary>
/// Calculates the difference between the usage start and end times, gets the total minutes used and fires an event to pass that info to a consumer
/// </summary>
public void EndDeviceUsage()
{
try
{
UsageEndTime = DateTime.Now;
if (UsageStartTime != null)
{
var timeUsed = UsageEndTime - UsageStartTime;
var handler = DeviceUsageEnded;
if (handler != null)
{
Debug.Console(1, "Device Usage Ended for: {0} at {1}. In use for {2} minutes.", Parent.Name, UsageEndTime, timeUsed.Minutes);
handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes });
}
}
}
catch (Exception e)
{
<<<<<<< HEAD
Debug.Console(1, "Device Usage Ended at {0}. In use for {1} minutes.", UsageEndTime, timeUsed.Minutes);
handler(this, new DeviceUsageEventArgs() { UsageEndTime = UsageEndTime, MinutesUsed = timeUsed.Minutes });
=======
Debug.Console(1, "Error ending device usage: {0}", e);
>>>>>>> origin/feature/fusion-nyu
}
}
}
public class DeviceUsageEventArgs : EventArgs
{
public DateTime UsageEndTime { get; set; }
public int MinutesUsed { get; set; }
}
}

View File

@@ -1,98 +1,105 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Defines minimal volume control methods
/// </summary>
public interface IBasicVolumeControls
{
void VolumeUp(bool pressRelease);
void VolumeDown(bool pressRelease);
void MuteToggle();
}
/// <summary>
/// Adds feedback and direct volume level set to IBasicVolumeControls
/// </summary>
public interface IBasicVolumeWithFeedback : IBasicVolumeControls
{
void SetVolume(ushort level);
void MuteOn();
void MuteOff();
IntFeedback VolumeLevelFeedback { get; }
BoolFeedback MuteFeedback { get; }
}
/// <summary>
///
/// </summary>
public interface IFullAudioSettings : IBasicVolumeWithFeedback
{
void SetBalance(ushort level);
void BalanceLeft(bool pressRelease);
void BalanceRight(bool pressRelease);
void SetBass(ushort level);
void BassUp(bool pressRelease);
void BassDown(bool pressRelease);
void SetTreble(ushort level);
void TrebleUp(bool pressRelease);
void TrebleDown(bool pressRelease);
bool hasMaxVolume { get; }
void SetMaxVolume(ushort level);
void MaxVolumeUp(bool pressRelease);
void MaxVolumeDown(bool pressRelease);
bool hasDefaultVolume { get; }
void SetDefaultVolume(ushort level);
void DefaultVolumeUp(bool pressRelease);
void DefaultVolumeDown(bool pressRelease);
void LoudnessToggle();
void MonoToggle();
BoolFeedback LoudnessFeedback { get; }
BoolFeedback MonoFeedback { get; }
IntFeedback BalanceFeedback { get; }
IntFeedback BassFeedback { get; }
IntFeedback TrebleFeedback { get; }
IntFeedback MaxVolumeFeedback { get; }
IntFeedback DefaultVolumeFeedback { get; }
}
/// <summary>
/// A class that implements this, contains a reference to an IBasicVolumeControls device.
/// For example, speakers attached to an audio zone. The speakers can provide reference
/// to their linked volume control.
/// </summary>
public interface IHasVolumeDevice
{
IBasicVolumeControls VolumeDevice { get; }
}
/// <summary>
/// Identifies a device that contains audio zones
/// </summary>
public interface IAudioZones : IRouting
{
Dictionary<uint, IAudioZone> Zone { get; }
}
/// <summary>
/// Defines minimum functionality for an audio zone
/// </summary>
public interface IAudioZone : IBasicVolumeWithFeedback
{
void SelectInput(ushort input);
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Defines minimal volume control methods
/// </summary>
public interface IBasicVolumeControls
{
void VolumeUp(bool pressRelease);
void VolumeDown(bool pressRelease);
void MuteToggle();
}
/// <summary>
/// Adds feedback and direct volume level set to IBasicVolumeControls
/// </summary>
public interface IBasicVolumeWithFeedback : IBasicVolumeControls
{
void SetVolume(ushort level);
void MuteOn();
void MuteOff();
IntFeedback VolumeLevelFeedback { get; }
BoolFeedback MuteFeedback { get; }
}
/// <summary>
/// A class that implements this contains a reference to a current IBasicVolumeControls device.
/// The class may have multiple IBasicVolumeControls.
/// </summary>
public interface IHasCurrentVolumeControls
{
IBasicVolumeControls CurrentVolumeControls { get; }
}
/// <summary>
///
/// </summary>
public interface IFullAudioSettings : IBasicVolumeWithFeedback
{
void SetBalance(ushort level);
void BalanceLeft(bool pressRelease);
void BalanceRight(bool pressRelease);
void SetBass(ushort level);
void BassUp(bool pressRelease);
void BassDown(bool pressRelease);
void SetTreble(ushort level);
void TrebleUp(bool pressRelease);
void TrebleDown(bool pressRelease);
bool hasMaxVolume { get; }
void SetMaxVolume(ushort level);
void MaxVolumeUp(bool pressRelease);
void MaxVolumeDown(bool pressRelease);
bool hasDefaultVolume { get; }
void SetDefaultVolume(ushort level);
void DefaultVolumeUp(bool pressRelease);
void DefaultVolumeDown(bool pressRelease);
void LoudnessToggle();
void MonoToggle();
BoolFeedback LoudnessFeedback { get; }
BoolFeedback MonoFeedback { get; }
IntFeedback BalanceFeedback { get; }
IntFeedback BassFeedback { get; }
IntFeedback TrebleFeedback { get; }
IntFeedback MaxVolumeFeedback { get; }
IntFeedback DefaultVolumeFeedback { get; }
}
/// <summary>
/// A class that implements this, contains a reference to an IBasicVolumeControls device.
/// For example, speakers attached to an audio zone. The speakers can provide reference
/// to their linked volume control.
/// </summary>
public interface IHasVolumeDevice
{
IBasicVolumeControls VolumeDevice { get; }
}
/// <summary>
/// Identifies a device that contains audio zones
/// </summary>
public interface IAudioZones : IRouting
{
Dictionary<uint, IAudioZone> Zone { get; }
}
/// <summary>
/// Defines minimum functionality for an audio zone
/// </summary>
public interface IAudioZone : IBasicVolumeWithFeedback
{
void SelectInput(ushort input);
}
}

View File

@@ -1,92 +0,0 @@
//using System;
//using System.Collections.Generic;
//using System.Linq;
//namespace PepperDash.Essentials.Core
//{
// //*********************************************************************************************************
// /// <summary>
// /// The core event and status-bearing class that most if not all device and connectors can derive from.
// /// </summary>
// public class Device : IKeyed
// {
// public string Key { get; protected set; }
// public string Name { get; protected set; }
// public bool Enabled { get; protected set; }
// List<Action> _PreActivationActions;
// List<Action> _PostActivationActions;
// public static Device DefaultDevice { get { return _DefaultDevice; } }
// static Device _DefaultDevice = new Device("Default", "Default");
// /// <summary>
// /// Base constructor for all Devices.
// /// </summary>
// /// <param name="key"></param>
// public Device(string key)
// {
// Key = key;
// if (key.Contains('.')) Debug.Console(0, this, "WARNING: Device name's should not include '.'");
// Name = "";
// }
// public Device(string key, string name) : this(key)
// {
// Name = name;
// }
// public void AddPreActivationAction(Action act)
// {
// if (_PreActivationActions == null)
// _PreActivationActions = new List<Action>();
// _PreActivationActions.Add(act);
// }
// public void AddPostActivationAction(Action act)
// {
// if (_PostActivationActions == null)
// _PostActivationActions = new List<Action>();
// _PostActivationActions.Add(act);
// }
// /// <summary>
// /// Gets this device ready to be used in the system. Runs any added pre-activation items, and
// /// all post-activation at end. Classes needing additional logic to
// /// run should override CustomActivate()
// /// </summary>
// public bool Activate()
// {
// if (_PreActivationActions != null)
// _PreActivationActions.ForEach(a => a.Invoke());
// var result = CustomActivate();
// if(result && _PostActivationActions != null)
// _PostActivationActions.ForEach(a => a.Invoke());
// return result;
// }
// /// <summary>
// /// Called in between Pre and PostActivationActions when Activate() is called.
// /// Override to provide addtitional setup when calling activation. Overriding classes
// /// do not need to call base.CustomActivate()
// /// </summary>
// /// <returns>true if device activated successfully.</returns>
// public virtual bool CustomActivate() { return true; }
// /// <summary>
// /// Call to deactivate device - unlink events, etc. Overriding classes do not
// /// need to call base.Deactivate()
// /// </summary>
// /// <returns></returns>
// public virtual bool Deactivate() { return true; }
// /// <summary>
// /// Helper method to check object for bool value false and fire an Action method
// /// </summary>
// /// <param name="o">Should be of type bool, others will be ignored</param>
// /// <param name="a">Action to be run when o is false</param>
// public void OnFalse(object o, Action a)
// {
// if (o is bool && !(bool)o) a();
// }
// }
//}

View File

@@ -1,44 +0,0 @@
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using Crestron.SimplSharp;
//using Crestron.SimplSharpPro;
//using Crestron.SimplSharpPro.DeviceSupport;
//using Crestron.SimplSharpPro.EthernetCommunication;
//using Crestron.SimplSharpPro.UI;
//using PepperDash.Core;
//namespace PepperDash.Essentials.Core
//{
//[Obsolete]
// public class PresentationDevice : Device, IPresentationSource
// {
// public PresentationSourceType Type { get; protected set; }
// public string IconName { get { return "Blank"; } set { } }
// public BoolFeedback HasPowerOnFeedback { get; protected set; }
// PresentationDevice()
// : base("Default", "Default")
// {
// HasPowerOnFeedback = new BoolFeedback(CommonBoolCue.HasPowerFeedback, () => false);
// Type = PresentationSourceType.None;
// }
// /// <summary>
// /// Returns a "default" presentation device, with no abilities.
// /// </summary>
// public static IPresentationSource Default
// {
// get
// {
// if (_Default == null)
// _Default = new PresentationDevice();
// return _Default;
// }
// }
// static IPresentationSource _Default;
// }
//}

View File

@@ -1,52 +0,0 @@
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using Crestron.SimplSharp;
//using Crestron.SimplSharpPro;
//using Newtonsoft.Json;
//using Newtonsoft.Json.Linq;
//namespace PepperDash.Essentials.Core
//{
// public class DeviceConfig
// {
// public string Key { get; set; }
// public string Name { get; set; }
// public string Type { get; set; }
// [JsonConverter(typeof(DevicePropertiesJsonConverter))]
// public JToken Properties { get; set; }
// }
// /// <summary>
// /// The gist of this converter: The comspec JSON comes in with normal values that need to be converted
// /// into enum names. This converter takes the value and applies the appropriate enum's name prefix to the value
// /// and then returns the enum value using Enum.Parse
// /// </summary>
// public class DevicePropertiesJsonConverter : JsonConverter
// {
// public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
// {
// return JObject.Load(reader);
// }
// /// <summary>
// /// This will be hit with every value in the ComPortConfig class. We only need to
// /// do custom conversion on the comspec items.
// /// </summary>
// public override bool CanConvert(Type objectType)
// {
// return true;
// }
// public override bool CanRead { get { return true; } }
// public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
// {
// throw new NotImplementedException();
// }
// }
//}

View File

@@ -1,50 +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 PepperDash.Core;
//namespace PepperDash.Essentials.Core
//{
// public abstract class DvdDeviceBase : Device, IPresentationSource, IHasCueActionList
// {
// public DvdDeviceBase(string key, string name)
// : base(key, name)
// {
// HasPowerOnFeedback = new BoolFeedback(() => false);
// }
// #region IPresentationSource Members
// PresentationSourceType IPresentationSource.Type
// {
// get { return PresentationSourceType.Dvd; }
// }
// public string IconName
// {
// get
// {
// return "DVD";
// }
// set { }
// }
// public virtual BoolFeedback HasPowerOnFeedback { get; private set; }
// #endregion
// #region IFunctionList Members
// public abstract List<CueActionPair> CueActionList { get; }
// #endregion
// }
//}

View File

@@ -1,130 +0,0 @@
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using Crestron.SimplSharpPro;
//using PepperDash.Essentials.Core;
//using PepperDash.Core;
//namespace PepperDash.Essentials.Core
//{
// /// <summary>
// /// This DVD class should cover most IR, one-way DVD and Bluray fuctions
// /// </summary>
// public class IrDvdBase : Device, IHasCueActionList,
// IPresentationSource, IAttachVideoStatus, IHasFeedback, IRoutingOutputs
// {
// public PresentationSourceType Type { get; protected set; }
// public string IconName { get; set; }
// public BoolFeedback HasPowerOnFeedback { get; private set; }
// public IrOutputPortController IrPort { get; private set; }
// public RoutingOutputPort HdmiOut { get; private set; }
// #region IRoutingOutputs Members
// /// <summary>
// /// Options: hdmi
// /// </summary>
// public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
// #endregion
// public IrDvdBase(string key, string name, IROutputPort port, IrDriverInfo driverInfo)
// : base(key, name)
// {
// IrPort = new IrOutputPortController("ir-" + key, port, driverInfo.FileName);
// Type = PresentationSourceType.Dvd;
// IconName = "Bluray";
// HasPowerOnFeedback = new BoolFeedback(CommonBoolCue.HasPowerFeedback, () => false);
// HdmiOut = new RoutingOutputPort("HDMI", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 0, this);
// OutputPorts = new RoutingPortCollection<RoutingOutputPort>()
// {
// HdmiOut
// };
// CueActionList = IrPort.GetUOsForIrCommands(driverInfo.IrMap);
// }
// public IrDvdBase(string key, string name, IROutputPort port, string irDriverFilepath)
// : base(key, name)
// {
// IrPort = new IrOutputPortController("ir-" + key, port, irDriverFilepath);
// Type = PresentationSourceType.Dvd;
// IconName = "Bluray";
// HasPowerOnFeedback = new BoolFeedback(CommonBoolCue.HasPowerFeedback, () => false);
// HdmiOut = new RoutingOutputPort("HDMI", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 0, this);
// OutputPorts = new RoutingPortCollection<RoutingOutputPort>()
// {
// HdmiOut
// };
// var numToIr = new Dictionary<Cue, string>
// {
// { CommonBoolCue.Power, IROutputStandardCommands.IROut_POWER },
// { CommonBoolCue.PowerOff, IROutputStandardCommands.IROut_POWER_OFF },
// { CommonBoolCue.PowerOn, IROutputStandardCommands.IROut_POWER_ON },
// { CommonBoolCue.Replay, IROutputStandardCommands.IROut_REPLAY },
// { CommonBoolCue.Play, IROutputStandardCommands.IROut_PLAY },
// { CommonBoolCue.Pause, IROutputStandardCommands.IROut_PAUSE },
// { CommonBoolCue.Stop, IROutputStandardCommands.IROut_STOP },
// { CommonBoolCue.ChapPrevious, IROutputStandardCommands.IROut_TRACK_MINUS },
// { CommonBoolCue.ChapNext, IROutputStandardCommands.IROut_TRACK_PLUS },
// { CommonBoolCue.Rewind, IROutputStandardCommands.IROut_RSCAN },
// { CommonBoolCue.Ffwd, IROutputStandardCommands.IROut_FSCAN },
// { CommonBoolCue.RStep, IROutputStandardCommands.IROut_R_STEP },
// { CommonBoolCue.FStep, IROutputStandardCommands.IROut_F_STEP },
// { CommonBoolCue.Exit, IROutputStandardCommands.IROut_EXIT },
// { CommonBoolCue.Home, IROutputStandardCommands.IROut_HOME },
// { CommonBoolCue.Menu, IROutputStandardCommands.IROut_MENU },
// { CommonBoolCue.PopUp, IROutputStandardCommands.IROut_POPUPMENU },
// { CommonBoolCue.Up, IROutputStandardCommands.IROut_UP_ARROW },
// { CommonBoolCue.Down, IROutputStandardCommands.IROut_DN_ARROW },
// { CommonBoolCue.Left, IROutputStandardCommands.IROut_LEFT_ARROW },
// { CommonBoolCue.Right, IROutputStandardCommands.IROut_RIGHT_ARROW },
// { CommonBoolCue.Select, IROutputStandardCommands.IROut_ENTER },
// { CommonBoolCue.Info, IROutputStandardCommands.IROut_INFO },
// { CommonBoolCue.Red, IROutputStandardCommands.IROut_RED },
// { CommonBoolCue.Green, IROutputStandardCommands.IROut_GREEN },
// { CommonBoolCue.Yellow, IROutputStandardCommands.IROut_YELLOW },
// { CommonBoolCue.Blue, IROutputStandardCommands.IROut_BLUE },
// { CommonBoolCue.Digit0, IROutputStandardCommands.IROut_0 },
// { CommonBoolCue.Digit1, IROutputStandardCommands.IROut_1 },
// { CommonBoolCue.Digit2, IROutputStandardCommands.IROut_2 },
// { CommonBoolCue.Digit3, IROutputStandardCommands.IROut_3 },
// { CommonBoolCue.Digit4, IROutputStandardCommands.IROut_4 },
// { CommonBoolCue.Digit5, IROutputStandardCommands.IROut_5 },
// { CommonBoolCue.Digit6, IROutputStandardCommands.IROut_6 },
// { CommonBoolCue.Digit7, IROutputStandardCommands.IROut_7 },
// { CommonBoolCue.Digit8, IROutputStandardCommands.IROut_8 },
// { CommonBoolCue.Digit9, IROutputStandardCommands.IROut_9 },
// { CommonBoolCue.Audio, "AUDIO" },
// { CommonBoolCue.Subtitle, "SUBTITLE" },
// { CommonBoolCue.Setup, "SETUP" },
// };
// CueActionList = IrPort.GetUOsForIrCommands(numToIr);
// }
// public List<Feedback> Feedbacks
// {
// get { return this.GetVideoStatuses().ToList(); }
// }
// #region IFunctionList Members
// public List<CueActionPair> CueActionList { get; set; }
// #endregion
// }
// public class IrDriverInfo
// {
// public Dictionary<Cue, string> IrMap { get; set; }
// public string FileName { get; set; }
// }
//}

View File

@@ -1,143 +0,0 @@
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using Crestron.SimplSharpPro;
//using PepperDash.Essentials.Core;
//using PepperDash.Essentials.Core.Presets;
//using PepperDash.Core;
//namespace PepperDash.Essentials.Core
//{
// /// <summary>
// /// This DVD class should cover most IR, one-way DVD and Bluray fuctions
// /// </summary>
// public class IrSetTopBoxBase : Device, IHasCueActionList,
// IPresentationSource, IAttachVideoStatus, IHasFeedback, IRoutingOutputs, IHasSetTopBoxProperties
// {
// public PresentationSourceType Type { get; protected set; }
// public string IconName { get; set; }
// public BoolFeedback HasPowerOnFeedback { get; private set; }
// public IrOutputPortController IrPort { get; private set; }
// public DevicePresetsModel PresetsModel { get; private set; }
// #region IRoutingOutputs Members
// /// <summary>
// /// Options: hdmi
// /// </summary>
// public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
// #endregion
// public IrSetTopBoxBase(string key, string name, IROutputPort port, string irDriverFilepath)
// : base(key, name)
// {
// IrPort = new IrOutputPortController("ir-" + key, port, irDriverFilepath);
// Type = PresentationSourceType.SetTopBox;
// IconName = "TV";
// HasPowerOnFeedback = new BoolFeedback(CommonBoolCue.HasPowerFeedback, () => false);
// OutputPorts = new RoutingPortCollection<RoutingOutputPort>()
// {
// new RoutingOutputPort("HDMI", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, 0, this)
// };
// }
// public void LoadPresets(string filePath)
// {
// //PresetsModel = new DevicePresetsModel(Key + "-presets", this, filePath);
// //DeviceManager.AddDevice(PresetsModel);
// }
// #region IDeviceWithOutputs Members
// public List<Feedback> Feedbacks
// {
// get { return this.GetVideoStatuses().ToList(); }
// }
// #endregion
// #region IFunctionList Members
// public List<CueActionPair> CueActionList
// {
// get
// {
// // This might be the best way to get the words back into functions
// new BoolCueActionPair(CommonBoolCue.Power, b => IrPort.PressRelease(IROutputStandardCommands.IROut_POWER, b));
// new BoolCueActionPair(CommonBoolCue.PowerOn, b => IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_ON, b));
// new BoolCueActionPair(CommonBoolCue.PowerOff, b => IrPort.PressRelease(IROutputStandardCommands.IROut_POWER_OFF, b));
// new BoolCueActionPair(CommonBoolCue.ChannelUp, b => IrPort.PressRelease(IROutputStandardCommands.IROut_CH_PLUS, b));
// var numToIr = new Dictionary<Cue, string>
// {
// { CommonBoolCue.Power, IROutputStandardCommands.IROut_POWER },
// { CommonBoolCue.PowerOn, IROutputStandardCommands.IROut_POWER_ON },
// { CommonBoolCue.PowerOff, IROutputStandardCommands.IROut_POWER_OFF },
// { CommonBoolCue.ChannelUp, IROutputStandardCommands.IROut_CH_PLUS },
// { CommonBoolCue.ChannelDown, IROutputStandardCommands.IROut_CH_MINUS },
// { CommonBoolCue.Last, IROutputStandardCommands.IROut_LAST },
// { CommonBoolCue.Play, IROutputStandardCommands.IROut_PLAY },
// { CommonBoolCue.Pause, IROutputStandardCommands.IROut_PAUSE },
// { CommonBoolCue.Stop, IROutputStandardCommands.IROut_STOP },
// { CommonBoolCue.ChapPrevious, IROutputStandardCommands.IROut_TRACK_MINUS },
// { CommonBoolCue.ChapNext, IROutputStandardCommands.IROut_TRACK_PLUS },
// { CommonBoolCue.Rewind, IROutputStandardCommands.IROut_RSCAN },
// { CommonBoolCue.Ffwd, IROutputStandardCommands.IROut_FSCAN },
// { CommonBoolCue.Replay, IROutputStandardCommands.IROut_REPLAY },
// { CommonBoolCue.Advance, "ADVANCE" },
// { CommonBoolCue.Record, IROutputStandardCommands.IROut_RECORD },
// { CommonBoolCue.Exit, IROutputStandardCommands.IROut_EXIT },
// { CommonBoolCue.Menu, IROutputStandardCommands.IROut_MENU },
// { CommonBoolCue.List, IROutputStandardCommands.IROut_DVR },
// { CommonBoolCue.Dvr, IROutputStandardCommands.IROut_DVR },
// { CommonBoolCue.Back, IROutputStandardCommands.IROut_BACK },
// { CommonBoolCue.Up, IROutputStandardCommands.IROut_UP_ARROW },
// { CommonBoolCue.Down, IROutputStandardCommands.IROut_DN_ARROW },
// { CommonBoolCue.Left, IROutputStandardCommands.IROut_LEFT_ARROW },
// { CommonBoolCue.Right, IROutputStandardCommands.IROut_RIGHT_ARROW },
// { CommonBoolCue.Select, IROutputStandardCommands.IROut_ENTER },
// { CommonBoolCue.Guide, IROutputStandardCommands.IROut_GUIDE },
// { CommonBoolCue.PageUp, IROutputStandardCommands.IROut_PAGE_UP },
// { CommonBoolCue.PageDown, IROutputStandardCommands.IROut_PAGE_DOWN },
// { CommonBoolCue.Info, IROutputStandardCommands.IROut_INFO },
// { CommonBoolCue.Red, IROutputStandardCommands.IROut_RED },
// { CommonBoolCue.Green, IROutputStandardCommands.IROut_GREEN },
// { CommonBoolCue.Yellow, IROutputStandardCommands.IROut_YELLOW },
// { CommonBoolCue.Blue, IROutputStandardCommands.IROut_BLUE },
// { CommonBoolCue.Digit0, IROutputStandardCommands.IROut_0 },
// { CommonBoolCue.Digit1, IROutputStandardCommands.IROut_1 },
// { CommonBoolCue.Digit2, IROutputStandardCommands.IROut_2 },
// { CommonBoolCue.Digit3, IROutputStandardCommands.IROut_3 },
// { CommonBoolCue.Digit4, IROutputStandardCommands.IROut_4 },
// { CommonBoolCue.Digit5, IROutputStandardCommands.IROut_5 },
// { CommonBoolCue.Digit6, IROutputStandardCommands.IROut_6 },
// { CommonBoolCue.Digit7, IROutputStandardCommands.IROut_7 },
// { CommonBoolCue.Digit8, IROutputStandardCommands.IROut_8 },
// { CommonBoolCue.Digit9, IROutputStandardCommands.IROut_9 },
// { CommonBoolCue.Dash, "DASH" },
// };
// return IrPort.GetUOsForIrCommands(numToIr);
// }
// }
// #endregion
// #region IHasSetTopBoxProperties Members
// public bool HasDpad { get; set; }
// public bool HasPreset { get; set; }
// public bool HasDvr { get; set; }
// public bool HasNumbers { get; set; }
// #endregion
// }
//}

View File

@@ -23,6 +23,7 @@ namespace PepperDash.Essentials.Core
/// </summary>
public class SourceListItem
{
[JsonProperty("sourceKey")]
public string SourceKey { get; set; }
/// <summary>
/// Returns the source Device for this, if it exists in DeviceManager
@@ -43,6 +44,7 @@ namespace PepperDash.Essentials.Core
/// Gets either the source's Name or this AlternateName property, if
/// defined. If source doesn't exist, returns "Missing source"
/// </summary>
[JsonProperty("preferredName")]
public string PreferredName
{
get
@@ -60,15 +62,36 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// A name that will override the source's name on the UI
/// </summary>
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("icon")]
public string Icon { get; set; }
[JsonProperty("altIcon")]
public string AltIcon { get; set; }
[JsonProperty("includeInSourceList")]
public bool IncludeInSourceList { get; set; }
public int Order { get; set; }
[JsonProperty("order")]
public int Order { get; set; }
[JsonProperty("volumeControlKey")]
public string VolumeControlKey { get; set; }
[JsonProperty("type")]
public eSourceListItemType Type { get; set; }
[JsonProperty("routeList")]
public List<SourceRouteListItem> RouteList { get; set; }
[JsonProperty("disableCodecSharing")]
public bool DisableCodecSharing { get; set; }
[JsonProperty("disableRoutedSharing")]
public bool DisableRoutedSharing { get; set; }
public SourceListItem()
{
Icon = "Blank";

View File

@@ -1,99 +1,127 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling
{
public BoolFeedback PowerIsOnFeedback { get; protected set; }
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
public BoolFeedback IsWarmingUpFeedback { get; private set; }
public uint WarmupTime { get; set; }
public uint CooldownTime { get; set; }
/// <summary>
/// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
/// by concrete sub-classes
/// </summary>
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
abstract protected Func<bool> IsCoolingDownFeedbackFunc { get; }
abstract protected Func<bool> IsWarmingUpFeedbackFunc { get; }
protected CTimer WarmupTimer;
protected CTimer CooldownTimer;
#region IRoutingInputs Members
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
#endregion
public DisplayBase(string key, string name)
: base(key, name)
{
PowerIsOnFeedback = new BoolFeedback(CommonBoolCue.PowerOnFeedback, PowerIsOnFeedbackFunc);
IsCoolingDownFeedback = new BoolFeedback(CommonBoolCue.IsCoolingDown, IsCoolingDownFeedbackFunc);
IsWarmingUpFeedback = new BoolFeedback(CommonBoolCue.IsWarmingUp, IsWarmingUpFeedbackFunc);
InputPorts = new RoutingPortCollection<RoutingInputPort>();
}
public abstract void PowerOn();
public abstract void PowerOff();
public abstract void PowerToggle();
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
PowerIsOnFeedback,
IsCoolingDownFeedback,
IsWarmingUpFeedback
};
}
}
public abstract void ExecuteSwitch(object selector);
}
/// <summary>
///
/// </summary>
public abstract class TwoWayDisplayBase : DisplayBase
{
public static MockDisplay DefaultDisplay {
get
{
if (_DefaultDisplay == null)
_DefaultDisplay = new MockDisplay("default", "Default Display");
return _DefaultDisplay;
}
}
static MockDisplay _DefaultDisplay;
public TwoWayDisplayBase(string key, string name)
: base(key, name)
{
WarmupTime = 7000;
CooldownTime = 15000;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Endpoints;
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
///
/// </summary>
public abstract class DisplayBase : Device, IHasFeedback, IRoutingSinkWithSwitching, IPower, IWarmingCooling, IUsageTracking
{
public BoolFeedback PowerIsOnFeedback { get; protected set; }
public BoolFeedback IsCoolingDownFeedback { get; protected set; }
public BoolFeedback IsWarmingUpFeedback { get; private set; }
public UsageTracking UsageTracker { get; set; }
public uint WarmupTime { get; set; }
public uint CooldownTime { get; set; }
/// <summary>
/// Bool Func that will provide a value for the PowerIsOn Output. Must be implemented
/// by concrete sub-classes
/// </summary>
abstract protected Func<bool> PowerIsOnFeedbackFunc { get; }
abstract protected Func<bool> IsCoolingDownFeedbackFunc { get; }
abstract protected Func<bool> IsWarmingUpFeedbackFunc { get; }
protected CTimer WarmupTimer;
protected CTimer CooldownTimer;
#region IRoutingInputs Members
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
#endregion
public DisplayBase(string key, string name)
: base(key, name)
{
PowerIsOnFeedback = new BoolFeedback(CommonBoolCue.PowerOnFeedback, PowerIsOnFeedbackFunc);
IsCoolingDownFeedback = new BoolFeedback(CommonBoolCue.IsCoolingDown, IsCoolingDownFeedbackFunc);
IsWarmingUpFeedback = new BoolFeedback(CommonBoolCue.IsWarmingUp, IsWarmingUpFeedbackFunc);
InputPorts = new RoutingPortCollection<RoutingInputPort>();
PowerIsOnFeedback.OutputChange += new EventHandler<EventArgs>(PowerIsOnFeedback_OutputChange);
}
void PowerIsOnFeedback_OutputChange(object sender, EventArgs e)
{
if (UsageTracker != null)
{
if (PowerIsOnFeedback.BoolValue)
UsageTracker.StartDeviceUsage();
else
UsageTracker.EndDeviceUsage();
}
}
public abstract void PowerOn();
public abstract void PowerOff();
public abstract void PowerToggle();
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
PowerIsOnFeedback,
IsCoolingDownFeedback,
IsWarmingUpFeedback
};
}
}
public abstract void ExecuteSwitch(object selector);
}
/// <summary>
///
/// </summary>
public abstract class TwoWayDisplayBase : DisplayBase
{
public StringFeedback CurrentInputFeedback { get; private set; }
abstract protected Func<string> CurrentInputFeedbackFunc { get; }
public static MockDisplay DefaultDisplay
{
get
{
if (_DefaultDisplay == null)
_DefaultDisplay = new MockDisplay("default", "Default Display");
return _DefaultDisplay;
}
}
static MockDisplay _DefaultDisplay;
public TwoWayDisplayBase(string key, string name)
: base(key, name)
{
CurrentInputFeedback = new StringFeedback(CurrentInputFeedbackFunc);
WarmupTime = 7000;
CooldownTime = 15000;
Feedbacks.Add(CurrentInputFeedback);
}
}
}

View File

@@ -33,6 +33,7 @@ namespace PepperDash.Essentials.Core
protected override Func<bool> PowerIsOnFeedbackFunc { get { return () => _PowerIsOn; } }
protected override Func<bool> IsCoolingDownFeedbackFunc { get { return () => _IsCoolingDown; } }
protected override Func<bool> IsWarmingUpFeedbackFunc { get { return () => _IsWarmingUp; } }
protected override Func<string> CurrentInputFeedbackFunc { get { return () => "Not Implemented"; } }
int VolumeHeldRepeatInterval = 200;
ushort VolumeInterval = 655;
@@ -63,14 +64,14 @@ namespace PepperDash.Essentials.Core
if (!PowerIsOnFeedback.BoolValue && !_IsWarmingUp && !_IsCoolingDown)
{
_IsWarmingUp = true;
IsWarmingUpFeedback.FireUpdate();
IsWarmingUpFeedback.InvokeFireUpdate();
// Fake power-up cycle
WarmupTimer = new CTimer(o =>
{
_IsWarmingUp = false;
_PowerIsOn = true;
IsWarmingUpFeedback.FireUpdate();
PowerIsOnFeedback.FireUpdate();
IsWarmingUpFeedback.InvokeFireUpdate();
PowerIsOnFeedback.InvokeFireUpdate();
}, WarmupTime);
}
}
@@ -83,14 +84,14 @@ namespace PepperDash.Essentials.Core
{
_IsCoolingDown = true;
_PowerIsOn = false;
PowerIsOnFeedback.FireUpdate();
IsCoolingDownFeedback.FireUpdate();
PowerIsOnFeedback.InvokeFireUpdate();
IsCoolingDownFeedback.InvokeFireUpdate();
// Fake cool-down cycle
CooldownTimer = new CTimer(o =>
{
Debug.Console(2, this, "Cooldown timer ending");
_IsCoolingDown = false;
IsCoolingDownFeedback.FireUpdate();
IsCoolingDownFeedback.InvokeFireUpdate();
}, CooldownTime);
}
}
@@ -116,20 +117,20 @@ namespace PepperDash.Essentials.Core
public void SetVolume(ushort level)
{
_FakeVolumeLevel = level;
VolumeLevelFeedback.FireUpdate();
_FakeVolumeLevel = level;
VolumeLevelFeedback.InvokeFireUpdate();
}
public void MuteOn()
{
_IsMuted = true;
MuteFeedback.FireUpdate();
MuteFeedback.InvokeFireUpdate();
}
public void MuteOff()
{
_IsMuted = false;
MuteFeedback.FireUpdate();
MuteFeedback.InvokeFireUpdate();
}
public BoolFeedback MuteFeedback { get; private set; }
@@ -169,7 +170,7 @@ namespace PepperDash.Essentials.Core
public void MuteToggle()
{
_IsMuted = !_IsMuted;
MuteFeedback.FireUpdate();
MuteFeedback.InvokeFireUpdate();
}
#endregion

View File

@@ -19,6 +19,16 @@ namespace PepperDash.Essentials.Core
public abstract eCueType Type { get; }
/// <summary>
/// Feedbacks can be put into test mode for simulation of events without real data.
/// Using JSON debugging methods and the Set/ClearTestValue methods, we can simulate
/// Feedback behaviors
/// </summary>
public bool InTestMode { get; protected set; }
/// <summary>
/// Base Constructor - empty
/// </summary>
protected Feedback()
{
}
@@ -28,8 +38,31 @@ namespace PepperDash.Essentials.Core
Cue = cue;
}
/// <summary>
/// Clears test mode and fires update.
/// </summary>
public void ClearTestValue()
{
InTestMode = false;
FireUpdate();
}
/// <summary>
/// Fires an update synchronously
/// </summary>
public abstract void FireUpdate();
/// <summary>
/// Fires the update asynchronously within a CrestronInvoke
/// </summary>
public void InvokeFireUpdate()
{
CrestronInvoke.BeginInvoke(o => FireUpdate());
}
/// <summary>
/// Helper method that fires event. Use this intstead of calling OutputChange
/// </summary>
protected void OnOutputChange()
{
if (OutputChange != null) OutputChange(this, EventArgs.Empty);
@@ -42,18 +75,24 @@ namespace PepperDash.Essentials.Core
public class BoolFeedback : Feedback
{
/// <summary>
/// Returns the current value of the feedback, derived from the ValueFunc
/// Returns the current value of the feedback, derived from the ValueFunc. The ValueFunc is
/// evaluated whenever FireUpdate() is called
/// </summary>
public override bool BoolValue { get { return _BoolValue; } }
bool _BoolValue;
public override eCueType Type { get { return eCueType.Bool; } }
/// <summary>
/// Fake value to be used in test mode
/// </summary>
public bool TestValue { get; private set; }
/// <summary>
/// Func that evaluates on FireUpdate
/// </summary>
public Func<bool> ValueFunc { get; private set; }
/// <summary>
/// The last value delivered on FireUpdate
/// </summary>
//public bool PreviousValue { get; private set; }
List<BoolInputSig> LinkedInputSigs = new List<BoolInputSig>();
List<BoolInputSig> LinkedComplementInputSigs = new List<BoolInputSig>();
@@ -71,7 +110,7 @@ namespace PepperDash.Essentials.Core
public override void FireUpdate()
{
var newValue = ValueFunc.Invoke();
bool newValue = InTestMode ? TestValue : ValueFunc.Invoke();
if (newValue != _BoolValue)
{
_BoolValue = newValue;
@@ -103,6 +142,22 @@ namespace PepperDash.Essentials.Core
LinkedComplementInputSigs.Remove(sig);
}
public override string ToString()
{
return (InTestMode ? "TEST -- " : "") + BoolValue.ToString();
}
/// <summary>
/// Puts this in test mode, sets the test value and fires an update.
/// </summary>
/// <param name="value"></param>
public void SetTestValue(bool value)
{
TestValue = value;
InTestMode = true;
FireUpdate();
}
void UpdateSig(BoolInputSig sig)
{
sig.BoolValue = _BoolValue;
@@ -120,9 +175,14 @@ namespace PepperDash.Essentials.Core
public override int IntValue { get { return _IntValue; } } // ValueFunc.Invoke(); } }
int _IntValue;
public ushort UShortValue { get { return (ushort)_IntValue; } }
public override eCueType Type { get { return eCueType.Int; } }
//public int PreviousValue { get; private set; }
public override eCueType Type { get { return eCueType.Int; } }
public int TestValue { get; private set; }
/// <summary>
/// Func evaluated on FireUpdate
/// </summary>
Func<int> ValueFunc;
List<UShortInputSig> LinkedInputSigs = new List<UShortInputSig>();
@@ -140,7 +200,7 @@ namespace PepperDash.Essentials.Core
public override void FireUpdate()
{
var newValue = ValueFunc.Invoke();
var newValue = InTestMode ? TestValue : ValueFunc.Invoke();
if (newValue != _IntValue)
{
_IntValue = newValue;
@@ -160,6 +220,22 @@ namespace PepperDash.Essentials.Core
LinkedInputSigs.Remove(sig);
}
public override string ToString()
{
return (InTestMode ? "TEST -- " : "") + IntValue.ToString();
}
/// <summary>
/// Puts this in test mode, sets the test value and fires an update.
/// </summary>
/// <param name="value"></param>
public void SetTestValue(int value)
{
TestValue = value;
InTestMode = true;
FireUpdate();
}
void UpdateSig(UShortInputSig sig)
{
sig.UShortValue = UShortValue;
@@ -172,8 +248,17 @@ namespace PepperDash.Essentials.Core
{
public override string StringValue { get { return _StringValue; } } // ValueFunc.Invoke(); } }
string _StringValue;
public override eCueType Type { get { return eCueType.String; } }
//public string PreviousValue { get; private set; }
/// <summary>
/// Used in testing. Set/Clear functions
/// </summary>
public string TestValue { get; private set; }
/// <summary>
/// Evalutated on FireUpdate
/// </summary>
public Func<string> ValueFunc { get; private set; }
List<StringInputSig> LinkedInputSigs = new List<StringInputSig>();
@@ -192,7 +277,7 @@ namespace PepperDash.Essentials.Core
public override void FireUpdate()
{
var newValue = ValueFunc.Invoke();
var newValue = InTestMode ? TestValue : ValueFunc.Invoke();
if (newValue != _StringValue)
{
_StringValue = newValue;
@@ -212,6 +297,22 @@ namespace PepperDash.Essentials.Core
LinkedInputSigs.Remove(sig);
}
public override string ToString()
{
return (InTestMode ? "TEST -- " : "") + StringValue;
}
/// <summary>
/// Puts this in test mode, sets the test value and fires an update.
/// </summary>
/// <param name="value"></param>
public void SetTestValue(string value)
{
TestValue = value;
InTestMode = true;
FireUpdate();
}
void UpdateSig(StringInputSig sig)
{
sig.StringValue = _StringValue;

View File

@@ -1,42 +1,49 @@
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronDataStore;
using Crestron.SimplSharpPro;
//using PepperDash.Essentials.Core.Http;
using PepperDash.Essentials.License;
namespace PepperDash.Essentials.Core
{
public static class Global
{
public static CrestronControlSystem ControlSystem { get; set; }
public static LicenseManager LicenseManager { get; set; }
//public static EssentialsHttpServer HttpConfigServer
//{
// get
// {
// if (_HttpConfigServer == null)
// _HttpConfigServer = new EssentialsHttpServer();
// return _HttpConfigServer;
// }
//}
//static EssentialsHttpServer _HttpConfigServer;
static Global()
{
// Fire up CrestronDataStoreStatic
var err = CrestronDataStoreStatic.InitCrestronDataStore();
if (err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
{
CrestronConsole.PrintLine("Error starting CrestronDataStoreStatic: {0}", err);
return;
}
}
}
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronDataStore;
using Crestron.SimplSharpPro;
//using PepperDash.Essentials.Core.Http;
using PepperDash.Essentials.License;
namespace PepperDash.Essentials.Core
{
public static class Global
{
public static CrestronControlSystem ControlSystem { get; set; }
public static LicenseManager LicenseManager { get; set; }
public static string FilePathPrefix { get; private set; }
public static char DirectorySeparator
{
get
{
return System.IO.Path.DirectorySeparatorChar;
}
}
/// <summary>
/// Sets the file path prefix
/// </summary>
/// <param name="prefix"></param>
public static void SetFilePathPrefix(string prefix)
{
FilePathPrefix = prefix;
}
static Global()
{
// Fire up CrestronDataStoreStatic
var err = CrestronDataStoreStatic.InitCrestronDataStore();
if (err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
{
CrestronConsole.PrintLine("Error starting CrestronDataStoreStatic: {0}", err);
return;
}
}
}
}

View File

@@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
public static class JobTimer
{
static CTimer MinuteTimer;
static List<JobTimerItem> Items = new List<JobTimerItem>();
/// <summary>
///
/// </summary>
/// <param name="act"></param>
public static void AddAction(Action act)
{
}
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="act"></param>
public static void AddJobTimerItem(JobTimerItem item)
{
var existing = Items.FirstOrDefault(i => i.Key == item.Key);
if (existing != null)
{
Items.Remove(existing);
}
Items.Add(item);
}
static void CheckAndRunTimer()
{
if (Items.Count > 0 && MinuteTimer == null)
{
MinuteTimer = new CTimer(o => MinuteTimerCallback(), null, 60000, 60000);
}
}
static void MinuteTimerCallback()
{
}
}
/// <summary>
///
/// </summary>
public class JobTimerItem
{
public string Key { get; private set; }
public Action JobAction { get; private set; }
public eJobTimerCycleTypes CycleType { get; private set; }
/// <summary>
///
/// </summary>
public DateTime RunNextAt { get; set; }
public JobTimerItem(string key, eJobTimerCycleTypes cycle, Action act)
{
}
}
public enum eJobTimerCycleTypes
{
RunEveryDay,
RunEveryHour,
RunEveryHalfHour,
RunEveryMinute
}
}

View File

@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.Lighting
{
/// <summary>
/// Requirements for a device that implements lighting scene control
/// </summary>
public interface ILightingScenes
{
event EventHandler<LightingSceneChangeEventArgs> LightingSceneChange;
List<LightingScene> LightingScenes { get; }
void SelectScene(LightingScene scene);
LightingScene CurrentLightingScene { get; }
}
/// <summary>
/// Requirements for a device that implements master raise/lower
/// </summary>
public interface ILightingMasterRaiseLower
{
void MasterRaise();
void MasterLower();
void MasterRaiseLowerStop();
}
/// <summary>
/// Requiremnts for controlling a lighting load
/// </summary>
public interface ILightingLoad
{
void SetLoadLevel(int level);
void Raise();
void Lower();
IntFeedback LoadLevelFeedback { get; }
BoolFeedback LoadIsOnFeedback { get; }
}
public class LightingSceneChangeEventArgs : EventArgs
{
public LightingScene CurrentLightingScene { get; private set; }
public LightingSceneChangeEventArgs(LightingScene scene)
{
CurrentLightingScene = scene;
}
}
}

View File

@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.Lighting
{
public abstract class LightingBase : Device, ILightingScenes
{
#region ILightingScenes Members
public event EventHandler<LightingSceneChangeEventArgs> LightingSceneChange;
public List<LightingScene> LightingScenes { get; protected set; }
public LightingScene CurrentLightingScene { get; protected set; }
#endregion
public LightingBase(string key, string name)
: base(key, name)
{
LightingScenes = new List<LightingScene>();
CurrentLightingScene = new LightingScene();
}
public abstract void SelectScene(LightingScene scene);
public void SimulateSceneSelect(string sceneName)
{
Debug.Console(1, this, "Simulating selection of scene '{0}'", sceneName);
var scene = LightingScenes.FirstOrDefault(s => s.Name.Equals(sceneName));
if (scene != null)
{
CurrentLightingScene = scene;
OnLightingSceneChange();
}
}
/// <summary>
/// Sets the IsActive property on each scene and fires the LightingSceneChange event
/// </summary>
protected void OnLightingSceneChange()
{
foreach (var scene in LightingScenes)
{
if (scene == CurrentLightingScene)
scene.IsActive = true;
else
scene.IsActive = false;
}
var handler = LightingSceneChange;
if (handler != null)
{
handler(this, new LightingSceneChangeEventArgs(CurrentLightingScene));
}
}
}
public class LightingScene
{
public string Name { get; set; }
public string ID { get; set; }
bool _IsActive;
public bool IsActive
{
get
{
return _IsActive;
}
set
{
_IsActive = value;
IsActiveFeedback.FireUpdate();
}
}
public BoolFeedback IsActiveFeedback { get; set; }
public LightingScene()
{
IsActiveFeedback = new BoolFeedback(new Func<bool>(() => IsActive));
}
}
}

View File

@@ -24,6 +24,7 @@ namespace PepperDash.Essentials.Core
long PollTime;
CTimer PollTimer;
string PollString;
Action PollAction;
/// <summary>
///
@@ -39,14 +40,38 @@ namespace PepperDash.Essentials.Core
{
if (pollTime > warningTime || pollTime > errorTime)
throw new ArgumentException("pollTime must be less than warning or errorTime");
if (pollTime < 5000)
throw new ArgumentException("pollTime cannot be less than 5000 ms");
//if (pollTime < 5000)
// throw new ArgumentException("pollTime cannot be less than 5000 ms");
Client = client;
PollTime = pollTime;
PollString = pollString;
}
/// <summary>
/// Poll is a provided action instead of string
/// </summary>
/// <param name="parent"></param>
/// <param name="client"></param>
/// <param name="pollTime"></param>
/// <param name="warningTime"></param>
/// <param name="errorTime"></param>
/// <param name="pollBytes"></param>
public GenericCommunicationMonitor(IKeyed parent, IBasicCommunication client, long pollTime,
long warningTime, long errorTime, Action pollAction) :
base(parent, warningTime, errorTime)
{
if (pollTime > warningTime || pollTime > errorTime)
throw new ArgumentException("pollTime must be less than warning or errorTime");
//if (pollTime < 5000)
// throw new ArgumentException("pollTime cannot be less than 5000 ms");
Client = client;
PollTime = pollTime;
PollAction = pollAction;
}
/// <summary>
/// Build the monitor from a config object
/// </summary>
@@ -79,7 +104,7 @@ namespace PepperDash.Essentials.Core
void Client_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
{
Status = MonitorStatus.IsOk;
StopErrorTimers();
ResetErrorTimers();
}
void Poll()
@@ -87,12 +112,15 @@ namespace PepperDash.Essentials.Core
StartErrorTimers();
if (Client.IsConnected)
{
Debug.Console(2, Client, "Monitor, Polling");
Client.SendText(PollString);
//Debug.Console(2, this, "Polling");
if(PollAction != null)
PollAction.Invoke();
else
Client.SendText(PollString);
}
else
{
Debug.Console(2, Client, "Monitor, Comm not connected");
Debug.Console(2, this, "Comm not connected");
}
}
@@ -104,7 +132,7 @@ namespace PepperDash.Essentials.Core
if (Client.IsConnected)
{
//Client.IsConnected -= OneTimeConnectHandler;
Debug.Console(2, Client, "Monitor, Comm connected");
Debug.Console(2, this, "Comm connected");
Poll();
}
}

View File

@@ -26,11 +26,14 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
///
/// StatusUnknown = 0, IsOk = 1, InWarning = 2, InError = 3
/// </summary>
public enum MonitorStatus
{
IsOk, InWarning, InError, StatusUnknown
StatusUnknown = 0,
IsOk = 1,
InWarning = 2,
InError = 3
}
public class MonitorStatusChangeEventArgs : EventArgs

View File

@@ -13,10 +13,17 @@ using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public abstract class StatusMonitorBase : IStatusMonitor
public abstract class StatusMonitorBase : IStatusMonitor, IKeyName
{
public event EventHandler<MonitorStatusChangeEventArgs> StatusChange;
/// <summary>
/// Format returned: "parentdevkey-comMonitor"
/// </summary>
public string Key { get { return Parent.Key + "-comMonitor"; } }
public string Name { get { return "Comm. monitor"; } }
public IKeyed Parent { get; private set; }
public MonitorStatus Status
@@ -29,7 +36,6 @@ namespace PepperDash.Essentials.Core
_Status = value;
OnStatusChange(value);
}
}
}
MonitorStatus _Status;
@@ -96,5 +102,13 @@ namespace PepperDash.Essentials.Core
ErrorTimer = null;
}
protected void ResetErrorTimers()
{
if(WarningTimer != null)
WarningTimer.Reset(WarningTime, WarningTime);
if(ErrorTimer != null)
ErrorTimer.Reset(ErrorTime, ErrorTime);
}
}
}

View File

@@ -24,7 +24,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<OutputPath>..\..\Release Package\</OutputPath>
<DefineConstants>DEBUG;TRACE;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -58,6 +58,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
</Reference>
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
@@ -67,9 +71,9 @@
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.0.16459, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="PepperDash_Core, Version=1.0.1.26313, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\PepperDash.Core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll</HintPath>
<HintPath>..\..\..\pepperdash-simplsharp-core\Pepperdash Core\CLZ Builds\PepperDash_Core.dll</HintPath>
</Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@@ -99,6 +103,18 @@
<Reference Include="System.Data" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config\SourceDevicePropertiesConfigBase.cs" />
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
<Compile Include="Crestron IO\IOPortConfig.cs" />
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
<Compile Include="Devices\CodecInterfaces.cs" />
<Compile Include="Global\JobTimer.cs" />
<Compile Include="Lighting\Lighting Interfaces.cs" />
<Compile Include="Lighting\LightingBase.cs" />
<Compile Include="Ramps and Increments\ActionIncrementer.cs" />
<Compile Include="Comm and IR\CommFactory.cs" />
<Compile Include="Comm and IR\CommunicationExtras.cs" />
<Compile Include="Comm and IR\REMOVE ComPortConfig.cs" />
@@ -111,7 +127,7 @@
<Compile Include="Config\DeviceConfig.cs" />
<Compile Include="Constants\CommonCues.cs" />
<Compile Include="Devices\DisplayUiConstants.cs" />
<Compile Include="Devices\REMOVE DeviceConfig.cs" />
<Compile Include="Devices\IUsageTracking.cs" />
<Compile Include="Devices\DeviceJsonApi.cs" />
<Compile Include="Devices\SourceListItem.cs" />
<Compile Include="DeviceTypeInterfaces\IDisplayBasic.cs" />
@@ -132,6 +148,9 @@
<Compile Include="Devices\IVolumeAndAudioInterfaces.cs" />
<Compile Include="Display\BasicIrDisplay.cs" />
<Compile Include="Feedbacks\BoolFeedbackOneShot.cs" />
<Compile Include="Ramps and Increments\NumericalHelpers.cs" />
<Compile Include="Ramps and Increments\UshortSigIncrementer.cs" />
<Compile Include="Routing\DummyRoutingInputsDevice.cs" />
<Compile Include="Routing\ICardPortsDevice.cs" />
<Compile Include="InUseTracking\IInUseTracking.cs" />
<Compile Include="InUseTracking\InUseTracking.cs" />
@@ -141,10 +160,7 @@
<Compile Include="Monitoring\StatusMonitorBase.cs" />
<Compile Include="Monitoring\Interfaces and things.cs" />
<Compile Include="Monitoring\GenericCommunicationMonitor.cs" />
<Compile Include="Devices\REPLACE IrSetTopBoxBase.cs" />
<Compile Include="Devices\REPLACE IrDvdBase.cs" />
<Compile Include="Devices\NewInterfaces.cs" />
<Compile Include="Devices\REPLACE DvdDeviceBase.cs" />
<Compile Include="Devices\IAttachVideoStatusExtensions.cs" />
<Compile Include="Devices\IHasFeedbacks.cs" />
<Compile Include="Devices\SmartObjectBaseTypes.cs" />
@@ -153,7 +169,7 @@
<Compile Include="Display\MockDisplay.cs" />
<Compile Include="Ethernet\EthernetStatistics.cs" />
<Compile Include="Fusion\MOVED FusionSystemController.cs" />
<Compile Include="Global.cs" />
<Compile Include="Global\Global.cs" />
<Compile Include="License\EssentialsLicenseManager.cs" />
<Compile Include="Feedbacks\BoolOutputLogicals.cs" />
<Compile Include="Presets\Interfaces.cs" />
@@ -167,12 +183,17 @@
<Compile Include="Feedbacks\BoolFeedbackPulseExtender.cs" />
<Compile Include="Routing\RoutingPortNames.cs" />
<Compile Include="Routing\TieLineConfig.cs" />
<Compile Include="Shades\Shade Interfaces.cs" />
<Compile Include="Shades\ShadeBase.cs" />
<Compile Include="Shades\ShadeController.cs" />
<Compile Include="SmartObjects\SmartObjectNumeric.cs" />
<Compile Include="SmartObjects\SmartObjectDynamicList.cs" />
<Compile Include="SmartObjects\SmartObjectDPad.cs" />
<Compile Include="SmartObjects\SmartObjectHelper.cs" />
<Compile Include="SmartObjects\SmartObjectHelperBase.cs" />
<Compile Include="Routing\TieLine.cs" />
<Compile Include="Timers\CountdownTimer.cs" />
<Compile Include="Touchpanels\Keyboards\HabaneroKeyboardController.cs" />
<Compile Include="Touchpanels\MOVED LargeTouchpanelControllerBase.cs" />
<Compile Include="Touchpanels\TriListExtensions.cs" />
<Compile Include="Touchpanels\MOVED UIControllers\DevicePageControllerBase.cs" />
@@ -188,8 +209,6 @@
<Compile Include="Crestron\CrestronGenericBaseDevice.cs" />
<Compile Include="Debug\Debug.cs" />
<Compile Include="DeviceControlsParentInterfaces\IPresentationSource.cs" />
<Compile Include="Devices\REMOVE DefaultDevice.cs" />
<Compile Include="Devices\MOVED TO CORE Device.cs" />
<Compile Include="Devices\DeviceManager.cs" />
<Compile Include="Devices\IrOutputPortController.cs" />
<Compile Include="Display\DisplayBase.cs" />
@@ -197,7 +216,7 @@
<Compile Include="Room\Room.cs" />
<Compile Include="Room\RoomCues.cs" />
<Compile Include="Room\MOVED RoomEventArgs.cs" />
<Compile Include="SubpageReferencList\SourceListSubpageReferenceList.cs" />
<Compile Include="SmartObjects\SubpageReferencList\SourceListSubpageReferenceList.cs" />
<Compile Include="Touchpanels\ModalDialog.cs" />
<Compile Include="Touchpanels\SmartGraphicsTouchpanelControllerBase.cs" />
<Compile Include="TriListBridges\HandlerBridge.cs" />
@@ -205,9 +224,8 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SigHelper.cs" />
<Compile Include="REMOVE SigId.cs" />
<Compile Include="SubpageReferencList\DeviceStatusListController.cs" />
<Compile Include="SubpageReferencList\SubpageReferenceList.cs" />
<Compile Include="SubpageReferencList\SubpageReferenceListItem.cs" />
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceList.cs" />
<Compile Include="SmartObjects\SubpageReferencList\SubpageReferenceListItem.cs" />
<None Include="app.config" />
<None Include="Properties\ControlSystem.cfg" />
</ItemGroup>

View File

@@ -4,5 +4,4 @@
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PepperDashEssentialsBase")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyVersion("1.0.0.*")]
[assembly: AssemblyVersion("1.0.3.*")]

View File

@@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// An incrementer that can use the values of some other object/primitive value to do its thing.
/// It uses an Action to set the value and a Func to get the value from whatever this is
/// attached to.
/// </summary>
public class ActionIncrementer
{
public int ChangeAmount { get; set; }
public int MaxValue { get; set; }
public int MinValue { get; set; }
public uint RepeatDelay { get; set; }
public uint RepeatTime { get; set; }
Action<int> SetAction;
Func<int> GetFunc;
CTimer Timer;
/// <summary>
///
/// </summary>
/// <param name="changeAmount"></param>
/// <param name="minValue"></param>
/// <param name="maxValue"></param>
/// <param name="repeatDelay"></param>
/// <param name="repeatTime"></param>
/// <param name="setAction">Action that will be called when this needs to set the destination value</param>
/// <param name="getFunc">Func that is called to get the current value</param>
public ActionIncrementer(int changeAmount, int minValue, int maxValue, uint repeatDelay, uint repeatTime, Action<int> setAction, Func<int> getFunc)
{
SetAction = setAction;
GetFunc = getFunc;
ChangeAmount = changeAmount;
MaxValue = maxValue;
MinValue = minValue;
RepeatDelay = repeatDelay;
RepeatTime = repeatTime;
}
/// <summary>
/// Starts incrementing cycle
/// </summary>
public void StartUp()
{
if (Timer != null) return;
Go(ChangeAmount);
}
/// <summary>
/// Starts decrementing cycle
/// </summary>
public void StartDown()
{
if (Timer != null) return;
Go(-ChangeAmount);
}
/// <summary>
/// Stops the repeat
/// </summary>
public void Stop()
{
if (Timer != null)
Timer.Stop();
Timer = null;
}
/// <summary>
/// Helper that does the work of setting new level, and starting repeat loop, checking against bounds first.
/// </summary>
/// <param name="change"></param>
void Go(int change)
{
int currentLevel = GetFunc();
// Fire once then pause
int newLevel = currentLevel + change;
bool atLimit = CheckLevel(newLevel, out newLevel);
SetAction(newLevel);
if (atLimit) // Don't go past end
Stop();
else if (Timer == null) // Only enter the timer if it's not already running
Timer = new CTimer(o => { Go(change); }, null, RepeatDelay, RepeatTime);
}
/// <summary>
/// Helper to check a new level against min/max. Returns revised level if new level
/// will go out of bounds
/// </summary>
/// <param name="levelIn">The level to check against bounds</param>
/// <param name="levelOut">Revised level if bounds are exceeded. Min or max</param>
/// <returns>true if new level is at or past bounds</returns>
bool CheckLevel(int levelIn, out int levelOut)
{
bool isAtLimit = false;
if (levelIn > MaxValue)
{
levelOut = MaxValue;
isAtLimit = true;
}
else if (levelIn < MinValue)
{
levelOut = MinValue;
isAtLimit = true;
}
else
levelOut = levelIn;
return isAtLimit;
}
}
}

View File

@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
public class NumericalHelpers
{
/// <summary>
/// Scales a value
/// </summary>
/// <param name="input"></param>
/// <param name="inMin"></param>
/// <param name="inMax"></param>
/// <param name="outMin"></param>
/// <param name="outMax"></param>
/// <returns></returns>
public static double Scale(double input, double inMin, double inMax, double outMin, double outMax)
{
//Debug.Console(2, this, "Scaling (double) input '{0}' with min '{1}'/max '{2}' to output range min '{3}'/max '{4}'", input, inMin, inMax, outMin, outMax);
double inputRange = inMax - inMin;
if (inputRange <= 0)
{
throw new ArithmeticException(string.Format("Invalid Input Range '{0}' for Scaling. Min '{1}' Max '{2}'.", inputRange, inMin, inMax));
}
double outputRange = outMax - outMin;
var output = (((input - inMin) * outputRange) / inputRange) + outMin;
// Debug.Console(2, this, "Scaled output '{0}'", output);
return output;
}
}
}

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Attaches to UShortInputSig and does incremental ramping of the signal
/// </summary>
public class UshortSigIncrementer
{
UShortInputSig TheSig;
public ushort ChangeAmount { get; set; }
public int MaxValue { get; set; }
public int MinValue { get; set; }
public uint RepeatDelay { get; set; }
public uint RepeatTime { get; set; }
bool SignedMode;
CTimer Timer;
public UshortSigIncrementer(UShortInputSig sig, ushort changeAmount, int minValue, int maxValue, uint repeatDelay, uint repeatTime)
{
TheSig = sig;
ChangeAmount = changeAmount;
MaxValue = maxValue;
MinValue = minValue;
if (MinValue < 0 || MaxValue < 0) SignedMode = true;
RepeatDelay = repeatDelay;
RepeatTime = repeatTime;
if (SignedMode && (MinValue < -32768 || MaxValue > 32767))
Debug.Console(1, "UshortSigIncrementer has signed values that exceed range of -32768, 32767");
}
public void StartUp()
{
if (Timer != null) return;
Go(ChangeAmount);
}
public void StartDown()
{
if (Timer != null) return;
Go(-ChangeAmount);
}
void Go(int change)
{
int level;
if (SignedMode) level = TheSig.ShortValue;
else level = TheSig.UShortValue;
// Fire once then pause
int newLevel = level + change;
bool atLimit = CheckLevel(newLevel, out newLevel);
SetValue((ushort)newLevel);
if (atLimit) // Don't go past end
Stop();
else if (Timer == null) // Only enter the timer if it's not already running
Timer = new CTimer(o => { Go(change); }, null, RepeatDelay, RepeatTime);
}
bool CheckLevel(int levelIn, out int levelOut)
{
bool IsAtLimit = false;
if (levelIn > MaxValue)
{
levelOut = MaxValue;
IsAtLimit = true;
}
else if (levelIn < MinValue)
{
levelOut = MinValue;
IsAtLimit = true;
}
else
levelOut = levelIn;
return IsAtLimit;
}
public void Stop()
{
if (Timer != null)
Timer.Stop();
Timer = null;
}
void SetValue(ushort value)
{
//CrestronConsole.PrintLine("Increment level:{0} / {1}", value, (short)value);
TheSig.UShortValue = value;
}
}
}

View File

@@ -1,56 +1,56 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
//***************************************************************************************************
public abstract class Room : Device, IHasFeedback
{
public abstract BoolFeedback RoomIsOnFeedback { get; protected set; }
public abstract BoolFeedback IsCoolingDownFeedback { get; protected set; }
public abstract BoolFeedback IsWarmingUpFeedback { get; protected set; }
// In concrete classes, these should be computed from the relevant devices
public virtual uint CooldownTime { get { return 10000; } }
public virtual uint WarmupTime { get { return 5000; } }
public string Description { get; set; }
public string HelpMessage { get; set; }
public Room(string key, string name)
: base(key, name)
{
Description = "";
HelpMessage = "";
}
public virtual void RoomOn() { }
public virtual void RoomOff() { }
#region IDeviceWithOutputs Members
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
RoomIsOnFeedback,
IsCoolingDownFeedback,
IsWarmingUpFeedback
};
}
}
#endregion
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
//***************************************************************************************************
public abstract class Room : Device, IHasFeedback
{
public abstract BoolFeedback RoomIsOnFeedback { get; protected set; }
public abstract BoolFeedback IsCoolingDownFeedback { get; protected set; }
public abstract BoolFeedback IsWarmingUpFeedback { get; protected set; }
// In concrete classes, these should be computed from the relevant devices
public virtual uint CooldownTime { get { return 10000; } }
public virtual uint WarmupTime { get { return 5000; } }
public string Description { get; set; }
public string HelpMessage { get; set; }
public Room(string key, string name)
: base(key, name)
{
Description = "";
HelpMessage = "";
}
public virtual void RoomOn() { }
public virtual void RoomOff() { }
#region IDeviceWithOutputs Members
public virtual List<Feedback> Feedbacks
{
get
{
return new List<Feedback>
{
RoomIsOnFeedback,
IsCoolingDownFeedback,
IsWarmingUpFeedback
};
}
}
#endregion
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.Routing
{
public class DummyRoutingInputsDevice : Device, IRoutingSource
{
/// <summary>
/// A single output port, backplane, audioVideo
/// </summary>
public RoutingOutputPort AudioVideoOutputPort { get; private set; }
/// <summary>
/// contains the output port
/// </summary>
public RoutingPortCollection<RoutingOutputPort> OutputPorts
{
get { return new RoutingPortCollection<RoutingOutputPort>() { AudioVideoOutputPort }; }
}
/// <summary>
/// constructor
/// </summary>
/// <param name="key">key for special device</param>
public DummyRoutingInputsDevice(string key) : base(key)
{
AudioVideoOutputPort = new RoutingOutputPort("internal", eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.BackplaneOnly,
null, this, true);
}
}
}

View File

@@ -30,7 +30,7 @@ namespace PepperDash.Essentials.Core
var newRoute = destination.GetRouteToSource(source, signalType);
if (newRoute == null) return;
RouteDescriptorCollection.DefaultCollection.AddRouteDescriptor(newRoute);
Debug.Console(1, destination, "Executing new route");
Debug.Console(2, destination, "Executing full route");
newRoute.ExecuteRoutes();
}
@@ -80,7 +80,7 @@ namespace PepperDash.Essentials.Core
routeDescr = null;
}
Debug.Console(1, destination, "Route{0} discovered", routeDescr == null ? " NOT" : "");
//Debug.Console(1, destination, "Route{0} discovered", routeDescr == null ? " NOT" : "");
return routeDescr;
}
@@ -102,19 +102,18 @@ namespace PepperDash.Essentials.Core
eRoutingSignalType signalType, int cycle, RouteDescriptor routeTable)
{
cycle++;
Debug.Console(2, destination, "SelectInput-cycle {1}. Finding {2} route back to {0}", source.Key, cycle, signalType);
Debug.Console(2, "GetRouteToSource: {0} {1}--> {2}", cycle, source.Key, destination.Key);
RoutingInputPort goodInputPort = null;
var destDevInputTies = TieLineCollection.Default.Where(t =>
t.DestinationPort.ParentDevice == destination && (t.Type == signalType || t.Type == eRoutingSignalType.AudioVideo));
// find a direct tie
var directTie = destDevInputTies.FirstOrDefault(
t => !(t.SourcePort.ParentDevice is IRoutingInputsOutputs)
&& t.DestinationPort.ParentDevice == destination
t => t.DestinationPort.ParentDevice == destination
&& t.SourcePort.ParentDevice == source);
RoutingInputPort goodInputPort = null;
if (directTie != null) // Found a tie directly to the source
{
Debug.Console(2, destination, "Found direct tie to {0}**", source.Key);
goodInputPort = directTie.DestinationPort;
}
else // no direct-connect. Walk back devices.
@@ -149,7 +148,7 @@ namespace PepperDash.Essentials.Core
// we have a route on corresponding inputPort. *** Do the route ***
if (goodInputPort != null)
{
Debug.Console(2, destination, "adding RouteDescriptor");
//Debug.Console(2, destination, "adding RouteDescriptor");
if (outputPortToUse == null)
{
// it's a sink device
@@ -161,7 +160,7 @@ namespace PepperDash.Essentials.Core
}
else // device is merely IRoutingInputOutputs
Debug.Console(2, destination, " No routing. Passthrough device");
Debug.Console(2, destination, "Exiting cycle {0}", cycle);
//Debug.Console(2, destination, "Exiting cycle {0}", cycle);
return true;
}
@@ -265,14 +264,14 @@ namespace PepperDash.Essentials.Core
{
foreach (var route in Routes)
{
Debug.Console(2, route.ToString());
Debug.Console(2, "ExecuteRoutes: {0}", route.ToString());
if (route.SwitchingDevice is IRoutingSinkWithSwitching)
(route.SwitchingDevice as IRoutingSinkWithSwitching).ExecuteSwitch(route.InputPort.Selector);
else if (route.SwitchingDevice is IRouting)
{
(route.SwitchingDevice as IRouting).ExecuteSwitch(route.InputPort.Selector, route.OutputPort.Selector, SignalType);
route.OutputPort.InUseTracker.AddUser(Destination, "destination-" + SignalType);
Debug.Console(2, "Port {0} routing. Count={1}", route.OutputPort.Key, route.OutputPort.InUseTracker.InUseCountFeedback.UShortValue);
Debug.Console(2, "Output port {0} routing. Count={1}", route.OutputPort.Key, route.OutputPort.InUseTracker.InUseCountFeedback.UShortValue);
}
}
}
@@ -324,10 +323,11 @@ namespace PepperDash.Essentials.Core
public override string ToString()
{
if(OutputPort == null) // IRoutingSink
if(SwitchingDevice is IRouting)
return string.Format("{0} switches output '{1}' to input '{2}'", SwitchingDevice.Key, OutputPort.Selector, InputPort.Selector);
else
return string.Format("{0} switches to input '{1}'", SwitchingDevice.Key, InputPort.Selector);
return string.Format("{0} switches output '{1}' to input '{2}'", SwitchingDevice.Key, OutputPort.Selector, InputPort.Selector);
}
}
}

View File

@@ -40,6 +40,9 @@ namespace PepperDash.Essentials.Core
}
/// <summary>
/// Endpoint device like a display, that selects inputs
/// </summary>
public interface IRoutingSinkWithSwitching : IRoutingSinkNoSwitching
{
//void ClearRoute();
@@ -53,12 +56,21 @@ namespace PepperDash.Essentials.Core
{
}
/// <summary>
/// Defines a midpoint device as have internal routing. Any devices in the middle of the
/// signal chain, that do switching, must implement this for routing to work otherwise
/// the routing algorithm will treat the IRoutingInputsOutputs device as a passthrough
/// device.
/// </summary>
public interface IRouting : IRoutingInputsOutputs
{
//void ClearRoute(object outputSelector);
void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType);
}
/// <summary>
/// Defines an IRoutingOutputs devices as being a source - the start of the chain
/// </summary>
public interface IRoutingSource : IRoutingOutputs
{
}

View File

@@ -1,200 +1,201 @@
using System;
using System.Collections.Generic;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Base class for RoutingInput and Output ports
/// </summary>
public abstract class RoutingPort : IKeyed
{
public string Key { get; private set; }
public eRoutingSignalType Type { get; private set; }
public eRoutingPortConnectionType ConnectionType { get; private set; }
public readonly object Selector;
public bool IsInternal { get; private set; }
public RoutingPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType, object selector, bool isInternal)
{
Key = key;
Type = type;
ConnectionType = connType;
Selector = selector;
IsInternal = IsInternal;
}
}
public enum eRoutingSignalType
{
Audio,
Video,
AudioVideo
}
public enum eRoutingPortConnectionType
{
None, BackplaneOnly, DisplayPort, Dvi, Hdmi, Rgb, Vga, LineAudio, DigitalAudio, Sdi,
Composite, Component, DmCat, DmMmFiber, DmSmFiber, Speaker
}
/// <summary>
/// Basic RoutingInput with no statuses.
/// </summary>
public class RoutingInputPort : RoutingPort
{
/// <summary>
/// The IRoutingInputs object this lives on
/// </summary>
public IRoutingInputs ParentDevice { get; private set; }
/// <summary>
/// Constructor for a basic RoutingInputPort
/// </summary>
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
/// May be string, number, whatever</param>
/// <param name="parent">The IRoutingInputs object this lives on</param>
public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingInputs parent)
: this (key, type, connType, selector, parent, false)
{
}
/// <summary>
/// Constructor for a virtual routing input port that lives inside a device. For example
/// the ports that link a DM card to a DM matrix bus
/// </summary>
/// <param name="isInternal">true for internal ports</param>
public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingInputs parent, bool isInternal)
: base(key, type, connType, selector, isInternal)
{
if (parent == null)
throw new ArgumentNullException("parent");
ParentDevice = parent;
}
///// <summary>
///// Static method to get a named port from a named device
///// </summary>
///// <returns>Returns null if device or port doesn't exist</returns>
//public static RoutingInputPort GetDevicePort(string deviceKey, string portKey)
//{
// var sourceDev = DeviceManager.GetDeviceForKey(deviceKey) as IRoutingInputs;
// if (sourceDev == null)
// return null;
// return sourceDev.InputPorts[portKey];
//}
///// <summary>
///// Static method to get a named port from a card in a named ICardPortsDevice device
///// Uses ICardPortsDevice.GetChildInputPort
///// </summary>
///// <param name="cardKey">'input-N'</param>
///// <returns>null if device, card or port doesn't exist</returns>
//public static RoutingInputPort GetDeviceCardPort(string deviceKey, string cardKey, string portKey)
//{
// var sourceDev = DeviceManager.GetDeviceForKey(deviceKey) as ICardPortsDevice;
// if (sourceDev == null)
// return null;
// return sourceDev.GetChildInputPort(cardKey, portKey);
//}
}
/// <summary>
/// A RoutingInputPort for devices like DM-TX and DM input cards.
/// Will provide video statistics on connected signals
/// </summary>
public class RoutingInputPortWithVideoStatuses : RoutingInputPort
{
/// <summary>
/// Video statuses attached to this port
/// </summary>
public VideoStatusOutputs VideoStatus { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
/// May be string, number, whatever</param>
/// <param name="parent">The IRoutingInputs object this lives on</param>
/// <param name="funcs">A VideoStatusFuncsWrapper used to assign the callback funcs that will get
/// the values for the various stats</param>
public RoutingInputPortWithVideoStatuses(string key,
eRoutingSignalType type, eRoutingPortConnectionType connType, object selector,
IRoutingInputs parent, VideoStatusFuncsWrapper funcs) :
base(key, type, connType, selector, parent)
{
VideoStatus = new VideoStatusOutputs(funcs);
}
}
public class RoutingOutputPort : RoutingPort
{
/// <summary>
/// The IRoutingOutputs object this port lives on
/// </summary>
public IRoutingOutputs ParentDevice { get; private set; }
public InUseTracking InUseTracker { get; private set; }
/// <summary>
/// </summary>
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
/// May be string, number, whatever</param>
/// <param name="parent">The IRoutingOutputs object this port lives on</param>
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingOutputs parent)
: this(key, type, connType, selector, parent, false)
{
}
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingOutputs parent, bool isInternal)
: base(key, type, connType, selector, isInternal)
{
if (parent == null)
throw new ArgumentNullException("parent");
ParentDevice = parent;
InUseTracker = new InUseTracking();
}
public override string ToString()
{
return ParentDevice.Key + ":" + Key;
}
///// <summary>
///// Static method to get a named port from a named device
///// </summary>
///// <returns>Returns null if device or port doesn't exist</returns>
//public static RoutingOutputPort GetDevicePort(string deviceKey, string portKey)
//{
// var sourceDev = DeviceManager.GetDeviceForKey(deviceKey) as IRoutingOutputs;
// if (sourceDev == null)
// return null;
// var port = sourceDev.OutputPorts[portKey];
// if (port == null)
// Debug.Console(0, "WARNING: Device '{0}' does does not contain output port '{1}'", deviceKey, portKey);
// return port;
//}
///// <summary>
///// Static method to get a named port from a card in a named ICardPortsDevice device
///// Uses ICardPortsDevice.GetChildOutputPort on that device
///// </summary>
///// <param name="cardKey">'input-N' or 'output-N'</param>
///// <returns>null if device, card or port doesn't exist</returns>
//public static RoutingOutputPort GetDeviceCardPort(string deviceKey, string cardKey, string portKey)
//{
// var sourceDev = DeviceManager.GetDeviceForKey(deviceKey) as ICardPortsDevice;
// if (sourceDev == null)
// return null;
// var port = sourceDev.GetChildOutputPort(cardKey, portKey);
//}
}
using System;
using System.Collections.Generic;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Base class for RoutingInput and Output ports
/// </summary>
public abstract class RoutingPort : IKeyed
{
public string Key { get; private set; }
public eRoutingSignalType Type { get; private set; }
public eRoutingPortConnectionType ConnectionType { get; private set; }
public readonly object Selector;
public bool IsInternal { get; private set; }
public object FeedbackMatchObject { get; set; }
public RoutingPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType, object selector, bool isInternal)
{
Key = key;
Type = type;
ConnectionType = connType;
Selector = selector;
IsInternal = IsInternal;
}
}
public enum eRoutingSignalType
{
Audio,
Video,
AudioVideo
}
public enum eRoutingPortConnectionType
{
None, BackplaneOnly, DisplayPort, Dvi, Hdmi, Rgb, Vga, LineAudio, DigitalAudio, Sdi,
Composite, Component, DmCat, DmMmFiber, DmSmFiber, Speaker
}
/// <summary>
/// Basic RoutingInput with no statuses.
/// </summary>
public class RoutingInputPort : RoutingPort
{
/// <summary>
/// The IRoutingInputs object this lives on
/// </summary>
public IRoutingInputs ParentDevice { get; private set; }
/// <summary>
/// Constructor for a basic RoutingInputPort
/// </summary>
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
/// May be string, number, whatever</param>
/// <param name="parent">The IRoutingInputs object this lives on</param>
public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingInputs parent)
: this (key, type, connType, selector, parent, false)
{
}
/// <summary>
/// Constructor for a virtual routing input port that lives inside a device. For example
/// the ports that link a DM card to a DM matrix bus
/// </summary>
/// <param name="isInternal">true for internal ports</param>
public RoutingInputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingInputs parent, bool isInternal)
: base(key, type, connType, selector, isInternal)
{
if (parent == null)
throw new ArgumentNullException("parent");
ParentDevice = parent;
}
///// <summary>
///// Static method to get a named port from a named device
///// </summary>
///// <returns>Returns null if device or port doesn't exist</returns>
//public static RoutingInputPort GetDevicePort(string deviceKey, string portKey)
//{
// var sourceDev = DeviceManager.GetDeviceForKey(deviceKey) as IRoutingInputs;
// if (sourceDev == null)
// return null;
// return sourceDev.InputPorts[portKey];
//}
///// <summary>
///// Static method to get a named port from a card in a named ICardPortsDevice device
///// Uses ICardPortsDevice.GetChildInputPort
///// </summary>
///// <param name="cardKey">'input-N'</param>
///// <returns>null if device, card or port doesn't exist</returns>
//public static RoutingInputPort GetDeviceCardPort(string deviceKey, string cardKey, string portKey)
//{
// var sourceDev = DeviceManager.GetDeviceForKey(deviceKey) as ICardPortsDevice;
// if (sourceDev == null)
// return null;
// return sourceDev.GetChildInputPort(cardKey, portKey);
//}
}
/// <summary>
/// A RoutingInputPort for devices like DM-TX and DM input cards.
/// Will provide video statistics on connected signals
/// </summary>
public class RoutingInputPortWithVideoStatuses : RoutingInputPort
{
/// <summary>
/// Video statuses attached to this port
/// </summary>
public VideoStatusOutputs VideoStatus { get; private set; }
/// <summary>
/// Constructor
/// </summary>
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
/// May be string, number, whatever</param>
/// <param name="parent">The IRoutingInputs object this lives on</param>
/// <param name="funcs">A VideoStatusFuncsWrapper used to assign the callback funcs that will get
/// the values for the various stats</param>
public RoutingInputPortWithVideoStatuses(string key,
eRoutingSignalType type, eRoutingPortConnectionType connType, object selector,
IRoutingInputs parent, VideoStatusFuncsWrapper funcs) :
base(key, type, connType, selector, parent)
{
VideoStatus = new VideoStatusOutputs(funcs);
}
}
public class RoutingOutputPort : RoutingPort
{
/// <summary>
/// The IRoutingOutputs object this port lives on
/// </summary>
public IRoutingOutputs ParentDevice { get; private set; }
public InUseTracking InUseTracker { get; private set; }
/// <summary>
/// </summary>
/// <param name="selector">An object used to refer to this port in the IRouting device's ExecuteSwitch method.
/// May be string, number, whatever</param>
/// <param name="parent">The IRoutingOutputs object this port lives on</param>
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingOutputs parent)
: this(key, type, connType, selector, parent, false)
{
}
public RoutingOutputPort(string key, eRoutingSignalType type, eRoutingPortConnectionType connType,
object selector, IRoutingOutputs parent, bool isInternal)
: base(key, type, connType, selector, isInternal)
{
if (parent == null)
throw new ArgumentNullException("parent");
ParentDevice = parent;
InUseTracker = new InUseTracking();
}
public override string ToString()
{
return ParentDevice.Key + ":" + Key;
}
///// <summary>
///// Static method to get a named port from a named device
///// </summary>
///// <returns>Returns null if device or port doesn't exist</returns>
//public static RoutingOutputPort GetDevicePort(string deviceKey, string portKey)
//{
// var sourceDev = DeviceManager.GetDeviceForKey(deviceKey) as IRoutingOutputs;
// if (sourceDev == null)
// return null;
// var port = sourceDev.OutputPorts[portKey];
// if (port == null)
// Debug.Console(0, "WARNING: Device '{0}' does does not contain output port '{1}'", deviceKey, portKey);
// return port;
//}
///// <summary>
///// Static method to get a named port from a card in a named ICardPortsDevice device
///// Uses ICardPortsDevice.GetChildOutputPort on that device
///// </summary>
///// <param name="cardKey">'input-N' or 'output-N'</param>
///// <returns>null if device, card or port doesn't exist</returns>
//public static RoutingOutputPort GetDeviceCardPort(string deviceKey, string cardKey, string portKey)
//{
// var sourceDev = DeviceManager.GetDeviceForKey(deviceKey) as ICardPortsDevice;
// if (sourceDev == null)
// return null;
// var port = sourceDev.GetChildOutputPort(cardKey, portKey);
//}
}
}

View File

@@ -1,46 +1,203 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Routing
{
/// <summary>
/// These should correspond directly with the portNames var in the config tool.
/// </summary>
public class RoutingPortNames
{
public const string AntennaIn = "antennaIn";
public const string AnyAudioIn = "anyAudioIn";
public const string AnyAudioOut = "anyAudioOut";
public const string AnyOut = "anyOut";
public const string AnyVideoIn = "anyVideoIn";
public const string AnyVideoOut = "anyVideoOut";
public const string BalancedAudioOut = "balancedAudioOut";
public const string ComponentIn = "componentIn";
public const string ComponentOut = "componentOut";
public const string CompositeIn = "compositeIn";
public const string CompositeOut = "compositeOut";
public const string DisplayPortIn = "displayPortIn";
public const string DisplayPortIn1 = "displayPortIn1";
public const string DisplayPortIn2 = "displayPortIn2";
public const string DisplayPortIn3 = "displayPortIn3";
public const string DisplayPortOut = "displayPortOut";
public const string DmIn = "dmIn";
public const string DmOut = "dmOut";
public const string DviIn = "dviIn";
public const string DviOut = "dviOut";
public const string HdmiIn = "hdmiIn";
public const string HdmiIn1 = "hdmiIn1";
public const string HdmiIn2 = "hdmiIn2";
public const string HdmiIn3 = "hdmiIn3";
public const string HdmiIn4 = "hdmiIn4";
public const string HdmiIn5 = "hdmiIn5";
public const string HdmiIn6 = "hdmiIn6";
public const string HdmiOut = "hdmiOut";
public const string RgbIn = "rgbIn";
public const string VgaIn = "vgaIn";
public const string VgaOut = "vgaOut";
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core.Routing
{
/// <summary>
/// These should correspond directly with the portNames var in the config tool.
/// </summary>
public class RoutingPortNames
{
/// <summary>
/// antennaIn
/// </summary>
public const string AntennaIn = "antennaIn";
/// <summary>
/// anyAudioIn
/// </summary>
public const string AnyAudioIn = "anyAudioIn";
/// <summary>
/// anyAudioOut
/// </summary>
public const string AnyAudioOut = "anyAudioOut";
/// <summary>
/// anyOut
/// </summary>
public const string AnyOut = "anyOut";
/// <summary>
/// anyVideoIn
/// </summary>
public const string AnyVideoIn = "anyVideoIn";
/// <summary>
/// anyVideoOut
/// </summary>
public const string AnyVideoOut = "anyVideoOut";
/// <summary>
/// balancedAudioOut
/// </summary>
public const string BalancedAudioOut = "balancedAudioOut";
/// <summary>
/// codecOsd
/// </summary>
public const string CodecOsd = "codecOsd";
/// <summary>
/// componentIn
/// </summary>
public const string ComponentIn = "componentIn";
/// <summary>
/// componentOut
/// </summary>
public const string ComponentOut = "componentOut";
/// <summary>
/// compositeIn
/// </summary>
public const string CompositeIn = "compositeIn";
/// <summary>
/// compositeOut
/// </summary>
public const string CompositeOut = "compositeOut";
/// <summary>
/// displayPortIn
/// </summary>
public const string DisplayPortIn = "displayPortIn";
/// <summary>
/// displayPortIn1
/// </summary>
public const string DisplayPortIn1 = "displayPortIn1";
/// <summary>
/// displayPortIn2
/// </summary>
public const string DisplayPortIn2 = "displayPortIn2";
/// <summary>
/// displayPortIn3
/// </summary>
public const string DisplayPortIn3 = "displayPortIn3";
/// <summary>
/// displayPortOut
/// </summary>
public const string DisplayPortOut = "displayPortOut";
/// <summary>
/// dmIn
/// </summary>
public const string DmIn = "dmIn";
/// <summary>
/// dmOut
/// </summary>
public const string DmOut = "dmOut";
/// <summary>
/// dviIn
/// </summary>
public const string DviIn = "dviIn";
/// <summary>
/// dviIn1
/// </summary>
public const string DviIn1 = "dviIn1";
/// <summary>
/// dviOut
/// </summary>
public const string DviOut = "dviOut";
/// <summary>
/// hdmiIn
/// </summary>
public const string HdmiIn = "hdmiIn";
/// <summary>
/// hdmiIn1
/// </summary>
public const string HdmiIn1 = "hdmiIn1";
/// <summary>
/// hdmiIn1PC
/// </summary>
public const string HdmiIn1PC = "hdmiIn1PC";
/// <summary>
/// hdmiIn2
/// </summary>
public const string HdmiIn2 = "hdmiIn2";
/// <summary>
/// hdmiIn2PC
/// </summary>
public const string HdmiIn2PC = "hdmiIn2PC";
/// <summary>
/// hdmiIn3
/// </summary>
public const string HdmiIn3 = "hdmiIn3";
/// <summary>
/// hdmiIn4
/// </summary>
public const string HdmiIn4 = "hdmiIn4";
/// <summary>
/// hdmiIn5
/// </summary>
public const string HdmiIn5 = "hdmiIn5";
/// <summary>
/// hdmiIn6
/// </summary>
public const string HdmiIn6 = "hdmiIn6";
/// <summary>
/// hdmiOut
/// </summary>
public const string HdmiOut = "hdmiOut";
/// <summary>
/// hdmiOut1
/// </summary>
public const string HdmiOut1 = "hdmiOut1";
/// <summary>
/// hdmiOut2
/// </summary>
public const string HdmiOut2 = "hdmiOut2";
/// <summary>
/// hdmiOut3
/// </summary>
public const string HdmiOut3 = "hdmiOut3";
/// <summary>
/// hdmiOut4
/// </summary>
public const string HdmiOut4 = "hdmiOut4";
/// <summary>
/// hdmiOut5
/// </summary>
public const string HdmiOut5 = "hdmiOut5";
/// <summary>
/// hdmiOut6
/// </summary>
public const string HdmiOut6 = "hdmiOut6";
/// <summary>
/// none
/// </summary>
public const string None = "none";
/// <summary>
/// rgbIn
/// </summary>
public const string RgbIn = "rgbIn";
/// <summary>
/// rgbIn1
/// </summary>
public const string RgbIn1 = "rgbIn1";
/// <summary>
/// rgbIn2
/// </summary>
public const string RgbIn2 = "rgbIn2";
/// <summary>
/// vgaIn
/// </summary>
public const string VgaIn = "vgaIn";
/// <summary>
/// vgaIn1
/// </summary>
public const string VgaIn1 = "vgaIn1";
/// <summary>
/// vgaOut
/// </summary>
public const string VgaOut = "vgaOut";
/// <summary>
/// IPC/OPS
/// </summary>
public const string IpcOps = "ipcOps";
/// <summary>
/// MediaPlayer
/// </summary>
public const string MediaPlayer = "mediaPlayer";
}
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.Shades
{
public interface IShades
{
List<ShadeBase> Shades { get; }
}
/// <summary>
/// Requirements for a device that implements basic Open/Close shade control
/// </summary>
public interface IShadesOpenClose
{
void Open();
void Close();
}
/// <summary>
/// Requirements for a device that implements basic Open/Close/Stop shade control (Uses 3 relays)
/// </summary>
public interface IShadesOpenCloseStop : IShadesOpenClose
{
void StopOrPreset();
}
/// <summary>
/// Requirements for a shade device that provides open/closed feedback
/// </summary>
public interface iShadesRaiseLowerFeedback
{
BoolFeedback ShadeIsOpenFeedback { get; }
BoolFeedback ShadeIsClosedFeedback { get; }
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core.CrestronIO;
namespace PepperDash.Essentials.Core.Shades
{
/// <summary>
/// Base class for a shade device
/// </summary>
public abstract class ShadeBase : Device, IShadesOpenClose
{
public ShadeBase(string key, string name)
: base(key, name)
{
}
#region iShadesOpenClose Members
public abstract void Open();
public abstract void StopOrPreset();
public abstract void Close();
#endregion
}
}

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.Shades
{
/// <summary>
/// Class that contains the shades to be controlled in a room
/// </summary>
public class ShadeController : Device, IShades
{
ShadeControllerConfigProperties Config;
public List<ShadeBase> Shades { get; private set; }
public ShadeController(string key, string name, ShadeControllerConfigProperties config)
: base(key, name)
{
Config = config;
Shades = new List<ShadeBase>();
}
public override bool CustomActivate()
{
foreach (var shadeConfig in Config.Shades)
{
var shade = DeviceManager.GetDeviceForKey(shadeConfig.Key) as ShadeBase;
if (shade != null)
{
AddShade(shade);
}
}
return base.CustomActivate();
}
void AddShade(ShadeBase shade)
{
Shades.Add(shade);
}
}
public class ShadeControllerConfigProperties
{
public List<ShadeConfig> Shades { get; set; }
public class ShadeConfig
{
public string Key { get; set; }
}
}
}

View File

@@ -69,93 +69,4 @@ namespace PepperDash.Essentials.Core
sig.CreateRamp(level, time / 10);
}
}
/// <summary>
/// Attaches to UShortInputSig and does incremental ramping of the signal
/// </summary>
public class UshortSigIncrementer
{
UShortInputSig TheSig;
public ushort ChangeAmount { get; set; }
public int MaxValue { get; set; }
public int MinValue { get; set; }
public uint RepeatDelay { get; set; }
public uint RepeatTime { get; set; }
bool SignedMode;
CTimer Timer;
public UshortSigIncrementer(UShortInputSig sig, ushort changeAmount, int minValue, int maxValue, uint repeatDelay, uint repeatTime)
{
TheSig = sig;
ChangeAmount = changeAmount;
MaxValue = maxValue;
MinValue = minValue;
if (MinValue < 0 || MaxValue < 0) SignedMode = true;
RepeatDelay = repeatDelay;
RepeatTime = repeatTime;
if (SignedMode && (MinValue < -32768 || MaxValue > 32767))
Debug.Console(1, "UshortSigIncrementer has signed values that exceed range of -32768, 32767");
}
public void StartUp()
{
if (Timer != null) return;
Go(ChangeAmount);
}
public void StartDown()
{
if (Timer != null) return;
Go(-ChangeAmount);
}
void Go(int change)
{
int level;
if (SignedMode) level = TheSig.ShortValue;
else level = TheSig.UShortValue;
// Fire once then pause
int newLevel = level + change;
bool atLimit = CheckLevel(newLevel, out newLevel);
SetValue((ushort)newLevel);
if (atLimit) // Don't go past end
Stop();
else if (Timer == null) // Only enter the timer if it's not already running
Timer = new CTimer(o => { Go(change); }, null, RepeatDelay, RepeatTime);
}
bool CheckLevel(int levelIn, out int levelOut)
{
bool IsAtLimit = false;
if (levelIn > MaxValue)
{
levelOut = MaxValue;
IsAtLimit = true;
}
else if (levelIn < MinValue)
{
levelOut = MinValue;
IsAtLimit = true;
}
else
levelOut = levelIn;
return IsAtLimit;
}
public void Stop()
{
if (Timer != null)
Timer.Stop();
Timer = null;
}
void SetValue(ushort value)
{
//CrestronConsole.PrintLine("Increment level:{0} / {1}", value, (short)value);
TheSig.UShortValue = value;
}
}
}

View File

@@ -33,6 +33,12 @@ namespace PepperDash.Essentials.Core.SmartObjects
/// </summary>
public int MaxCount { get; private set; }
/// <summary>
/// Wrapper for smart object
/// </summary>
/// <param name="so"></param>
/// <param name="useUserObjectHandler">True if the standard user object action handler will be used</param>
/// <param name="nameSigOffset">The starting join of the string sigs for the button labels</param>
public SmartObjectDynamicList(SmartObject so, bool useUserObjectHandler, uint nameSigOffset) : base(so, useUserObjectHandler)
{
try

View File

@@ -6,6 +6,8 @@ using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.SmartObjects
{
public class SmartObjectHelperBase
@@ -33,13 +35,37 @@ namespace PepperDash.Essentials.Core.SmartObjects
SmartObject.SigChange -= this.SmartObject_SigChange;
}
/// <summary>
/// Helper to get a sig name with debugging when fail
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public BoolOutputSig GetBoolOutputNamed(string name)
{
if (SmartObject.BooleanOutput.Contains(name))
return SmartObject.BooleanOutput[name];
else
Debug.Console(0, "WARNING: Cannot get signal. Smart object {0} on trilist {1:x2} does not contain signal '{2}'",
SmartObject.ID, SmartObject.Device.ID, name);
return null;
}
/// <summary>
/// Sets action on signal after checking for existence.
/// </summary>
/// <param name="name"></param>
/// <param name="a"></param>
public void SetBoolAction(string name, Action<bool> a)
{
if (SmartObject.BooleanOutput.Contains(name))
SmartObject.BooleanOutput[name].UserObject = a;
else
{
Debug.Console(0, "WARNING: Cannot set action. Smart object {0} on trilist {1:x2} does not contain signal '{2}'",
SmartObject.ID, SmartObject.Device.ID, name);
}
}
/// <summary>
/// Standard Action listener
/// </summary>

View File

@@ -10,6 +10,14 @@ namespace PepperDash.Essentials.Core.SmartObjects
{
public class SmartObjectNumeric : SmartObjectHelperBase
{
/// <summary>
/// Defaults to "Misc_1". The name of the button in VTPro (Usually the text)
/// </summary>
public string Misc1SigName { get; set; }
/// <summary>
/// Defaults to "Misc_2". The name of the button in VTPro (Usually the text)
/// </summary>
public string Misc2SigName { get; set; }
public BoolOutputSig Digit1 { get { return GetBoolOutputNamed("1"); } }
public BoolOutputSig Digit2 { get { return GetBoolOutputNamed("2"); } }
@@ -21,11 +29,13 @@ namespace PepperDash.Essentials.Core.SmartObjects
public BoolOutputSig Digit8 { get { return GetBoolOutputNamed("8"); } }
public BoolOutputSig Digit9 { get { return GetBoolOutputNamed("9"); } }
public BoolOutputSig Digit0 { get { return GetBoolOutputNamed("0"); } }
public BoolOutputSig Misc1 { get { return GetBoolOutputNamed("Misc_1"); } }
public BoolOutputSig Misc2 { get { return GetBoolOutputNamed("Misc_2"); } }
public BoolOutputSig Misc1 { get { return GetBoolOutputNamed(Misc1SigName); } }
public BoolOutputSig Misc2 { get { return GetBoolOutputNamed(Misc2SigName); } }
public SmartObjectNumeric(SmartObject so, bool useUserObjectHandler) : base(so, useUserObjectHandler)
{
Misc1SigName = "Misc_1";
Misc2SigName = "Misc_2";
}
}
}

View File

@@ -53,7 +53,7 @@ namespace PepperDash.Essentials.Core
// Fail cleanly if not defined
if (triList.SmartObjects == null || triList.SmartObjects.Count == 0)
{
Debug.Console(0, "TriList {0:X2} Smart objects not loaded", triList.ID, smartObjectId);
Debug.Console(0, "TriList {0:X2} Smart objects have not been loaded", triList.ID, smartObjectId);
return;
}
if (triList.SmartObjects.TryGetValue(smartObjectId, out obj))
@@ -68,13 +68,14 @@ namespace PepperDash.Essentials.Core
// Count the enable lines to see what max items is
MaxDefinedItems = (ushort)SRL.BooleanInput
.Where(s => s.Name.Contains("Enable")).Count();
Debug.Console(0, "SRL {0} contains max {1} items", SRL.ID, MaxDefinedItems);
Debug.Console(2, "SRL {0} contains max {1} items", SRL.ID, MaxDefinedItems);
SRL.SigChange -= new SmartObjectSigChangeEventHandler(SRL_SigChange);
SRL.SigChange += new SmartObjectSigChangeEventHandler(SRL_SigChange);
}
else
Debug.Console(0, "TriList 0x{0:X2} Cannot load smart object {1}", triList.ID, smartObjectId);
Debug.Console(0, "ERROR: TriList 0x{0:X2} Cannot load smart object {1}. Verify correct SGD file is loaded",
triList.ID, smartObjectId);
}
/// <summary>

View File

@@ -1,111 +0,0 @@
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using Crestron.SimplSharp;
//using Crestron.SimplSharpPro;
//using Crestron.SimplSharpPro.UI;
//namespace PepperDash.Essentials.Core
//{
// /// <summary>
// /// Controls the device/tech status list - links in to the first 10, 1, 5 statuses in an item's StatusProperties
// /// </summary>
// public class DeviceStatusListController : SubpageReferenceListController
// {
// Dictionary<uint, Device> Items = new Dictionary<uint, Device>();
// public DeviceStatusListController(SmartObject list)
// {
// TheList = new SubpageReferenceList(list, 10, 1, 5);
// }
// /// <summary>
// /// Attaches an item's StatusProperties to the list item.
// /// THIS METHOD MAY BE BETTER ABSORBED INTO SOME OTHER CONTROLLER CLASS AS A
// /// PSIG -> LIST ITEM ADAPTER
// /// </summary>
// /// <param name="index">List position</param>
// /// <param name="device"></param>
// public void AddItem(uint listIndex, Device device)
// {
// if (device == null) throw new ArgumentNullException("device");
// Items[listIndex] = device;
// // Feedback - read the status properties and if there is room for them on the list sigs
// // link them up.
// //foreach (PValue statusPsig in device.StatusProperties)
// //{
// // uint num = statusPsig.Number;
// // Sig listSig = null;
// // switch (statusPsig.Type) // Switch on the PSig type and whether the PSig number is within the increment range
// // {
// // case eSigType.Bool:
// // if (num > TheList.BoolIncrement) return;
// // listSig = TheList.BoolInputSig(listIndex, num); // Pull the appropriate list sig.
// // break;
// // case eSigType.String:
// // if (num > TheList.StringIncrement) return;
// // listSig = TheList.StringInputSig(listIndex, num);
// // break;
// // case eSigType.UShort:
// // if (num > TheList.UShortIncrement) return;
// // listSig = TheList.UShortInputSig(listIndex, num);
// // break;
// // default:
// // return;
// // }
// // if (listSig != null) // If we got a sig, plug it into the PSig for updates.
// // statusPsig.AddLinkedSig(listSig, true);
// //}
// // Press/other handlers - read the Commands and if there is room, add them as Sig handlers.
// //foreach (var id in device.Commands.Keys)
// //{
// // var pValueNumber = id.Number;
// // Sig listSig = null;
// // // Switch on type of a command and if it's in range, get it's list Sig.
// // switch (id.Type)
// // {
// // case eSigType.Bool:
// // if (pValueNumber > TheList.BoolIncrement) return;
// // listSig = TheList.BoolFeedbackSig(listIndex, pValueNumber);
// // break;
// // case eSigType.String:
// // if (pValueNumber > TheList.StringIncrement) return;
// // listSig = TheList.StringOutputSig(listIndex, pValueNumber);
// // break;
// // case eSigType.UShort:
// // if (pValueNumber > TheList.UShortIncrement) return;
// // listSig = TheList.UShortOutputSig(listIndex, pValueNumber);
// // break;
// // default:
// // return;
// // }
// // if (listSig != null) // If we got a sig, add the command to its ChangeAction
// // SigToAction.GetSigToActionUserObjectForSig(listSig).SigChangeAction += device.Commands[id];
// // // This will need to be undone when detached MAKE A HELPER!!!!
// //}
// // "Custom things" below
// // Set the name on sig 1 - just an assignment. Don't
// var nameSig = TheList.StringInputSig(listIndex, 1);
// if (nameSig != null)
// nameSig.StringValue = device.Key;
// // Map IsOnline bool to a 0 / 1 state analog icon
// // Add an action to the online PValue that maps to a ushort sig on the list POTENTIAL LEAK HERE IF
// // this isn't cleaned up on disconnect
// var onlineSig = TheList.UShortInputSig(listIndex, 1);
// //var onlinePValue = device.StatusProperties[Device.JoinIsOnline];
// //if (onlineSig != null && onlinePValue != null)
// // onlinePValue.AddChangeAction(pv => onlineSig.UShortValue = (ushort)(onlinePValue.BoolValue ? 1 : 0));
// // //OR onlinePValue.AddLinkedSig(onlineSig, true);
// // Set the list length based on largest key
// TheList.Count = (ushort)Items.Keys.DefaultIfEmpty().Max(); // The count will be the largest key or 0
// }
// }
//}

View File

@@ -0,0 +1,134 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
public class SecondsCountdownTimer: IKeyed
{
public event EventHandler<EventArgs> HasStarted;
public event EventHandler<EventArgs> HasFinished;
public event EventHandler<EventArgs> WasCancelled;
public string Key { get; private set; }
public BoolFeedback IsRunningFeedback { get; private set; }
bool _IsRunning;
public IntFeedback PercentFeedback { get; private set; }
public StringFeedback TimeRemainingFeedback { get; private set; }
public bool CountsDown { get; set; }
public int SecondsToCount { get; set; }
public DateTime StartTime { get; private set; }
public DateTime FinishTime { get; private set; }
CTimer SecondTimer;
/// <summary>
///
/// </summary>
/// <param name="key"></param>
public SecondsCountdownTimer(string key)
{
Key = key;
IsRunningFeedback = new BoolFeedback(() => _IsRunning);
TimeRemainingFeedback = new StringFeedback(() =>
{
// Need to handle up and down here.
if (StartTime == null || FinishTime == null)
return "";
var timeSpan = FinishTime - DateTime.Now;
return Math.Round(timeSpan.TotalSeconds).ToString();
});
PercentFeedback = new IntFeedback(() =>
{
if (StartTime == null || FinishTime == null)
return 0;
double percent = (FinishTime - DateTime.Now).TotalSeconds
/ (FinishTime - StartTime).TotalSeconds
* 100;
return (int)percent;
});
}
/// <summary>
///
/// </summary>
public void Start()
{
if (_IsRunning)
return;
StartTime = DateTime.Now;
FinishTime = StartTime + TimeSpan.FromSeconds(SecondsToCount);
if (SecondTimer != null)
SecondTimer.Stop();
SecondTimer = new CTimer(SecondElapsedTimerCallback, null, 0, 1000);
_IsRunning = true;
IsRunningFeedback.FireUpdate();
var handler = HasStarted;
if (handler != null)
handler(this, new EventArgs());
}
/// <summary>
///
/// </summary>
public void Reset()
{
_IsRunning = false;
Start();
}
/// <summary>
///
/// </summary>
public void Cancel()
{
StopHelper();
var handler = WasCancelled;
if (handler != null)
handler(this, new EventArgs());
}
/// <summary>
/// Called upon expiration, or calling this will force timer to finish.
/// </summary>
public void Finish()
{
StopHelper();
var handler = HasFinished;
if (handler != null)
handler(this, new EventArgs());
}
void StopHelper()
{
if (SecondTimer != null)
SecondTimer.Stop();
_IsRunning = false;
IsRunningFeedback.FireUpdate();
}
void SecondElapsedTimerCallback(object o)
{
PercentFeedback.FireUpdate();
TimeRemainingFeedback.FireUpdate();
if (DateTime.Now >= FinishTime)
Finish();
}
}
}

View File

@@ -0,0 +1,436 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
namespace PepperDash.Essentials.Core.Touchpanels.Keyboards
{
public class HabaneroKeyboardController
{
/// <summary>
/// Single-key press events, rather than using a built-up text string on the OutputFeedback
/// </summary>
public event EventHandler<KeyboardControllerPressEventArgs> KeyPress;
public BasicTriList TriList { get; private set; }
public StringFeedback OutputFeedback { get; private set; }
public bool IsVisible { get; private set; }
public string DotComButtonString { get; set; }
public string GoButtonText { get; set; }
public string SecondaryButtonText { get; set; }
public bool GoButtonVisible { get; set; }
public bool SecondaryButtonVisible { get; set; }
int ShiftMode = 0;
StringBuilder Output;
public Action HideAction { get; set; }
CTimer BackspaceTimer;
/// <summary>
///
/// </summary>
/// <param name="trilist"></param>
public HabaneroKeyboardController(BasicTriList trilist)
{
TriList = trilist;
Output = new StringBuilder();
OutputFeedback = new StringFeedback(() => Output.ToString());
DotComButtonString = ".com";
}
/// <summary>
/// Shows the keyboard and attaches sig handlers in the range of 2901-2969
/// </summary>
public void Show()
{
if (IsVisible)
return;
TriList.SetSigTrueAction(ClosePressJoin, Hide);
TriList.SetSigTrueAction(GoButtonPressJoin, () => OnKeyPress(KeyboardSpecialKey.GoButton));
TriList.SetSigTrueAction(SecondaryButtonPressJoin, () => OnKeyPress(KeyboardSpecialKey.SecondaryButton));
TriList.SetSigTrueAction(2921, () => Press(A(ShiftMode)));
TriList.SetSigTrueAction(2922, () => Press(B(ShiftMode)));
TriList.SetSigTrueAction(2923, () => Press(C(ShiftMode)));
TriList.SetSigTrueAction(2924, () => Press(D(ShiftMode)));
TriList.SetSigTrueAction(2925, () => Press(E(ShiftMode)));
TriList.SetSigTrueAction(2926, () => Press(F(ShiftMode)));
TriList.SetSigTrueAction(2927, () => Press(G(ShiftMode)));
TriList.SetSigTrueAction(2928, () => Press(H(ShiftMode)));
TriList.SetSigTrueAction(2929, () => Press(I(ShiftMode)));
TriList.SetSigTrueAction(2930, () => Press(J(ShiftMode)));
TriList.SetSigTrueAction(2931, () => Press(K(ShiftMode)));
TriList.SetSigTrueAction(2932, () => Press(L(ShiftMode)));
TriList.SetSigTrueAction(2933, () => Press(M(ShiftMode)));
TriList.SetSigTrueAction(2934, () => Press(N(ShiftMode)));
TriList.SetSigTrueAction(2935, () => Press(O(ShiftMode)));
TriList.SetSigTrueAction(2936, () => Press(P(ShiftMode)));
TriList.SetSigTrueAction(2937, () => Press(Q(ShiftMode)));
TriList.SetSigTrueAction(2938, () => Press(R(ShiftMode)));
TriList.SetSigTrueAction(2939, () => Press(S(ShiftMode)));
TriList.SetSigTrueAction(2940, () => Press(T(ShiftMode)));
TriList.SetSigTrueAction(2941, () => Press(U(ShiftMode)));
TriList.SetSigTrueAction(2942, () => Press(V(ShiftMode)));
TriList.SetSigTrueAction(2943, () => Press(W(ShiftMode)));
TriList.SetSigTrueAction(2944, () => Press(X(ShiftMode)));
TriList.SetSigTrueAction(2945, () => Press(Y(ShiftMode)));
TriList.SetSigTrueAction(2946, () => Press(Z(ShiftMode)));
TriList.SetSigTrueAction(2947, () => Press('.'));
TriList.SetSigTrueAction(2948, () => Press('@'));
TriList.SetSigTrueAction(2949, () => Press(' '));
TriList.SetSigHeldAction(2950, 500, StartBackspaceRepeat, StopBackspaceRepeat, Backspace);
//TriList.SetSigTrueAction(2950, Backspace);
TriList.SetSigTrueAction(2951, Shift);
TriList.SetSigTrueAction(2952, NumShift);
TriList.SetSigTrueAction(2953, Clear);
TriList.SetSigTrueAction(2954, () => Press(DotComButtonString));
TriList.SetBool(GoButtonVisibleJoin, GoButtonVisible);
TriList.SetString(GoButtonTextJoin, GoButtonText);
TriList.SetBool(SecondaryButtonVisibleJoin, SecondaryButtonVisible);
TriList.SetString(SecondaryButtonTextJoin, SecondaryButtonText);
TriList.SetBool(KeyboardVisible, true);
ShowKeys();
IsVisible = true;
}
/// <summary>
/// Hides the keyboard and disconnects ALL sig handlers from 2901 - 2969
/// </summary>
public void Hide()
{
if (!IsVisible)
return;
for (uint i = 2901; i < 2970; i++)
TriList.ClearBoolSigAction(i);
// run attached actions
if(HideAction != null)
HideAction();
TriList.SetBool(KeyboardVisible, false);
IsVisible = false;
}
/// <summary>
///
/// </summary>
/// <param name="c"></param>
public void Press(char c)
{
OnKeyPress(c.ToString());
Output.Append(c);
OutputFeedback.FireUpdate();
ResetShift();
}
/// <summary>
///
/// </summary>
/// <param name="s"></param>
public void Press(string s)
{
OnKeyPress(s);
Output.Append(s);
OutputFeedback.FireUpdate();
ResetShift();
}
/// <summary>
///
/// </summary>
public void EnableGoButton()
{
TriList.SetBool(GoButtonEnableJoin, true);
}
/// <summary>
///
/// </summary>
public void DisableGoButton()
{
TriList.SetBool(GoButtonEnableJoin, false);
}
void ResetShift()
{
if (ShiftMode == 1)
{
ShiftMode = 0;
ShowKeys();
}
else if (ShiftMode == 3)
{
ShiftMode = 2;
ShowKeys();
}
}
char A(int i) { return new char[] { 'a', 'A', '?', '?' }[i]; }
char B(int i) { return new char[] { 'b', 'B', ':', ':' }[i]; }
char C(int i) { return new char[] { 'c', 'C', '>', '>' }[i]; }
char D(int i) { return new char[] { 'd', 'D', '_', '_' }[i]; }
char E(int i) { return new char[] { 'e', 'E', '3', '#' }[i]; }
char F(int i) { return new char[] { 'f', 'F', '=', '=' }[i]; }
char G(int i) { return new char[] { 'g', 'G', '+', '+' }[i]; }
char H(int i) { return new char[] { 'h', 'H', '[', '[' }[i]; }
char I(int i) { return new char[] { 'i', 'I', '8', '*' }[i]; }
char J(int i) { return new char[] { 'j', 'J', ']', ']' }[i]; }
char K(int i) { return new char[] { 'k', 'K', '/', '/' }[i]; }
char L(int i) { return new char[] { 'l', 'L', '\\', '\\' }[i]; }
char M(int i) { return new char[] { 'm', 'M', '"', '"' }[i]; }
char N(int i) { return new char[] { 'n', 'N', '\'', '\'' }[i]; }
char O(int i) { return new char[] { 'o', 'O', '9', '(' }[i]; }
char P(int i) { return new char[] { 'p', 'P', '0', ')' }[i]; }
char Q(int i) { return new char[] { 'q', 'Q', '1', '!' }[i]; }
char R(int i) { return new char[] { 'r', 'R', '4', '$' }[i]; }
char S(int i) { return new char[] { 's', 'S', '-', '-' }[i]; }
char T(int i) { return new char[] { 't', 'T', '5', '%' }[i]; }
char U(int i) { return new char[] { 'u', 'U', '7', '&' }[i]; }
char V(int i) { return new char[] { 'v', 'V', ';', ';' }[i]; }
char W(int i) { return new char[] { 'w', 'W', '2', '@' }[i]; }
char X(int i) { return new char[] { 'x', 'X', '<', '<' }[i]; }
char Y(int i) { return new char[] { 'y', 'Y', '6', '^' }[i]; }
char Z(int i) { return new char[] { 'z', 'Z', ',', ',' }[i]; }
/// <summary>
/// Does what it says
/// </summary>
void StartBackspaceRepeat()
{
if (BackspaceTimer == null)
{
BackspaceTimer = new CTimer(o => Backspace(), null, 0, 175);
}
}
/// <summary>
/// Does what it says
/// </summary>
void StopBackspaceRepeat()
{
if (BackspaceTimer != null)
{
BackspaceTimer.Stop();
BackspaceTimer = null;
}
}
void Backspace()
{
OnKeyPress(KeyboardSpecialKey.Backspace);
if (Output.Length > 0)
{
Output.Remove(Output.Length - 1, 1);
OutputFeedback.FireUpdate();
}
}
void Clear()
{
OnKeyPress(KeyboardSpecialKey.Clear);
Output.Remove(0, Output.Length);
OutputFeedback.FireUpdate();
}
/* When in mode 0 (lowercase):
* shift button: up arrow 0
* numShift button: 123/#$@#$ 0
*
* - shift --> mode 1
* - double-tap shift --> caps lock
* - numShift --> mode 2
*
* mode 1 (uppercase)
* shift button: down arrow 1
* numShift button: 123/##$# 0
*
* - shift --> mode 0
* - numShift --> mode 2
*
* - Tapping any key will go back to mode 0
*
* mode 2 (numbers-sym)
* Shift button: #$#$#$ 2
* numShift: ABC 1
*
* - shift --> mode 3
* - double-tap shift --> caps lock
* - numShift --> mode 0
*
* mode 3 (sym)
* Shift button: 123 3
* numShift: ABC 1
*
* - shift --> mode 2
* - numShift --> mode 0
*
* - Tapping any key will go back to mode 2
*/
void Shift()
{
if (ShiftMode == 0)
ShiftMode = 1;
else if (ShiftMode == 1)
ShiftMode = 0;
else if (ShiftMode == 2)
ShiftMode = 3;
else
ShiftMode = 2;
ShowKeys();
}
void NumShift()
{
if (ShiftMode == 0 || ShiftMode == 1)
ShiftMode = 2;
else if (ShiftMode == 2 || ShiftMode == 3)
ShiftMode = 0;
ShowKeys();
}
void ShowKeys()
{
TriList.SetString(2921, A(ShiftMode).ToString());
TriList.SetString(2922, B(ShiftMode).ToString());
TriList.SetString(2923, C(ShiftMode).ToString());
TriList.SetString(2924, D(ShiftMode).ToString());
TriList.SetString(2925, E(ShiftMode).ToString());
TriList.SetString(2926, F(ShiftMode).ToString());
TriList.SetString(2927, G(ShiftMode).ToString());
TriList.SetString(2928, H(ShiftMode).ToString());
TriList.SetString(2929, I(ShiftMode).ToString());
TriList.SetString(2930, J(ShiftMode).ToString());
TriList.SetString(2931, K(ShiftMode).ToString());
TriList.SetString(2932, L(ShiftMode).ToString());
TriList.SetString(2933, M(ShiftMode).ToString());
TriList.SetString(2934, N(ShiftMode).ToString());
TriList.SetString(2935, O(ShiftMode).ToString());
TriList.SetString(2936, P(ShiftMode).ToString());
TriList.SetString(2937, Q(ShiftMode).ToString());
TriList.SetString(2938, R(ShiftMode).ToString());
TriList.SetString(2939, S(ShiftMode).ToString());
TriList.SetString(2940, T(ShiftMode).ToString());
TriList.SetString(2941, U(ShiftMode).ToString());
TriList.SetString(2942, V(ShiftMode).ToString());
TriList.SetString(2943, W(ShiftMode).ToString());
TriList.SetString(2944, X(ShiftMode).ToString());
TriList.SetString(2945, Y(ShiftMode).ToString());
TriList.SetString(2946, Z(ShiftMode).ToString());
TriList.SetString(2954, DotComButtonString);
TriList.SetUshort(2951, (ushort)ShiftMode); // 0 = up, 1 = down, 2 = #, 3 = 123
TriList.SetUshort(2952, (ushort)(ShiftMode < 2 ? 0 : 1)); // 0 = #, 1 = abc
}
/// <summary>
/// Event fire helper for text
/// </summary>
/// <param name="text"></param>
void OnKeyPress(string text)
{
var handler = KeyPress;
if (handler != null)
KeyPress(this, new KeyboardControllerPressEventArgs(text));
}
/// <summary>
/// event helper for special keys
/// </summary>
/// <param name="key"></param>
void OnKeyPress(KeyboardSpecialKey key)
{
var handler = KeyPress;
if (handler != null)
KeyPress(this, new KeyboardControllerPressEventArgs(key));
}
/// <summary>
/// 2901
/// </summary>
public const uint KeyboardVisible = 2901;
/// <summary>
/// 2902
/// </summary>
public const uint ClosePressJoin = 2902;
/// <summary>
/// 2903
/// </summary>
public const uint GoButtonPressJoin = 2903;
/// <summary>
/// 2903
/// </summary>
public const uint GoButtonTextJoin = 2903;
/// <summary>
/// 2904
/// </summary>
public const uint SecondaryButtonPressJoin = 2904;
/// <summary>
/// 2904
/// </summary>
public const uint SecondaryButtonTextJoin = 2904;
/// <summary>
/// 2905
/// </summary>
public const uint GoButtonVisibleJoin = 2905;
/// <summary>
/// 2906
/// </summary>
public const uint SecondaryButtonVisibleJoin = 2906;
/// <summary>
/// 2907
/// </summary>
public const uint GoButtonEnableJoin = 2907;
/// <summary>
/// 2910
/// </summary>
public const uint ClearPressJoin = 2910;
/// <summary>
/// 2911
/// </summary>
public const uint ClearVisibleJoin = 2911;
}
/// <summary>
///
/// </summary>
public class KeyboardControllerPressEventArgs : EventArgs
{
public string Text { get; private set; }
public KeyboardSpecialKey SpecialKey { get; private set; }
public KeyboardControllerPressEventArgs(string text)
{
Text = text;
}
public KeyboardControllerPressEventArgs(KeyboardSpecialKey key)
{
SpecialKey = key;
}
}
public enum KeyboardSpecialKey
{
None = 0, Backspace, Clear, GoButton, SecondaryButton
}
}

View File

@@ -1,6 +1,7 @@
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
@@ -14,6 +15,10 @@ namespace PepperDash.Essentials.Core
/// Bool press 3992
/// </summary>
public const uint Button2Join = 3992;
/// <summary>
/// 3993
/// </summary>
public const uint CancelButtonJoin = 3993;
/// <summary>
///For visibility of single button. Bool feedback 3994
/// </summary>
@@ -26,6 +31,10 @@ namespace PepperDash.Essentials.Core
/// Shows the timer guage if in use. Bool feedback 3996
/// </summary>
public const uint TimerVisibleJoin = 3996;
/// <summary>
/// Visibility join to show "X" button 3997
/// </summary>
public const uint CancelVisibleJoin = 3997;
/// <summary>
/// Shows the modal subpage. Boolean feeback join 3999
/// </summary>
@@ -34,7 +43,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// The seconds value of the countdown timer. Ushort join 3991
/// </summary>
public const uint TimerSecondsJoin = 3991;
//public const uint TimerSecondsJoin = 3991;
/// <summary>
/// The full ushort value of the countdown timer for a gauge. Ushort join 3992
/// </summary>
@@ -69,11 +78,15 @@ namespace PepperDash.Essentials.Core
get { return TriList.BooleanInput[ModalVisibleJoin].BoolValue; }
}
/// <summary>
///
/// </summary>
public bool CanCancel { get; private set; }
BasicTriList TriList;
Action<uint> ModalCompleteAction;
CTimer Timer;
static object CompleteActionLock = new object();
@@ -85,8 +98,10 @@ namespace PepperDash.Essentials.Core
{
TriList = triList;
// Attach actions to buttons
triList.SetSigFalseAction(Button1Join, () => OnModalComplete(1, true));
triList.SetSigFalseAction(Button2Join, () => OnModalComplete(2, true));
triList.SetSigFalseAction(Button1Join, () => OnModalComplete(1));
triList.SetSigFalseAction(Button2Join, () => OnModalComplete(2));
triList.SetSigFalseAction(CancelButtonJoin, () => { if (CanCancel) CancelDialog(); });
CanCancel = true;
}
/// <summary>
@@ -97,11 +112,10 @@ namespace PepperDash.Essentials.Core
/// <param name="decreasingGauge">If the progress bar gauge needs to count down instead of up</param>
/// <param name="completeAction">The action to run when the dialog is dismissed. Parameter will be 1 or 2 if button pressed, or 0 if dialog times out</param>
/// <returns>True when modal is created.</returns>
public bool PresentModalTimerDialog(uint numberOfButtons, string title, string iconName,
public bool PresentModalDialog(uint numberOfButtons, string title, string iconName,
string message, string button1Text,
string button2Text, uint timeMs, bool decreasingGauge, Action<uint> completeAction)
string button2Text, bool showGauge, bool showCancel, Action<uint> completeAction)
{
//Debug.Console(0, "Present dialog");
// Don't reset dialog if visible now
if (!ModalIsVisible)
{
@@ -131,69 +145,45 @@ namespace PepperDash.Essentials.Core
TriList.StringInput[Button1TextJoin].StringValue = button1Text;
TriList.StringInput[Button2TextJoin].StringValue = button2Text;
}
// Show/hide timer
TriList.BooleanInput[TimerVisibleJoin].BoolValue = timeMs > 0;
// Show/hide guage
TriList.BooleanInput[TimerVisibleJoin].BoolValue = showGauge;
CanCancel = showCancel;
TriList.BooleanInput[CancelVisibleJoin].BoolValue = showCancel;
//Reveal and activate
TriList.BooleanInput[ModalVisibleJoin].BoolValue = true;
// Start ramp timers if visible
if (timeMs > 0)
{
TriList.UShortInput[TimerSecondsJoin].UShortValue = (ushort)(timeMs / 1000); // Seconds display
TriList.UShortInput[TimerSecondsJoin].CreateRamp(0, (uint)(timeMs / 10));
if (decreasingGauge)
{
// Gauge
TriList.UShortInput[TimerGaugeJoin].UShortValue = ushort.MaxValue;
// Text
TriList.UShortInput[TimerGaugeJoin].CreateRamp(0, (uint)(timeMs / 10));
}
else
{
TriList.UShortInput[TimerGaugeJoin].UShortValue = 0; // Gauge
TriList.UShortInput[TimerGaugeJoin].
CreateRamp(ushort.MaxValue, (uint)(timeMs / 10));
}
Timer = new CTimer(o => OnModalComplete(0, false), timeMs);
}
// Start a timer and fire action with no button on timeout.
return true;
}
// Dialog is busy
//Debug.Console(2, "Modal is already visible");
return false;
}
/// <summary>
/// Hide dialog from elsewhere, fires CompleteAction
/// </summary>
public void CancelDialog()
{
if (ModalIsVisible)
{
TriList.UShortInput[TimerSecondsJoin].StopRamp();
TriList.UShortInput[TimerGaugeJoin].StopRamp();
if (Timer != null) Timer.Stop();
TriList.BooleanInput[ModalVisibleJoin].BoolValue = false;
}
OnModalComplete(0);
}
/// <summary>
/// Hides dialog. Fires no action
/// </summary>
public void HideDialog()
{
TriList.BooleanInput[ModalVisibleJoin].BoolValue = false;
}
// When the modal is cleared or times out, clean up the various bits
void OnModalComplete(uint buttonNum, bool cancelled)
void OnModalComplete(uint buttonNum)
{
//Debug.Console(2, "OnModalComplete {0}, {1}", buttonNum, cancelled);
TriList.BooleanInput[ModalVisibleJoin].BoolValue = false;
if (cancelled)
{
TriList.UShortInput[TimerSecondsJoin].StopRamp();
TriList.UShortInput[TimerGaugeJoin].StopRamp();
Timer.Stop();
}
if (ModalCompleteAction != null)
{
//Debug.Console(2, "Modal complete action");
ModalCompleteAction(buttonNum);
}
var action = ModalCompleteAction;
if (action != null)
action(buttonNum);
}
}

View File

@@ -2,9 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
@@ -13,7 +17,8 @@ namespace PepperDash.Essentials.Core
public static class SigAndTriListExtensions
{
/// <summary>
/// Attaches Action to Sig's user object and returns the same Sig.
/// Attaches Action to Sig's user object and returns the same Sig. This provides no protection
/// from null sigs
/// </summary>
/// <param name="sig">The BoolOutputSig to attach the Action to</param>
/// <param name="a">An action to run when sig is pressed and when released</param>
@@ -59,6 +64,74 @@ namespace PepperDash.Essentials.Core
return sig.SetBoolSigAction(b => { if (!b) a(); });
}
/// <summary>
/// Sets an action to a held sig
/// </summary>
/// <returns>The sig</returns>
public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction)
{
return SetSigHeldAction(tl, sigNum, heldMs, heldAction, null);
}
/// <summary>
/// Sets an action to a held sig as well as a released-without-hold action
/// </summary>
/// <returns></returns>
public static BoolOutputSig SetSigHeldAction(this BoolOutputSig sig, uint heldMs, Action heldAction, Action holdReleasedAction, Action releaseAction)
{
CTimer heldTimer = null;
bool wasHeld = false;
return sig.SetBoolSigAction(press =>
{
if (press)
{
wasHeld = false;
// Could insert a pressed action here
heldTimer = new CTimer(o =>
{
// if still held and there's an action
if (sig.BoolValue && heldAction != null)
{
wasHeld = true;
// Hold action here
heldAction();
}
}, heldMs);
}
else if (!press && !wasHeld) // released, no hold
{
heldTimer.Stop();
if (releaseAction != null)
releaseAction();
}
else // !press && wasHeld // released after held
{
heldTimer.Stop();
if (holdReleasedAction != null)
holdReleasedAction();
}
});
}
/// <summary>
/// Sets an action to a held sig as well as a released-without-hold action
/// </summary>
/// <returns>The sig</returns>
public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction, Action releaseAction)
{
return tl.BooleanOutput[sigNum].SetSigHeldAction(heldMs, heldAction, null, releaseAction);
}
/// <summary>
/// Sets an action to a held sig, an action for the release of hold, as well as a released-without-hold action
/// </summary>
/// <returns></returns>
public static BoolOutputSig SetSigHeldAction(this BasicTriList tl, uint sigNum, uint heldMs, Action heldAction,
Action holdReleasedAction, Action releaseAction)
{
return tl.BooleanOutput[sigNum].SetSigHeldAction(heldMs, heldAction, holdReleasedAction, releaseAction);
}
/// <summary>
///
@@ -71,23 +144,47 @@ namespace PepperDash.Essentials.Core
sig.UserObject = a;
return sig;
}
/// <summary>
///
/// </summary>
/// <param name="tl"></param>
/// <param name="sigNum"></param>
/// <param name="a"></param>
/// <returns></returns>
public static UShortOutputSig SetUShortSigAction(this BasicTriList tl, uint sigNum, Action<ushort> a)
{
return tl.UShortOutput[sigNum].SetUShortSigAction(a);
}
/// <summary>
///
/// </summary>
/// <param name="sig"></param>
/// <param name="a"></param>
/// <returns></returns>
public static StringOutputSig SetStringSigAction(this StringOutputSig sig, Action<string> a)
{
sig.UserObject = a;
return sig;
}
/// <summary>
///
/// </summary>
/// <param name="tl"></param>
/// <param name="sigNum"></param>
/// <param name="a"></param>
/// <returns></returns>
public static StringOutputSig SetStringSigAction(this BasicTriList tl, uint sigNum, Action<string> a)
{
return tl.SetStringSigAction(sigNum, a);
return tl.StringOutput[sigNum].SetStringSigAction(a);
}
/// <summary>
///
/// </summary>
/// <param name="sig"></param>
/// <returns></returns>
public static Sig ClearSigAction(this Sig sig)
{
sig.UserObject = null;
@@ -108,5 +205,50 @@ namespace PepperDash.Essentials.Core
{
return ClearSigAction(tl.StringOutput[sigNum]) as StringOutputSig;
}
}
/// <summary>
/// Helper method to set the value of a bool Sig on TriList
/// </summary>
public static void SetBool(this BasicTriList tl, uint sigNum, bool value)
{
tl.BooleanInput[sigNum].BoolValue = value;
}
/// <summary>
/// Sends an true-false pulse to the sig
/// </summary>
/// <param name="tl"></param>
/// <param name="sigNum"></param>
public static void PulseBool(this BasicTriList tl, uint sigNum)
{
tl.BooleanInput[sigNum].Pulse();
}
/// <summary>
/// Sends a timed pulse to the sig
/// </summary>
/// <param name="tl"></param>
/// <param name="sigNum"></param>
/// <param name="ms"></param>
public static void PulseBool(this BasicTriList tl, uint sigNum, int ms)
{
tl.BooleanInput[sigNum].Pulse(ms);
}
/// <summary>
/// Helper method to set the value of a ushort Sig on TriList
/// </summary>
public static void SetUshort(this BasicTriList tl, uint sigNum, ushort value)
{
tl.UShortInput[sigNum].UShortValue = value;
}
/// <summary>
/// Helper method to set the value of a string Sig on TriList
/// </summary>
public static void SetString(this BasicTriList tl, uint sigNum, string value)
{
tl.StringInput[sigNum].StringValue = value;
}
}
}

View File

@@ -89,8 +89,10 @@ namespace PepperDash.Essentials.DM
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
Output.Volume.CreateRamp(0, 400);
#warning SCALE THIS RAMP
{
var remainingRatio = Output.Volume.UShortValue / 65535;
Output.Volume.CreateRamp(0, (uint)(400 * remainingRatio));
}
else
Output.Volume.StopRamp();
}
@@ -101,7 +103,10 @@ namespace PepperDash.Essentials.DM
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
{
var remainingRatio = (65535 - Output.Volume.UShortValue) / 65535;
Output.Volume.CreateRamp(65535, 400);
}
else
Output.Volume.StopRamp();
}

View File

@@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.DM
{
public class DmCardAudioOutputController : IBasicVolumeWithFeedback
{
public Audio.Output Output { get; private set; }
public IntFeedback VolumeLevelFeedback { get; private set; }
public BoolFeedback MuteFeedback { get; private set; }
ushort PreMuteVolumeLevel;
bool IsMuted;
public DmCardAudioOutputController(Audio.Output output)
{
Output = output;
VolumeLevelFeedback = new IntFeedback(() => Output.VolumeFeedback.UShortValue);
MuteFeedback = new BoolFeedback(() => IsMuted);
}
#region IBasicVolumeWithFeedback Members
/// <summary>
///
/// </summary>
public void MuteOff()
{
SetVolume(PreMuteVolumeLevel);
IsMuted = false;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void MuteOn()
{
PreMuteVolumeLevel = Output.VolumeFeedback.UShortValue;
SetVolume(0);
IsMuted = true;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void SetVolume(ushort level)
{
Debug.Console(2, "Set volume out {0}", level);
Output.Volume.UShortValue = level;
}
/// <summary>
///
/// </summary>
internal void VolumeEventFromChassis()
{
VolumeLevelFeedback.FireUpdate();
}
#endregion
#region IBasicVolumeControls Members
/// <summary>
///
/// </summary>
public void MuteToggle()
{
if (IsMuted)
MuteOff();
else
MuteOn();
}
/// <summary>
///
/// </summary>
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
<<<<<<< HEAD
{
var remainingRatio = Output.Volume.UShortValue / 65535;
Output.Volume.CreateRamp(0, (uint)(400 * remainingRatio));
}
=======
Output.Volume.CreateRamp(0, 400);
>>>>>>> origin/feature/fusion-nyu
else
Output.Volume.StopRamp();
}
/// <summary>
///
/// </summary>
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
{
var remainingRatio = (65535 - Output.Volume.UShortValue) / 65535;
Output.Volume.CreateRamp(65535, 400);
}
else
Output.Volume.StopRamp();
}
#endregion
}
}

View File

@@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.DM
{
public class DmCardAudioOutputController : IBasicVolumeWithFeedback
{
public Audio.Output Output { get; private set; }
public IntFeedback VolumeLevelFeedback { get; private set; }
public BoolFeedback MuteFeedback { get; private set; }
ushort PreMuteVolumeLevel;
bool IsMuted;
public DmCardAudioOutputController(Audio.Output output)
{
Output = output;
VolumeLevelFeedback = new IntFeedback(() => Output.VolumeFeedback.UShortValue);
MuteFeedback = new BoolFeedback(() => IsMuted);
}
#region IBasicVolumeWithFeedback Members
/// <summary>
///
/// </summary>
public void MuteOff()
{
SetVolume(PreMuteVolumeLevel);
IsMuted = false;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void MuteOn()
{
PreMuteVolumeLevel = Output.VolumeFeedback.UShortValue;
SetVolume(0);
IsMuted = true;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void SetVolume(ushort level)
{
Debug.Console(2, "Set volume out {0}", level);
Output.Volume.UShortValue = level;
}
/// <summary>
///
/// </summary>
internal void VolumeEventFromChassis()
{
VolumeLevelFeedback.FireUpdate();
}
#endregion
#region IBasicVolumeControls Members
/// <summary>
///
/// </summary>
public void MuteToggle()
{
if (IsMuted)
MuteOff();
else
MuteOn();
}
/// <summary>
///
/// </summary>
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
<<<<<<< HEAD
{
var remainingRatio = Output.Volume.UShortValue / 65535;
Output.Volume.CreateRamp(0, (uint)(400 * remainingRatio));
}
=======
Output.Volume.CreateRamp(0, 400);
>>>>>>> origin/feature/fusion-nyu
else
Output.Volume.StopRamp();
}
/// <summary>
///
/// </summary>
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
{
var remainingRatio = (65535 - Output.Volume.UShortValue) / 65535;
Output.Volume.CreateRamp(65535, 400);
}
else
Output.Volume.StopRamp();
}
#endregion
}
}

View File

@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.DM
{
public class DmCardAudioOutputController : IBasicVolumeWithFeedback
{
public Audio.Output Output { get; private set; }
public IntFeedback VolumeLevelFeedback { get; private set; }
public BoolFeedback MuteFeedback { get; private set; }
ushort PreMuteVolumeLevel;
bool IsMuted;
public DmCardAudioOutputController(Audio.Output output)
{
Output = output;
VolumeLevelFeedback = new IntFeedback(() => Output.VolumeFeedback.UShortValue);
MuteFeedback = new BoolFeedback(() => IsMuted);
}
#region IBasicVolumeWithFeedback Members
/// <summary>
///
/// </summary>
public void MuteOff()
{
SetVolume(PreMuteVolumeLevel);
IsMuted = false;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void MuteOn()
{
PreMuteVolumeLevel = Output.VolumeFeedback.UShortValue;
SetVolume(0);
IsMuted = true;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void SetVolume(ushort level)
{
Debug.Console(2, "Set volume out {0}", level);
Output.Volume.UShortValue = level;
}
/// <summary>
///
/// </summary>
internal void VolumeEventFromChassis()
{
VolumeLevelFeedback.FireUpdate();
}
#endregion
#region IBasicVolumeControls Members
/// <summary>
///
/// </summary>
public void MuteToggle()
{
if (IsMuted)
MuteOff();
else
MuteOn();
}
/// <summary>
///
/// </summary>
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
Output.Volume.CreateRamp(0, 400);
#warning SCALE THIS RAMP
else
Output.Volume.StopRamp();
}
/// <summary>
///
/// </summary>
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
Output.Volume.CreateRamp(65535, 400);
else
Output.Volume.StopRamp();
}
#endregion
}
}

View File

@@ -0,0 +1,116 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.DM
{
public class DmCardAudioOutputController : IBasicVolumeWithFeedback
{
public Audio.Output Output { get; private set; }
public IntFeedback VolumeLevelFeedback { get; private set; }
public BoolFeedback MuteFeedback { get; private set; }
ushort PreMuteVolumeLevel;
bool IsMuted;
public DmCardAudioOutputController(Audio.Output output)
{
Output = output;
VolumeLevelFeedback = new IntFeedback(() => Output.VolumeFeedback.UShortValue);
MuteFeedback = new BoolFeedback(() => IsMuted);
}
#region IBasicVolumeWithFeedback Members
/// <summary>
///
/// </summary>
public void MuteOff()
{
SetVolume(PreMuteVolumeLevel);
IsMuted = false;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void MuteOn()
{
PreMuteVolumeLevel = Output.VolumeFeedback.UShortValue;
SetVolume(0);
IsMuted = true;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void SetVolume(ushort level)
{
Debug.Console(2, "Set volume out {0}", level);
Output.Volume.UShortValue = level;
}
/// <summary>
///
/// </summary>
internal void VolumeEventFromChassis()
{
VolumeLevelFeedback.FireUpdate();
}
#endregion
#region IBasicVolumeControls Members
/// <summary>
///
/// </summary>
public void MuteToggle()
{
if (IsMuted)
MuteOff();
else
MuteOn();
}
/// <summary>
///
/// </summary>
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
{
var remainingRatio = Output.Volume.UShortValue / 65535;
Output.Volume.CreateRamp(0, (uint)(400 * remainingRatio));
}
else
Output.Volume.StopRamp();
}
/// <summary>
///
/// </summary>
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
{
var remainingRatio = (65535 - Output.Volume.UShortValue) / 65535;
Output.Volume.CreateRamp(65535, 400);
}
else
Output.Volume.StopRamp();
}
#endregion
}
}

View File

@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM;
using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.DM
{
public class DmCardAudioOutputController : IBasicVolumeWithFeedback
{
public Audio.Output Output { get; private set; }
public IntFeedback VolumeLevelFeedback { get; private set; }
public BoolFeedback MuteFeedback { get; private set; }
ushort PreMuteVolumeLevel;
bool IsMuted;
public DmCardAudioOutputController(Audio.Output output)
{
Output = output;
VolumeLevelFeedback = new IntFeedback(() => Output.VolumeFeedback.UShortValue);
MuteFeedback = new BoolFeedback(() => IsMuted);
}
#region IBasicVolumeWithFeedback Members
/// <summary>
///
/// </summary>
public void MuteOff()
{
SetVolume(PreMuteVolumeLevel);
IsMuted = false;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void MuteOn()
{
PreMuteVolumeLevel = Output.VolumeFeedback.UShortValue;
SetVolume(0);
IsMuted = true;
MuteFeedback.FireUpdate();
}
/// <summary>
///
/// </summary>
public void SetVolume(ushort level)
{
Debug.Console(2, "Set volume out {0}", level);
Output.Volume.UShortValue = level;
}
/// <summary>
///
/// </summary>
internal void VolumeEventFromChassis()
{
VolumeLevelFeedback.FireUpdate();
}
#endregion
#region IBasicVolumeControls Members
/// <summary>
///
/// </summary>
public void MuteToggle()
{
if (IsMuted)
MuteOff();
else
MuteOn();
}
/// <summary>
///
/// </summary>
public void VolumeDown(bool pressRelease)
{
if (pressRelease)
Output.Volume.CreateRamp(0, 400);
else
Output.Volume.StopRamp();
}
/// <summary>
///
/// </summary>
public void VolumeUp(bool pressRelease)
{
if (pressRelease)
Output.Volume.CreateRamp(65535, 400);
else
Output.Volume.StopRamp();
}
#endregion
}
}

View File

@@ -0,0 +1,127 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DM;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM.Chassis
{
public class HdMdNxM4kEController : Device, IRoutingInputsOutputs, IRouting
{
public HdMdNxM Chassis { get; private set; }
public RoutingPortCollection<RoutingInputPort> InputPorts { get; private set; }
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; private set; }
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="name"></param>
/// <param name="chassis"></param>
public HdMdNxM4kEController(string key, string name, HdMdNxM chassis,
HdMdNxM4kEPropertiesConfig props)
: base(key, name)
{
Chassis = chassis;
// logical ports
InputPorts = new RoutingPortCollection<RoutingInputPort>();
for (uint i = 1; i <= 4; i++)
{
InputPorts.Add(new RoutingInputPort("hdmiIn" + i, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, i, this));
}
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
OutputPorts.Add(new RoutingOutputPort(DmPortName.HdmiOut, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, null, this));
// physical settings
if (props != null && props.Inputs != null)
{
foreach (var kvp in props.Inputs)
{
// strip "hdmiIn"
var inputNum = Convert.ToUInt32(kvp.Key.Substring(6));
var port = chassis.HdmiInputs[inputNum].HdmiInputPort;
// set hdcp disables
if (kvp.Value.DisableHdcp)
{
Debug.Console(0, this, "Configuration disables HDCP support on {0}", kvp.Key);
port.HdcpSupportOff();
}
else
port.HdcpSupportOn();
}
}
}
public override bool CustomActivate()
{
var result = Chassis.Register();
if (result != Crestron.SimplSharpPro.eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(0, this, "Device registration failed: {0}", result);
return false;
}
return base.CustomActivate();
}
#region IRouting Members
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{
// Try to make switch only when necessary. The unit appears to toggle when already selected.
var current = Chassis.HdmiOutputs[1].VideoOut;
if(current != Chassis.HdmiInputs[(uint)inputSelector])
Chassis.HdmiOutputs[1].VideoOut = Chassis.HdmiInputs[(uint)inputSelector];
}
#endregion
/////////////////////////////////////////////////////
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="name"></param>
/// <param name="type"></param>
/// <param name="properties"></param>
/// <returns></returns>
public static HdMdNxM4kEController GetController(string key, string name,
string type, HdMdNxM4kEPropertiesConfig properties)
{
try
{
var ipid = properties.Control.IpIdInt;
var address = properties.Control.TcpSshProperties.Address;
type = type.ToLower();
if (type == "hdmd4x14ke")
{
var chassis = new HdMd4x14kE(ipid, address, Global.ControlSystem);
return new HdMdNxM4kEController(key, name, chassis, properties);
}
return null;
}
catch (Exception e)
{
Debug.Console(0, "ERROR Creating device key {0}: \r{1}", key, e);
return null;
}
}
}
}

View File

@@ -47,6 +47,13 @@ namespace PepperDash.Essentials.DM
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);
}
return null;
}

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Newtonsoft.Json;
using PepperDash.Core;
namespace PepperDash.Essentials.DM.Config
{
/// <summary>
/// Defines the properties section of HdMdNxM boxes
/// </summary>
public class HdMdNxM4kEPropertiesConfig
{
[JsonProperty("control")]
public ControlPropertiesConfig Control { get; set; }
[JsonProperty("inputs")]
public Dictionary<string, InputPropertiesConfig> Inputs { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.DM.Config
{
public class InputPropertiesConfig
{
public string Name { get; set; }
public bool DisableHdcp { get; set; }
}
}

View File

@@ -55,14 +55,10 @@
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
</Reference>
<Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.0.15153, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="PepperDash_Core, Version=1.0.4.20530, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\PepperDash.Core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.dll</HintPath>
</Reference>
<Reference Include="PepperDash_Essentials_Core, Version=1.0.0.14500, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Essentials Core\PepperDashEssentialsBase\bin\PepperDash_Essentials_Core.dll</HintPath>
</Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
@@ -95,9 +91,12 @@
<Compile Include="Cards REMOVE\DmInputCardBase.cs" />
<Compile Include="Chassis\DmCardAudioOutput.cs" />
<Compile Include="Chassis\DmChassisController.cs" />
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
<Compile Include="Config\DmRmcConfig.cs" />
<Compile Include="Config\DmTxConfig.cs" />
<Compile Include="Config\DMChassisConfig.cs" />
<Compile Include="Config\HdMdNxM4kEPropertiesConfig.cs" />
<Compile Include="Config\InputPropertiesConfig.cs" />
<Compile Include="DmPortName.cs" />
<Compile Include="Endpoints\Receivers\DmRmc4KScalerCController.cs" />
<Compile Include="Endpoints\Receivers\DmRmcScalerCController.cs" />
@@ -115,6 +114,12 @@
<Compile Include="VideoStatusHelpers.cs" />
<None Include="Properties\ControlSystem.cfg" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj">
<Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project>
<Name>PepperDash_Essentials_Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>

View File

@@ -4,5 +4,4 @@
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Essentials_DM")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyVersion("1.0.0.*")]
[assembly: AssemblyVersion("1.0.3.*")]

View File

@@ -0,0 +1,740 @@
<?xml version="1.0" encoding="utf-8"?>
<ClassDiagram MajorVersion="1" MinorVersion="1">
<Class Name="PepperDash.Essentials.Devices.Common.GenericAudioOut" Collapsed="true">
<Position X="0.5" Y="7.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAA=</HashCode>
<FileName>Audio\GenericAudioOut.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.GenericAudioOutWithVolume" Collapsed="true">
<Position X="0.5" Y="9" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAgAAAAQA=</HashCode>
<FileName>Audio\GenericAudioOut.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.CenRfgwController" Collapsed="true">
<Position X="19" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAIIAAAAAAACABAAAAAAAAAAAA=</HashCode>
<FileName>Crestron\Gateways\CenRfgwController.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.IRBlurayBase" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="17.25" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>gUyjAAoIAAAAxgYAABAAgAECABAoAEAQqcCAQHIABAI=</HashCode>
<FileName>DiscPlayer\IRDiscPlayerBase.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DeviceFactory" Collapsed="true">
<Position X="15.5" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAA=</HashCode>
<FileName>Factory\DeviceFactory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.GenericSource" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="12" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAgAAAAAAAACAAAAAAAAAAAAAAAgAAAAAAAAAAIAAAA=</HashCode>
<FileName>Generic\GenericSource.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.InRoomPc" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="15.5" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAwAAAAAAAACAAAAAAACAAAAAQAgAAAAAAAAAAIAAAA=</HashCode>
<FileName>PC\InRoomPc.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Laptop" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="22.5" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAwAAAAAAAACAAAAAAACAAAAAQAgAAAAAAAAAAIAAAA=</HashCode>
<FileName>PC\Laptop.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.IRSetTopBoxBase" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="19" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AUgjCAqAEAASwgYAACAAoAECABAoAEAwrcCAQHKABAI=</HashCode>
<FileName>SetTopBox\IRSetTopBoxBase.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.SetTopBoxPropertiesConfig" Collapsed="true">
<Position X="13.75" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAEEAAQAAAAAAAAIAAAAAAAAAAAAAAAAACAAAA=</HashCode>
<FileName>SetTopBox\SetTopBoxPropertiesConfig.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.AppleTV" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="10.25" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAggAAIAAAAARAAAAAAAgAACABAoAEAQqACAQAAABAI=</HashCode>
<FileName>Streaming\AppleTV.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Roku2" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="10.25" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAggAAIAAAAABAAAAAAAgAACABAoAEAQqACAQAAABAI=</HashCode>
<FileName>Streaming\Roku.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecActiveCallItem" Collapsed="true">
<Position X="19" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAACAAAEAAAAAAAAAOAAAAQAAAAAAAAAAQAAAAAAAAA=</HashCode>
<FileName>Codec\CodecActiveCallItem.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecCallStatusItemChangeEventArgs" Collapsed="true">
<Position X="15.5" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\CodecActiveCallItem.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecCallDirection" Collapsed="true">
<Position X="20.75" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAA=</HashCode>
<FileName>Codec\eCodecCallDirection.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecCallStatus" Collapsed="true">
<Position X="13.75" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAA=</HashCode>
<FileName>Codec\eCodecCallStatus.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecCallType" Collapsed="true">
<Position X="17.25" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAA=</HashCode>
<FileName>Codec\eCodecCallType.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecCallPrivacy" Collapsed="true">
<Position X="12" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAA=</HashCode>
<FileName>Codec\eMeetingPrivacy.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.VideoCodecInfo" Collapsed="true">
<Position X="5.5" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>gIAAAAAAAAAAAACCAACAAAAAAAAAAAACAAAAAABAAAA=</HashCode>
<FileName>Codec\iCodecInfo.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecCallFavorites" Collapsed="true">
<Position X="22.5" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAA=</HashCode>
<FileName>Codec\iHasCallFavorites.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecCallHistory" Collapsed="true">
<Position X="10.25" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAQAAAAAgAAAAAAAAAAAAAAGAAAABAAAAAAACQ=</HashCode>
<FileName>Codec\iHasCallHistory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.DirectoryEventArgs" Collapsed="true">
<Position X="17.25" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecDirectory" Collapsed="true">
<Position X="20.75" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAIAAAAAAAAAAAABAAAAAIAAIAAQAAAAAA=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.DirectoryItem" Collapsed="true">
<Position X="6.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.DirectoryFolder" Collapsed="true">
<Position X="5.5" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAIAAAAAAAAA=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.DirectoryContact" Collapsed="true">
<Position X="7.75" Y="1.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAgAAAAAAAEAAAAAAAAAAAAAAAAEIAAAAAAAAAAA=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.ContactMethod" Collapsed="true">
<Position X="13.75" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAIAAAAAAAgAAAEAAAAAAAAAIAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.DirectorySearchResultEventArgs" Collapsed="true">
<Position X="19" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CodecScheduleAwareness" Collapsed="true">
<Position X="10.25" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAABAAAAAEAAAAAAAgAAEAAAABAAAAAAAIQAAAAA=</HashCode>
<FileName>Codec\iHasScheduleAwareness.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.Meeting" Collapsed="true">
<Position X="13.75" Y="5.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAACAAAAAAACEEgAAAAAAAgQIAAoAQABAAQAAEgAAAA=</HashCode>
<FileName>Codec\iHasScheduleAwareness.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.Call" Collapsed="true">
<Position X="17.25" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAEAAAABAAAAIAAAAAAAAAAgAAAA=</HashCode>
<FileName>Codec\iHasScheduleAwareness.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.MeetingEventArgs" Collapsed="true">
<Position X="15.5" Y="5.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAQAAAAA=</HashCode>
<FileName>Codec\iHasScheduleAwareness.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.CiscoSparkCodecPropertiesConfig" Collapsed="true">
<Position X="17.25" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAQAAAAAAAAAAAAAAAAAIQAAACAABAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\CiscoSparkCodecPropertiesConfig.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Codec.SharingProperties" Collapsed="true">
<Position X="15.5" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\CiscoSparkCodecPropertiesConfig.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Displays.AvocorDisplay" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="12" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>hC4gIEAIUAABoQAEgBACAAAdBC1gmsGRICKGdQNBACw=</HashCode>
<FileName>Display\AvocorVTFDisplay.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Displays.ComTcpDisplayBase" Collapsed="true">
<Position X="6.5" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAEQAAAAA=</HashCode>
<FileName>Display\ComTcpDisplayBase.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory" Collapsed="true">
<Position X="20.75" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAA=</HashCode>
<FileName>Display\DeviceFactory.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Displays.NecPaSeriesProjector" Collapsed="true">
<Position X="6.5" Y="8" Width="1.5" />
<TypeIdentifier>
<HashCode>ogSIAAKIAAALCAAEABAQEAgABAAAAMIAAAAAEABAACA=</HashCode>
<FileName>Display\NecPaSeriesProjector.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Displays.NecPSXMDisplay" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="22.5" Y="5.5" Width="1.5" />
<TypeIdentifier>
<HashCode>hLQgIShIAABFQQRUAvICDRMQESwSEQKRKACCZQNAESY=</HashCode>
<FileName>Display\NECPSXMDisplay.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Displays.SamsungMDC" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="12" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>hKwwIEAIQAABoUAGgBACAAAEBGxAmYORKCCGZQJAACw=</HashCode>
<FileName>Display\SamsungMDCDisplay.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.BiampTesiraForteDsp" Collapsed="true">
<Position X="3.5" Y="8" Width="1.5" />
<TypeIdentifier>
<HashCode>gACAAIAAAAEAQYCigAAAAAAQAACgCAAAAAAAAAMAAAI=</HashCode>
<FileName>DSP\BiampTesira\BiampTesiraForteDsp.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.TesiraForteLevelControl" Collapsed="true">
<Position X="0.5" Y="6.25" Width="1.5" />
<TypeIdentifier>
<HashCode>RAAgJACAAAAAAYAAAkIAAAAAIAQCEACJABACRAAAAUQ=</HashCode>
<FileName>DSP\BiampTesira\BiampTesiraForteDspLevel.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.BiampTesiraFortePropertiesConfig" Collapsed="true">
<Position X="15.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAAAAAEAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAA=</HashCode>
<FileName>DSP\BiampTesira\BiampTesiraFortePropertiesConfig.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.BiampTesiraForteLevelControlBlockConfig" Collapsed="true">
<Position X="13.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAEAAAAIAAAAAAAAAAAAAAAAAIAAEAAAAAAEQ=</HashCode>
<FileName>DSP\BiampTesira\BiampTesiraFortePropertiesConfig.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.TesiraForteControlPoint" Collapsed="true">
<Position X="0.5" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAIAAAAACAAQQAAAAAQAAAAAAAIAAAABEAAAAAAEA=</HashCode>
<FileName>DSP\BiampTesira\TesiraForteControlPoint.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.DspBase" Collapsed="true">
<Position X="3.5" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAEAIAgAAAAAAIAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>DSP\DspBase.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.DspControlPoint" Collapsed="true">
<Position X="1.75" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>DSP\DspBase.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.DspMuteControl" Collapsed="true">
<Position X="2.75" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAQAAAAAQ=</HashCode>
<FileName>DSP\DspBase.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.DSP.SoundStructureBasics" Collapsed="true">
<Position X="17.25" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAA=</HashCode>
<FileName>DSP\PolycomSoundStructure\SoundStructureBasics.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="10.25" Y="5.5" Width="1.5" />
<TypeIdentifier>
<HashCode>gACAEBAAAoAABQBAASAAAAAAAAEgAAACAAACAAMAQAI=</HashCode>
<FileName>Environment\Lutron\LutronQuantum.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumPropertiesConfig" Collapsed="true">
<Position X="12" Y="5.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAEAAAAAAAAgQAAAAAAAAAAAAQCAAACAAAAAAA=</HashCode>
<FileName>Environment\Lutron\LutronQuantum.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyController" Collapsed="true">
<Position X="17.25" Y="5.5" Width="1.5" />
<TypeIdentifier>
<HashCode>gQAABAAAAxAAIACAgAgAgCBAUQAAQAgCIAEQAACBAAA=</HashCode>
<FileName>Microphone\MicrophonePrivacyController.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Microphones.MicrophonePrivacyControllerConfig" Collapsed="true">
<Position X="19" Y="5.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAIAAAAAAAAAA=</HashCode>
<FileName>Microphone\MicrophonePrivacyControllerConfig.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Microphones.KeyedDevice" Collapsed="true">
<Position X="20.75" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Microphone\MicrophonePrivacyControllerConfig.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Occupancy.EssentialsGlsOccupancySensorBaseController" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="22.5" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAIAAAAAAAABAABgAAAAAASEABAAAAAAAAA=</HashCode>
<FileName>Occupancy\EssentialsGlsOccupancySensorBaseController.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.Occupancy.EssentialsOccupancyAggregator" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="10.25" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAACBAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Occupancy\EssentialsOccupancyAggregator.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodecBookings" Collapsed="true">
<Position X="22.5" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAg=</HashCode>
<FileName>VideoCodec\CiscoCodec\BookingsDataClasses.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCallHistory" Collapsed="true">
<Position X="20.75" Y="0.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\CallHistoryDataClasses.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodecPhonebook" Collapsed="true">
<Position X="13.75" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>EAAAABAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\PhonebookDataClasses.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.MockVC" Collapsed="true">
<Position X="0.5" Y="2" Width="1.5" />
<TypeIdentifier>
<HashCode>BgYAIAACAQaKBACAAwAAUSQAAWYCEACDAAiAQBBCgQU=</HashCode>
<FileName>VideoCodec\MockVC\MockVC.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.MockCodecInfo" Collapsed="true">
<Position X="5.5" Y="4.75" Width="1.5" />
<TypeIdentifier>
<HashCode>gKAAAAAAAAAAAACCAACAAAAAAAAAAAACAAAAAABBAAA=</HashCode>
<FileName>VideoCodec\MockVC\MockVC.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.MockVcPropertiesConfig" Collapsed="true">
<Position X="20.75" Y="5.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAA=</HashCode>
<FileName>VideoCodec\MockVC\MockVcPropertiesConfig.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.VideoCodecBase" Collapsed="true">
<Position X="1.75" Y="2" Width="1.5" />
<TypeIdentifier>
<HashCode>BiwgAAECAASAAECAgQEDIABAAAYiEBCpCEigQBZCAQU=</HashCode>
<FileName>VideoCodec\VideoCodecBase.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.CodecPhonebookSyncState" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="22.5" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>EAiCAAQAAgEAAQQAEAAAAAAAAAEAAAAAAACAAAAAAAM=</HashCode>
<FileName>VideoCodec\VideoCodecBase.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoSparkCodec" Collapsed="true">
<Position X="2.75" Y="2" Width="1.5" />
<TypeIdentifier>
<HashCode>jhQEtAJaASb7kSCwAwtxECSABsf2n1GBJEmAVJFKWTc=</HashCode>
<FileName>VideoCodec\CiscoCodec\CiscoSparkCodec.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CodecCommandWithLabel" Collapsed="true">
<Position X="19" Y="2.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAEAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\CiscoSparkCodec.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CodecSyncState" Collapsed="true" BaseTypeListCollapsed="true">
<Position X="12" Y="3.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AIAAAAQACAEAAAQAEAAAAAAAAAAgAAAAAAAACAACACE=</HashCode>
<FileName>VideoCodec\CiscoCodec\CiscoSparkCodec.cs</FileName>
</TypeIdentifier>
<Lollipop Position="0.2" Collapsed="true" />
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.HttpApiServer" Collapsed="true">
<Position X="13.75" Y="4.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAQAAAACAAAAABAAAAAAAIAIAAAAAAAQAAgAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\HttpApiServer.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodecConfiguration" Collapsed="true">
<Position X="10.25" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\xConfiguration.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodecEvents" Collapsed="true">
<Position X="12" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\xEvent.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.CiscoCodecStatus" Collapsed="true">
<Position X="15.5" Y="1.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\xStatus.cs</FileName>
</TypeIdentifier>
</Class>
<Class Name="PepperDash.Essentials.Devices.Common.VideoCodec.CiscoCodec.xStatusSparkPlus" Collapsed="true">
<Position X="19" Y="6.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\xStatusSparkPlus.cs</FileName>
</TypeIdentifier>
</Class>
<Interface Name="PepperDash.Essentials.Devices.Common.Codec.ICodecAudio" Collapsed="true">
<Position X="10.25" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iCodecAudio.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.Codec.iCodecInfo" Collapsed="true">
<Position X="12" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iCodecInfo.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.Codec.IHasCallFavorites" Collapsed="true">
<Position X="15.5" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iHasCallFavorites.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.Codec.IHasCallHistory" Collapsed="true">
<Position X="17.25" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAQAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iHasCallHistory.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.Codec.IHasContentSharing" Collapsed="true">
<Position X="22.5" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAACAAAAAAAAAAAAAAAAAAAAAAAIAEAgABAAAAA=</HashCode>
<FileName>Codec\iHasContentSharing.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.Codec.IHasDialer" Collapsed="true">
<Position X="10.25" Y="8.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAgAAAACAAAAAACAAAAAAAAAAAICAAAAAAAAAAQCAAA=</HashCode>
<FileName>Codec\iHasDialer.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.Codec.IHasDirectory" Collapsed="true">
<Position X="12" Y="8.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAgAAAAAAAAAAAAgCAAAAABAAAEAAAAAA=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.Codec.IHasScheduleAwareness" Collapsed="true">
<Position X="13.75" Y="8.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Codec\iHasScheduleAwareness.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Displays.IInputHdmi1" Collapsed="true">
<Position X="19" Y="8.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAA=</HashCode>
<FileName>Display\InputInterfaces.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Displays.IInputHdmi2" Collapsed="true">
<Position X="20.75" Y="8.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAA=</HashCode>
<FileName>Display\InputInterfaces.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Displays.IInputHdmi3" Collapsed="true">
<Position X="22.5" Y="8.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAA=</HashCode>
<FileName>Display\InputInterfaces.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Displays.IInputHdmi4" Collapsed="true">
<Position X="10.25" Y="9.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAA=</HashCode>
<FileName>Display\InputInterfaces.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Displays.IInputDisplayPort1" Collapsed="true">
<Position X="15.5" Y="8.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAA=</HashCode>
<FileName>Display\InputInterfaces.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Displays.IInputDisplayPort2" Collapsed="true">
<Position X="17.25" Y="8.5" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAA=</HashCode>
<FileName>Display\InputInterfaces.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Displays.IInputVga1" Collapsed="true">
<Position X="12" Y="9.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Display\InputInterfaces.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.DSP.IDspLevelControl" Collapsed="true">
<Position X="13.75" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>QAAAAACAAAAAAAAAAAAAAAAAAAAAAAAIAAEAAAAAAAQ=</HashCode>
<FileName>DSP\DspBase.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.Occupancy.IOccupancyStatusProvider" Collapsed="true">
<Position X="13.75" Y="9.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Occupancy\iOccupancyStatusProvider.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.VideoCodec.IHasCodecLayouts" Collapsed="true">
<Position X="19" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAgAAAAAAAAAAAAAAAEEgAAAAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\Interfaces\IHasCodecLayouts.cs</FileName>
</TypeIdentifier>
</Interface>
<Interface Name="PepperDash.Essentials.Devices.Common.VideoCodec.IHasCodecSelfview" Collapsed="true">
<Position X="20.75" Y="7.75" Width="1.5" />
<TypeIdentifier>
<HashCode>ABAAEAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAABAAAAI=</HashCode>
<FileName>VideoCodec\Interfaces\IHasCodecSelfview.cs</FileName>
</TypeIdentifier>
</Interface>
<Enum Name="PepperDash.Essentials.Devices.Common.eExGatewayType" Collapsed="true">
<Position X="10.25" Y="11" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAgAAAAAAAAAAAAAIAAAEAAAAAAAAAAAAAAAAA=</HashCode>
<FileName>Crestron\Gateways\CenRfgwController.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Codec.eCodecCallDirection" Collapsed="true">
<Position X="12" Y="10.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAAAAgQAAAAAAAAAAAABA=</HashCode>
<FileName>Codec\eCodecCallDirection.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Codec.eCodecCallStatus" Collapsed="true">
<Position X="13.75" Y="10.25" Width="1.5" />
<TypeIdentifier>
<HashCode>CAgAAABAAAAAQAACAAABAAAAAAAAAAABCAAAAiAAQBA=</HashCode>
<FileName>Codec\eCodecCallStatus.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Codec.eCodecCallType" Collapsed="true">
<Position X="15.5" Y="10.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAoBg=</HashCode>
<FileName>Codec\eCodecCallType.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Codec.eMeetingPrivacy" Collapsed="true">
<Position X="13.75" Y="11" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAQBA=</HashCode>
<FileName>Codec\eMeetingPrivacy.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Codec.eCodecOccurrenceType" Collapsed="true">
<Position X="17.25" Y="10.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAABAAAAAIAAAAAAAAAAAAAAAAAAAEAAAAAAABA=</HashCode>
<FileName>Codec\iHasCallHistory.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Codec.eContactMethodDevice" Collapsed="true">
<Position X="22.5" Y="10.25" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAIAAAAAAABg=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Codec.eContactMethodCallType" Collapsed="true">
<Position X="20.75" Y="10.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAABg=</HashCode>
<FileName>Codec\iHasDirectory.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Codec.eMeetingEventChangeType" Collapsed="true">
<Position X="12" Y="11" Width="1.5" />
<TypeIdentifier>
<HashCode>BAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAIACg=</HashCode>
<FileName>Codec\iHasScheduleAwareness.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.Environment.Lutron.eAction" Collapsed="true">
<Position X="10.25" Y="10.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AACAACAAABAAgIAAgAAQAAAAAAAAIAAAIAAAACAEAAg=</HashCode>
<FileName>Environment\Lutron\LutronQuantum.cs</FileName>
</TypeIdentifier>
</Enum>
<Enum Name="PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eCommandType" Collapsed="true">
<Position X="19" Y="10.25" Width="1.5" />
<TypeIdentifier>
<HashCode>AAAAAAAAAAAACAQAAAAABAAEAAAAAAAAgAAAAAAAAAA=</HashCode>
<FileName>VideoCodec\CiscoCodec\CiscoSparkCodec.cs</FileName>
</TypeIdentifier>
</Enum>
<Font Name="Segoe UI" Size="9" />
</ClassDiagram>

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public class CodecActiveCallItem
{
public string Name { get; set; }
public string Number { get; set; }
public eCodecCallType Type { get; set; }
public eCodecCallStatus Status { get; set; }
public eCodecCallDirection Direction { get; set; }
public string Id { get; set; }
//public object CallMetaData { get; set; }
/// <summary>
/// Returns true when this call is any status other than
/// Unknown, Disconnected, Disconnecting
/// </summary>
public bool IsActiveCall
{
get
{
return !(Status == eCodecCallStatus.Disconnected
|| Status == eCodecCallStatus.Disconnecting
|| Status == eCodecCallStatus.Idle
|| Status == eCodecCallStatus.Unknown);
}
}
}
/// <summary>
///
/// </summary>
public class CodecCallStatusItemChangeEventArgs : EventArgs
{
public CodecActiveCallItem CallItem { get; private set; }
public CodecCallStatusItemChangeEventArgs(CodecActiveCallItem item)
{
CallItem = item;
}
}
}

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public class CodecActiveCallItem
{
public string Name { get; set; }
public string Number { get; set; }
<<<<<<< HEAD:Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs
public eCodecCallType Type { get; set; }
public eCodecCallStatus Status { get; set; }
public string Id { get; set; }
=======
public eCodecCallType Type { get; set; }
public eCodecCallStatus Status { get; set; }
public string Id { get; set; }
public object CallMetaData { get; set; }
>>>>>>> origin/feature/cisco-spark-2:Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs
}
public enum eCodecCallType
{
Unknown = 0, Audio, Video
<<<<<<< HEAD:Essentials Devices Common/Essentials Devices Common/Codec/CodecActiveCallItem.cs
}
public enum eCodecCallStatus
{
Unknown = 0, Dialing, Connected, Incoming, OnHold, Disconnected
=======
}
public enum eCodecCallStatus
{
Unknown = 0, Dialing, Connected, Incoming, OnHold, Disconnected
>>>>>>> origin/feature/cisco-spark-2:Essentials Devices Common/Essentials Devices Common/VideoCodec/CodecActiveCallItem.cs
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public enum eCodecCallDirection
{
Unknown = 0, Incoming, Outgoing
}
public class CodecCallDirection
{
/// <summary>
/// Takes the Cisco call type and converts to the matching enum
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static eCodecCallDirection ConvertToDirectionEnum(string s)
{
switch (s.ToLower())
{
case "incoming":
{
return eCodecCallDirection.Incoming;
}
case "outgoing":
{
return eCodecCallDirection.Outgoing;
}
default:
return eCodecCallDirection.Unknown;
}
}
}
}

View File

@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public enum eCodecCallStatus
{
Unknown = 0,
Connected,
Connecting,
Dialing,
Disconnected,
Disconnecting,
EarlyMedia,
Idle,
OnHold,
Ringing,
Preserved,
RemotePreserved,
}
public class CodecCallStatus
{
/// <summary>
/// Takes the Cisco call type and converts to the matching enum
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static eCodecCallStatus ConvertToStatusEnum(string s)
{
switch (s)
{
case "Connected":
{
return eCodecCallStatus.Connected;
}
case "Connecting":
{
return eCodecCallStatus.Connecting;
}
case "Dialling":
{
return eCodecCallStatus.Dialing;
}
case "Disconnected":
{
return eCodecCallStatus.Disconnected;
}
case "Disconnecting":
{
return eCodecCallStatus.Disconnecting;
}
case "EarlyMedia":
{
return eCodecCallStatus.EarlyMedia;
}
case "Idle":
{
return eCodecCallStatus.Idle;
}
case "OnHold":
{
return eCodecCallStatus.OnHold;
}
case "Ringing":
{
return eCodecCallStatus.Ringing;
}
case "Preserved":
{
return eCodecCallStatus.Preserved;
}
case "RemotePreserved":
{
return eCodecCallStatus.RemotePreserved;
}
default:
return eCodecCallStatus.Unknown;
}
}
}
}

View File

@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public enum eCodecCallType
{
Unknown = 0,
Audio,
Video,
AudioCanEscalate,
ForwardAllCall
}
public class CodecCallType
{
/// <summary>
/// Takes the Cisco call type and converts to the matching enum
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static eCodecCallType ConvertToTypeEnum(string s)
{
switch (s)
{
case "Audio":
{
return eCodecCallType.Audio;
}
case "Video":
{
return eCodecCallType.Video;
}
case "AudioCanEscalate":
{
return eCodecCallType.AudioCanEscalate;
}
case "ForwardAllCall":
{
return eCodecCallType.ForwardAllCall;
}
default:
return eCodecCallType.Unknown;
}
}
}
}

View File

@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
public enum eMeetingPrivacy
{
Unknown = 0,
Public,
Private
}
public class CodecCallPrivacy
{
/// <summary>
/// Takes the Cisco privacy type and converts to the matching enum
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static eMeetingPrivacy ConvertToDirectionEnum(string s)
{
switch (s.ToLower())
{
case "public":
{
return eMeetingPrivacy.Public;
}
case "private":
{
return eMeetingPrivacy.Private;
}
default:
return eMeetingPrivacy.Unknown;
}
}
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials.Devices.Common.Codec
{
/// <summary>
/// Defines minimum volume controls for a codec device with dialing capabilities
/// </summary>
public interface ICodecAudio : IBasicVolumeWithFeedback, IPrivacy
{
}
}

View File

@@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Devices.Common.Codec
{
/// <summary>
/// Implements a common set of data about a codec
/// </summary>
public interface iCodecInfo
{
VideoCodecInfo CodecInfo { get; }
}
/// <summary>
/// Stores general information about a codec
/// </summary>
public abstract class VideoCodecInfo
{
public abstract bool MultiSiteOptionIsEnabled { get; }
public abstract string IpAddress { get; }
public abstract string SipPhoneNumber { get; }
public abstract string E164Alias { get; }
public abstract string H323Id { get; }
public abstract string SipUri { get; }
public abstract bool AutoAnswerEnabled { get; }
}
}

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