Compare commits
74 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd15b4e93b | ||
|
|
92b6e8a752 | ||
|
|
d905b2c25b | ||
|
|
943ae2115b | ||
|
|
7be1c6df44 | ||
|
|
bea94ceaf0 | ||
|
|
9b6b661c18 | ||
|
|
cdab417de8 | ||
|
|
d80602d3c6 | ||
|
|
a1e9d35a69 | ||
|
|
fd84e44a85 | ||
|
|
4be32cb909 | ||
|
|
b48b9ad9cf | ||
|
|
b7f97dc146 | ||
|
|
c8eb4923e6 | ||
|
|
ddeb41832f | ||
|
|
c62508b8ae | ||
|
|
e894e2d1b4 | ||
|
|
3e16cbb092 | ||
|
|
73ab16ce55 | ||
|
|
f74d2241a0 | ||
|
|
65b95006be | ||
|
|
c871f5e6c8 | ||
|
|
66b08b6be0 | ||
|
|
0228d2938d | ||
|
|
d2fc4d2175 | ||
|
|
5f4793ed0c | ||
|
|
f33f42a40e | ||
|
|
86dcd066fe | ||
|
|
c420e06540 | ||
|
|
00e14b746b | ||
|
|
ee26e77f15 | ||
|
|
8a09ffa7e4 | ||
|
|
4d300a9b68 | ||
|
|
dc9eee9325 | ||
|
|
f5586d2c9d | ||
|
|
b5a7c76c3f | ||
|
|
4f35a4285b | ||
|
|
28d5daab5b | ||
|
|
1a80bcf5c2 | ||
|
|
e5d745f508 | ||
|
|
a799973e52 | ||
|
|
6a9a793bc5 | ||
|
|
7835ed12bb | ||
|
|
f1278d0ee4 | ||
|
|
56fae89ae2 | ||
|
|
9a2c001a93 | ||
|
|
48cc8ec33f | ||
|
|
7e406dd987 | ||
|
|
1fdad20abd | ||
|
|
704bcc974b | ||
|
|
f3e460677d | ||
|
|
f52ee9ab5d | ||
|
|
2822952491 | ||
|
|
0d47cce442 | ||
|
|
615dde41c2 | ||
|
|
ee2a619aa5 | ||
|
|
af5699a0b0 | ||
|
|
a0db8532b6 | ||
|
|
d1fb97ec7a | ||
|
|
d18f79ac48 | ||
|
|
2072f0bff8 | ||
|
|
f479418492 | ||
|
|
07bc288fd0 | ||
|
|
d2b8d38000 | ||
|
|
48da139b2f | ||
|
|
32a548b8fb | ||
|
|
0724ec06eb | ||
|
|
df6bd2a21f | ||
|
|
8d3b409ec3 | ||
|
|
9eb48acd6a | ||
|
|
4361fe6186 | ||
|
|
09bc84346d | ||
|
|
8f530aa7fe |
34
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: "[BUG]-"
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Stacktrace**
|
||||
|
||||
Include a stack trace of the exception if possible.
|
||||
```
|
||||
Paste stack trace here
|
||||
```
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: "[FEATURE]-"
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
If this is a request for support for a new device or type, be as specific as possible and include any pertinent manufacturer and model information.
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
||||
[submodule "essentials-framework/pepperdashcore-builds"]
|
||||
path = essentials-framework/pepperdashcore-builds
|
||||
url = https://bitbucket.org/Pepperdash_Products/pepperdashcore-builds.git
|
||||
url = https://github.com/ndorin/PepperDashCore-Builds.git
|
||||
|
||||
110
CONTRIBUTING.md
Normal file
@@ -0,0 +1,110 @@
|
||||
# Contributors Guide
|
||||
|
||||
Essentials is an open source project. If you are interested in making it better,
|
||||
there are many ways you can contribute. For example, you can:
|
||||
|
||||
- Submit a bug report
|
||||
- Suggest a new feature
|
||||
- Provide feedback by commenting on feature requests/proposals
|
||||
- Propose a patch by submitting a pull request
|
||||
- Suggest or submit documentation improvements
|
||||
- Review outstanding pull requests
|
||||
- Answer questions from other users
|
||||
- Share the software with other users who are interested
|
||||
- Teach others to use the software
|
||||
|
||||
## Bugs and Feature Requests
|
||||
|
||||
If you believe that you have found a bug or wish to propose a new feature,
|
||||
please first search the existing [issues] to see if it has already been
|
||||
reported. If you are unable to find an existing issue, consider using one of
|
||||
the provided templates to create a new issue and provide as many details as you
|
||||
can to assist in reproducing the bug or explaining your proposed feature.
|
||||
|
||||
## Patch Submission tips
|
||||
|
||||
Patches should be submitted in the form of Pull Requests to the Essentials
|
||||
[repository] on GitHub. But first, consider the following tips to ensure a
|
||||
smooth process when submitting a patch:
|
||||
|
||||
- Ensure that the patch compiles and does not break any build-time tests.
|
||||
- Be understanding, patient, and friendly; developers may need time to review
|
||||
your submissions before they can take action or respond. This does not mean
|
||||
your contribution is not valued. If your contribution has not received a
|
||||
response in a reasonable time, consider commenting with a polite inquiry for
|
||||
an update.
|
||||
- Limit your patches to the smallest reasonable change to achieve your intended
|
||||
goal. For example, do not make unnecessary indentation changes; but don't go
|
||||
out of your way to make the patch so minimal that it isn't easy to read,
|
||||
either. Consider the reviewer's perspective.
|
||||
- Before submission, please squash your commits to using a message that starts
|
||||
with the issue number and a description of the changes.
|
||||
- Isolate multiple patches from each other. If you wish to make several
|
||||
independent patches, do so in separate, smaller pull requests that can be
|
||||
reviewed more easily.
|
||||
- Be prepared to answer questions from reviewers. They may have further
|
||||
questions before accepting your patch, and may even propose changes. Please
|
||||
accept this feedback constructively, and not as a rejection of your proposed
|
||||
change.
|
||||
|
||||
## GitFlow Branch Model
|
||||
This repository adheres to the [GitFlow](https://nvie.com/posts/a-successful-git-branching-model/) branch model and is intitialized for GitFlow to make for consistent branch name prefixes. Please take time to familiarize yourself with this model.
|
||||
|
||||
- `master` will contain the latest stable version of the framework and release builds will be created from tagged commits on `master`.
|
||||
- HotFix/Patch Pull Requests should target `master` as the base branch.
|
||||
- All other Pull Requests (bug fixes, enhancements, etc.) should target `development` as the base branch.
|
||||
- `release/vX.Y.X` branches will be used for release candidates when moving new features from `development` to `master`.
|
||||
Beta builds will be created from tagged commits on release candidate branches.
|
||||
|
||||
## Review
|
||||
|
||||
- We welcome code reviews from anyone. A committer is required to formally
|
||||
accept and merge the changes.
|
||||
- Reviewers will be looking for things like threading issues, performance
|
||||
implications, API design, duplication of existing functionality, readability
|
||||
and code style, avoidance of bloat (scope-creep), etc.
|
||||
- Reviewers will likely ask questions to better understand your change.
|
||||
- Reviewers will make comments about changes to your patch:
|
||||
- MUST means that the change is required
|
||||
- SHOULD means that the change is suggested, further discussion on the
|
||||
subject may be required
|
||||
- COULD means that the change is optional
|
||||
|
||||
## Timeline and Managing Expectations
|
||||
|
||||
As we continue to engage contributors and learn best practices for running a successful open source project, our processes
|
||||
and guidance will likely evolve. We will try to communicate expectations as we are able and to always be responsive. We
|
||||
hope that the community will share their suggestions for improving this engagement. Based on the level of initial interest
|
||||
we receive and the availability of resources to evaluate contributions, we anticipate the following:
|
||||
|
||||
- We will initially prioritize pull requests that include small bug fixes and code that addresses potential vulnerabilities
|
||||
as well as pull requests that include improvements for processor language specifications because these require a
|
||||
reasonable amount of effort to evaluate and will help us exercise and revise our process for accepting contributions. In
|
||||
other words, we are going to start small in order to work out the kinks first.
|
||||
- We are committed to maintaining the integrity and security of our code base. In addition to the careful review the
|
||||
maintainers will give to code contributions to make sure they do not introduce new bugs or vulnerabilities, we will be
|
||||
trying to identify best practices to incorporate with our open source project so that contributors can have more control
|
||||
over whether their contributions are accepted. These might include things like style guides and requirements for tests and
|
||||
documentation to accompany some code contributions. As a result, it may take a long time for some contributions to be
|
||||
accepted. This does not mean we are ignoring them.
|
||||
- We are committed to integrating this GitHub project with our team's regular development work flow so that the open source
|
||||
project remains dynamic and relevant. This may affect our responsiveness and ability to accept pull requests
|
||||
quickly. This does not mean we are ignoring them.
|
||||
- Not all innovative ideas need to be accepted as pull requests into this GitHub project to be valuable to the community.
|
||||
There may be times when we recommend that you just share your code for some enhancement to Ghidra from your own
|
||||
repository. As we identify and recognize extensions that are of general interest to the reverse engineering community, we
|
||||
may seek to incorporate them with our baseline.
|
||||
|
||||
## Legal
|
||||
|
||||
Consistent with Section D.6. of the GitHub Terms of Service as of 2019, and the MIT license, the project maintainer for this project accepts contributions using the inbound=outbound model.
|
||||
When you submit a pull request to this repository (inbound), you are agreeing to license your contribution under the same terms as specified in [LICENSE] (outbound).
|
||||
|
||||
This is an open source project.
|
||||
Contributions you make to this repository are completely voluntary.
|
||||
When you submit an issue, bug report, question, enhancement, pull request, etc., you are offering your contribution without expectation of payment, you expressly waive any future pay claims against PepperDash related to your contribution, and you acknowledge that this does not create an obligation on the part of PepperDash of any kind.
|
||||
Furthermore, your contributing to this project does not create an employer-employee relationship between the PepperDash and the contributor.
|
||||
|
||||
[issues]: https://github.com/PepperDash/Essentials/issues
|
||||
[repository]: https://github.com/PepperDash/Essentials
|
||||
[LICENSE]: https://github.com/PepperDash/Essentials/blob/master/LICENSE.md
|
||||
7
LICENSE.md
Normal file
@@ -0,0 +1,7 @@
|
||||
Copyright (c) <2020> PepperDash Technology Corporation
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -166,6 +166,16 @@ namespace PepperDash.Essentials.Bridges
|
||||
(device as PepperDash.Essentials.Devices.Common.Occupancy.GlsOccupancySensorBaseController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is StatusSignController)
|
||||
{
|
||||
(device as StatusSignController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
else if (device is C2nRthsController)
|
||||
{
|
||||
(device as C2nRthsController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
38
PepperDashEssentials/Bridges/C2nRthsControllerBridge.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class C2nRthsControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this C2nRthsController device, BasicTriList triList, uint joinStart,
|
||||
string joinMapKey)
|
||||
{
|
||||
var joinMap = new C2nRthsControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<C2nRthsControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, device, "Linking to Trilist '{0}'", triList.ID.ToString("X"));
|
||||
|
||||
|
||||
triList.SetBoolSigAction(joinMap.TemperatureFormat, device.SetTemperatureFormat);
|
||||
|
||||
device.IsOnline.LinkInputSig(triList.BooleanInput[joinMap.IsOnline]);
|
||||
device.TemperatureFeedback.LinkInputSig(triList.UShortInput[joinMap.Temperature]);
|
||||
device.HumidityFeedback.LinkInputSig(triList.UShortInput[joinMap.Humidity]);
|
||||
|
||||
triList.StringInput[joinMap.Name].StringValue = device.Name;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class DmChassisControllerApiExtentions
|
||||
public static class DmChassisControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this DmChassisController dmChassis, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
|
||||
trilist.UShortInput[joinMap.HdcpSupportCapability].UShortValue = (ushort)tx.HdcpSupportCapability;
|
||||
|
||||
if(txR.InputPorts[DmPortName.HdmiIn] != null)
|
||||
if (txR.InputPorts[DmPortName.HdmiIn] != null)
|
||||
{
|
||||
var inputPort = txR.InputPorts[DmPortName.HdmiIn];
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
SetHdcpCapabilityAction(hdcpTypeSimple, port, joinMap.Port1HdcpState, trilist);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (txR.InputPorts[DmPortName.HdmiIn1] != null)
|
||||
{
|
||||
var inputPort = txR.InputPorts[DmPortName.HdmiIn1];
|
||||
@@ -103,6 +103,22 @@ namespace PepperDash.Essentials.Bridges
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var txFreeRun = tx as IHasFreeRun;
|
||||
if (txFreeRun != null)
|
||||
{
|
||||
txFreeRun.FreeRunEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.FreeRunEnabled]);
|
||||
trilist.SetBoolSigAction(joinMap.FreeRunEnabled, new Action<bool>(b => txFreeRun.SetFreeRunEnabled(b)));
|
||||
}
|
||||
|
||||
var txVga = tx as IVgaBrightnessContrastControls;
|
||||
{
|
||||
txVga.VgaBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaBrightness]);
|
||||
txVga.VgaContrastFeedback.LinkInputSig(trilist.UShortInput[joinMap.VgaContrast]);
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.VgaBrightness, new Action<ushort>(u => txVga.SetVgaBrightness(u)));
|
||||
trilist.SetUShortSigAction(joinMap.VgaContrast, new Action<ushort>(u => txVga.SetVgaContrast(u)));
|
||||
}
|
||||
}
|
||||
|
||||
static void SetHdcpCapabilityAction(bool hdcpTypeSimple, EndpointHdmiInput port, uint join, BasicTriList trilist)
|
||||
|
||||
@@ -1,110 +1,114 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class GlsOccupancySensorBaseControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GlsOccupancySensorBaseJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
#region Single and Dual Sensor Stuff
|
||||
occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
// Occupied status
|
||||
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
|
||||
trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
|
||||
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
|
||||
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
|
||||
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
|
||||
|
||||
// Timouts
|
||||
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
|
||||
occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
|
||||
occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
|
||||
|
||||
// LED Flash
|
||||
trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
|
||||
occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
|
||||
|
||||
// Short Timeout
|
||||
trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
|
||||
occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
|
||||
|
||||
// PIR Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
|
||||
occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
|
||||
|
||||
// PIR Sensitivity in Occupied State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
|
||||
occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
|
||||
|
||||
// PIR Sensitivity in Vacant State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b)));
|
||||
occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
|
||||
#endregion
|
||||
|
||||
#region Dual Technology Sensor Stuff
|
||||
var odtOccController = occController as GlsOdtOccupancySensorController;
|
||||
|
||||
if (odtOccController != null)
|
||||
{
|
||||
// OR When Vacated
|
||||
trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b)));
|
||||
odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
|
||||
|
||||
// AND When Vacated
|
||||
trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b)));
|
||||
odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
|
||||
|
||||
// Ultrasonic A Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
|
||||
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
|
||||
|
||||
// Ultrasonic B Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
|
||||
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
|
||||
|
||||
// US Sensitivity in Occupied State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
|
||||
odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
|
||||
|
||||
// US Sensitivity in Vacant State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
|
||||
odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
|
||||
using PepperDash.Essentials.Devices.Common.Occupancy;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class GlsOccupancySensorBaseControllerApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this GlsOccupancySensorBaseController occController, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||
{
|
||||
GlsOccupancySensorBaseJoinMap joinMap = new GlsOccupancySensorBaseJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<GlsOccupancySensorBaseJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, occController, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
#region Single and Dual Sensor Stuff
|
||||
occController.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
|
||||
// Occupied status
|
||||
trilist.SetSigTrueAction(joinMap.ForceOccupied, new Action(() => occController.ForceOccupied()));
|
||||
trilist.SetSigTrueAction(joinMap.ForceVacant, new Action(() => occController.ForceVacant()));
|
||||
occController.RoomIsOccupiedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RoomOccupiedFeedback]);
|
||||
occController.RoomIsOccupiedFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.RoomVacantFeedback]);
|
||||
occController.RawOccupancyFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyFeedback]);
|
||||
|
||||
// Timouts
|
||||
trilist.SetUShortSigAction(joinMap.Timeout, new Action<ushort>((u) => occController.SetRemoteTimeout(u)));
|
||||
occController.CurrentTimeoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.Timeout]);
|
||||
occController.LocalTimoutFeedback.LinkInputSig(trilist.UShortInput[joinMap.TimeoutLocalFeedback]);
|
||||
|
||||
// LED Flash
|
||||
trilist.SetSigTrueAction(joinMap.EnableLedFlash, new Action(() => occController.SetLedFlashEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableLedFlash, new Action(() => occController.SetLedFlashEnable(false)));
|
||||
occController.LedFlashEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.EnableLedFlash]);
|
||||
|
||||
// Short Timeout
|
||||
trilist.SetSigTrueAction(joinMap.EnableShortTimeout, new Action(() => occController.SetShortTimeoutState(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableShortTimeout, new Action(() => occController.SetShortTimeoutState(false)));
|
||||
occController.ShortTimeoutEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableShortTimeout]);
|
||||
|
||||
// PIR Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnablePir, new Action(() => occController.SetPirEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisablePir, new Action(() => occController.SetPirEnable(false)));
|
||||
occController.PirSensorEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnablePir]);
|
||||
|
||||
// PIR Sensitivity in Occupied State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementPirInOccupiedState, new Action<bool>((b) => occController.IncrementPirSensitivityInOccupiedState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementPirInOccupiedState, new Action<bool>((b) => occController.DecrementPirSensitivityInOccupiedState(b)));
|
||||
occController.PirSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInOccupiedState]);
|
||||
|
||||
// PIR Sensitivity in Vacant State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementPirInVacantState, new Action<bool>((b) => occController.IncrementPirSensitivityInVacantState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementPirInVacantState, new Action<bool>((b) => occController.DecrementPirSensitivityInVacantState(b)));
|
||||
occController.PirSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.PirSensitivityInVacantState]);
|
||||
#endregion
|
||||
|
||||
#region Dual Technology Sensor Stuff
|
||||
var odtOccController = occController as GlsOdtOccupancySensorController;
|
||||
|
||||
if (odtOccController != null)
|
||||
{
|
||||
// OR When Vacated
|
||||
trilist.SetBoolSigAction(joinMap.OrWhenVacated, new Action<bool>((b) => odtOccController.SetOrWhenVacatedState(b)));
|
||||
odtOccController.OrWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.OrWhenVacated]);
|
||||
|
||||
// AND When Vacated
|
||||
trilist.SetBoolSigAction(joinMap.AndWhenVacated, new Action<bool>((b) => odtOccController.SetAndWhenVacatedState(b)));
|
||||
odtOccController.AndWhenVacatedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AndWhenVacated]);
|
||||
|
||||
// Ultrasonic A Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnableUsA, new Action(() => odtOccController.SetUsAEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableUsA, new Action(() => odtOccController.SetUsAEnable(false)));
|
||||
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsA]);
|
||||
|
||||
// Ultrasonic B Sensor
|
||||
trilist.SetSigTrueAction(joinMap.EnableUsB, new Action(() => odtOccController.SetUsBEnable(true)));
|
||||
trilist.SetSigTrueAction(joinMap.DisableUsB, new Action(() => odtOccController.SetUsBEnable(false)));
|
||||
odtOccController.UltrasonicAEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.EnableUsB]);
|
||||
|
||||
// US Sensitivity in Occupied State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementUsInOccupiedState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInOccupiedState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementUsInOccupiedState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInOccupiedState(b)));
|
||||
odtOccController.UltrasonicSensitivityInOccupiedStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInOccupiedState]);
|
||||
|
||||
// US Sensitivity in Vacant State
|
||||
trilist.SetBoolSigAction(joinMap.IncrementUsInVacantState, new Action<bool>((b) => odtOccController.IncrementUsSensitivityInVacantState(b)));
|
||||
trilist.SetBoolSigAction(joinMap.DecrementUsInVacantState, new Action<bool>((b) => odtOccController.DecrementUsSensitivityInVacantState(b)));
|
||||
odtOccController.UltrasonicSensitivityInVacantStateFeedback.LinkInputSig(trilist.UShortInput[joinMap.UsSensitivityInVacantState]);
|
||||
|
||||
//Sensor Raw States
|
||||
odtOccController.RawOccupancyPirFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyPirFeedback]);
|
||||
odtOccController.RawOccupancyUsFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RawOccupancyUsFeedback]);
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class C2nRthsControllerJoinMap:JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint Name { get; set; }
|
||||
public uint Temperature { get; set; }
|
||||
public uint Humidity { get; set; }
|
||||
public uint TemperatureFormat { get; set; }
|
||||
|
||||
public C2nRthsControllerJoinMap()
|
||||
{
|
||||
//digital
|
||||
IsOnline = 1;
|
||||
TemperatureFormat = 2;
|
||||
|
||||
//Analog
|
||||
Temperature = 2;
|
||||
Humidity = 3;
|
||||
|
||||
//serial
|
||||
Name = 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
var properties =
|
||||
GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof(uint)).ToList();
|
||||
|
||||
foreach (var propertyInfo in properties)
|
||||
{
|
||||
propertyInfo.SetValue(this, (uint)propertyInfo.GetValue(this, null) + joinOffset, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,6 +139,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
OutputEndpointOnline = OutputEndpointOnline + joinOffset;
|
||||
HdcpSupportState = HdcpSupportState + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
TxAdvancedIsPresent = TxAdvancedIsPresent + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,10 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// High when video sync is detected
|
||||
/// </summary>
|
||||
public uint VideoSyncStatus { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public uint FreeRunEnabled { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
@@ -41,6 +45,16 @@ namespace PepperDash.Essentials.Bridges
|
||||
/// Sets and reports the current HDCP state for the corresponding input port
|
||||
/// </summary>
|
||||
public uint Port2HdcpState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets and reports the current VGA Brightness level
|
||||
/// </summary>
|
||||
public uint VgaBrightness { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sets and reports the current VGA Contrast level
|
||||
/// </summary>
|
||||
public uint VgaContrast { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Serials
|
||||
@@ -56,6 +70,7 @@ namespace PepperDash.Essentials.Bridges
|
||||
// Digital
|
||||
IsOnline = 1;
|
||||
VideoSyncStatus = 2;
|
||||
FreeRunEnabled = 3;
|
||||
// Serial
|
||||
CurrentInputResolution = 1;
|
||||
// Analog
|
||||
@@ -64,6 +79,8 @@ namespace PepperDash.Essentials.Bridges
|
||||
HdcpSupportCapability = 3;
|
||||
Port1HdcpState = 4;
|
||||
Port2HdcpState = 5;
|
||||
VgaBrightness = 6;
|
||||
VgaContrast = 7;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
@@ -72,12 +89,15 @@ namespace PepperDash.Essentials.Bridges
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
VideoSyncStatus = VideoSyncStatus + joinOffset;
|
||||
FreeRunEnabled = FreeRunEnabled + joinOffset;
|
||||
CurrentInputResolution = CurrentInputResolution + joinOffset;
|
||||
VideoInput = VideoInput + joinOffset;
|
||||
AudioInput = AudioInput + joinOffset;
|
||||
HdcpSupportCapability = HdcpSupportCapability + joinOffset;
|
||||
Port1HdcpState = Port1HdcpState + joinOffset;
|
||||
Port2HdcpState = Port2HdcpState + joinOffset;
|
||||
VgaBrightness = VgaBrightness + joinOffset;
|
||||
VgaContrast = VgaContrast + joinOffset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,219 +1,230 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class GlsOccupancySensorBaseJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
/// <summary>
|
||||
/// High when device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Forces the device to report occupied status
|
||||
/// </summary>
|
||||
public uint ForceOccupied { get; set; }
|
||||
/// <summary>
|
||||
/// Forces the device to report vacant status
|
||||
/// </summary>
|
||||
public uint ForceVacant { get; set; }
|
||||
/// <summary>
|
||||
/// Enables raw status reporting
|
||||
/// </summary>
|
||||
public uint EnableRawStates { get; set; }
|
||||
/// <summary>
|
||||
/// High when raw occupancy is detected
|
||||
/// </summary>
|
||||
public uint RawOccupancyFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when occupancy is detected
|
||||
/// </summary>
|
||||
public uint RoomOccupiedFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// Hich when occupancy is detected in the grace period
|
||||
/// </summary>
|
||||
public uint GraceOccupancyDetectedFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when vacancy is detected
|
||||
/// </summary>
|
||||
public uint RoomVacantFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables the LED Flash when set high
|
||||
/// </summary>
|
||||
public uint EnableLedFlash { get; set; }
|
||||
/// <summary>
|
||||
/// Disables the LED flash when set high
|
||||
/// </summary>
|
||||
public uint DisableLedFlash { get; set; }
|
||||
/// <summary>
|
||||
/// Enables the Short Timeout
|
||||
/// </summary>
|
||||
public uint EnableShortTimeout { get; set; }
|
||||
/// <summary>
|
||||
/// Disables the Short Timout
|
||||
/// </summary>
|
||||
public uint DisableShortTimeout { get; set; }
|
||||
/// <summary>
|
||||
/// Set high to enable one technology to trigger occupancy
|
||||
/// </summary>
|
||||
public uint OrWhenVacated { get; set; }
|
||||
/// <summary>
|
||||
/// Set high to require both technologies to trigger occupancy
|
||||
/// </summary>
|
||||
public uint AndWhenVacated { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Ultrasonic Sensor A
|
||||
/// </summary>
|
||||
public uint EnableUsA { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Ultrasonic Sensor A
|
||||
/// </summary>
|
||||
public uint DisableUsA { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Ultrasonic Sensor B
|
||||
/// </summary>
|
||||
public uint EnableUsB { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Ultrasonic Sensor B
|
||||
/// </summary>
|
||||
public uint DisableUsB { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Pir
|
||||
/// </summary>
|
||||
public uint EnablePir { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Pir
|
||||
/// </summary>
|
||||
public uint DisablePir { get; set; }
|
||||
public uint IncrementUsInOccupiedState { get; set; }
|
||||
public uint DecrementUsInOccupiedState { get; set; }
|
||||
public uint IncrementUsInVacantState { get; set; }
|
||||
public uint DecrementUsInVacantState { get; set; }
|
||||
public uint IncrementPirInOccupiedState { get; set; }
|
||||
public uint DecrementPirInOccupiedState { get; set; }
|
||||
public uint IncrementPirInVacantState { get; set; }
|
||||
public uint DecrementPirInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets adn reports the remote timeout value
|
||||
/// </summary>
|
||||
public uint Timeout { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the local timeout value
|
||||
/// </summary>
|
||||
public uint TimeoutLocalFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the minimum internal photo sensor value and reports the current level
|
||||
/// </summary>
|
||||
public uint InternalPhotoSensorValue { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the minimum external photo sensor value and reports the current level
|
||||
/// </summary>
|
||||
public uint ExternalPhotoSensorValue { get; set; }
|
||||
|
||||
public uint UsSensitivityInOccupiedState { get; set; }
|
||||
|
||||
public uint UsSensitivityInVacantState { get; set; }
|
||||
|
||||
public uint PirSensitivityInOccupiedState { get; set; }
|
||||
|
||||
public uint PirSensitivityInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
public GlsOccupancySensorBaseJoinMap()
|
||||
{
|
||||
IsOnline = 1;
|
||||
ForceOccupied = 2;
|
||||
ForceVacant = 3;
|
||||
EnableRawStates = 4;
|
||||
RoomOccupiedFeedback = 2;
|
||||
GraceOccupancyDetectedFeedback = 3;
|
||||
RoomVacantFeedback = 4;
|
||||
RawOccupancyFeedback = 5;
|
||||
EnableLedFlash = 11;
|
||||
DisableLedFlash = 12;
|
||||
EnableShortTimeout = 13;
|
||||
DisableShortTimeout = 14;
|
||||
OrWhenVacated = 15;
|
||||
AndWhenVacated = 16;
|
||||
EnableUsA = 17;
|
||||
DisableUsA = 18;
|
||||
EnableUsB = 19;
|
||||
DisableUsB = 20;
|
||||
EnablePir = 21;
|
||||
DisablePir = 22;
|
||||
DisablePir = 23;
|
||||
IncrementUsInOccupiedState = 24;
|
||||
DecrementUsInOccupiedState = 25;
|
||||
IncrementUsInVacantState = 26;
|
||||
DecrementUsInVacantState = 27;
|
||||
IncrementPirInOccupiedState = 28;
|
||||
DecrementPirInOccupiedState = 29;
|
||||
IncrementPirInVacantState = 30;
|
||||
DecrementPirInVacantState = 31;
|
||||
|
||||
Timeout = 1;
|
||||
TimeoutLocalFeedback = 2;
|
||||
InternalPhotoSensorValue = 3;
|
||||
ExternalPhotoSensorValue = 4;
|
||||
UsSensitivityInOccupiedState = 5;
|
||||
UsSensitivityInVacantState = 6;
|
||||
PirSensitivityInOccupiedState = 7;
|
||||
PirSensitivityInVacantState = 8;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
ForceOccupied = ForceOccupied + joinOffset;
|
||||
ForceVacant = ForceVacant + joinOffset;
|
||||
EnableRawStates = EnableRawStates + joinOffset;
|
||||
RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
|
||||
GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
|
||||
RoomVacantFeedback = RoomVacantFeedback + joinOffset;
|
||||
RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
|
||||
EnableLedFlash = EnableLedFlash + joinOffset;
|
||||
DisableLedFlash = DisableLedFlash + joinOffset;
|
||||
EnableShortTimeout = EnableShortTimeout + joinOffset;
|
||||
DisableShortTimeout = DisableShortTimeout + joinOffset;
|
||||
OrWhenVacated = OrWhenVacated + joinOffset;
|
||||
AndWhenVacated = AndWhenVacated + joinOffset;
|
||||
EnableUsA = EnableUsA + joinOffset;
|
||||
DisableUsA = DisableUsA + joinOffset;
|
||||
EnableUsB = EnableUsB + joinOffset;
|
||||
DisableUsB = DisableUsB + joinOffset;
|
||||
EnablePir = EnablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
|
||||
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
|
||||
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
|
||||
DecrementUsInVacantState = DecrementUsInVacantState + joinOffset;
|
||||
IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset;
|
||||
DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset;
|
||||
IncrementPirInVacantState = IncrementPirInVacantState + joinOffset;
|
||||
DecrementPirInVacantState = DecrementPirInVacantState + joinOffset;
|
||||
|
||||
Timeout = Timeout + joinOffset;
|
||||
TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset;
|
||||
InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset;
|
||||
ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset;
|
||||
UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset;
|
||||
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
|
||||
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
|
||||
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class GlsOccupancySensorBaseJoinMap : JoinMapBase
|
||||
{
|
||||
#region Digitals
|
||||
|
||||
/// <summary>
|
||||
/// High when device is online
|
||||
/// </summary>
|
||||
public uint IsOnline { get; set; }
|
||||
/// <summary>
|
||||
/// Forces the device to report occupied status
|
||||
/// </summary>
|
||||
public uint ForceOccupied { get; set; }
|
||||
/// <summary>
|
||||
/// Forces the device to report vacant status
|
||||
/// </summary>
|
||||
public uint ForceVacant { get; set; }
|
||||
/// <summary>
|
||||
/// Enables raw status reporting
|
||||
/// </summary>
|
||||
public uint EnableRawStates { get; set; }
|
||||
/// <summary>
|
||||
/// High when raw occupancy is detected
|
||||
/// </summary>
|
||||
public uint RawOccupancyFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when PIR sensor detects motion
|
||||
/// </summary>
|
||||
public uint RawOccupancyPirFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when US sensor detects motion
|
||||
/// </summary>
|
||||
public uint RawOccupancyUsFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when occupancy is detected
|
||||
/// </summary>
|
||||
public uint RoomOccupiedFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// Hich when occupancy is detected in the grace period
|
||||
/// </summary>
|
||||
public uint GraceOccupancyDetectedFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// High when vacancy is detected
|
||||
/// </summary>
|
||||
public uint RoomVacantFeedback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables the LED Flash when set high
|
||||
/// </summary>
|
||||
public uint EnableLedFlash { get; set; }
|
||||
/// <summary>
|
||||
/// Disables the LED flash when set high
|
||||
/// </summary>
|
||||
public uint DisableLedFlash { get; set; }
|
||||
/// <summary>
|
||||
/// Enables the Short Timeout
|
||||
/// </summary>
|
||||
public uint EnableShortTimeout { get; set; }
|
||||
/// <summary>
|
||||
/// Disables the Short Timout
|
||||
/// </summary>
|
||||
public uint DisableShortTimeout { get; set; }
|
||||
/// <summary>
|
||||
/// Set high to enable one technology to trigger occupancy
|
||||
/// </summary>
|
||||
public uint OrWhenVacated { get; set; }
|
||||
/// <summary>
|
||||
/// Set high to require both technologies to trigger occupancy
|
||||
/// </summary>
|
||||
public uint AndWhenVacated { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Ultrasonic Sensor A
|
||||
/// </summary>
|
||||
public uint EnableUsA { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Ultrasonic Sensor A
|
||||
/// </summary>
|
||||
public uint DisableUsA { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Ultrasonic Sensor B
|
||||
/// </summary>
|
||||
public uint EnableUsB { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Ultrasonic Sensor B
|
||||
/// </summary>
|
||||
public uint DisableUsB { get; set; }
|
||||
/// <summary>
|
||||
/// Enables Pir
|
||||
/// </summary>
|
||||
public uint EnablePir { get; set; }
|
||||
/// <summary>
|
||||
/// Disables Pir
|
||||
/// </summary>
|
||||
public uint DisablePir { get; set; }
|
||||
public uint IncrementUsInOccupiedState { get; set; }
|
||||
public uint DecrementUsInOccupiedState { get; set; }
|
||||
public uint IncrementUsInVacantState { get; set; }
|
||||
public uint DecrementUsInVacantState { get; set; }
|
||||
public uint IncrementPirInOccupiedState { get; set; }
|
||||
public uint DecrementPirInOccupiedState { get; set; }
|
||||
public uint IncrementPirInVacantState { get; set; }
|
||||
public uint DecrementPirInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Analogs
|
||||
/// <summary>
|
||||
/// Sets adn reports the remote timeout value
|
||||
/// </summary>
|
||||
public uint Timeout { get; set; }
|
||||
/// <summary>
|
||||
/// Reports the local timeout value
|
||||
/// </summary>
|
||||
public uint TimeoutLocalFeedback { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the minimum internal photo sensor value and reports the current level
|
||||
/// </summary>
|
||||
public uint InternalPhotoSensorValue { get; set; }
|
||||
/// <summary>
|
||||
/// Sets the minimum external photo sensor value and reports the current level
|
||||
/// </summary>
|
||||
public uint ExternalPhotoSensorValue { get; set; }
|
||||
|
||||
public uint UsSensitivityInOccupiedState { get; set; }
|
||||
|
||||
public uint UsSensitivityInVacantState { get; set; }
|
||||
|
||||
public uint PirSensitivityInOccupiedState { get; set; }
|
||||
|
||||
public uint PirSensitivityInVacantState { get; set; }
|
||||
#endregion
|
||||
|
||||
public GlsOccupancySensorBaseJoinMap()
|
||||
{
|
||||
IsOnline = 1;
|
||||
ForceOccupied = 2;
|
||||
ForceVacant = 3;
|
||||
EnableRawStates = 4;
|
||||
RoomOccupiedFeedback = 2;
|
||||
GraceOccupancyDetectedFeedback = 3;
|
||||
RoomVacantFeedback = 4;
|
||||
RawOccupancyFeedback = 5;
|
||||
RawOccupancyPirFeedback = 6;
|
||||
RawOccupancyUsFeedback = 7;
|
||||
EnableLedFlash = 11;
|
||||
DisableLedFlash = 12;
|
||||
EnableShortTimeout = 13;
|
||||
DisableShortTimeout = 14;
|
||||
OrWhenVacated = 15;
|
||||
AndWhenVacated = 16;
|
||||
EnableUsA = 17;
|
||||
DisableUsA = 18;
|
||||
EnableUsB = 19;
|
||||
DisableUsB = 20;
|
||||
EnablePir = 21;
|
||||
DisablePir = 22;
|
||||
IncrementUsInOccupiedState = 23;
|
||||
DecrementUsInOccupiedState = 24;
|
||||
IncrementUsInVacantState = 25;
|
||||
DecrementUsInVacantState = 26;
|
||||
IncrementPirInOccupiedState = 27;
|
||||
DecrementPirInOccupiedState = 28;
|
||||
IncrementPirInVacantState = 29;
|
||||
DecrementPirInVacantState = 30;
|
||||
|
||||
Timeout = 1;
|
||||
TimeoutLocalFeedback = 2;
|
||||
InternalPhotoSensorValue = 3;
|
||||
ExternalPhotoSensorValue = 4;
|
||||
UsSensitivityInOccupiedState = 5;
|
||||
UsSensitivityInVacantState = 6;
|
||||
PirSensitivityInOccupiedState = 7;
|
||||
PirSensitivityInVacantState = 8;
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
|
||||
IsOnline = IsOnline + joinOffset;
|
||||
ForceOccupied = ForceOccupied + joinOffset;
|
||||
ForceVacant = ForceVacant + joinOffset;
|
||||
EnableRawStates = EnableRawStates + joinOffset;
|
||||
RoomOccupiedFeedback = RoomOccupiedFeedback + joinOffset;
|
||||
GraceOccupancyDetectedFeedback = GraceOccupancyDetectedFeedback + joinOffset;
|
||||
RoomVacantFeedback = RoomVacantFeedback + joinOffset;
|
||||
RawOccupancyFeedback = RawOccupancyFeedback + joinOffset;
|
||||
RawOccupancyPirFeedback = RawOccupancyPirFeedback + joinOffset;
|
||||
RawOccupancyUsFeedback = RawOccupancyUsFeedback + joinOffset;
|
||||
EnableLedFlash = EnableLedFlash + joinOffset;
|
||||
DisableLedFlash = DisableLedFlash + joinOffset;
|
||||
EnableShortTimeout = EnableShortTimeout + joinOffset;
|
||||
DisableShortTimeout = DisableShortTimeout + joinOffset;
|
||||
OrWhenVacated = OrWhenVacated + joinOffset;
|
||||
AndWhenVacated = AndWhenVacated + joinOffset;
|
||||
EnableUsA = EnableUsA + joinOffset;
|
||||
DisableUsA = DisableUsA + joinOffset;
|
||||
EnableUsB = EnableUsB + joinOffset;
|
||||
DisableUsB = DisableUsB + joinOffset;
|
||||
EnablePir = EnablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
DisablePir = DisablePir + joinOffset;
|
||||
IncrementUsInOccupiedState = IncrementUsInOccupiedState + joinOffset;
|
||||
DecrementUsInOccupiedState = DecrementUsInOccupiedState + joinOffset;
|
||||
IncrementUsInVacantState = IncrementUsInVacantState + joinOffset;
|
||||
DecrementUsInVacantState = DecrementUsInVacantState + joinOffset;
|
||||
IncrementPirInOccupiedState = IncrementPirInOccupiedState + joinOffset;
|
||||
DecrementPirInOccupiedState = DecrementPirInOccupiedState + joinOffset;
|
||||
IncrementPirInVacantState = IncrementPirInVacantState + joinOffset;
|
||||
DecrementPirInVacantState = DecrementPirInVacantState + joinOffset;
|
||||
|
||||
Timeout = Timeout + joinOffset;
|
||||
TimeoutLocalFeedback = TimeoutLocalFeedback + joinOffset;
|
||||
InternalPhotoSensorValue = InternalPhotoSensorValue + joinOffset;
|
||||
ExternalPhotoSensorValue = ExternalPhotoSensorValue + joinOffset;
|
||||
UsSensitivityInOccupiedState = UsSensitivityInOccupiedState + joinOffset;
|
||||
UsSensitivityInVacantState = UsSensitivityInVacantState + joinOffset;
|
||||
PirSensitivityInOccupiedState = PirSensitivityInOccupiedState + joinOffset;
|
||||
PirSensitivityInVacantState = PirSensitivityInVacantState + joinOffset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp.Reflection;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public class StatusSignControllerJoinMap:JoinMapBase
|
||||
{
|
||||
public uint IsOnline { get; set; }
|
||||
public uint Name { get; set; }
|
||||
public uint RedLed { get; set; }
|
||||
public uint GreenLed { get; set; }
|
||||
public uint BlueLed { get; set; }
|
||||
public uint RedControl { get; set; }
|
||||
public uint GreenControl { get; set; }
|
||||
public uint BlueControl { get; set; }
|
||||
|
||||
public StatusSignControllerJoinMap()
|
||||
{
|
||||
//digital
|
||||
IsOnline = 1;
|
||||
RedControl = 2;
|
||||
GreenControl = 3;
|
||||
BlueControl = 4;
|
||||
|
||||
//Analog
|
||||
RedLed = 2;
|
||||
GreenLed = 3;
|
||||
BlueLed = 4;
|
||||
|
||||
//string
|
||||
Name = 1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void OffsetJoinNumbers(uint joinStart)
|
||||
{
|
||||
var joinOffset = joinStart - 1;
|
||||
var properties =
|
||||
GetType().GetCType().GetProperties().Where(p => p.PropertyType == typeof (uint)).ToList();
|
||||
|
||||
foreach (var propertyInfo in properties)
|
||||
{
|
||||
propertyInfo.SetValue(this, (uint) propertyInfo.GetValue(this, null) + joinOffset, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
65
PepperDashEssentials/Bridges/StatusSignControllerBridge.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.Bridges
|
||||
{
|
||||
public static class StatusSignDeviceApiExtensions
|
||||
{
|
||||
public static void LinkToApi(this StatusSignController ssDevice, BasicTriList trilist, uint joinStart,
|
||||
string joinMapKey)
|
||||
{
|
||||
var joinMap = new StatusSignControllerJoinMap();
|
||||
|
||||
var joinMapSerialized = JoinMapHelper.GetJoinMapForDevice(joinMapKey);
|
||||
|
||||
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||
joinMap = JsonConvert.DeserializeObject<StatusSignControllerJoinMap>(joinMapSerialized);
|
||||
|
||||
joinMap.OffsetJoinNumbers(joinStart);
|
||||
|
||||
Debug.Console(1, ssDevice, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||
|
||||
trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||
trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||
trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, ssDevice));
|
||||
|
||||
trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||
trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||
trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, ssDevice));
|
||||
|
||||
trilist.StringInput[joinMap.Name].StringValue = ssDevice.Name;
|
||||
|
||||
ssDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||
ssDevice.RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
|
||||
ssDevice.BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
|
||||
ssDevice.GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);
|
||||
|
||||
ssDevice.RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
|
||||
ssDevice.BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
|
||||
ssDevice.GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
|
||||
|
||||
}
|
||||
|
||||
private static void EnableControl(BasicTriList triList, StatusSignControllerJoinMap joinMap,
|
||||
StatusSignController device)
|
||||
{
|
||||
var redEnable = triList.BooleanOutput[joinMap.RedControl].BoolValue;
|
||||
var greenEnable = triList.BooleanOutput[joinMap.GreenControl].BoolValue;
|
||||
var blueEnable = triList.BooleanOutput[joinMap.BlueControl].BoolValue;
|
||||
device.EnableLedControl(redEnable, greenEnable, blueEnable);
|
||||
}
|
||||
|
||||
private static void SetColor(BasicTriList triList, StatusSignControllerJoinMap joinMap,
|
||||
StatusSignController device)
|
||||
{
|
||||
var redBrightness = triList.UShortOutput[joinMap.RedLed].UShortValue;
|
||||
var greenBrightness = triList.UShortOutput[joinMap.GreenLed].UShortValue;
|
||||
var blueBrightness = triList.UShortOutput[joinMap.BlueLed].UShortValue;
|
||||
|
||||
device.SetColor(redBrightness, greenBrightness, blueBrightness);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,72 +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;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
|
||||
//public class TPConfig : DeviceConfig
|
||||
//{
|
||||
// new public TPConfigProperties Properties { get; set; }
|
||||
//}
|
||||
|
||||
//public class TPConfigProperties
|
||||
//{
|
||||
// /*
|
||||
// "properties": {
|
||||
// "ipId": "aa",
|
||||
// "defaultSystemKey": "system1",
|
||||
// "sgdPath": "\\NVRAM\\Program1\\Sgds\\PepperDash Essentials TSW1050_v0.9.sgd",
|
||||
// "usesSplashPage": true,
|
||||
// "showDate": true,
|
||||
// "showTime": false
|
||||
// }
|
||||
// */
|
||||
// public uint IpId { get; set; }
|
||||
// public string deafultSystemKey { get; set; }
|
||||
// public string SgdPath { get; set; }
|
||||
// public bool UsesSplashPage { get; set; }
|
||||
// public bool ShowDate { get; set; }
|
||||
// public bool ShowTime { 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 TPPropertiesConverter : 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();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class ConfigTieLine
|
||||
{
|
||||
[JsonProperty(Required=Required.Always)]
|
||||
public string SourceDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string SourcePortKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string DestinationDeviceKey { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string DestinationPortKey { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Tie line: [{0}]{1} --> [{2}]{3}", SourceDeviceKey, SourcePortKey, DestinationDeviceKey, DestinationPortKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a tie line if one can be constructed between the two devices and ports
|
||||
/// </summary>
|
||||
/// <returns>TieLine or null if devices or ports don't exist</returns>
|
||||
public TieLine GetTieLine()
|
||||
{
|
||||
var sourceDevice = (IRoutingOutputs)DeviceManager.GetDeviceForKey(SourceDeviceKey);
|
||||
var destinationDevice = (IRoutingInputs)DeviceManager.GetDeviceForKey(DestinationDeviceKey);
|
||||
|
||||
if (sourceDevice == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine. Source device '{0}' not found or does not have outputs",
|
||||
SourceDeviceKey);
|
||||
return null;
|
||||
}
|
||||
else if (destinationDevice == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine. Destination device '{0}' not found or does not have inputs",
|
||||
DestinationDeviceKey);
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get the ports by key name from the lists
|
||||
RoutingOutputPort sourcePort = sourceDevice.OutputPorts.FirstOrDefault(
|
||||
p => p.Key.Equals(SourcePortKey, System.StringComparison.OrdinalIgnoreCase));
|
||||
//RoutingOutputPort sourcePort = null;
|
||||
//sourceDevice.OutputPorts.TryGetValue(SourcePortKey, out sourcePort);
|
||||
if (sourcePort == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine {0}-->{1}. Source device does not have output port '{2}'",
|
||||
sourceDevice.Key, destinationDevice.Key, SourcePortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
RoutingInputPort destinationPort = destinationDevice.InputPorts.FirstOrDefault(
|
||||
p => p.Key.Equals(DestinationPortKey, System.StringComparison.OrdinalIgnoreCase));
|
||||
//RoutingInputPort destinationPort = null;
|
||||
//destinationDevice.InputPorts.TryGetValue(DestinationPortKey, out destinationPort);
|
||||
if (destinationPort == null)
|
||||
{
|
||||
Debug.Console(0, " Cannot create TieLine {0}-->{1}. Destination device does not have input port '{2}'",
|
||||
sourceDevice.Key, destinationDevice.Key, DestinationPortKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
var tl = new TieLine(sourcePort, destinationPort);
|
||||
Debug.Console(1, " Created {0}", this);
|
||||
return tl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,287 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharp.CrestronIO;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.CrestronThread;
|
||||
using Crestron.SimplSharpPro.Diagnostics;
|
||||
using Crestron.SimplSharpPro.EthernetCommunication;
|
||||
using Crestron.SimplSharpPro.UI;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Core.Devices.Dm;
|
||||
//using PepperDash.Essentials.Fusion;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public static class Configuration
|
||||
{
|
||||
|
||||
public static string LastPath { get; private set; }
|
||||
public static CrestronControlSystem ControlSystem { get; private set; }
|
||||
|
||||
public static void Initialize(CrestronControlSystem cs)
|
||||
{
|
||||
CrestronConsole.AddNewConsoleCommand(ReloadFromConsole, "configreload", "Reloads configuration file",
|
||||
ConsoleAccessLevelEnum.AccessOperator);
|
||||
ControlSystem = cs;
|
||||
}
|
||||
|
||||
public static bool ReadConfiguration(string filePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Read file
|
||||
if (File.Exists(filePath))
|
||||
{
|
||||
LastPath = filePath;
|
||||
string json = File.ReadToEnd(filePath, System.Text.Encoding.ASCII);
|
||||
JObject jo = JObject.Parse(json);
|
||||
|
||||
var info = JsonConvert.DeserializeObject<ConfigInfo>(jo["info"].ToString());
|
||||
Debug.Console(0, "\r[Config] file read:");
|
||||
Debug.Console(0, " File: {0}", filePath);
|
||||
Debug.Console(0, " Name: {0}", info.Name);
|
||||
Debug.Console(0, " Type: {0}", info.SystemTemplateType);
|
||||
Debug.Console(0, " Date: {0}", info.EditDate);
|
||||
Debug.Console(0, " ConfigVersion: {0}", info.Version);
|
||||
Debug.Console(0, " EditedBy: {0}", info.EditedBy);
|
||||
Debug.Console(0, " Comment: {0}\r", info.Comment);
|
||||
|
||||
// Get the main config object
|
||||
var jConfig = jo["configuration"];
|
||||
|
||||
// Devices
|
||||
var jDevices = (JArray)jConfig["devices"];
|
||||
CreateDevices(jDevices);
|
||||
|
||||
// TieLines
|
||||
var jRouting = jConfig["routing"];
|
||||
CreateRouting(jRouting);
|
||||
|
||||
/// Parse the available source list(s)
|
||||
var jSourceLists = (JArray)jConfig["sourceLists"];
|
||||
var jSourceListJson = jSourceLists.ToString();
|
||||
List<ConfigSourceList> sourceLists = JsonConvert.DeserializeObject<List<ConfigSourceList>>(jSourceListJson);
|
||||
|
||||
// System
|
||||
var jSystems = (JArray)jConfig["systems"];
|
||||
CreateSystems(jSystems, sourceLists);
|
||||
|
||||
// Activate everything
|
||||
DeviceManager.ActivateAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] file not found '{0}'", filePath);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, "Configuration read error: \r {0}", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void CreateDevices(JArray jDevices)
|
||||
{
|
||||
//Debug.Console(0, " Creating {0} devices", jDevices.Count);
|
||||
//for (int i = 0; i < jDevices.Count; i++)
|
||||
//{
|
||||
// var jDev = jDevices[i];
|
||||
|
||||
// //var devConfig = JsonConvert.DeserializeObject<DeviceConfig>(jDev.ToString());
|
||||
// //Debug.Console(0, "++++++++++++{0}", devConfig);
|
||||
|
||||
|
||||
// var group = jDev["group"].Value<string>();
|
||||
// Debug.Console(0, " [{0}], creating {1}:{2}", jDev["key"].Value<string>(),
|
||||
// group, jDev["type"].Value<string>());
|
||||
|
||||
// Device dev = null;
|
||||
// if (group.Equals("Display", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DisplayFactory.CreateDisplay(jDev);
|
||||
// else if (group.Equals("DeviceMonitor", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DeviceManagerFactory.Create(jDev);
|
||||
// //else if (group.Equals("Pc", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = PcFactory.Create(jDev);
|
||||
// //else if (group.Equals("SetTopBox", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = SetTopBoxFactory.Create(jDev);
|
||||
// //else if (group.Equals("DiscPlayer", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = DiscPlayerFactory.Create(jDev);
|
||||
// //else if (group.Equals("Touchpanel", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = TouchpanelFactory.Create(jDev);
|
||||
// else if (group.Equals("dmEndpoint", StringComparison.OrdinalIgnoreCase)) // Add Transmitter and Receiver
|
||||
// dev = DmFactory.Create(jDev);
|
||||
// else if (group.Equals("dmChassic", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = DmFactory.CreateChassis(jDev);
|
||||
// else if (group.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
// continue; // ignore it. Has no value right now.
|
||||
// //else if (group.Equals("remote", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = RemoteFactory.Create(jDev);
|
||||
// else
|
||||
// {
|
||||
// Debug.Console(0, " ERROR: Device [{0}] has unknown Group '{1}'. Skipping",
|
||||
// jDev["key"].Value<string>(), group);
|
||||
// continue;
|
||||
// }
|
||||
|
||||
// if (dev != null)
|
||||
// DeviceManager.AddDevice(dev);
|
||||
// else
|
||||
// Debug.Console(0, " ERROR: failed to create device {0}",
|
||||
// jDev["key"].Value<string>());
|
||||
//}
|
||||
}
|
||||
|
||||
static void CreateSystems(JArray jSystems, List<ConfigSourceList> sourceLists)
|
||||
{
|
||||
// // assuming one system
|
||||
// var jSystem = jSystems[0];
|
||||
// var name = jSystem.Value<string>("name");
|
||||
// var key = FactoryHelper.KeyOrConvertName(jSystem.Value<string>("key"), name);
|
||||
|
||||
// if (jSystem.Value<string>("type").Equals("EssentialsHuddleSpace", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var sys = new HuddleSpaceRoom(key, name);
|
||||
// var props = jSystem["properties"];
|
||||
// var displayKey = props["displayKey"].Value<string>();
|
||||
// if (displayKey != null)
|
||||
// sys.DefaultDisplay = (DisplayBase)DeviceManager.GetDeviceForKey(displayKey);
|
||||
|
||||
// // Add sources from passed in config list
|
||||
// var myList = sourceLists.FirstOrDefault(
|
||||
// l => l.Key.Equals(props.Value<string>("sourceListKey"), StringComparison.OrdinalIgnoreCase));
|
||||
// if (myList != null)
|
||||
// AddSourcesToSystem(sys, myList);
|
||||
|
||||
// DeviceManager.AddDevice(sys);
|
||||
|
||||
// //spin up a fusion thing too
|
||||
//#warning add this fusion connector back in later
|
||||
// //DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemController(sys, 0xf1));
|
||||
//}
|
||||
}
|
||||
|
||||
//static void AddSourcesToSystem(Room system, ConfigSourceList configList)
|
||||
//{
|
||||
//foreach (var configItem in configList.PresentationSources)
|
||||
//{
|
||||
// var src = (IPresentationSource)DeviceManager.GetDeviceForKey(configItem.SourceKey);
|
||||
// if (src != null)
|
||||
// system.Sources.Add(configItem.Number, src);
|
||||
// else
|
||||
// Debug.Console(0, system, "cannot find source '{0}' from list {1}",
|
||||
// configItem.SourceKey, configList.Name);
|
||||
//}
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Links up routing, creates tie lines
|
||||
/// </summary>
|
||||
/// <param name="jRouting">The "Routing" JArray from configuration</param>
|
||||
static void CreateRouting(JToken jRouting)
|
||||
{
|
||||
var jsonTieLines = jRouting["tieLines"].ToString();
|
||||
var tieLineConfigs = JsonConvert.DeserializeObject<List<ConfigTieLine>>(jsonTieLines);
|
||||
foreach (var c in tieLineConfigs)
|
||||
{
|
||||
var tl = c.GetTieLine();
|
||||
if (tl != null)
|
||||
TieLineCollection.Default.Add(tl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the IIROutputPorts device (control system, etc) that contains a given IR port
|
||||
/// </summary>
|
||||
/// <param name="propsToken"></param>
|
||||
static IROutputPort GetIrPort(JToken propsToken)
|
||||
{
|
||||
var portDevName = propsToken.Value<string>("IrPortDevice");
|
||||
var portNum = propsToken.Value<uint>("IrPortNumber");
|
||||
if (portDevName.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
IIROutputPorts irDev = ControlSystem;
|
||||
if (portNum <= irDev.NumberOfIROutputPorts)
|
||||
return ControlSystem.IROutputPorts[portNum];
|
||||
else
|
||||
Debug.Console(0, "[Config] ERROR: IR Port {0} out of range. Range 0-{1} on {2}", portNum,
|
||||
ControlSystem.IROutputPorts.Count, irDev.ToString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static void HandleUnknownType(JToken devToken, string type)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR: Type '{0}' not found in group '{1}'", type,
|
||||
devToken.Value<string>("Group"));
|
||||
}
|
||||
|
||||
static void HandleDeviceCreationError(JToken devToken, Exception e)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR creating device [{0}]: \r{1}",
|
||||
devToken["Key"].Value<string>(), e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Console helper to reload
|
||||
/// </summary>
|
||||
static void ReloadFromConsole(string s)
|
||||
{
|
||||
// Gotta tear down everything first!
|
||||
|
||||
if (!string.IsNullOrEmpty(LastPath))
|
||||
{
|
||||
ReadConfiguration(LastPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class ConfigSourceList
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Key { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public List<ConfigSourceItem> PresentationSources { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class ConfigSourceItem
|
||||
{
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public uint Number { get; set; }
|
||||
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public string SourceKey { get; set; }
|
||||
|
||||
public string AlternateName { get; set; }
|
||||
}
|
||||
|
||||
public class ConfigInfo
|
||||
{
|
||||
public string SystemTemplateType { get; set; }
|
||||
public string ProcessorType { get; set; }
|
||||
public string Name { get; set; }
|
||||
public uint ProgramSlotNumber { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string EditedBy { get; set; }
|
||||
public string EditDate { get; set; }
|
||||
public string Comment { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class SourceListConfigProperties
|
||||
{
|
||||
[JsonProperty(Required= Required.Always)]
|
||||
public uint Number { get; set; }
|
||||
[JsonProperty(Required= Required.Always)]
|
||||
public string SourceKey { get; set; }
|
||||
public string AltName { get; set; }
|
||||
public string AltIcon { get; set; }
|
||||
|
||||
public SourceListConfigProperties()
|
||||
{
|
||||
AltName = "";
|
||||
AltIcon = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class CommFactory
|
||||
// {
|
||||
// public static IBasicCommunication CreateCommForDevice(JToken devToken)
|
||||
// {
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// IBasicCommunication comm = null;
|
||||
// try
|
||||
// {
|
||||
// var control = devToken["properties"]["control"];
|
||||
// var commMethod = control["method"].Value<string>();
|
||||
// if (commMethod == "com")
|
||||
// {
|
||||
// var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(
|
||||
// control["comParams"].ToString(),
|
||||
// new JsonSerializerSettings
|
||||
// {
|
||||
// // Needs ObjectCreationHandling to make the ComSpec struct populate
|
||||
// ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
// Converters = new JsonConverter[] { new ComSpecJsonConverter() }
|
||||
// });
|
||||
// comm = new ComPortController(devKey + "-com", comConfig.GetComPort(), comConfig.ComSpec);
|
||||
// }
|
||||
// else if (commMethod == "tcpIp")
|
||||
// {
|
||||
// var tcpConfig = JsonConvert.DeserializeObject<TcpIpConfig>(control["tcpParams"].ToString());
|
||||
// comm = new GenericTcpIpClient(devKey + "-tcp", tcpConfig.Address, tcpConfig.Port, tcpConfig.BufferSize);
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}", devToken.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;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,38 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Core.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class DeviceManagerFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// Device dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// if (devType.Equals("DeviceMonitor", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var comm = CommFactory.CreateCommForDevice(devToken);
|
||||
// if (comm == null) return null;
|
||||
// dev = new GenericCommunicationMonitoredDevice(devKey, devName, comm, devToken["properties"]["pollString"].Value<string>());
|
||||
// }
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,122 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Displays;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class DisplayFactory
|
||||
// {
|
||||
// public static DisplayBase CreateDisplay(JToken devToken)
|
||||
// {
|
||||
// DisplayBase dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// var properties = devToken["properties"];
|
||||
|
||||
// if (devType.Equals("MockDisplay", StringComparison.OrdinalIgnoreCase))
|
||||
// dev = new MockDisplay(devKey, devName);
|
||||
|
||||
// else if (devType.Equals("NecMPSX", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var comm = CommFactory.CreateCommForDevice(devToken);
|
||||
// if (comm == null) return null;
|
||||
// dev = new NecPSXMDisplayCom(devKey, devName, comm);
|
||||
|
||||
|
||||
|
||||
// //var commMethod = properties["control"]["method"].Value<string>();
|
||||
|
||||
// //// Helper-ize this?
|
||||
// //if(commMethod == "com")
|
||||
// //{
|
||||
// // // Move some of this up above???
|
||||
// // var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(
|
||||
// // properties["control"]["comParams"].ToString(),
|
||||
// // new JsonSerializerSettings {
|
||||
// // // Needs ObjectCreationHandling to make the ComSpec struct populate
|
||||
// // ObjectCreationHandling = ObjectCreationHandling.Replace,
|
||||
// // Converters = new JsonConverter[] { new ComSpecJsonConverter() }
|
||||
// // });
|
||||
// // dev = new NecPSXMDisplayCom(devKey, devName, comConfig.GetComPort(), comConfig.ComSpec);
|
||||
// //}
|
||||
// //else if (commMethod == "tcpIp")
|
||||
// //{
|
||||
// // var spec = properties["control"]["tcpSpec"];
|
||||
// // var host = spec["address"].Value<string>();
|
||||
// // var port = spec["port"].Value<int>();
|
||||
// // dev = new NecPSXMDisplayCom(devKey, devName, host, port);
|
||||
// //}
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// else if (devType.Equals("NecNpPa550", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var proj = new NecPaSeriesProjector(devKey, devName);
|
||||
// var comm = CreateCommunicationFromPropertiesToken(
|
||||
// devKey + "-comm", properties, 3000);
|
||||
// proj.CommunicationMethod = comm;
|
||||
// dev = proj;
|
||||
// }
|
||||
// else
|
||||
// FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
|
||||
// public static IBasicCommunication CreateCommunicationFromPropertiesToken(
|
||||
// string commKey, JToken properties, int bufferSize)
|
||||
// {
|
||||
// Debug.Console(2, "Building port from: {0}", properties.ToString());
|
||||
|
||||
// var tcpToken = properties["TcpIp"];
|
||||
// if (tcpToken != null)
|
||||
// {
|
||||
// // Convert the Tcp property
|
||||
// var spec = JsonConvert.DeserializeObject<TcpIpConfig>(tcpToken.ToString());
|
||||
|
||||
// var tcp = new GenericTcpIpClient(commKey, spec.Address, spec.Port, bufferSize);
|
||||
// DeviceManager.AddDevice(tcp);
|
||||
// return tcp;
|
||||
// }
|
||||
|
||||
// var com = properties["Com"];
|
||||
// if (com != null)
|
||||
// {
|
||||
// // Make the interim config object
|
||||
// var comConfig = JsonConvert.DeserializeObject<ComPortConfig>(com.ToString(),
|
||||
// new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace });
|
||||
|
||||
// // Get the IComPorts hardware device from the Device or Control System
|
||||
// var comDev = comConfig.GetIComPortsDeviceFromManagedDevice();
|
||||
// if (comDev != null)
|
||||
// {
|
||||
// var controller = new ComPortController(commKey, comDev.ComPorts[comConfig.ComPortNumber], comConfig.ComSpec);
|
||||
// DeviceManager.AddDevice(controller);
|
||||
// return controller;
|
||||
// }
|
||||
// }
|
||||
// Debug.Console(0, "No Tcp or Com port information for port {0}", commKey);
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -1,101 +0,0 @@
|
||||
using System;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
|
||||
using Crestron.SimplSharpPro.DM.Endpoints.Transmitters;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Essentials.Devices.Dm;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public class DmFactory
|
||||
{
|
||||
public static Device Create(JToken devToken)
|
||||
{
|
||||
Device dev = null;
|
||||
try
|
||||
{
|
||||
var devType = devToken.Value<string>("type");
|
||||
var devKey = devToken.Value<string>("key");
|
||||
var devName = devToken.Value<string>("name");
|
||||
// Catch all 200 series TX
|
||||
var devprops = devToken["properties"];
|
||||
var ipId = Convert.ToUInt32(devprops.Value<string>("ipId"), 16);
|
||||
var parent = devprops.Value<string>("parent");
|
||||
if (parent == null)
|
||||
parent = "controlSystem";
|
||||
|
||||
if (devType.StartsWith("DmTx2", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
DmTx201C tx;
|
||||
if (parent.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
tx = new DmTx201C(ipId, Global.ControlSystem);
|
||||
//dev = new DmTx201SBasicController(devKey, devName, tx);
|
||||
}
|
||||
|
||||
}
|
||||
else if (devType.StartsWith("DmRmc", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
DmRmc100C rmc;
|
||||
if (parent.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
rmc = new DmRmc100C(ipId, Global.ControlSystem);
|
||||
//dev = new DmRmcBaseController(devKey, devName, rmc);
|
||||
}
|
||||
}
|
||||
else
|
||||
FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
}
|
||||
return dev;
|
||||
}
|
||||
|
||||
|
||||
public static Device CreateChassis(JToken devToken)
|
||||
{
|
||||
Device dev = null;
|
||||
try
|
||||
{
|
||||
var devType = devToken.Value<string>("type");
|
||||
var devKey = devToken.Value<string>("key");
|
||||
var devName = devToken.Value<string>("name");
|
||||
// Catch all 200 series TX
|
||||
var devprops = devToken["properties"];
|
||||
var ipId = Convert.ToUInt32(devprops.Value<string>("ipId"), 16);
|
||||
var parent = devprops.Value<string>("parent");
|
||||
if (parent == null)
|
||||
parent = "controlSystem";
|
||||
|
||||
if (devType.Equals("dmmd8x8", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var dm = new DmMd8x8(ipId, Global.ControlSystem);
|
||||
//dev = new DmChassisController(devKey, devName, dm);
|
||||
}
|
||||
else if (devType.Equals("dmmd16x16", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var dm = new DmMd16x16(ipId, Global.ControlSystem);
|
||||
//dev = new DmChassisController(devKey, devName, dm);
|
||||
}
|
||||
else if (devType.Equals("dmmd32x32", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var dm = new DmMd32x32(ipId, Global.ControlSystem);
|
||||
//dev = new DmChassisController(devKey, devName, dm);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
}
|
||||
return dev;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,124 +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.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Devices;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials
|
||||
{
|
||||
public static class FactoryHelper
|
||||
{
|
||||
public static string IrDriverPathPrefix = Global.FilePathPrefix + "IR" + Global.DirectorySeparator;
|
||||
|
||||
public static void HandleUnknownType(JToken devToken, string type)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR: Type '{0}' not found in group '{1}'", type,
|
||||
devToken.Value<string>("group"));
|
||||
}
|
||||
|
||||
public static void HandleDeviceCreationError(JToken devToken, Exception e)
|
||||
{
|
||||
Debug.Console(0, "[Config] ERROR creating device [{0}]: \r{1}",
|
||||
devToken["key"].Value<string>(), e);
|
||||
Debug.Console(0, "Relevant config:\r{0}", devToken.ToString(Newtonsoft.Json.Formatting.Indented));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds either the ControlSystem or a device controller that contains IR ports and
|
||||
/// returns a port from the hardware device
|
||||
/// </summary>
|
||||
/// <param name="propsToken"></param>
|
||||
/// <returns>Crestron IrPort or null if device doesn't have IR or is not found</returns>
|
||||
public static IrOutPortConfig GetIrPort(JToken propsToken)
|
||||
{
|
||||
var irSpec = propsToken["control"]["irSpec"];
|
||||
var portDevKey = irSpec.Value<string>("portDeviceKey");
|
||||
var portNum = irSpec.Value<uint>("portNumber");
|
||||
IIROutputPorts irDev = null;
|
||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||
|| portDevKey.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
irDev = Global.ControlSystem;
|
||||
else
|
||||
irDev = DeviceManager.GetDeviceForKey(portDevKey) as IIROutputPorts;
|
||||
|
||||
if (irDev == null)
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device with IR ports '{0}' not found", portDevKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (portNum <= irDev.NumberOfIROutputPorts) // success!
|
||||
{
|
||||
var file = IrDriverPathPrefix + irSpec["file"].Value<string>();
|
||||
return new IrOutPortConfig { Port = irDev.IROutputPorts[portNum], FileName = file };
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device '{0}' IR port {1} out of range",
|
||||
portDevKey, portNum);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Finds either the ControlSystem or a device controller that contains com ports and
|
||||
/// returns a port from the hardware device
|
||||
/// </summary>
|
||||
/// <param name="propsToken">The Properties token from the device's config</param>
|
||||
/// <returns>Crestron ComPort or null if device doesn't have IR or is not found</returns>
|
||||
public static ComPort GetComPort(JToken propsToken)
|
||||
{
|
||||
var portDevKey = propsToken.Value<string>("comPortDevice");
|
||||
var portNum = propsToken.Value<uint>("comPortNumber");
|
||||
IComPorts comDev = null;
|
||||
if (portDevKey.Equals("controlSystem", StringComparison.OrdinalIgnoreCase))
|
||||
comDev = Global.ControlSystem;
|
||||
else
|
||||
comDev = DeviceManager.GetDeviceForKey(portDevKey) as IComPorts;
|
||||
|
||||
if (comDev == null)
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device with com ports '{0}' not found", portDevKey);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (portNum <= comDev.NumberOfComPorts) // success!
|
||||
return comDev.ComPorts[portNum];
|
||||
else
|
||||
{
|
||||
Debug.Console(0, "[Config] Error, device '{0}' com port {1} out of range",
|
||||
portDevKey, portNum);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the key if it exists or converts the name into a key
|
||||
/// </summary>
|
||||
public static string KeyOrConvertName(string key, string name)
|
||||
{
|
||||
if (string.IsNullOrEmpty(key))
|
||||
return name.Replace(' ', '-');
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrapper to help in IR port creation
|
||||
/// </summary>
|
||||
public class IrOutPortConfig
|
||||
{
|
||||
public IROutputPort Port { get; set; }
|
||||
public string FileName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class PcFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// Device dev = null;
|
||||
// //try
|
||||
// //{
|
||||
// // var devType = devToken.Value<string>("type");
|
||||
// // var devKey = devToken.Value<string>("key");
|
||||
// // var devName = devToken.Value<string>("name");
|
||||
// // if (devType.Equals("laptop", StringComparison.OrdinalIgnoreCase))
|
||||
// // dev = new Laptop(devKey, devName);
|
||||
// // else
|
||||
// // FactoryHelper.HandleUnknownType(devToken, devType);
|
||||
// //}
|
||||
// //catch (Exception e)
|
||||
// //{
|
||||
// // FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// //}
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -1,127 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.Remotes;
|
||||
//using Crestron.SimplSharpPro.UI;
|
||||
//using Newtonsoft.Json;
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
////using PepperDash.Essentials.Remotes;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// //public class RemoteFactory
|
||||
// //{
|
||||
// // public static Device Create(JToken devToken)
|
||||
// // {
|
||||
// // Hr150Controller dev = null;
|
||||
// // try
|
||||
// // {
|
||||
// // var devType = devToken.Value<string>("type");
|
||||
// // var devKey = devToken.Value<string>("key");
|
||||
// // var devName = devToken.Value<string>("name");
|
||||
// // var props = devToken["properties"];
|
||||
|
||||
// // if (devType.Equals("hr150", StringComparison.OrdinalIgnoreCase))
|
||||
// // {
|
||||
// // uint id = Convert.ToUInt32(props.Value<string>("rfId"), 16);
|
||||
// // var parent = props.Value<string>("rfGateway");
|
||||
// // RFExGateway rf = GetGateway(parent);
|
||||
|
||||
// // var hw = new Hr150(id, rf);
|
||||
// // dev = new Hr150Controller(devKey, devName, hw);
|
||||
|
||||
// // // Have to add the buttons and default source after all devices are spun up
|
||||
// // dev.AddPostActivationAction(() =>
|
||||
// // {
|
||||
// // var defaultSystemKey = props.Value<string>("defaultSystemKey");
|
||||
// // dev.SetCurrentRoom((EssentialsRoom)DeviceManager.GetDeviceForKey(defaultSystemKey));
|
||||
|
||||
// // // Link custom buttons
|
||||
// // var buttonProps = JsonConvert.DeserializeObject<Dictionary<uint, string>>(props["buttons"].ToString());
|
||||
// // foreach (var kvp in buttonProps)
|
||||
// // {
|
||||
// // var split = kvp.Value.Split(':');
|
||||
// // if (split[0].Equals("source"))
|
||||
// // {
|
||||
// // var src = DeviceManager.GetDeviceForKey(split[1]) as IPresentationSource;
|
||||
// // if (src == null)
|
||||
// // {
|
||||
// // Debug.Console(0, dev, "Error: Cannot add source key '{0}'", split[1]);
|
||||
// // continue;
|
||||
// // }
|
||||
// // dev.SetCustomButtonAsSource(kvp.Key, src);
|
||||
// // }
|
||||
// // else if (split[0] == "room")
|
||||
// // {
|
||||
// // if (split[1] == "off")
|
||||
// // dev.SetCustomButtonAsRoomOff(kvp.Key);
|
||||
// // }
|
||||
// // }
|
||||
// // });
|
||||
// // }
|
||||
// // else if (devType.Equals("tsr302", StringComparison.OrdinalIgnoreCase))
|
||||
// // {
|
||||
// // uint id = Convert.ToUInt32(props.Value<string>("rfId"), 16);
|
||||
// // var parent = props.Value<string>("rfGateway");
|
||||
// // RFExGateway rf = GetGateway(parent);
|
||||
// // var sgd = props.Value<string>("sgdPath");
|
||||
|
||||
// // var hw = new Tsr302(id, rf);
|
||||
|
||||
// // //dev = new Hr150Controller(devKey, devName, hw);
|
||||
|
||||
// // //// Have to add the buttons and default source after all devices are spun up
|
||||
// // //dev.AddPostActivationAction(() =>
|
||||
// // //{
|
||||
// // // var defaultSystemKey = props.Value<string>("defaultSystemKey");
|
||||
// // // dev.SetCurrentRoom((EssentialsRoom)DeviceManager.GetDeviceForKey(defaultSystemKey));
|
||||
|
||||
// // // // Link custom buttons
|
||||
// // // var buttonProps = JsonConvert.DeserializeObject<Dictionary<uint, string>>(props["buttons"].ToString());
|
||||
// // // foreach (var kvp in buttonProps)
|
||||
// // // {
|
||||
// // // var split = kvp.Value.Split(':');
|
||||
// // // if (split[0].Equals("source"))
|
||||
// // // {
|
||||
// // // var src = DeviceManager.GetDeviceForKey(split[1]) as IPresentationSource;
|
||||
// // // if (src == null)
|
||||
// // // {
|
||||
// // // Debug.Console(0, dev, "Error: Cannot add source key '{0}'", split[1]);
|
||||
// // // continue;
|
||||
// // // }
|
||||
// // // dev.SetCustomButtonAsSource(kvp.Key, src);
|
||||
// // // }
|
||||
// // // else if (split[0] == "room")
|
||||
// // // {
|
||||
// // // if (split[1] == "off")
|
||||
// // // dev.SetCustomButtonAsRoomOff(kvp.Key);
|
||||
// // // }
|
||||
// // // }
|
||||
// // //});
|
||||
// // }
|
||||
// // }
|
||||
// // catch (Exception e)
|
||||
// // {
|
||||
// // FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// // }
|
||||
// // return dev;
|
||||
// // }
|
||||
|
||||
// // public static RFExGateway GetGateway(string parent)
|
||||
// // {
|
||||
// // if (parent == null)
|
||||
// // parent = "controlSystem";
|
||||
// // RFExGateway rf = null;
|
||||
// // if (parent.Equals("controlSystem", StringComparison.OrdinalIgnoreCase)
|
||||
// // || parent.Equals("processor", StringComparison.OrdinalIgnoreCase))
|
||||
// // {
|
||||
// // rf = Global.ControlSystem.ControllerRFGatewayDevice;
|
||||
// // }
|
||||
// // return rf;
|
||||
// // }
|
||||
// //}
|
||||
//}
|
||||
@@ -1,48 +0,0 @@
|
||||
//using System;
|
||||
//using Crestron.SimplSharpPro;
|
||||
//using Crestron.SimplSharpPro.UI;
|
||||
|
||||
//using Newtonsoft.Json.Linq;
|
||||
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Devices;
|
||||
//using PepperDash.Core;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class TouchpanelFactory
|
||||
// {
|
||||
// public static Device Create(JToken devToken)
|
||||
// {
|
||||
// SmartGraphicsTouchpanelControllerBase dev = null;
|
||||
// try
|
||||
// {
|
||||
// var devType = devToken.Value<string>("type");
|
||||
// var devKey = devToken.Value<string>("key");
|
||||
// var devName = devToken.Value<string>("name");
|
||||
// var props = devToken["properties"];
|
||||
// if (devType.Equals("Tsw1052", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// uint ipId = Convert.ToUInt32(props.Value<string>("ipId"), 16);
|
||||
// var hw = new Tsw1052(ipId, Global.ControlSystem);
|
||||
// dev = TouchpanelControllerFactory.Create(devKey, devName, hw, props.Value<string>("sgdPath"));
|
||||
// dev.UsesSplashPage = props.Value<bool>("usesSplashPage");
|
||||
// dev.ShowDate = props.Value<bool>("showDate");
|
||||
// dev.ShowTime = props.Value<bool>("showTime");
|
||||
|
||||
// // This plugs the system key into the tp, but it won't be linked up until later
|
||||
// dev.AddPostActivationAction(() =>
|
||||
// {
|
||||
// var defaultSystemKey = props.Value<string>("defaultSystemKey");
|
||||
// dev.SetCurrentRoom((EssentialsRoom)DeviceManager.GetDeviceForKey(defaultSystemKey));
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// FactoryHelper.HandleDeviceCreationError(devToken, e);
|
||||
// }
|
||||
// return dev;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@@ -96,7 +96,7 @@ namespace PepperDash.Essentials
|
||||
string directoryPrefix;
|
||||
|
||||
directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
|
||||
|
||||
|
||||
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
|
||||
|
||||
Global.SetAssemblyVersion(string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build));
|
||||
|
||||
@@ -0,0 +1,232 @@
|
||||
{
|
||||
"system": {},
|
||||
"system_url": "",
|
||||
"template_url": "",
|
||||
"template": {
|
||||
"sourceLists": {
|
||||
"default": {
|
||||
"source-2": {
|
||||
"order": 6,
|
||||
"type": "route",
|
||||
"altIcon": "Blank",
|
||||
"icon": "",
|
||||
"sourceKey": "wePresent-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"sourceKey": "wePresent-1",
|
||||
"type": "audioVideo",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"source-1": {
|
||||
"order": 5,
|
||||
"type": "route",
|
||||
"altIcon": "Blank",
|
||||
"icon": "",
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"type": "audioVideo",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"roomOff": {
|
||||
"sourceKey": "$off",
|
||||
"type": "off",
|
||||
"routeList": [
|
||||
{
|
||||
"sourceKey": "$off",
|
||||
"type": "audioVideo",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"name": "RMC3",
|
||||
"group": "processor",
|
||||
"properties": {
|
||||
"numberOfIrPorts": 2,
|
||||
"numberOfComPorts": 1
|
||||
},
|
||||
"supportedSystemTypes": [
|
||||
"hudType",
|
||||
"presType",
|
||||
"vtcType",
|
||||
"custom"
|
||||
],
|
||||
"type": "rmc3",
|
||||
"supportedConfigModes": [
|
||||
"compliance",
|
||||
"essentials"
|
||||
],
|
||||
"supportsCompliance": true,
|
||||
"key": "processor",
|
||||
"uid": 0
|
||||
},
|
||||
{
|
||||
"name": "Room PC",
|
||||
"key": "inRoomPc-1",
|
||||
"type": "inRoomPc",
|
||||
"group": "pc",
|
||||
"uid": 8,
|
||||
"properties": {
|
||||
"hasAudio": true,
|
||||
"hasControls": false,
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Wireless Video",
|
||||
"key": "wePresent-1",
|
||||
"type": "wePresent",
|
||||
"group": "genericSource",
|
||||
"uid": 9,
|
||||
"properties": {
|
||||
"isDefault": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Samsung QM Series Display",
|
||||
"key": "display-1",
|
||||
"type": "samsungmdc",
|
||||
"group": "display",
|
||||
"uid": 11,
|
||||
"properties": {
|
||||
"id": "01",
|
||||
"control": {
|
||||
"controlPortDevKey": "processor",
|
||||
"comParams": {
|
||||
"parity": "None",
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"softwareHandshake": "None",
|
||||
"dataBits": 8,
|
||||
"hardwareHandshake": "None",
|
||||
"stopBits": 1
|
||||
},
|
||||
"controlPortNumber": 1,
|
||||
"method": "com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "TSW-760",
|
||||
"key": "tsw760-1",
|
||||
"type": "tsw760",
|
||||
"group": "touchpanel",
|
||||
"uid": 14,
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "03",
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
}
|
||||
},
|
||||
"showVolumeGauge": true,
|
||||
"roomListKey": "",
|
||||
"showDate": true,
|
||||
"headerStyle": "Verbose",
|
||||
"sgdFile": "PepperDash Essentials TSW-760.sgd",
|
||||
"showTime": true,
|
||||
"sourcesOverflowCount": 4,
|
||||
"usesSplashPage": false,
|
||||
"defaultRoomKey": "room1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "iPad",
|
||||
"key": "crestronApp-1",
|
||||
"type": "crestronApp",
|
||||
"group": "touchpanel",
|
||||
"uid": 15,
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "04",
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
}
|
||||
},
|
||||
"showVolumeGauge": true,
|
||||
"roomListKey": "",
|
||||
"showDate": false,
|
||||
"headerStyle": "Verbose",
|
||||
"sgdFile": "PepperDash Essentials iPad.sgd",
|
||||
"showTime": false,
|
||||
"sourcesOverflowCount": 5,
|
||||
"projectName": "PepperDash Essentials iPad",
|
||||
"defaultRoomKey": "room1",
|
||||
"usesSplashPage": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"processorType": "rmc3",
|
||||
"lastUid": 16,
|
||||
"lastModifiedDate": "2018-02-16T17:54:41.315Z",
|
||||
"systemType": "huddle",
|
||||
"comment": "",
|
||||
"requiredControlSofwareVersion": ""
|
||||
},
|
||||
"tieLines": [
|
||||
{
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"sourcePort": "anyVideoOut",
|
||||
"destinationKey": "display-1",
|
||||
"destinationPort": "HdmiIn1",
|
||||
"type": "audioVideo"
|
||||
},
|
||||
{
|
||||
"sourceKey": "wePresent-1",
|
||||
"sourcePort": "anyOut",
|
||||
"destinationKey": "display-1",
|
||||
"destinationPort": "HdmiIn2",
|
||||
"type": "audioVideo"
|
||||
}
|
||||
],
|
||||
"rooms": [
|
||||
{
|
||||
"type": "huddle",
|
||||
"name": "Essentials Huddle 2 Inputs",
|
||||
"key": "room1",
|
||||
"properties": {
|
||||
"defaultDisplayKey": "display-1",
|
||||
"logo": {
|
||||
"type": "system",
|
||||
"url": ""
|
||||
},
|
||||
"description": "Huddle Space with 2 sources. RMC3 processor. iPad + TSW-560",
|
||||
"defaultSourceItem": "source-1",
|
||||
"hasDsp": false,
|
||||
"helpMessage": "",
|
||||
"sourceListKey": "default",
|
||||
"volumes": {
|
||||
"master": {
|
||||
"level": 40,
|
||||
"deviceKey": "display-1",
|
||||
"label": "Volume"
|
||||
}
|
||||
},
|
||||
"defaultAudioKey": "display-1",
|
||||
"defaultVideoBehavior": "basic",
|
||||
"tech": {
|
||||
"password": "1234"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,387 @@
|
||||
{
|
||||
"system": {
|
||||
"rooms": [
|
||||
{
|
||||
"name": "Example Room",
|
||||
"key": "room1",
|
||||
"properties": {
|
||||
"occupancy": {
|
||||
"timeoutMinutes": "60"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"devices": [
|
||||
{
|
||||
"key": "hdMd4x14kE-1",
|
||||
"uid": 4,
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"address": "0.0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "mockCodec-1",
|
||||
"uid": 5,
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"address": "0.0.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"lastModifiedDate": "2019-02-26T21:08:09.195Z"
|
||||
}
|
||||
},
|
||||
"system_url": "",
|
||||
"template_url": "",
|
||||
"template": {
|
||||
"rooms": [
|
||||
{
|
||||
"type": "huddleVtc1",
|
||||
"name": "Essentials DIN-AP3 - DM4x1",
|
||||
"key": "room1",
|
||||
"properties": {
|
||||
"defaultDisplayKey": "display-1",
|
||||
"description": "",
|
||||
"helpMessage": "",
|
||||
"sourceListKey": "default",
|
||||
"defaultVideoBehavior": "basic",
|
||||
"logo": {
|
||||
"type": "system",
|
||||
"url": ""
|
||||
},
|
||||
"occupancy": {
|
||||
"timeoutMinutes": "60",
|
||||
"deviceKey": "glsOdtCCn-1"
|
||||
},
|
||||
"defaultSourceItem": "source-1",
|
||||
"videoCodecKey": "mockCodec-1",
|
||||
"hasDsp": false,
|
||||
"volumes": {
|
||||
"master": {
|
||||
"level": 40,
|
||||
"deviceKey": "mockCodec-1",
|
||||
"label": "Volume"
|
||||
}
|
||||
},
|
||||
"defaultAudioKey": "display-1",
|
||||
"tech": {
|
||||
"password": "1234"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"devices": [
|
||||
{
|
||||
"name": "DIN-AP3",
|
||||
"key": "processor",
|
||||
"type": "dinAp3",
|
||||
"group": "processor",
|
||||
"uid": 0,
|
||||
"properties": {
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Room PC",
|
||||
"key": "inRoomPc-1",
|
||||
"type": "inRoomPc",
|
||||
"properties": {
|
||||
"hasAudio": true,
|
||||
"hasControls": false,
|
||||
"isDefault": true
|
||||
},
|
||||
"group": "pc",
|
||||
"uid": 1
|
||||
},
|
||||
{
|
||||
"name": "Laptop",
|
||||
"key": "laptop-1",
|
||||
"type": "laptop",
|
||||
"properties": {
|
||||
"hasAudio": true,
|
||||
"hasControls": false
|
||||
},
|
||||
"group": "pc",
|
||||
"uid": 2
|
||||
},
|
||||
{
|
||||
"name": "Wireless Video",
|
||||
"key": "wePresent-1",
|
||||
"type": "wePresent",
|
||||
"properties": {},
|
||||
"group": "genericSource",
|
||||
"uid": 3
|
||||
},
|
||||
{
|
||||
"name": "HD-MD4x1-4k-E HDMI Switch 1",
|
||||
"key": "hdMd4x14kE-1",
|
||||
"type": "hdMd4x14kE",
|
||||
"properties": {
|
||||
"control": {
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
},
|
||||
"ipid": "10",
|
||||
"method": "ipidTcp",
|
||||
"tcpSshProperties": {
|
||||
"port": 0,
|
||||
"address": ""
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "processor",
|
||||
"inputs": {
|
||||
"hdmiIn2": {
|
||||
"disableHdcp": true
|
||||
},
|
||||
"hdmiIn3": {
|
||||
"disableHdcp": true
|
||||
},
|
||||
"hdmiIn4": {
|
||||
"disableHdcp": true
|
||||
},
|
||||
"hdmiIn1": {
|
||||
"disableHdcp": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"group": "hdMdSwitch",
|
||||
"uid": 4
|
||||
},
|
||||
{
|
||||
"name": "Mock Video Codec 1",
|
||||
"key": "mockCodec-1",
|
||||
"type": "mockVc",
|
||||
"properties": {
|
||||
"favorites": [
|
||||
{
|
||||
"name": "Corporate WebEx",
|
||||
"number": "5555555555"
|
||||
}
|
||||
]
|
||||
},
|
||||
"group": "videoCodec",
|
||||
"uid": 5
|
||||
},
|
||||
{
|
||||
"name": "Samsung MDC Protocol 1",
|
||||
"key": "display-1",
|
||||
"type": "samsungmdc",
|
||||
"properties": {
|
||||
"id": "01",
|
||||
"control": {
|
||||
"controlPortDevKey": "processor",
|
||||
"controlPortNumber": 1,
|
||||
"method": "com",
|
||||
"comParams": {
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"hardwareHandshake": "None",
|
||||
"softwareHandshake": "None",
|
||||
"dataBits": 8,
|
||||
"parity": "None",
|
||||
"stopBits": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"group": "display",
|
||||
"uid": 6
|
||||
},
|
||||
{
|
||||
"name": "Crestron GLS-ODT-C-CN 1",
|
||||
"key": "glsOdtCCn-1",
|
||||
"type": "glsOdtCCn",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "cresnet",
|
||||
"cresnetId": "97"
|
||||
}
|
||||
},
|
||||
"group": "occupancy",
|
||||
"uid": 7
|
||||
},
|
||||
{
|
||||
"name": "TSW-760",
|
||||
"key": "tsw760-1",
|
||||
"type": "tsw760",
|
||||
"properties": {
|
||||
"control": {
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
},
|
||||
"ipid": "03",
|
||||
"method": "ipid"
|
||||
},
|
||||
"showVolumeGauge": true,
|
||||
"sourcesOverflowCount": 4,
|
||||
"showDate": true,
|
||||
"headerStyle": "Verbose",
|
||||
"sgdFile": "PepperDash Essentials TSW-760.sgd",
|
||||
"showTime": true,
|
||||
"roomListKey": "",
|
||||
"usesSplashPage": false,
|
||||
"defaultRoomKey": "room1"
|
||||
},
|
||||
"group": "touchpanel",
|
||||
"uid": 8
|
||||
},
|
||||
{
|
||||
"name": "Crestron XPanel",
|
||||
"key": "crestronApp-1",
|
||||
"type": "crestronApp",
|
||||
"properties": {
|
||||
"control": {
|
||||
"params": {
|
||||
"deviceReadyResponsePattern": ".*>",
|
||||
"endOfLineString": "\n"
|
||||
},
|
||||
"ipid": "04",
|
||||
"method": "ipid"
|
||||
},
|
||||
"showVolumeGauge": true,
|
||||
"sourcesOverflowCount": 5,
|
||||
"showDate": true,
|
||||
"headerStyle": "Verbose",
|
||||
"sgdFile": "PepperDash Essentials iPad.sgd",
|
||||
"showTime": true,
|
||||
"roomListKey": "",
|
||||
"projectName": "PepperDash Essentials iPad",
|
||||
"defaultRoomKey": "room1",
|
||||
"usesSplashPage": false
|
||||
},
|
||||
"group": "touchpanel",
|
||||
"uid": 9
|
||||
}
|
||||
],
|
||||
"info": {
|
||||
"comment": "",
|
||||
"lastUid": 10,
|
||||
"lastModifiedDate": "2018-07-02T17:41:06.550Z",
|
||||
"systemType": "huddle",
|
||||
"processorType": "dinAp3",
|
||||
"requiredControlSofwareVersion": ""
|
||||
},
|
||||
"tieLines": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "hdMd4x14kE-1",
|
||||
"destinationKey": "mockCodec-1",
|
||||
"destinationPort": "HdmiIn2",
|
||||
"sourcePort": "hdmiOut"
|
||||
},
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "mockCodec-1",
|
||||
"destinationKey": "display-1",
|
||||
"destinationPort": "HdmiIn1",
|
||||
"sourcePort": "HdmiOut1"
|
||||
},
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "laptop-1",
|
||||
"destinationKey": "hdMd4x14kE-1",
|
||||
"destinationPort": "hdmiIn1",
|
||||
"sourcePort": "anyOut"
|
||||
},
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"destinationKey": "mockCodec-1",
|
||||
"destinationPort": "HdmiIn3",
|
||||
"sourcePort": "anyVideoOut"
|
||||
},
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "wePresent-1",
|
||||
"destinationKey": "hdMd4x14kE-1",
|
||||
"destinationPort": "hdmiIn2",
|
||||
"sourcePort": "anyOut"
|
||||
}
|
||||
],
|
||||
"sourceLists": {
|
||||
"default": {
|
||||
"source-2": {
|
||||
"order": 6,
|
||||
"icon": "",
|
||||
"altIcon": "Blank",
|
||||
"type": "route",
|
||||
"sourceKey": "laptop-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "laptop-1",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"source-3": {
|
||||
"order": 7,
|
||||
"icon": "",
|
||||
"altIcon": "Blank",
|
||||
"type": "route",
|
||||
"sourceKey": "wePresent-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "wePresent-1",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"source-1": {
|
||||
"order": 5,
|
||||
"icon": "",
|
||||
"altIcon": "Blank",
|
||||
"type": "route",
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"includeInSourceList": true,
|
||||
"volumeControlKey": "$defaultAudio",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "inRoomPc-1",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"roomOff": {
|
||||
"type": "off",
|
||||
"sourceKey": "$off",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "$off",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
},
|
||||
"codecOsd": {
|
||||
"order": 1,
|
||||
"name": "None",
|
||||
"type": "route",
|
||||
"includeInSourceList": true,
|
||||
"sourceKey": "",
|
||||
"routeList": [
|
||||
{
|
||||
"type": "audioVideo",
|
||||
"sourceKey": "mockCodec-1[osd]",
|
||||
"destinationKey": "$defaultAll"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,439 @@
|
||||
{
|
||||
"system_url": "",
|
||||
"template": {
|
||||
"info": {
|
||||
"comment": "",
|
||||
"requiredControlSofwareVersion": "",
|
||||
"systemType": "huddle",
|
||||
"lastModifiedDate": "2018-07-09T20:00:47.873Z",
|
||||
"lastUid": 23,
|
||||
"processorType": "rmc3"
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"key": "processor",
|
||||
"group": "processor",
|
||||
"uid": 0,
|
||||
"supportsCompliance": true,
|
||||
"type": "rmc3",
|
||||
"properties": {},
|
||||
"name": "RMC3"
|
||||
},
|
||||
{
|
||||
"key": "comm-1",
|
||||
"uid": 1,
|
||||
"name": "Generic comm 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"comParams": {
|
||||
"hardwareHandshake": "None",
|
||||
"parity": "None",
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"dataBits": 8,
|
||||
"softwareHandshake": "None",
|
||||
"stopBits": 1
|
||||
},
|
||||
"controlPortNumber": 1,
|
||||
"controlPortDevKey": "processor",
|
||||
"method": "Com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "tcp-1",
|
||||
"uid": 2,
|
||||
"name": "Generic TCP 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"username": "",
|
||||
"autoReconnect": true,
|
||||
"AutoReconnectIntervalMs": 2000,
|
||||
"port": 23,
|
||||
"address": "0.0.0.0",
|
||||
"password": ""
|
||||
},
|
||||
"method": "Tcpip"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "ssh-1",
|
||||
"uid": 3,
|
||||
"name": "Generic SSH 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"username": "crestron",
|
||||
"autoReconnect": true,
|
||||
"AutoReconnectIntervalMs": 2000,
|
||||
"port": 22,
|
||||
"address": "10.11.50.135",
|
||||
"password": "2H3Zu&OvgXp6"
|
||||
},
|
||||
"method": "Ssh"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "eisc-1A",
|
||||
"uid": 4,
|
||||
"type": "eiscApi",
|
||||
"group": "api",
|
||||
"properties": {
|
||||
"control": {
|
||||
"tcpSshProperties": {
|
||||
"address": "127.0.0.2",
|
||||
"port": 0
|
||||
},
|
||||
"ipId": "1A"
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"deviceKey": "comm-1",
|
||||
"joinStart": 3001
|
||||
},
|
||||
{
|
||||
"deviceKey": "tcp-1",
|
||||
"joinStart": 3011
|
||||
},
|
||||
{
|
||||
"deviceKey": "ssh-1",
|
||||
"joinStart": 3021
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmMd8x8-1",
|
||||
"joinStart": 1
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmTx201C-1",
|
||||
"joinStart": 3051
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmRmc4kScalerC-1",
|
||||
"joinStart": 3061
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmRmc200C-1",
|
||||
"joinStart": 3071
|
||||
},
|
||||
{
|
||||
"deviceKey": "dmRmc100C-1",
|
||||
"joinStart": 3081
|
||||
},
|
||||
{
|
||||
"deviceKey": "comm-2",
|
||||
"joinStart": 2501
|
||||
},
|
||||
{
|
||||
"deviceKey": "comm-3",
|
||||
"joinStart": 2511
|
||||
},
|
||||
{
|
||||
"deviceKey": "comm-4",
|
||||
"joinStart": 2521
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-1",
|
||||
"joinStart": 2531
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-2",
|
||||
"joinStart": 2541
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-3",
|
||||
"joinStart": 2551
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-4",
|
||||
"joinStart": 2561
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-5",
|
||||
"joinStart": 2571
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-6",
|
||||
"joinStart": 2581
|
||||
},
|
||||
{
|
||||
"deviceKey": "cec-7",
|
||||
"joinStart": 2591
|
||||
},
|
||||
{
|
||||
"deviceKey": "gls-oir-1",
|
||||
"joinStart": 2701
|
||||
},
|
||||
{
|
||||
"deviceKey": "gls-odt-1",
|
||||
"joinStart": 2751
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmMd8x8-1",
|
||||
"uid": 5,
|
||||
"name": "DM-MD8x8 Chassis 1",
|
||||
"type": "dmMd8x8",
|
||||
"group": "dmChassis",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "40",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"volumeControls": {},
|
||||
"inputSlots": {
|
||||
"1": "dmcHdDsp",
|
||||
"2": "dmcHdDsp",
|
||||
"3": "dmcDvi",
|
||||
"4": "dmcDvi",
|
||||
"5": "dmcC",
|
||||
"6": "dmcCDsp"
|
||||
},
|
||||
"outputSlots": {
|
||||
"1": "dmcCoHd",
|
||||
"2": "dmcCoHd"
|
||||
},
|
||||
"inputNames": {
|
||||
"1": "Input 1",
|
||||
"2": "Input 2",
|
||||
"3": "Input 3",
|
||||
"4": "Input 4",
|
||||
"5": "Input 5",
|
||||
"6": "Input 6"
|
||||
},
|
||||
"parentDeviceKey": "processor",
|
||||
"outputNames": {
|
||||
"1": "Output 1",
|
||||
"2": "Output 2",
|
||||
"3": "Output 3",
|
||||
"4": "Output 4"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmTx201C-1",
|
||||
"uid": 6,
|
||||
"name": "DM-TX-201C 1",
|
||||
"type": "dmTx201C",
|
||||
"group": "dmEndpoint",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "45",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "dmMd8x8-1",
|
||||
"parentInputNumber": "5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmRmc4kScalerC-1",
|
||||
"uid": 7,
|
||||
"name": "DM-RMC-4K-SCALER-C Out 1",
|
||||
"type": "dmRmc4kScalerC",
|
||||
"group": "dmEndpoint",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "61",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "dmMd8x8-1",
|
||||
"parentOutputNumber": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmRmc200C-1",
|
||||
"uid": 8,
|
||||
"name": "DM-RMC-200-C Out 2",
|
||||
"type": "dmRmc200C",
|
||||
"group": "dmEndpoint",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "62",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "dmMd8x8-1",
|
||||
"parentOutputNumber": "2"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "dmRmc100C-1",
|
||||
"uid": 9,
|
||||
"name": "DM-RMC-100-C Out 3",
|
||||
"type": "dmRmc100C",
|
||||
"group": "dmEndpoint",
|
||||
"properties": {
|
||||
"control": {
|
||||
"method": "ipid",
|
||||
"ipid": "63",
|
||||
"params": {
|
||||
"endOfLineString": "\n",
|
||||
"deviceReadyResponsePattern": ".*>"
|
||||
}
|
||||
},
|
||||
"parentDeviceKey": "dmMd8x8-1",
|
||||
"parentOutputNumber": "3"
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "comm-2",
|
||||
"uid": 10,
|
||||
"name": "Rmc comm 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"comParams": {
|
||||
"hardwareHandshake": "None",
|
||||
"parity": "None",
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"dataBits": 8,
|
||||
"softwareHandshake": "None",
|
||||
"stopBits": 1
|
||||
},
|
||||
"controlPortNumber": 1,
|
||||
"controlPortDevKey": "dmRmc4kScalerC-1",
|
||||
"method": "Com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "comm-3",
|
||||
"uid": 11,
|
||||
"name": "Rmc comm 2",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"comParams": {
|
||||
"hardwareHandshake": "None",
|
||||
"parity": "None",
|
||||
"protocol": "RS232",
|
||||
"baudRate": 9600,
|
||||
"dataBits": 8,
|
||||
"softwareHandshake": "None",
|
||||
"stopBits": 1
|
||||
},
|
||||
"controlPortNumber": 1,
|
||||
"controlPortDevKey": "dmRmc200C-1",
|
||||
"method": "Com"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "cec-1",
|
||||
"uid": 13,
|
||||
"name": "Tx 5 cec 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"controlPortName": "HdmiIn",
|
||||
"controlPortDevKey": "dmTx201C-1",
|
||||
"method": "Cec"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "cec-5",
|
||||
"uid": 17,
|
||||
"name": "Rmc 1 cec 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"controlPortName": "HdmiOut",
|
||||
"controlPortDevKey": "dmRmc4kScalerC-1",
|
||||
"method": "Cec"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "cec-6",
|
||||
"uid": 18,
|
||||
"name": "Dm Chassis In 1 cec 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"controlPortName": "inputCard1--hdmiIn",
|
||||
"controlPortDevKey": "dmMd8x8-1",
|
||||
"method": "Cec"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "cec-7",
|
||||
"uid": 19,
|
||||
"name": "Dm Chassis Out 1 cec 1",
|
||||
"type": "genericComm",
|
||||
"group": "comm",
|
||||
"properties": {
|
||||
"control": {
|
||||
"controlPortName": "outputCard1--hdmiOut1",
|
||||
"controlPortDevKey": "dmMd8x8-1",
|
||||
"method": "Cec"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "gls-oir-1",
|
||||
"uid": 19,
|
||||
"name": "GLS-OIR-CN 1",
|
||||
"type": "glsoirccn",
|
||||
"group": "occupancy",
|
||||
"properties": {
|
||||
"control": {
|
||||
"cresnetId": "41",
|
||||
"method": "cresnet"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"key": "gls-odt-1",
|
||||
"uid": 19,
|
||||
"name": "GLS-ODT-CN 1",
|
||||
"type": "glsodtccn",
|
||||
"group": "occupancy",
|
||||
"properties": {
|
||||
"control": {
|
||||
"cresnetId": "42",
|
||||
"method": "cresnet"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"rooms": [],
|
||||
"sourceLists": {},
|
||||
"tieLines": []
|
||||
},
|
||||
"template_url": "",
|
||||
"system": {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"system_url": "",
|
||||
"template": {
|
||||
"info": {
|
||||
"comment": "",
|
||||
"requiredControlSofwareVersion": "",
|
||||
"systemType": "huddle",
|
||||
"lastModifiedDate": "2018-07-09T20:00:47.873Z",
|
||||
"lastUid": 23,
|
||||
"processorType": "dmps3300c"
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"key": "processor",
|
||||
"group": "processor",
|
||||
"uid": 0,
|
||||
"supportsCompliance": true,
|
||||
"type": "dmps3300c",
|
||||
"properties": {
|
||||
},
|
||||
"name": "DMPS3-300-C"
|
||||
},
|
||||
{
|
||||
"key": "eisc-A",
|
||||
"uid":4,
|
||||
"type": "eiscApi",
|
||||
"group":"api",
|
||||
"properties": {
|
||||
"control":{
|
||||
"tcpSshProperties":{
|
||||
"address":"127.0.0.2",
|
||||
"port":0
|
||||
},
|
||||
"ipId":"1A"
|
||||
},
|
||||
"devices": [
|
||||
{
|
||||
"deviceKey":"processor-avRouting",
|
||||
"joinStart":1
|
||||
},
|
||||
{
|
||||
"deviceKey":"processor-programAudioOutput",
|
||||
"joinStart":3001
|
||||
},
|
||||
{
|
||||
"deviceKey":"processor-aux1AudioOutput",
|
||||
"joinStart":3011
|
||||
},
|
||||
{
|
||||
"deviceKey":"processor-aux2AudioOutput",
|
||||
"joinStart":3021
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
"rooms": [
|
||||
|
||||
],
|
||||
"sourceLists": {
|
||||
|
||||
},
|
||||
"tieLines": [
|
||||
]
|
||||
},
|
||||
"template_url": "",
|
||||
"system": {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -119,9 +119,11 @@
|
||||
<Compile Include="Bridges\AppleTvBridge.cs" />
|
||||
<Compile Include="Bridges\BridgeBase.cs" />
|
||||
<Compile Include="Bridges\BridgeFactory.cs" />
|
||||
<Compile Include="Bridges\C2nRthsControllerBridge.cs" />
|
||||
<Compile Include="Bridges\CameraControllerBridge.cs" />
|
||||
<Compile Include="Bridges\AirMediaControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DmBladeChassisControllerBridge.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\DmBladeChassisControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\DmpsAudioOutputControllerBridge.cs" />
|
||||
<Compile Include="Bridges\DmpsRoutingControllerBridge.cs" />
|
||||
@@ -153,20 +155,10 @@
|
||||
<Compile Include="Bridges\JoinMaps\IBasicCommunicationJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\IDigitalInputJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\GlsOccupancySensorBaseJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
|
||||
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
|
||||
<Compile Include="Bridges\StatusSignControllerBridge.cs" />
|
||||
<Compile Include="Bridges\SystemMonitorBridge.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Builders\TPConfig.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Configuration.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\ConfigurationHelpers.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\ConfigTieLine.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\CommFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\RemoteFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\DeviceMonitorFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\DmFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\TouchpanelFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\PcFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\DisplayFactory.cs" />
|
||||
<Compile Include="Configuration ORIGINAL\Factories\FactoryHelper.cs" />
|
||||
<Compile Include="Factory\DeviceFactory.cs" />
|
||||
<Compile Include="Devices\Amplifier.cs" />
|
||||
<Compile Include="ControlSystem.cs" />
|
||||
@@ -201,7 +193,6 @@
|
||||
<Compile Include="Room\Types\EssentialsDualDisplayRoom.cs" />
|
||||
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
||||
<Compile Include="Room\Types\EssentialsNDisplayRoomBase.cs" />
|
||||
<Compile Include="Room\Types\EssentialsPresentationRoom.cs" />
|
||||
<Compile Include="Room\Config\EssentialsRoomConfig.cs" />
|
||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
|
||||
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
|
||||
@@ -236,6 +227,18 @@
|
||||
<Compile Include="UI\EssentialsTouchpanelController.cs" />
|
||||
<Compile Include="UI\SubpageReferenceListSourceItem.cs" />
|
||||
<None Include="app.config" />
|
||||
<EmbeddedResource Include="Example Configuration\EssentialsHuddleSpaceRoom\configurationFile-HuddleSpace-2-Source.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Example Configuration\EssentialsHuddleVtc1Room\configurationFile-mockVideoCodec_din-ap3_-_dm4x1.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Example Configuration\SIMPLBridging\configurationFile-dmps3300c-avRouting.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Example Configuration\SIMPLBridging\SIMPLBridgeExample_configurationFile.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\ControlSystem.cfg" />
|
||||
<EmbeddedResource Include="SGD\PepperDash Essentials iPad.sgd">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
|
||||
@@ -1,437 +0,0 @@
|
||||
//using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Linq;
|
||||
//using System.Text;
|
||||
//using Crestron.SimplSharp;
|
||||
|
||||
//using PepperDash.Core;
|
||||
//using PepperDash.Essentials.Core;
|
||||
//using PepperDash.Essentials.Room.Config;
|
||||
|
||||
//namespace PepperDash.Essentials
|
||||
//{
|
||||
// public class EssentialsPresentationRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange
|
||||
// {
|
||||
// public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
|
||||
// public event SourceInfoChangeHandler CurrentSingleSourceChange;
|
||||
// public event SourceInfoChangeHandler CurrentDisplay1SourceChange;
|
||||
// public event SourceInfoChangeHandler CurrentDisplay2SourceChange;
|
||||
|
||||
// protected override Func<bool> OnFeedbackFunc { get {
|
||||
// return () => (CurrentSingleSourceInfo != null
|
||||
// && CurrentSingleSourceInfo.Type != eSourceListItemType.Off)
|
||||
// || (Display1SourceInfo != null
|
||||
// && Display1SourceInfo.Type != eSourceListItemType.Off)
|
||||
// || (Display2SourceInfo != null
|
||||
// && Display2SourceInfo.Type != eSourceListItemType.Off); } }
|
||||
|
||||
// protected override Func<bool> IsWarmingFeedbackFunc { get { return () =>false;; } }
|
||||
// protected override Func<bool> IsCoolingFeedbackFunc { get { return () => false; } }
|
||||
|
||||
// public EssentialsPresentationRoomPropertiesConfig Config { get; private set; }
|
||||
|
||||
// public Dictionary<uint, IRoutingSinkNoSwitching> Displays { get; private set; }
|
||||
|
||||
// public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; }
|
||||
// public IBasicVolumeControls DefaultVolumeControls { get; private set; }C:\Working Directories\PD\essentials\PepperDashEssentials\Room\Types\EssentialsPresentationRoom.cs
|
||||
|
||||
// /// <summary>
|
||||
// /// The config name of the source list
|
||||
// /// </summary>
|
||||
// public string SourceListKey { get; set; }
|
||||
|
||||
// /// <summary>
|
||||
// /// If room is off, enables power on to last source. Default true
|
||||
// /// </summary>
|
||||
// public bool EnablePowerOnToLastSource { get; set; }
|
||||
// string LastSourceKey;
|
||||
|
||||
// public enum eVideoRoutingMode
|
||||
// {
|
||||
// SelectSourceSelectDisplay, SourceToAllDisplays
|
||||
// }
|
||||
|
||||
// public eVideoRoutingMode VideoRoutingMode { get; set; }
|
||||
|
||||
// public enum eAudioRoutingMode
|
||||
// {
|
||||
// AudioFollowsLastVideo, SelectAudioFromDisplay
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// public IBasicVolumeControls CurrentVolumeControls
|
||||
// {
|
||||
// get { return _CurrentAudioDevice; }
|
||||
// set
|
||||
// {
|
||||
// if (value == _CurrentAudioDevice) return;
|
||||
|
||||
// var oldDev = _CurrentAudioDevice;
|
||||
// // derigister this room from the device, if it can
|
||||
// if (oldDev is IInUseTracking)
|
||||
// (oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
|
||||
// var handler = CurrentVolumeDeviceChange;
|
||||
// if (handler != null)
|
||||
// CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
|
||||
// _CurrentAudioDevice = value;
|
||||
// if (handler != null)
|
||||
// CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
|
||||
// // register this room with new device, if it can
|
||||
// if (_CurrentAudioDevice is IInUseTracking)
|
||||
// (_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
|
||||
// }
|
||||
// }
|
||||
// IBasicVolumeControls _CurrentAudioDevice;
|
||||
|
||||
// /// <summary>
|
||||
// /// The SourceListItem last run - containing names and icons. The complex setter is
|
||||
// /// to add/remove this room to the source's InUseTracking, if it is capable
|
||||
// /// </summary>
|
||||
// public SourceListItem CurrentSingleSourceInfo
|
||||
// {
|
||||
// get { return _CurrentSingleSourceInfo; }
|
||||
// private set
|
||||
// {
|
||||
// if (value == _CurrentSingleSourceInfo) return;
|
||||
|
||||
// var handler = CurrentSingleSourceChange;
|
||||
// // remove from in-use tracker, if so equipped
|
||||
// if(_CurrentSingleSourceInfo != null && _CurrentSingleSourceInfo.SourceDevice is IInUseTracking)
|
||||
// (_CurrentSingleSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
|
||||
|
||||
// if (handler != null)
|
||||
// handler(this, _CurrentSingleSourceInfo, ChangeType.WillChange);
|
||||
|
||||
// _CurrentSingleSourceInfo = value;
|
||||
|
||||
// // add to in-use tracking
|
||||
// if (_CurrentSingleSourceInfo != null && _CurrentSingleSourceInfo.SourceDevice is IInUseTracking)
|
||||
// (_CurrentSingleSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
|
||||
// if (handler != null)
|
||||
// handler(this, _CurrentSingleSourceInfo, ChangeType.DidChange);
|
||||
// }
|
||||
// }
|
||||
// SourceListItem _CurrentSingleSourceInfo;
|
||||
|
||||
// public SourceListItem Display1SourceInfo
|
||||
// {
|
||||
// get { return _Display1SourceInfo; }
|
||||
// set
|
||||
// {
|
||||
// if (value == _Display1SourceInfo) return;
|
||||
|
||||
// var handler = CurrentDisplay1SourceChange;
|
||||
// if (handler != null)
|
||||
// handler(this, _Display1SourceInfo, ChangeType.WillChange);
|
||||
|
||||
// _Display1SourceInfo = value;
|
||||
|
||||
// if (handler != null)
|
||||
// handler(this, _Display1SourceInfo, ChangeType.DidChange);
|
||||
// }
|
||||
// }
|
||||
// SourceListItem _Display1SourceInfo;
|
||||
|
||||
// public SourceListItem Display2SourceInfo
|
||||
// {
|
||||
// get { return _Display2SourceInfo; }
|
||||
// set
|
||||
// {
|
||||
// if (value == _Display2SourceInfo) return;
|
||||
|
||||
// var handler = CurrentDisplay2SourceChange;
|
||||
// if (handler != null)
|
||||
// handler(this, _Display2SourceInfo, ChangeType.WillChange);
|
||||
|
||||
// _Display2SourceInfo = value;
|
||||
|
||||
// if (handler != null)
|
||||
// handler(this, _Display2SourceInfo, ChangeType.DidChange);
|
||||
// }
|
||||
// }
|
||||
// SourceListItem _Display2SourceInfo;
|
||||
|
||||
// /// <summary>
|
||||
// /// If an audio dialer is available for this room
|
||||
// /// </summary>
|
||||
// public bool HasAudioDialer { get { return false; } }
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// /// <param name="key"></param>
|
||||
// /// <param name="name"></param>
|
||||
// public EssentialsPresentationRoom(string key, string name,
|
||||
// Dictionary<uint, IRoutingSinkNoSwitching> displays,
|
||||
// IBasicVolumeWithFeedback defaultVolume, EssentialsPresentationRoomPropertiesConfig config)
|
||||
// : base(key, name)
|
||||
// {
|
||||
// Config = config;
|
||||
// Displays = displays;
|
||||
|
||||
// DefaultVolumeControls = defaultVolume;
|
||||
// CurrentVolumeControls = defaultVolume;
|
||||
|
||||
// //DefaultAudioDevice = defaultAudio;
|
||||
// //if (defaultAudio is IBasicVolumeControls)
|
||||
// // DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
|
||||
// //else if (defaultAudio is IHasVolumeDevice)
|
||||
// // DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
|
||||
|
||||
|
||||
// SourceListKey = "default";
|
||||
// EnablePowerOnToLastSource = true;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Run the same source to all destinations
|
||||
// /// </summary>
|
||||
// /// <param name="sourceItem"></param>
|
||||
// public void RouteSourceToAllDestinations(SourceListItem sourceItem)
|
||||
// {
|
||||
// if (Config.Volumes.Master != null)
|
||||
// {
|
||||
// var audioDev = DeviceManager.GetDeviceForKey(Config.Volumes.Master.DeviceKey);
|
||||
// if (audioDev is IBasicVolumeWithFeedback)
|
||||
// {
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
// foreach (var display in Displays.Values)
|
||||
// {
|
||||
// if (sourceItem != null)
|
||||
// DoVideoRoute(sourceItem.SourceKey, display.Key);
|
||||
// else
|
||||
// DoVideoRoute("$off", display.Key);
|
||||
// }
|
||||
// Display1SourceInfo = sourceItem;
|
||||
// Display2SourceInfo = sourceItem;
|
||||
// CurrentSingleSourceInfo = sourceItem;
|
||||
// OnFeedback.FireUpdate();
|
||||
// }
|
||||
|
||||
// public void SourceToDisplay1(SourceListItem sourceItem)
|
||||
// {
|
||||
// DoVideoRoute(sourceItem.SourceKey, Displays[1].Key);
|
||||
// Display1SourceInfo = sourceItem;
|
||||
// OnFeedback.FireUpdate();
|
||||
// }
|
||||
|
||||
// public void SourceToDisplay2(SourceListItem sourceItem)
|
||||
// {
|
||||
// DoVideoRoute(sourceItem.SourceKey, Displays[2].Key);
|
||||
// Display2SourceInfo = sourceItem;
|
||||
// OnFeedback.FireUpdate();
|
||||
// }
|
||||
|
||||
|
||||
// /// <summary>
|
||||
// /// Basic source -> destination routing
|
||||
// /// </summary>
|
||||
// void DoVideoRoute(string sourceKey, string destinationKey)
|
||||
// {
|
||||
// new CTimer(o =>
|
||||
// {
|
||||
// var dest = DeviceManager.GetDeviceForKey(destinationKey) as IRoutingSinkNoSwitching;
|
||||
// if (dest == null)
|
||||
// {
|
||||
// Debug.Console(1, this, "Cannot route. Destination '{0}' not found", destinationKey);
|
||||
// return;
|
||||
// }
|
||||
// // off is special case
|
||||
// if (sourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// dest.ReleaseRoute();
|
||||
// if (dest is IPower)
|
||||
// (dest as IPower).PowerOff();
|
||||
// return;
|
||||
// }
|
||||
|
||||
// var source = DeviceManager.GetDeviceForKey(sourceKey) as IRoutingOutputs;
|
||||
// if (source == null)
|
||||
// {
|
||||
// Debug.Console(1, this, "Cannot route. Source '{0}' not found", sourceKey);
|
||||
// return;
|
||||
// }
|
||||
// dest.ReleaseAndMakeRoute(source, eRoutingSignalType.Video);
|
||||
// }, 0);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// protected override void EndShutdown()
|
||||
// {
|
||||
// RunRouteAction("roomoff");
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// /// <param name="routeKey"></param>
|
||||
// public void RunRouteAction(string routeKey)
|
||||
// {
|
||||
// RunRouteAction(routeKey, null);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Gets a source from config list SourceListKey and dynamically build and executes the
|
||||
// /// route or commands
|
||||
// /// </summary>
|
||||
// /// <param name="name"></param>
|
||||
// public void RunRouteAction(string routeKey, Action successCallback)
|
||||
// {
|
||||
// // Run this on a separate thread
|
||||
// new CTimer(o =>
|
||||
// {
|
||||
// Debug.Console(1, this, "Run room action '{0}'", routeKey);
|
||||
// var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
|
||||
// if(dict == null)
|
||||
// {
|
||||
// Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // Try to get the list item by it's string key
|
||||
// if (!dict.ContainsKey(routeKey))
|
||||
// {
|
||||
// Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
|
||||
// routeKey, SourceListKey);
|
||||
// return;
|
||||
// }
|
||||
|
||||
// var item = dict[routeKey];
|
||||
// //Debug.Console(2, this, "Action {0} has {1} steps",
|
||||
// // item.SourceKey, item.RouteList.Count);
|
||||
|
||||
// // Let's run it
|
||||
// if (routeKey.ToLower() != "roomoff")
|
||||
// LastSourceKey = routeKey;
|
||||
|
||||
// foreach (var route in item.RouteList)
|
||||
// {
|
||||
// // if there is a $defaultAll on route, run two separate
|
||||
// if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// var tempAudio = new SourceRouteListItem
|
||||
// {
|
||||
// DestinationKey = "$defaultDisplay",
|
||||
// SourceKey = route.SourceKey,
|
||||
// Type = eRoutingSignalType.Video
|
||||
// };
|
||||
// DoRoute(tempAudio);
|
||||
|
||||
// var tempVideo = new SourceRouteListItem
|
||||
// {
|
||||
// DestinationKey = "$defaultAudio",
|
||||
// SourceKey = route.SourceKey,
|
||||
// Type = eRoutingSignalType.Audio
|
||||
// };
|
||||
// DoRoute(tempVideo);
|
||||
// continue;
|
||||
// }
|
||||
// else
|
||||
// DoRoute(route);
|
||||
// }
|
||||
|
||||
// // Set volume control on room, using default if non provided
|
||||
// IBasicVolumeControls volDev = null;
|
||||
// // Handle special cases for volume control
|
||||
// if (string.IsNullOrEmpty(item.VolumeControlKey)
|
||||
// || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
|
||||
// volDev = DefaultVolumeControls;
|
||||
// //else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
|
||||
// // volDev = DefaultDisplay as IBasicVolumeControls;
|
||||
// // Or a specific device, probably rarely used.
|
||||
// else
|
||||
// {
|
||||
// var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
|
||||
// if (dev is IBasicVolumeControls)
|
||||
// volDev = dev as IBasicVolumeControls;
|
||||
// else if (dev is IHasVolumeDevice)
|
||||
// volDev = (dev as IHasVolumeDevice).VolumeDevice;
|
||||
// }
|
||||
// CurrentVolumeControls = volDev;
|
||||
|
||||
// // store the name and UI info for routes
|
||||
// if (item.SourceKey != null)
|
||||
// CurrentSingleSourceInfo = item;
|
||||
// // And finally, set the "control". This will trigger event
|
||||
// //CurrentControlDevice = DeviceManager.GetDeviceForKey(item.SourceKey) as Device;
|
||||
|
||||
// OnFeedback.FireUpdate();
|
||||
|
||||
// // report back when done
|
||||
// if (successCallback != null)
|
||||
// successCallback();
|
||||
// }, 0); // end of CTimer
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Will power the room on with the last-used source
|
||||
// /// </summary>
|
||||
// public void PowerOnToDefaultOrLastSource()
|
||||
// {
|
||||
// if (!EnablePowerOnToLastSource || LastSourceKey == null)
|
||||
// return;
|
||||
// RunRouteAction(LastSourceKey);
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Does what it says
|
||||
// /// </summary>
|
||||
// public override void SetDefaultLevels()
|
||||
// {
|
||||
// Debug.Console(0, this, "SetDefaultLevels not implemented");
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// ///
|
||||
// /// </summary>
|
||||
// /// <param name="route"></param>
|
||||
// /// <returns></returns>
|
||||
// bool DoRoute(SourceRouteListItem route)
|
||||
// {
|
||||
// IRoutingSinkNoSwitching dest = null;
|
||||
|
||||
// if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
|
||||
// dest = DefaultAudioDevice;
|
||||
// //else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
|
||||
// // dest = DefaultDisplay;
|
||||
// else
|
||||
// dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching;
|
||||
|
||||
// if (dest == null)
|
||||
// {
|
||||
// Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
|
||||
// {
|
||||
// dest.ReleaseRoute();
|
||||
// if (dest is IPower)
|
||||
// (dest as IPower).PowerOff();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
|
||||
// if (source == null)
|
||||
// {
|
||||
// Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
|
||||
// return false;
|
||||
// }
|
||||
// dest.ReleaseAndMakeRoute(source, route.Type);
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// public override void RoomVacatedForTimeoutPeriod(object o)
|
||||
// {
|
||||
// //Implement this
|
||||
// }
|
||||
|
||||
// }
|
||||
//}
|
||||
@@ -106,12 +106,18 @@ namespace PepperDash.Essentials
|
||||
Debug.Console(0, this, Debug.ErrorLogLevel.Notice, "WARNING: Registration failed. Continuing, but panel may not function: {0}", Panel.RegistrationFailureReason);
|
||||
|
||||
// Give up cleanly if SGD is not present.
|
||||
var sgdName = Global.FilePathPrefix
|
||||
+ Global.DirectorySeparator + "sgd" + Global.DirectorySeparator + props.SgdFile;
|
||||
var sgdName = Global.FilePathPrefix + "sgd" + Global.DirectorySeparator + props.SgdFile;
|
||||
if (!File.Exists(sgdName))
|
||||
{
|
||||
Debug.Console(0, this, "ERROR: Smart object file '{0}' not present. Exiting TSW load", sgdName);
|
||||
return;
|
||||
Debug.Console(0, this, "Smart object file '{0}' not present in User folder. Looking for embedded file", sgdName);
|
||||
|
||||
sgdName = Global.ApplicationDirectoryPathPrefix + Global.DirectorySeparator + "SGD" + Global.DirectorySeparator + props.SgdFile;
|
||||
|
||||
if (!File.Exists(sgdName))
|
||||
{
|
||||
Debug.Console(0, this, "Unable to find SGD file '{0}' in User sgd or application SGD folder. Exiting touchpanel load.", sgdName);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Panel.LoadSmartObjects(sgdName);
|
||||
|
||||
34
README.md
@@ -1,7 +1,12 @@
|
||||
|
||||
# PepperDash Essentials Framework
|
||||
# PepperDash Essentials Framework (c) 2020
|
||||
|
||||
## License
|
||||
Provided under MIT license
|
||||
|
||||
## Overview
|
||||
PepperDash Essentials is an open source Crestron framework that can be configured as a standalone program capable of running a wide variety of system designs and can also be utilized as a plug-in architecture to augment other Simpl# Pro and Simpl Windows programs.
|
||||
|
||||
Essentials Framework is a collection of C# / Simpl# Pro libraries that can be utilized in several different manners. It is currently operating as a 100% configuration-driven system, and can be extended to add different workflows and behaviors, either through the addition of further device "types" or via the plug-in mechanism. The framework is a collection of "things" that are all related and interconnected, but in general do not have dependencies on each other.
|
||||
|
||||
## Minimum Requirements
|
||||
@@ -9,36 +14,31 @@ Essentials Framework is a collection of C# / Simpl# Pro libraries that can be ut
|
||||
- To edit and compile the source, Microsoft Visual Studio 2008 Professional with SP1 is required.
|
||||
- Crestron's Simpl# Plugin is also required (must be obtained from Crestron).
|
||||
|
||||
## Dependencies
|
||||
|
||||
The [PepperDash.Core](https://github.com/PepperDash/PepperDashCore) SIMPL# library is required. It is referenced as a submodule and will be automatically checked out when cloning this repo if set to recurse submodules. This allows different builds of the PepperDash.Core library to be referenced by checking out the desired submodule commit.
|
||||
|
||||
## Utilization
|
||||
Essentials was originally conceptualized as a standalone application for running control system logic entirely in Simpl# Pro. It is primarily designed around accomplishing this goal, but during development, it became obvious that it could easily be leveraged to also serve as a partner application to one or more SIMPL Windows programs.
|
||||
|
||||
Utilization of Essentials Framework falls into the following categories:
|
||||
|
||||
1. Standalone Control System Application for controlling one or more rooms
|
||||
1. Standalone Control System Application for controlling one or more rooms. See [Standalone Use](https://github.com/PepperDash/Essentials/wiki/Standalone-Use#standalone-application)
|
||||
|
||||
2. Partner Application to a SIMPL Windows program. This allows for several useful advantages
|
||||
2. Partner Application to a SIMPL Windows program. This allows for several useful advantages. See [SIMPL Windows Bridging](https://github.com/PepperDash/Essentials/wiki/SIMPL-Bridging#simpl-windows-bridging)
|
||||
|
||||
- Dynamic device instantiation. Devices can be defined in configuration and instantiated at runtime and then "bridged" to a SIMPL Windows program via EISC.
|
||||
- Dynamic device instantiation. Devices can be defined in configuration and instantiated at runtime and then bridged to a SIMPL Windows program via EISC.
|
||||
|
||||
- Advanced logic. Some logic operations that cannot be affectively accomplished in SIMPL Windows (ex. JSON/XML serialization/deserialization, database operations, etc.) can be done in the Simpl# Pro environment and the necessary input and output "bridged" to a SIMPL Windows program via EISC.
|
||||
- Advanced logic. Some logic operations that cannot be affectively accomplished in SIMPL Windows (ex. JSON/XML serialization/deserialization, database operations, etc.) can be done in the Simpl# Pro environment and the necessary input and output bridged to a SIMPL Windows program via EISC.
|
||||
|
||||
3. Hybrid Application that may contain elements of both standalone control and SIMPL partner application integration.
|
||||
- There may be a use case where a device can only be defined in a single application, but that device may need to be interacted with from multiple applications. The device can be defined in an Essentials application, interacted with in that application and also "bridged" to one or more SIMPL Windows applications.
|
||||
- There may be a use case where a device can only be defined in a single application, but that device may need to be interacted with from multiple applications. The device can be defined in an Essentials application, interacted with in that application and also bridged to one or more SIMPL Windows applications.
|
||||
|
||||
## Documentation
|
||||
For detailed documentation, follow this [LINK]() to the Wiki.
|
||||
For detailed documentation, see the [Wiki](https://github.com/PepperDash/EssentialsFramework/wiki).
|
||||
|
||||
## How-To (Getting Started)
|
||||
To help understand Essentials Framework, we recommend starting with the current [Example Build]() and loading it to a Crestron 3-Series processor.
|
||||
|
||||
1. First, load the PepperDashEssentials.cpz to the processor in program slot 1 and start the program.
|
||||
2. On first boot, the Essentials Application will build the necessary configuration folder structure in the User/Program1/ path.
|
||||
3. Load the ExampleEssentialsConfigurationFile.json to the User/Program1/ folder.
|
||||
4. Reset the program via console (progreset -p:1). The program will load the example configuration file.
|
||||
5. Launch the EssentialsExampleXpanel.vtz project. You can interact with the program (which uses simulated device logic to emulate a real commercial huddle room with presentation, audio and video calling capabilities).
|
||||
6. Via console, you can run the (**devlist:1**) command to get some insight into what has been loaded from the configuration file into the system . This will print the basic device information in the form of ["key"] "Name". The "key" value is what we can use to interact with each device uniquely.
|
||||
7. Run the command (**devprops:1 display-1**). This will print the real-time property values of the device with key "display-1".
|
||||
8. Run the command (**devmethods:1 display-1**). This will print the public methods available for the device with key "display-1".
|
||||
9. Run the command (**devjson:1 {"deviceKey":"display-1","methodName":"PowerOn", "params": []}**). This will call the method PowerOn() on the device with key "display-1".
|
||||
See [Getting Started](https://github.com/PepperDash/Essentials/wiki/Get-started#how-to-get-started)
|
||||
|
||||
|
||||
|
||||
BIN
docs/Plugin Load Sequence.png
Normal file
|
After Width: | Height: | Size: 398 KiB |
BIN
docs/arch-high-level.png
Normal file
|
After Width: | Height: | Size: 228 KiB |
BIN
docs/arch-overview.png
Normal file
|
After Width: | Height: | Size: 337 KiB |
BIN
docs/arch-table.PNG
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
docs/comm-device-factory.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
docs/lifecycle.png
Normal file
|
After Width: | Height: | Size: 648 KiB |
BIN
docs/routing-system-diagram.png
Normal file
|
After Width: | Height: | Size: 230 KiB |
@@ -7,7 +7,7 @@ using Crestron.SimplSharp.Net.Http;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Core.DebugThings;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
public class GenericHttpClient : Device, IBasicCommunication
|
||||
{
|
||||
@@ -23,7 +23,6 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -53,6 +52,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
Client.Dispatch(request);
|
||||
Debug.Console(2, this, "GenericHttpClient SentRequest TX:'{0}'", url);
|
||||
}
|
||||
|
||||
private void Response(HttpClientResponse response, HTTP_CALLBACK_ERROR error, object request)
|
||||
{
|
||||
if (error == HTTP_CALLBACK_ERROR.COMPLETED)
|
||||
@@ -0,0 +1,44 @@
|
||||
using System;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
public class C2nRthsController:CrestronGenericBaseDevice
|
||||
{
|
||||
private C2nRths _device;
|
||||
|
||||
public IntFeedback TemperatureFeedback { get; private set; }
|
||||
public IntFeedback HumidityFeedback { get; private set; }
|
||||
|
||||
public C2nRthsController(string key, string name, GenericBase hardware) : base(key, name, hardware)
|
||||
{
|
||||
_device = hardware as C2nRths;
|
||||
|
||||
TemperatureFeedback = new IntFeedback(() => _device.TemperatureFeedback.UShortValue);
|
||||
HumidityFeedback = new IntFeedback(() => _device.HumidityFeedback.UShortValue);
|
||||
|
||||
_device.BaseEvent += DeviceOnBaseEvent;
|
||||
}
|
||||
|
||||
private void DeviceOnBaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case C2nRths.TemperatureFeedbackEventId:
|
||||
TemperatureFeedback.FireUpdate();
|
||||
break;
|
||||
case C2nRths.HumidityFeedbackEventId:
|
||||
HumidityFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTemperatureFormat(bool setToC)
|
||||
{
|
||||
_device.TemperatureFormat.BoolValue = setToC;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DeviceSupport;
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core.CrestronIO
|
||||
{
|
||||
public class StatusSignController:CrestronGenericBaseDevice
|
||||
{
|
||||
private StatusSign _device;
|
||||
|
||||
public BoolFeedback RedLedEnabledFeedback { get; private set; }
|
||||
public BoolFeedback GreenLedEnabledFeedback { get; private set; }
|
||||
public BoolFeedback BlueLedEnabledFeedback { get; private set; }
|
||||
|
||||
public IntFeedback RedLedBrightnessFeedback { get; private set; }
|
||||
public IntFeedback GreenLedBrightnessFeedback { get; private set; }
|
||||
public IntFeedback BlueLedBrightnessFeedback { get; private set; }
|
||||
|
||||
public StatusSignController(string key, string name, GenericBase hardware) : base(key, name, hardware)
|
||||
{
|
||||
_device = hardware as StatusSign;
|
||||
|
||||
RedLedEnabledFeedback =
|
||||
new BoolFeedback(
|
||||
() =>
|
||||
_device.Leds[(uint) StatusSign.Led.eLedColor.Red]
|
||||
.ControlFeedback.BoolValue);
|
||||
GreenLedEnabledFeedback =
|
||||
new BoolFeedback(
|
||||
() =>
|
||||
_device.Leds[(uint) StatusSign.Led.eLedColor.Green]
|
||||
.ControlFeedback.BoolValue);
|
||||
BlueLedEnabledFeedback =
|
||||
new BoolFeedback(
|
||||
() =>
|
||||
_device.Leds[(uint) StatusSign.Led.eLedColor.Blue]
|
||||
.ControlFeedback.BoolValue);
|
||||
|
||||
RedLedBrightnessFeedback =
|
||||
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Red].BrightnessFeedback);
|
||||
GreenLedBrightnessFeedback =
|
||||
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Green].BrightnessFeedback);
|
||||
BlueLedBrightnessFeedback =
|
||||
new IntFeedback(() => (int) _device.Leds[(uint) StatusSign.Led.eLedColor.Blue].BrightnessFeedback);
|
||||
|
||||
_device.BaseEvent += _device_BaseEvent;
|
||||
}
|
||||
|
||||
void _device_BaseEvent(GenericBase device, BaseEventArgs args)
|
||||
{
|
||||
switch (args.EventId)
|
||||
{
|
||||
case StatusSign.LedBrightnessFeedbackEventId:
|
||||
RedLedBrightnessFeedback.FireUpdate();
|
||||
GreenLedBrightnessFeedback.FireUpdate();
|
||||
BlueLedBrightnessFeedback.FireUpdate();
|
||||
break;
|
||||
case StatusSign.LedControlFeedbackEventId:
|
||||
RedLedEnabledFeedback.FireUpdate();
|
||||
GreenLedEnabledFeedback.FireUpdate();
|
||||
BlueLedEnabledFeedback.FireUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public void EnableLedControl(bool red, bool green, bool blue)
|
||||
{
|
||||
_device.Leds[(uint) StatusSign.Led.eLedColor.Red].Control.BoolValue = red;
|
||||
_device.Leds[(uint)StatusSign.Led.eLedColor.Green].Control.BoolValue = green;
|
||||
_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Control.BoolValue = blue;
|
||||
}
|
||||
|
||||
public void SetColor(uint red, uint green, uint blue)
|
||||
{
|
||||
try
|
||||
{
|
||||
_device.Leds[(uint)StatusSign.Led.eLedColor.Red].Brightness =
|
||||
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(red);
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
Debug.Console(1, this, "Error converting value to Red LED brightness. value: {0}", red);
|
||||
}
|
||||
try
|
||||
{
|
||||
_device.Leds[(uint)StatusSign.Led.eLedColor.Green].Brightness =
|
||||
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(green);
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
Debug.Console(1, this, "Error converting value to Green LED brightness. value: {0}", green);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_device.Leds[(uint)StatusSign.Led.eLedColor.Blue].Brightness =
|
||||
(StatusSign.Led.eBrightnessPercentageValues)SimplSharpDeviceHelper.PercentToUshort(blue);
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
{
|
||||
Debug.Console(1, this, "Error converting value to Blue LED brightness. value: {0}", blue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,156 +1,169 @@
|
||||
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; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list containing the Outputs that we want to expose.
|
||||
/// </summary>
|
||||
public FeedbackCollection<Feedback> Feedbacks { get; private set; }
|
||||
|
||||
public BoolFeedback IsOnline { get; private set; }
|
||||
public BoolFeedback IsRegistered { get; private set; }
|
||||
public StringFeedback IpConnectionsText { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used by implementing classes to prevent registration with Crestron TLDM. For
|
||||
/// devices like RMCs and TXs attached to a chassis.
|
||||
/// </summary>
|
||||
public bool PreventRegistration { get; protected set; }
|
||||
|
||||
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
||||
: base(key, name)
|
||||
{
|
||||
Feedbacks = new FeedbackCollection<Feedback>();
|
||||
|
||||
Hardware = hardware;
|
||||
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
|
||||
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
|
||||
IpConnectionsText = new StringFeedback("IpConnectionsText", () =>
|
||||
string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray()));
|
||||
|
||||
AddToFeedbackList(IsOnline, IsRegistered, IpConnectionsText);
|
||||
|
||||
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");
|
||||
if (!PreventRegistration)
|
||||
{
|
||||
//Debug.Console(1, this, " Does not require registration. Skipping");
|
||||
|
||||
var response = Hardware.RegisterWithLogging(Key);
|
||||
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
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>
|
||||
/// Adds feedback(s) to the list
|
||||
/// </summary>
|
||||
/// <param name="newFbs"></param>
|
||||
public void AddToFeedbackList(params Feedback[] newFbs)
|
||||
{
|
||||
foreach (var f in newFbs)
|
||||
{
|
||||
if (f != null)
|
||||
{
|
||||
if (!Feedbacks.Contains(f))
|
||||
{
|
||||
Feedbacks.Add(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
{
|
||||
if (args.DeviceOnLine)
|
||||
{
|
||||
foreach (var feedback in Feedbacks)
|
||||
{
|
||||
if (feedback != null)
|
||||
feedback.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();
|
||||
var level = result == eDeviceRegistrationUnRegistrationResponse.Success ?
|
||||
Debug.ErrorLogLevel.Notice : Debug.ErrorLogLevel.Error;
|
||||
Debug.Console(0, level, "Register device result: '{0}', type '{1}', result {2}", key, device, result);
|
||||
//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; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list containing the Outputs that we want to expose.
|
||||
/// </summary>
|
||||
public FeedbackCollection<Feedback> Feedbacks { get; private set; }
|
||||
|
||||
public BoolFeedback IsOnline { get; private set; }
|
||||
public BoolFeedback IsRegistered { get; private set; }
|
||||
public StringFeedback IpConnectionsText { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Used by implementing classes to prevent registration with Crestron TLDM. For
|
||||
/// devices like RMCs and TXs attached to a chassis.
|
||||
/// </summary>
|
||||
public bool PreventRegistration { get; protected set; }
|
||||
|
||||
public CrestronGenericBaseDevice(string key, string name, GenericBase hardware)
|
||||
: base(key, name)
|
||||
{
|
||||
Feedbacks = new FeedbackCollection<Feedback>();
|
||||
|
||||
Hardware = hardware;
|
||||
IsOnline = new BoolFeedback("IsOnlineFeedback", () => Hardware.IsOnline);
|
||||
IsRegistered = new BoolFeedback("IsRegistered", () => Hardware.Registered);
|
||||
IpConnectionsText = new StringFeedback("IpConnectionsText", () =>
|
||||
{
|
||||
if (Hardware.ConnectedIpList != null)
|
||||
return string.Join(",", Hardware.ConnectedIpList.Select(cip => cip.DeviceIpAddress).ToArray());
|
||||
else
|
||||
return string.Empty;
|
||||
});
|
||||
AddToFeedbackList(IsOnline, IpConnectionsText);
|
||||
|
||||
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");
|
||||
if (!PreventRegistration)
|
||||
{
|
||||
//Debug.Console(1, this, " Does not require registration. Skipping");
|
||||
|
||||
var response = Hardware.RegisterWithLogging(Key);
|
||||
if (response != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
{
|
||||
//Debug.Console(0, this, "ERROR: Cannot register Crestron device: {0}", response);
|
||||
return false;
|
||||
}
|
||||
|
||||
IsRegistered.FireUpdate();
|
||||
}
|
||||
|
||||
foreach (var f in Feedbacks)
|
||||
{
|
||||
f.FireUpdate();
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
var success = Hardware.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
|
||||
|
||||
IsRegistered.FireUpdate();
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds feedback(s) to the list
|
||||
/// </summary>
|
||||
/// <param name="newFbs"></param>
|
||||
public void AddToFeedbackList(params Feedback[] newFbs)
|
||||
{
|
||||
foreach (var f in newFbs)
|
||||
{
|
||||
if (f != null)
|
||||
{
|
||||
if (!Feedbacks.Contains(f))
|
||||
{
|
||||
Feedbacks.Add(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Hardware_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
{
|
||||
Debug.Console(2, this, "OnlineStatusChange Event. Online = {0}", args.DeviceOnLine);
|
||||
foreach (var feedback in Feedbacks)
|
||||
{
|
||||
if (feedback != null)
|
||||
feedback.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();
|
||||
var level = result == eDeviceRegistrationUnRegistrationResponse.Success ?
|
||||
Debug.ErrorLogLevel.Notice : Debug.ErrorLogLevel.Error;
|
||||
Debug.Console(0, level, "Register device result: '{0}', type '{1}', result {2}", key, device, result);
|
||||
//if (result != eDeviceRegistrationUnRegistrationResponse.Success)
|
||||
//{
|
||||
// Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot register device '{0}': {1}", key, result);
|
||||
//}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,11 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
|
||||
using Crestron.SimplSharpPro.GeneralIO;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
using PepperDash.Essentials.Core.CrestronIO;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
@@ -59,6 +60,20 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
return new CenIoDigIn104Controller(key, name, new Crestron.SimplSharpPro.GeneralIO.CenIoDi104(ipid, Global.ControlSystem));
|
||||
}
|
||||
if (typeName == "statussign")
|
||||
{
|
||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
||||
var cresnetId = control.CresnetIdInt;
|
||||
|
||||
return new StatusSignController(key, name, new StatusSign(cresnetId, Global.ControlSystem));
|
||||
}
|
||||
if (typeName == "c2nrths")
|
||||
{
|
||||
var control = CommFactory.GetControlPropertiesConfig(dc);
|
||||
var cresnetId = control.CresnetIdInt;
|
||||
|
||||
return new C2nRthsController(key, name, new C2nRths(cresnetId, Global.ControlSystem));
|
||||
}
|
||||
|
||||
// then check for types that have been added by plugin dlls.
|
||||
if (FactoryMethods.ContainsKey(typeName))
|
||||
|
||||
@@ -26,6 +26,17 @@ namespace PepperDash.Essentials.Core
|
||||
/// </summary>
|
||||
public static string FilePathPrefix { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The file path prefix to the applciation directory
|
||||
/// </summary>
|
||||
public static string ApplicationDirectoryPathPrefix
|
||||
{
|
||||
get
|
||||
{
|
||||
return Crestron.SimplSharp.CrestronIO.Directory.GetApplicationDirectory();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the directory separator character based on the running OS
|
||||
/// </summary>
|
||||
|
||||
@@ -31,7 +31,9 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Base class for join maps
|
||||
/// </summary>
|
||||
public abstract class JoinMapBase
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@@ -113,11 +113,13 @@
|
||||
<ItemGroup>
|
||||
<Compile Include="Config\Comm and IR\CecPortController.cs" />
|
||||
<Compile Include="Config\Comm and IR\GenericComm.cs" />
|
||||
<Compile Include="Config\Comm and IR\GenericHttpClient.cs" />
|
||||
<Compile Include="Config\Essentials\ConfigUpdater.cs" />
|
||||
<Compile Include="Config\Essentials\ConfigReader.cs" />
|
||||
<Compile Include="Config\Essentials\ConfigWriter.cs" />
|
||||
<Compile Include="Config\Essentials\EssentialsConfig.cs" />
|
||||
<Compile Include="Config\SourceDevicePropertiesConfigBase.cs" />
|
||||
<Compile Include="Crestron IO\C2nRts\C2nRthsController.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\CenIoDigIn104Controller.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
|
||||
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
||||
@@ -125,6 +127,7 @@
|
||||
<Compile Include="Crestron IO\IOPortConfig.cs" />
|
||||
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
|
||||
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
|
||||
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
|
||||
<Compile Include="Devices\CodecInterfaces.cs" />
|
||||
<Compile Include="Devices\CrestronProcessor.cs" />
|
||||
<Compile Include="Devices\DeviceApiBase.cs" />
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core.Config;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Plugins
|
||||
{
|
||||
public interface IPluginDeviceConfig
|
||||
{
|
||||
string MinimumEssentialsFrameworkVersion { get; }
|
||||
IKeyed BuildDevice(DeviceConfig dc);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Plugins
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public sealed class PluginEntryPointAttribute : Attribute
|
||||
{
|
||||
private readonly string _uniqueKey;
|
||||
|
||||
public string UniqueKey {
|
||||
get { return _uniqueKey; }
|
||||
}
|
||||
|
||||
public PluginEntryPointAttribute(string key)
|
||||
{
|
||||
_uniqueKey = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,5 @@
|
||||
[assembly: AssemblyTitle("PepperDashEssentialsBase")]
|
||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||
[assembly: AssemblyProduct("PepperDashEssentialsBase")]
|
||||
[assembly: AssemblyCopyright("Copyright © Ppperdash 2019")]
|
||||
[assembly: AssemblyCopyright("Copyright © Pepperdash 2019")]
|
||||
[assembly: AssemblyVersion("1.4.0.*")]
|
||||
@@ -23,6 +23,10 @@ namespace PepperDash.Essentials.Core
|
||||
public StringFeedback TimeRemainingFeedback { get; private set; }
|
||||
|
||||
public bool CountsDown { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The number of seconds to countdown
|
||||
/// </summary>
|
||||
public int SecondsToCount { get; set; }
|
||||
|
||||
public DateTime StartTime { get; private set; }
|
||||
@@ -31,7 +35,7 @@ namespace PepperDash.Essentials.Core
|
||||
CTimer SecondTimer;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
public SecondsCountdownTimer(string key)
|
||||
@@ -61,7 +65,7 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Starts the Timer
|
||||
/// </summary>
|
||||
public void Start()
|
||||
{
|
||||
@@ -82,7 +86,7 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Restarts the timer
|
||||
/// </summary>
|
||||
public void Reset()
|
||||
{
|
||||
@@ -91,7 +95,7 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Cancels the timer (without triggering it to finish)
|
||||
/// </summary>
|
||||
public void Cancel()
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM
|
||||
/// <summary>
|
||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||
/// </summary>
|
||||
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback
|
||||
public class DmTx200Controller : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx200C2G Tx { get; private set; }
|
||||
|
||||
@@ -32,8 +32,10 @@ namespace PepperDash.Essentials.DM
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
||||
|
||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
@@ -115,7 +117,7 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||
{
|
||||
if (tx.HdmiInput.HdpcSupportOnFeedback.BoolValue)
|
||||
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
@@ -123,6 +125,14 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
||||
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
@@ -170,6 +180,21 @@ namespace PepperDash.Essentials.DM
|
||||
DmOutput.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
||||
{
|
||||
VgaBrightnessFeedback.FireUpdate();
|
||||
}
|
||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
||||
{
|
||||
VgaContrastFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
{
|
||||
ActiveVideoInputFeedback.FireUpdate();
|
||||
@@ -191,6 +216,40 @@ namespace PepperDash.Essentials.DM
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM
|
||||
/// <summary>
|
||||
/// Controller class for all DM-TX-201C/S/F transmitters
|
||||
/// </summary>
|
||||
public class DmTx201XController : DmTxControllerBase, ITxRouting, IHasFeedback
|
||||
public class DmTx201XController : DmTxControllerBase, ITxRouting, IHasFeedback, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx201S Tx { get; private set; } // uses the 201S class as it is the base class for the 201C
|
||||
|
||||
@@ -33,8 +33,10 @@ namespace PepperDash.Essentials.DM
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
||||
|
||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
@@ -116,12 +118,19 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||
{
|
||||
if (tx.HdmiInput.HdpcSupportOnFeedback.BoolValue)
|
||||
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
});
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
@@ -156,7 +165,7 @@ namespace PepperDash.Essentials.DM
|
||||
};
|
||||
|
||||
AnyVideoInput = new RoutingInputPortWithVideoStatuses(DmPortName.AnyVideoIn,
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.None, 0, this, combinedFuncs);
|
||||
|
||||
DmOutput = new RoutingOutputPort(DmPortName.DmOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.DmCat, null, this);
|
||||
HdmiLoopOut = new RoutingOutputPort(DmPortName.HdmiLoopOut, eRoutingSignalType.Audio | eRoutingSignalType.Video,
|
||||
@@ -174,6 +183,21 @@ namespace PepperDash.Essentials.DM
|
||||
DmOutput.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
||||
{
|
||||
VgaBrightnessFeedback.FireUpdate();
|
||||
}
|
||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
||||
{
|
||||
VgaContrastFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
void Tx_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||
{
|
||||
ActiveVideoInputFeedback.FireUpdate();
|
||||
@@ -183,8 +207,7 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
|
||||
{
|
||||
Tx.HdmiInput.InputStreamChange += (o, a) => FowardInputStreamChange(HdmiInput, a.EventId);
|
||||
Tx.HdmiInput.VideoAttributes.AttributeChange += (o, a) => FireVideoAttributeChange(HdmiInput, a.EventId);
|
||||
|
||||
@@ -195,6 +218,46 @@ namespace PepperDash.Essentials.DM
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Switches the audio/video source based on the integer value (0-Auto, 1-HDMI, 2-VGA, 3-Disable)
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <param name="output"></param>
|
||||
/// <param name="type"></param>
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
@@ -250,6 +313,7 @@ namespace PepperDash.Essentials.DM
|
||||
Debug.Console(2, this, " Audio Source: {0}", Tx.AudioSourceFeedback);
|
||||
AudioSourceNumericFeedback.FireUpdate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void InputStreamChangeEvent(EndpointInputStream inputStream, EndpointInputStreamEventArgs args)
|
||||
@@ -264,6 +328,10 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
HdmiInHdcpCapabilityFeedback.FireUpdate();
|
||||
}
|
||||
else if (args.EventId == EndpointInputStreamEventIds.FreeRunFeedbackEventId)
|
||||
{
|
||||
FreeRunEnabledFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace PepperDash.Essentials.DM
|
||||
{
|
||||
using eVst = DmTx401C.eSourceSelection;
|
||||
|
||||
public class DmTx401CController : DmTxControllerBase, ITxRouting, IHasFeedback, IIROutputPorts, IComPorts
|
||||
public class DmTx401CController : DmTxControllerBase, ITxRouting, IHasFeedback, IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx401C Tx { get; private set; }
|
||||
|
||||
@@ -34,6 +34,11 @@ namespace PepperDash.Essentials.DM
|
||||
public IntFeedback AudioSourceNumericFeedback { get; protected set; }
|
||||
public IntFeedback HdmiInHdcpCapabilityFeedback { get; protected set; }
|
||||
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
/// </summary>
|
||||
@@ -122,7 +127,7 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
HdmiInHdcpCapabilityFeedback = new IntFeedback("HdmiInHdcpCapability", () =>
|
||||
{
|
||||
if (tx.HdmiInput.HdpcSupportOnFeedback.BoolValue)
|
||||
if (tx.HdmiInput.HdcpSupportOnFeedback.BoolValue)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
@@ -130,6 +135,13 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.HdcpAutoSupport;
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
HdcpActiveFeedbackFunc = () =>
|
||||
@@ -269,6 +281,55 @@ namespace PepperDash.Essentials.DM
|
||||
}
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
||||
{
|
||||
VgaBrightnessFeedback.FireUpdate();
|
||||
}
|
||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
||||
{
|
||||
VgaContrastFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Relays the input stream change to the appropriate RoutingInputPort.
|
||||
/// </summary>
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace PepperDash.Essentials.DM
|
||||
using eAst = Crestron.SimplSharpPro.DeviceSupport.eX02AudioSourceType;
|
||||
|
||||
public class DmTx4k302CController : DmTxControllerBase, ITxRouting, IHasFeedback,
|
||||
IIROutputPorts, IComPorts
|
||||
IIROutputPorts, IComPorts, IHasFreeRun, IVgaBrightnessContrastControls
|
||||
{
|
||||
public DmTx4k302C Tx { get; private set; }
|
||||
|
||||
@@ -35,8 +35,10 @@ namespace PepperDash.Essentials.DM
|
||||
public IntFeedback HdmiIn1HdcpCapabilityFeedback { get; protected set; }
|
||||
public IntFeedback HdmiIn2HdcpCapabilityFeedback { get; protected set; }
|
||||
|
||||
//public override IntFeedback HdcpSupportAllFeedback { get; protected set; }
|
||||
//public override ushort HdcpSupportCapability { get; protected set; }
|
||||
public BoolFeedback FreeRunEnabledFeedback { get; protected set; }
|
||||
|
||||
public IntFeedback VgaBrightnessFeedback { get; protected set; }
|
||||
public IntFeedback VgaContrastFeedback { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Helps get the "real" inputs, including when in Auto
|
||||
@@ -122,6 +124,13 @@ namespace PepperDash.Essentials.DM
|
||||
|
||||
HdcpSupportCapability = eHdcpCapabilityType.Hdcp2_2Support;
|
||||
|
||||
FreeRunEnabledFeedback = new BoolFeedback(() => tx.VgaInput.FreeRunFeedback == eDmFreeRunSetting.Enabled);
|
||||
|
||||
VgaBrightnessFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.BrightnessFeedback.UShortValue);
|
||||
VgaContrastFeedback = new IntFeedback(() => tx.VgaInput.VideoControls.ContrastFeedback.UShortValue);
|
||||
|
||||
tx.VgaInput.VideoControls.ControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(VideoControls_ControlChange);
|
||||
|
||||
|
||||
var combinedFuncs = new VideoStatusFuncsWrapper
|
||||
{
|
||||
@@ -181,6 +190,21 @@ namespace PepperDash.Essentials.DM
|
||||
DmOut.Port = Tx.DmOutput;
|
||||
}
|
||||
|
||||
void VideoControls_ControlChange(object sender, Crestron.SimplSharpPro.DeviceSupport.GenericEventArgs args)
|
||||
{
|
||||
var id = args.EventId;
|
||||
Debug.Console(2, this, "EventId {0}", args.EventId);
|
||||
|
||||
if (id == VideoControlsEventIds.BrightnessFeedbackEventId)
|
||||
{
|
||||
VgaBrightnessFeedback.FireUpdate();
|
||||
}
|
||||
else if (id == VideoControlsEventIds.ContrastFeedbackEventId)
|
||||
{
|
||||
VgaContrastFeedback.FireUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override bool CustomActivate()
|
||||
@@ -199,6 +223,42 @@ namespace PepperDash.Essentials.DM
|
||||
return base.CustomActivate();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enables or disables free run
|
||||
/// </summary>
|
||||
/// <param name="enable"></param>
|
||||
public void SetFreeRunEnabled(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
{
|
||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Enabled;
|
||||
}
|
||||
else
|
||||
{
|
||||
Tx.VgaInput.FreeRun = eDmFreeRunSetting.Disabled;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA brightness level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaBrightness(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Brightness.UShortValue = level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the VGA contrast level
|
||||
/// </summary>
|
||||
/// <param name="level"></param>
|
||||
public void SetVgaContrast(ushort level)
|
||||
{
|
||||
Tx.VgaInput.VideoControls.Contrast.UShortValue = level;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void ExecuteNumericSwitch(ushort input, ushort output, eRoutingSignalType type)
|
||||
{
|
||||
Debug.Console(2, this, "Executing Numeric Switch to input {0}.", input);
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.DM
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a device capable of setting the Free Run state of a VGA input and reporting feedback
|
||||
/// </summary>
|
||||
public interface IHasFreeRun
|
||||
{
|
||||
BoolFeedback FreeRunEnabledFeedback { get; }
|
||||
|
||||
void SetFreeRunEnabled(bool enable);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Defines a device capable of adjusting VGA settings
|
||||
/// </summary>
|
||||
public interface IVgaBrightnessContrastControls
|
||||
{
|
||||
IntFeedback VgaBrightnessFeedback { get; }
|
||||
IntFeedback VgaContrastFeedback { get; }
|
||||
|
||||
void SetVgaBrightness(ushort level);
|
||||
void SetVgaContrast(ushort level);
|
||||
}
|
||||
}
|
||||
@@ -96,6 +96,7 @@
|
||||
<Compile Include="Chassis\DmpsInternalVirtualDmTxController.cs" />
|
||||
<Compile Include="Chassis\DmpsRoutingController.cs" />
|
||||
<Compile Include="Chassis\HdMdNxM4kEController.cs" />
|
||||
<Compile Include="Endpoints\Transmitters\TxInterfaces.cs" />
|
||||
<Compile Include="IDmSwitch.cs" />
|
||||
<Compile Include="Config\DmpsRoutingConfig.cs" />
|
||||
<Compile Include="Config\DmRmcConfig.cs" />
|
||||
|
||||
@@ -73,17 +73,18 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
||||
{
|
||||
// Iterate the meeting list and check if any meeting need to do anythingk
|
||||
|
||||
const double meetingTimeEpsilon = 0.0001;
|
||||
foreach (Meeting m in Meetings)
|
||||
{
|
||||
eMeetingEventChangeType changeType = eMeetingEventChangeType.Unkown;
|
||||
|
||||
if (m.TimeToMeetingStart.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start
|
||||
changeType = eMeetingEventChangeType.MeetingStartWarning;
|
||||
else if (m.TimeToMeetingStart.TotalMinutes == 0) // Meeting Start
|
||||
else if (Math.Abs(m.TimeToMeetingStart.TotalMinutes) < meetingTimeEpsilon) // Meeting Start
|
||||
changeType = eMeetingEventChangeType.MeetingStart;
|
||||
else if (m.TimeToMeetingEnd.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to end
|
||||
changeType = eMeetingEventChangeType.MeetingEndWarning;
|
||||
else if (m.TimeToMeetingEnd.TotalMinutes == 0) // Meeting has ended
|
||||
else if (Math.Abs(m.TimeToMeetingEnd.TotalMinutes) < meetingTimeEpsilon) // Meeting has ended
|
||||
changeType = eMeetingEventChangeType.MeetingEnd;
|
||||
|
||||
if (changeType != eMeetingEventChangeType.Unkown)
|
||||
|
||||
@@ -62,7 +62,6 @@ namespace PepperDash.Essentials.Devices.Common.DSP
|
||||
/// In BiAmp: Instance Tag, QSC: Named Control, Polycom:
|
||||
/// </summary>
|
||||
string ControlPointTag { get; }
|
||||
#warning I dont think index1 and index2 should be a part of the interface. JTA 2018-07-17
|
||||
int Index1 { get; }
|
||||
int Index2 { get; }
|
||||
bool HasMute { get; }
|
||||
|
||||
@@ -112,11 +112,6 @@
|
||||
<Compile Include="Occupancy\GlsOdtOccupancySensorController.cs" />
|
||||
<Compile Include="Power Controllers\Digitallogger.cs" />
|
||||
<Compile Include="Power Controllers\DigitalLoggerPropertiesConfig.cs" />
|
||||
<Compile Include="Evertz\EvertsEndpointStatusServer.cs" />
|
||||
<Compile Include="Evertz\EvertzEndpointVarIds.cs" />
|
||||
<Compile Include="Evertz\EvertzEndpoint.cs" />
|
||||
<Compile Include="Evertz\EvertzEndpointPropertiesConfig.cs" />
|
||||
<Compile Include="Evertz\GenericHttpClient.cs" />
|
||||
<Compile Include="ImageProcessors\AnalogWay\AnalongWayLiveCore.cs" />
|
||||
<Compile Include="ImageProcessors\AnalogWay\AnalogWayLiveCorePropertiesConfig.cs" />
|
||||
<Compile Include="VideoCodec\CiscoCodec\CiscoCamera.cs" />
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp.Net.Http;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
using Crestron.SimplSharp.CrestronSockets;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
|
||||
/*****
|
||||
* TODO JTA: Add Polling
|
||||
* TODO JTA: Move all the registration commnads to the EvertEndpoint class.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
public class EvertzEndpointStatusServer : Device
|
||||
{
|
||||
public IBasicCommunication Communication { get; private set; }
|
||||
public CommunicationGather PortGather { get; private set; }
|
||||
public StatusMonitorBase CommunicationMonitor { get; private set; }
|
||||
public bool isSubscribed;
|
||||
public string Address;
|
||||
public GenericUdpServer Server;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Shows received lines as hex
|
||||
/// </summary>
|
||||
public bool ShowHexResponse { get; set; }
|
||||
public Dictionary<string, EvertzEndpoint> Endpoints;
|
||||
public Dictionary<string, string> ServerIdByEndpointIp;
|
||||
|
||||
public EvertzEndpointStatusServer(string key, string name, GenericUdpServer server, EvertzEndpointStatusServerPropertiesConfig props) :
|
||||
base(key, name)
|
||||
{
|
||||
Server = server;
|
||||
Address = props.serverHostname;
|
||||
Server.DataRecievedExtra += new EventHandler<GenericUdpReceiveTextExtraArgs>(_Server_DataRecievedExtra);
|
||||
|
||||
Server.Connect();
|
||||
Endpoints = new Dictionary<string,EvertzEndpoint>();
|
||||
|
||||
//CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//TODO JTA: Move this method and process over to the endpoint itself. return a bool.
|
||||
public bool RegisterEvertzEndpoint (EvertzEndpoint device)
|
||||
{
|
||||
|
||||
if (Endpoints.ContainsKey(device.Address) == false)
|
||||
{
|
||||
Endpoints.Add(device.Address, device);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void _Server_DataRecievedExtra(object sender, GenericUdpReceiveTextExtraArgs e)
|
||||
{
|
||||
Debug.Console(2, this, "_Server_DataRecievedExtra:\nIP:{0}\nPort:{1}\nText{2}\nBytes:{3} ", e.IpAddress, e.Port, e.Text, e.Bytes);
|
||||
}
|
||||
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
/*
|
||||
Communication.Connect();
|
||||
CommunicationMonitor.StatusChange += (o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); };
|
||||
CommunicationMonitor.Start();
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public class EvertzPortRestResponse
|
||||
{
|
||||
public string id;
|
||||
public string name;
|
||||
public string type;
|
||||
public string value;
|
||||
|
||||
}
|
||||
|
||||
public class EvertsStatusRequesstResponse
|
||||
{
|
||||
public EvertzStatusDataResponse data;
|
||||
public string error;
|
||||
}
|
||||
|
||||
public class EvertzStatusDataResponse
|
||||
{
|
||||
public List<EvertzServerStatusResponse> servers;
|
||||
}
|
||||
|
||||
public class EvertzServerStatusResponse
|
||||
{
|
||||
public string id;
|
||||
public string name;
|
||||
public EvertsServerStausNotificationsResponse notify;
|
||||
|
||||
}
|
||||
public class EvertsServerStausNotificationsResponse
|
||||
{
|
||||
public string ip;
|
||||
public List<string> parameters;
|
||||
public string port;
|
||||
public string protocol;
|
||||
}
|
||||
public class EvertzEndpointStatusServerPropertiesConfig
|
||||
{
|
||||
|
||||
public ControlPropertiesConfig control { get; set; }
|
||||
public string serverHostname { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,337 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
using System.Text.RegularExpressions;
|
||||
using Crestron.SimplSharp.Net.Http;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
|
||||
public class EvertzEndpoint : Device
|
||||
{
|
||||
|
||||
|
||||
|
||||
public IBasicCommunication Communication { get; private set; }
|
||||
public CommunicationGather PortGather { get; private set; }
|
||||
public GenericCommunicationMonitor CommunicationMonitor { get; private set; }
|
||||
|
||||
private GenericHttpClient Client;
|
||||
public string userName;
|
||||
public string password;
|
||||
public string Address;
|
||||
private bool OnlineStatus;
|
||||
public BoolFeedback OnlineFeedback;
|
||||
public IntFeedback PresetFeedback;
|
||||
|
||||
|
||||
public bool isSubscribed;
|
||||
|
||||
|
||||
|
||||
CrestronQueue CommandQueue;
|
||||
|
||||
public Dictionary<string, EvertzEndpointPort> Ports;
|
||||
|
||||
private string _ControllerKey;
|
||||
|
||||
|
||||
private EvertzEndpointStatusServer StatusServer;
|
||||
private String StatusServerId;
|
||||
|
||||
/// <summary>
|
||||
/// Shows received lines as hex
|
||||
/// </summary>
|
||||
public bool ShowHexResponse { get; set; }
|
||||
|
||||
public EvertzEndpoint(string key, string name, EvertzEndpointPropertiesConfig props, string type) :
|
||||
base(key, name)
|
||||
{
|
||||
|
||||
|
||||
this.Address = props.address;
|
||||
Client = new GenericHttpClient(string.Format("{0}-GenericWebClient", name), string.Format("{0}-GenericWebClient", name), this.Address);
|
||||
Client.ResponseRecived += new EventHandler<GenericHttpClientEventArgs>(Client_ResponseRecived);
|
||||
Ports = new Dictionary<string, EvertzEndpointPort>();
|
||||
if (type.ToLower() == "mma10g-trs4k")
|
||||
{
|
||||
//create port hdmi 01
|
||||
EvertzEndpointPort hdmi1 = new EvertzEndpointPort("HDMI01", "131.0@s", "136.0@s");
|
||||
EvertzEndpointPort hdmi2 = new EvertzEndpointPort("HDMI02", "131.1@s", "136.1@s");
|
||||
// add to dictionay with all keys
|
||||
addPortToDictionary(hdmi1);
|
||||
addPortToDictionary(hdmi2);
|
||||
}
|
||||
_ControllerKey = null;
|
||||
if (props.controllerKey != null)
|
||||
{
|
||||
_ControllerKey = props.controllerKey;
|
||||
}
|
||||
AddPostActivationAction( () => {PostActivation();});
|
||||
CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
|
||||
if (props.CommunicationMonitorProperties != null)
|
||||
{
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Client, props.CommunicationMonitorProperties);
|
||||
}
|
||||
else
|
||||
{
|
||||
CommunicationMonitor = new GenericCommunicationMonitor(this, Client, 40000, 120000, 300000, "v.api/apis/EV/SERVERSTATUS");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Helper method
|
||||
/// </summary>
|
||||
/// <param name="port"></param>
|
||||
private void addPortToDictionary(EvertzEndpointPort port)
|
||||
{
|
||||
Ports.Add(port.PortName, port);
|
||||
Ports.Add(port.ResolutionVarID, port);
|
||||
Ports.Add(port.SyncVarID, port);
|
||||
//PollForState(port.SyncVarID);
|
||||
//PollForState(port.ResolutionVarID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override bool CustomActivate()
|
||||
{
|
||||
|
||||
// Create Device -> Constructor fires
|
||||
// PreActivations get called
|
||||
// CustomActivate Gets Called Anything that is involved with this single class Ex: Connection, Setup Feedback, Etc.
|
||||
// After this point all devices are ready for interaction
|
||||
// PostActivation gets called. Use this for interClass activation.
|
||||
CommunicationMonitor.Start();
|
||||
OnlineFeedback = new BoolFeedback(() => { return OnlineStatus; });
|
||||
|
||||
|
||||
//CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private void PostActivation()
|
||||
{
|
||||
Debug.Console(2, this, "EvertzEndpoint Post Activation");
|
||||
if (_ControllerKey != null)
|
||||
{
|
||||
StatusServer = DeviceManager.GetDeviceForKey(_ControllerKey) as EvertzEndpointStatusServer;
|
||||
StatusServer.RegisterEvertzEndpoint(this);
|
||||
|
||||
// RegisterStatusServer();
|
||||
// SendStatusRequest();
|
||||
}
|
||||
// PollAll();
|
||||
}
|
||||
|
||||
void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType)
|
||||
{
|
||||
if (programEventType == eProgramStatusEventType.Stopping)
|
||||
{
|
||||
Debug.Console(1, this, "Program stopping. Disabling EvertzStatusServer");
|
||||
if (StatusServerId != null)
|
||||
{
|
||||
//UnregisterServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ProcessServerStatusRequest(EvertsStatusRequesstResponse status)
|
||||
{
|
||||
// var status = JsonConvert.DeserializeObject<EvertsStatusRequesstResponse>(SendStatusRequest());
|
||||
if (status.error != null)
|
||||
{
|
||||
|
||||
}
|
||||
else if (status.data != null)
|
||||
{
|
||||
foreach (var server in status.data.servers)
|
||||
{
|
||||
if (server.name == string.Format("{0}-{1}", this.Name, StatusServer.Address))
|
||||
{
|
||||
StatusServerId = server.id;
|
||||
Debug.Console(2, this, "EvertzEndpoint {0} StatusServer {1} Registered ID {2}", Name, StatusServer.Name, StatusServerId);
|
||||
/*
|
||||
|
||||
foreach (var port in Ports)
|
||||
{
|
||||
// TODO JTA: This needs a better check
|
||||
// you get a {"status": "success"} or "error": "error to register notification- Variable exists.."
|
||||
if (!server.notify.parameters.Contains(port.Value.ResolutionVarID))
|
||||
{
|
||||
RegisterForNotification(StatusServerId, port.Value.ResolutionVarID);
|
||||
}
|
||||
if (!server.notify.parameters.Contains(port.Value.ResolutionVarID))
|
||||
{
|
||||
RegisterForNotification(StatusServerId, port.Value.SyncVarID);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
StatusServerId = null;
|
||||
}
|
||||
}
|
||||
private void RegisterServerWithEndpoint()
|
||||
{
|
||||
/*
|
||||
var registrationResult = RegisterServer(StatusServer.Address, string.Format("{0}-{1}", this.Name, StatusServer.Address), StatusServer.Server.Port.ToString());
|
||||
Debug.Console(2, this, "EvertzEndpointStatusServer Registration Result with device {0}\n{1}", Address, registrationResult);
|
||||
if (registrationResult.Contains("success"))
|
||||
{
|
||||
RegisterStatusServer();
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Console(0, this, "EvertzEndpointStatusServer RegisterServerWithEndpoint with device {0}\n{1}", Address, registrationResult);
|
||||
|
||||
}
|
||||
* */
|
||||
}
|
||||
|
||||
public void PollAll()
|
||||
{
|
||||
string collection = "";
|
||||
foreach (var parameter in Ports)
|
||||
{
|
||||
if (parameter.Key.Contains("@"))
|
||||
{
|
||||
collection = collection + parameter.Key + ",";
|
||||
}
|
||||
}
|
||||
collection = collection.Substring(0, collection.Length - 1);
|
||||
SendGetRequest(collection);
|
||||
}
|
||||
public void PollForState(string varId)
|
||||
{
|
||||
try
|
||||
{
|
||||
SendGetRequest(varId);
|
||||
//var returnState = JsonConvert.DeserializeObject<EvertzPortRestResponse>(SendGetRequest(varId));
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Console(0, this, "PollForState {0}", e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ProcessGetParameterResponse(EvertzPortRestResponse response)
|
||||
{
|
||||
var PortObject = Ports[response.id];
|
||||
if (response.name == "Input Status")
|
||||
{
|
||||
if (response.value == "Missing") { PortObject.SyncDetected = false; }
|
||||
else { PortObject.SyncDetected = true; }
|
||||
}
|
||||
}
|
||||
public void SendGetRequest(string s)
|
||||
{
|
||||
Client.SendText("v.api/apis/EV/GET/parameter/{0}", s);
|
||||
}
|
||||
|
||||
public void SendStatusRequest()
|
||||
{
|
||||
Client.SendText("/v.api/apis/EV/SERVERSTATUS");
|
||||
}
|
||||
public void RegisterServer(string hostname, string servername, string port)
|
||||
{
|
||||
Client.SendText("v.api/apis/EV/SERVERADD/server/{0}/{1}/{2}/udp", hostname, servername, port);
|
||||
}
|
||||
public void UnregisterServer()
|
||||
{
|
||||
if (StatusServerId != null)
|
||||
{
|
||||
Client.SendTextNoResponse("v.api/apis/EV/SERVERDEL/server/{0}", StatusServerId);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO JTA: Craete a UnregisterServerFast using DispatchASync.
|
||||
public void RegisterForNotification(string varId)
|
||||
{
|
||||
Client.SendText("v.api/apis/EV/NOTIFYADD/parameter/{0}/{1}", StatusServerId, varId);
|
||||
}
|
||||
|
||||
|
||||
void Client_ResponseRecived(object sender, GenericHttpClientEventArgs e)
|
||||
{
|
||||
if (e.Error == HTTP_CALLBACK_ERROR.COMPLETED)
|
||||
{
|
||||
if (e.RequestPath.Contains("GET/parameter/"))
|
||||
{
|
||||
// Get Parameter response
|
||||
if (!e.ResponseText.Contains("["))
|
||||
ProcessGetParameterResponse(JsonConvert.DeserializeObject<EvertzPortRestResponse>(e.ResponseText));
|
||||
else if (e.ResponseText.Contains("["))
|
||||
{
|
||||
List<EvertzPortRestResponse> test = JsonConvert.DeserializeObject<List<EvertzPortRestResponse>>(e.ResponseText);
|
||||
foreach (var thing in test)
|
||||
{
|
||||
ProcessGetParameterResponse(thing);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else if (e.RequestPath.Contains("SERVERSTATUS"))
|
||||
{
|
||||
PollAll();
|
||||
ProcessServerStatusRequest(JsonConvert.DeserializeObject<EvertsStatusRequesstResponse>(e.ResponseText));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public class EvertzPortsRestResponse
|
||||
{
|
||||
List<EvertzPortRestResponse> test;
|
||||
}
|
||||
public class EvertzPortRestResponse
|
||||
{
|
||||
public string id;
|
||||
public string name;
|
||||
public string type;
|
||||
public string value;
|
||||
|
||||
}
|
||||
|
||||
public class EvertzEndpointPort
|
||||
{
|
||||
public string PortName;
|
||||
public string SyncVarID;
|
||||
public string ResolutionVarID;
|
||||
public bool SyncDetected;
|
||||
public string Resolution;
|
||||
public BoolFeedback SyncDetectedFeedback;
|
||||
|
||||
public EvertzEndpointPort (string portName, string syncVarId, string resolutionVarId)
|
||||
{
|
||||
PortName = portName;
|
||||
SyncVarID = syncVarId;
|
||||
ResolutionVarID = resolutionVarId;
|
||||
SyncDetectedFeedback = new BoolFeedback(() => { return SyncDetected; });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
using PepperDash.Core;
|
||||
using PepperDash.Essentials.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class EvertzEndpointPropertiesConfig
|
||||
{
|
||||
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
|
||||
|
||||
public ControlPropertiesConfig Control { get; set; }
|
||||
public string userName { get; set; }
|
||||
public string password { get; set; }
|
||||
public string address { get; set; }
|
||||
public string controllerKey { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Crestron.SimplSharp;
|
||||
|
||||
namespace PepperDash.Essentials.Devices.Common
|
||||
{
|
||||
public class EvertzEndpointVarIds
|
||||
{
|
||||
private string HdmiPort01SyncStatus = "136.0";
|
||||
}
|
||||
}
|
||||
@@ -107,21 +107,6 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
properties.ToString());
|
||||
return new DigitalLogger(key, name, props);
|
||||
}
|
||||
else if (groupName == "evertzendpoint")
|
||||
{
|
||||
// var comm = CommFactory.CreateCommForDevice(dc);
|
||||
var props = JsonConvert.DeserializeObject<EvertzEndpointPropertiesConfig>(
|
||||
properties.ToString());
|
||||
return new EvertzEndpoint(key, name, props, typeName);
|
||||
}
|
||||
else if (typeName == "evertzendpointstatusserver")
|
||||
{
|
||||
var server = CommFactory.CreateCommForDevice(dc) as GenericUdpServer;
|
||||
|
||||
var props = JsonConvert.DeserializeObject<EvertzEndpointStatusServerPropertiesConfig>(
|
||||
properties.ToString());
|
||||
return new EvertzEndpointStatusServer(key, name, server, props);
|
||||
}
|
||||
else if (typeName == "genericaudiooutwithvolume")
|
||||
{
|
||||
var zone = dc.Properties.Value<uint>("zone");
|
||||
@@ -395,13 +380,6 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
}
|
||||
|
||||
}
|
||||
//else if (typeName == "qscdsp")
|
||||
//{
|
||||
// var comm = CommFactory.CreateCommForDevice(dc);
|
||||
// var props = JsonConvert.DeserializeObject<QscDspPropertiesConfig>(
|
||||
// properties.ToString());
|
||||
// return new QscDsp(key, name, comm, props);
|
||||
//}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,11 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||
|
||||
public IntFeedback UltrasonicSensitivityInVacantStateFeedback { get; private set; }
|
||||
|
||||
public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; }
|
||||
public IntFeedback UltrasonicSensitivityInOccupiedStateFeedback { get; private set; }
|
||||
|
||||
public BoolFeedback RawOccupancyPirFeedback { get; private set; }
|
||||
|
||||
public BoolFeedback RawOccupancyUsFeedback { get; private set; }
|
||||
|
||||
|
||||
public GlsOdtOccupancySensorController(string key, string name, GlsOdtCCn sensor)
|
||||
@@ -38,11 +42,15 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||
|
||||
UltrasonicAEnabledFeedback = new BoolFeedback(() => OccSensor.UsAEnabledFeedback.BoolValue);
|
||||
|
||||
UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UsBEnabledFeedback.BoolValue);
|
||||
UltrasonicBEnabledFeedback = new BoolFeedback(() => OccSensor.UsBEnabledFeedback.BoolValue);
|
||||
|
||||
RawOccupancyPirFeedback = new BoolFeedback(() => OccSensor.RawOccupancyPirFeedback.BoolValue);
|
||||
|
||||
RawOccupancyUsFeedback = new BoolFeedback(() => OccSensor.RawOccupancyUsFeedback.BoolValue);
|
||||
|
||||
UltrasonicSensitivityInVacantStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInVacantStateFeedback.UShortValue);
|
||||
|
||||
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
|
||||
UltrasonicSensitivityInOccupiedStateFeedback = new IntFeedback(() => OccSensor.UsSensitivityInOccupiedStateFeedback.UShortValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -52,20 +60,23 @@ namespace PepperDash.Essentials.Devices.Common.Occupancy
|
||||
/// <param name="device"></param>
|
||||
/// <param name="args"></param>
|
||||
protected override void OccSensor_GlsOccupancySensorChange(GlsOccupancySensorBase device, GlsOccupancySensorChangeEventArgs args)
|
||||
{
|
||||
if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
|
||||
AndWhenVacatedFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId)
|
||||
OrWhenVacatedFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.UsAEnabledFeedbackEventId)
|
||||
UltrasonicAEnabledFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
|
||||
UltrasonicBEnabledFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
|
||||
UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
|
||||
UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
|
||||
|
||||
{
|
||||
if (args.EventId == GlsOccupancySensorBase.AndWhenVacatedFeedbackEventId)
|
||||
AndWhenVacatedFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.OrWhenVacatedFeedbackEventId)
|
||||
OrWhenVacatedFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.UsAEnabledFeedbackEventId)
|
||||
UltrasonicAEnabledFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.UsBEnabledFeedbackEventId)
|
||||
UltrasonicBEnabledFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyPirFeedbackEventId)
|
||||
RawOccupancyPirFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.RawOccupancyUsFeedbackEventId)
|
||||
RawOccupancyUsFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInOccupiedStateFeedbackEventId)
|
||||
UltrasonicSensitivityInOccupiedStateFeedback.FireUpdate();
|
||||
else if (args.EventId == GlsOccupancySensorBase.UsSensitivityInVacantStateFeedbackEventId)
|
||||
UltrasonicSensitivityInVacantStateFeedback.FireUpdate();
|
||||
|
||||
base.OccSensor_GlsOccupancySensorChange(device, args);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
public string address;
|
||||
private bool OnlineStatus;
|
||||
public BoolFeedback OnlineFeedback;
|
||||
private ushort CurrentPreset;
|
||||
//private ushort CurrentPreset;
|
||||
public IntFeedback PresetFeedback;
|
||||
|
||||
public Dictionary<uint, DigitalLoggerCircuit> CircuitStatus;
|
||||
@@ -103,7 +103,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
});
|
||||
CircuitIsCritical[circuit] = new BoolFeedback(() =>
|
||||
{
|
||||
if (CircuitStatus[circuit].critical != null)
|
||||
if (CircuitStatus.ContainsKey(circuit))
|
||||
{
|
||||
return CircuitStatus[circuit].critical;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ namespace PepperDash.Essentials.Devices.Common
|
||||
});
|
||||
CircuitState[circuit] = new BoolFeedback(() =>
|
||||
{
|
||||
if (CircuitStatus[circuit].state != null)
|
||||
if (CircuitStatus.ContainsKey(circuit))
|
||||
{
|
||||
return CircuitStatus[circuit].state;
|
||||
}
|
||||
|
||||
@@ -336,8 +336,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
||||
if(b.Agenda != null)
|
||||
meeting.Agenda = b.Agenda.Value;
|
||||
if(b.Time != null)
|
||||
{
|
||||
meeting.StartTime = b.Time.StartTime.Value;
|
||||
meeting.EndTime = b.Time.EndTime.Value;
|
||||
}
|
||||
if(b.Privacy != null)
|
||||
meeting.Privacy = CodecCallPrivacy.ConvertToDirectionEnum(b.Privacy.Value);
|
||||
|
||||
|
||||
@@ -979,8 +979,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
meeting.StartTime = b.StartTime;
|
||||
if (b.EndTime != null)
|
||||
meeting.EndTime = b.EndTime;
|
||||
if (b.IsPrivate != null)
|
||||
meeting.Privacy = b.IsPrivate ? eMeetingPrivacy.Private : eMeetingPrivacy.Public;
|
||||
|
||||
meeting.Privacy = b.IsPrivate ? eMeetingPrivacy.Private : eMeetingPrivacy.Public;
|
||||
|
||||
// No meeting.Calls data exists for Zoom Rooms. Leaving out for now.
|
||||
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
public bool CommDebuggingIsOn;
|
||||
|
||||
CTimer LoginMessageReceivedTimer;
|
||||
CTimer RetryConnectionTimer;
|
||||
//CTimer LoginMessageReceivedTimer;
|
||||
//CTimer RetryConnectionTimer;
|
||||
|
||||
/// <summary>
|
||||
/// Gets and returns the scaled volume of the codec
|
||||
|
||||
@@ -47,13 +47,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
||||
|
||||
private bool isZooming;
|
||||
|
||||
private bool isFocusing;
|
||||
//private bool isFocusing;
|
||||
|
||||
private bool isMoving
|
||||
{
|
||||
get
|
||||
{
|
||||
return isPanning || isTilting || isZooming || isFocusing;
|
||||
return isPanning || isTilting || isZooming;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||