Compare commits

...

31 Commits

Author SHA1 Message Date
Trevor Payne
fbba6e089a Merge branch 'development' into feature/GenericHttpClientOptions 2023-07-04 23:56:27 -05:00
Trevor Payne
cef78c881e feature: Add Additional Options for Generic Http Client
Feature: Add constructor to set client options

feature: Add overloaded methods to set Request Types for Client Requests
2023-06-29 09:51:33 -05:00
Andrew Welker
e1ce35863f Merge pull request #1109 from PepperDash/release/1.14.0
Release/1.14.0
2023-06-07 10:11:49 -06:00
Andrew Welker
acd3bad1f2 Merge pull request #1108 from PepperDash/release/1.14.0
1.14.0
2023-06-07 09:54:34 -06:00
Andrew Welker
08514915b2 Merge branch 'main' into release/1.14.0 2023-05-09 10:22:08 -06:00
Andrew Welker
ea464038b9 Merge pull request #1106 from PepperDash/hotfix/remove-old-workflow
Hotfix/remove old workflow
2023-04-27 13:13:37 -06:00
Andrew Welker
c4c44d02f5 Merge branch 'development' into hotfix/remove-old-workflow 2023-04-27 12:54:18 -06:00
Andrew Welker
3fe5d89904 Merge pull request #1105 from PepperDash/hotfix/remove-old-workflow
Delete add-issues-to-project.yml
2023-04-27 12:54:08 -06:00
Jason T Alborough
c0d78e8978 Delete add-issues-to-project.yml 2023-04-27 13:59:36 -04:00
Neil Dorin
3716dd0824 Merge pull request #1104 from PepperDash/hotfix/dm-build-issues
Enable DM TX/RX builds for blade chassis DEV
2023-04-27 10:22:15 -06:00
Andrew Welker
ebe8ee5653 Merge branch 'development' into hotfix/dm-build-issues 2023-04-27 09:55:26 -06:00
Andrew Welker
432934ad00 Merge pull request #1103 from PepperDash/hotfix/dm-build-issues
Enable DM TX/RX builds for blade chassis
2023-04-27 09:55:08 -06:00
Andrew Welker
372cf86613 Merge pull request #1100 from PepperDash/feature/IHasBatteryStats
Add Interfaces for Battery Status Tracking
2023-04-27 09:51:15 -06:00
Andrew Welker
67c99a9ad4 Merge branch 'development' into feature/IHasBatteryStats 2023-04-27 09:26:56 -06:00
Andrew Welker
31085d42a9 Merge pull request #1099 from PepperDash/hotfix/DisplayPortHdcp
Resolve Issues with HDCP Displayport
2023-04-27 09:26:41 -06:00
Andrew Welker
0df315426b fix: use new interface for parentDev
The GetDmRmcController & GetDmTxController methods were
previously ignoring the `DmBladeChassisController` type.
This was causing transmitters connected to a DM blade chassis to
not be built,
2023-04-26 13:32:49 -06:00
Andrew Welker
6ddbdd90c7 feat: add new interface and update Chassis controllers 2023-04-26 13:32:18 -06:00
Andrew Welker
39e1e5167b Merge branch 'development' into hotfix/DisplayPortHdcp 2023-04-20 11:51:21 -06:00
Trevor Payne
7f916d1d2f refactor: change IHasPowerCycleWithBatteries to IHasPowerCycleWithBattery for clarity 2023-04-20 12:31:50 -05:00
Trevor Payne
7c7f087898 feature: added additional parameters to IHasPowerCycleWithBatteries 2023-04-20 12:29:34 -05:00
Trevor Payne
898dab1d9a feature: add several interfaces for battery status on devices
refactor: mark existing PDU interfaces in PepperDash_Essentials_Core.Devices as obsolete

refactor: replicate existing PDU interfaces in PepperDash.Essentials.Core
2023-04-20 12:21:45 -05:00
Andrew Welker
c53cad8119 Merge pull request #1086 from PepperDash/hotfix/pd-core-update-ssh-issues
Update PD Core to 1.2.1 DEV
2023-04-07 11:52:23 -06:00
Andrew Welker
82e8b4b203 Merge branch 'development' into hotfix/pd-core-update-ssh-issues 2023-04-07 11:37:31 -06:00
Andrew Welker
8c3b891255 Merge pull request #1082 from PepperDash/feature/vc4-fileio
Update VC4 file handling
2023-04-07 11:25:01 -06:00
jtalborough
10fc8ee30b Merge remote-tracking branch 'origin/feature/vc4-fileio' into development 2023-03-28 16:26:32 -04:00
Andrew Welker
8da8b8c584 Merge pull request #1080 from PepperDash/hotfix/dge-hdcp
Add HDCP & Bridging support for DGE Devices DEV
2023-03-27 16:40:39 -06:00
Andrew Welker
c7e0326b8c Merge branch 'development' into hotfix/dge-hdcp 2023-03-27 16:27:16 -06:00
Neil Dorin
465aa947cf Merge pull request #1078 from PepperDash/release/1.13.0
1.13.0 DEV
2023-03-24 13:08:18 -06:00
jta
3b2fa8aec5 fix: issue with file path on four sereis
refactor: remove redundnet /
2023-01-09 17:16:03 -05:00
jta
ffa864c71b Merge remote-tracking branch 'origin/development' into feature/vc4-fileio 2023-01-09 15:45:38 -05:00
jta
112a2b7382 feature: fileio now uses Global.FilePathPrefix as its directory
All read wirtes now use the current working essentials directory. This resolves issues between 3 series, 4 series, and VC-4
2022-12-20 15:16:18 -05:00
11 changed files with 342 additions and 118 deletions

View File

@@ -1,37 +0,0 @@
name: Add bugs to bugs project
on:
issues:
types:
- opened
- labeled
jobs:
check-secret:
runs-on: ubuntu-latest
outputs:
my-key: ${{ steps.my-key.outputs.defined }}
steps:
- id: my-key
if: "${{ env.MY_KEY != '' }}"
run: echo "::set-output name=defined::true"
env:
MY_KEY: ${{ secrets.PROJECT_URL }}
throw-error:
name: Check
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.my-key != 'true'
steps:
- run: echo "The Project URL Repo Secret is empty"
add-to-project:
name: Add issue to project
runs-on: ubuntu-latest
needs: [check-secret]
if: needs.check-secret.outputs.my-key == 'true'
steps:
- uses: actions/add-to-project@main
with:
project-url: ${{ secrets.PROJECT_URL }}
github-token: ${{ secrets.GH_PROJECTS_PASSWORD }}

View File

@@ -1,11 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.ComponentModel;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Net.Http; using Crestron.SimplSharp.Net.Http;
using Crestron.SimplSharp.Ssh;
using Crestron.SimplSharpPro.EthernetCommunication;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Core.DebugThings;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
@@ -17,52 +16,130 @@ namespace PepperDash.Essentials.Core
public GenericHttpClient(string key, string name, string hostname) public GenericHttpClient(string key, string name, string hostname)
: base(key, name) : base(key, name)
{ {
Client = new HttpClient(); Client = new HttpClient {HostName = hostname};
Client.HostName = hostname; }
public GenericHttpClient(string key, string name, string hostname, GenericHttpClientConnectionOptions options)
: base(key, name)
{
Client = new HttpClient
{
HostName = hostname,
Accept = options.Accept,
KeepAlive = options.KeepAlive,
Password = options.Password,
Timeout = options.Timeout,
TimeoutEnabled = options.TimeoutEnabled,
UserAgent = options.UserAgent,
UserName = options.UserName,
Version = options.Version
};
if (options.Port > 0) Client.Port = options.Port;
} }
/// <summary> /// <summary>
/// /// Send a HTTP Get Request to a client
/// </summary> /// </summary>
/// <param name="path"></param> /// <param name="path">Path to request node</param>
public void SendText(string path) public void SendText(string path)
{ {
HttpClientRequest request = new HttpClientRequest(); var url = string.Format("http://{0}/{1}", Client.HostName, path);
string url = string.Format("http://{0}/{1}", Client.HostName, path); var request = new HttpClientRequest()
request.Url = new UrlParser(url);
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
}
public void SendText(string format, params object[] items)
{ {
HttpClientRequest request = new HttpClientRequest(); Url = new UrlParser(url)
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items)); };
request.Url = new UrlParser(url); var error = Client.DispatchAsyncEx(request, Response, request);
HttpClient.DISPATCHASYNC_ERROR error = Client.DispatchAsyncEx(request, Response, request);
} }
/// <summary>
/// Send a HTTP Get Request to a client using a formatted string
/// </summary>
/// <param name="format">Path</param>
/// <param name="items">Parameters for Path String Formatting</param>
public void SendText(string format, params object[] items)
{
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
var request = new HttpClientRequest()
{
Url = new UrlParser(url)
};
var error = Client.DispatchAsyncEx(request, Response, request);
}
/// <summary>
/// Send a unidirectional HTTP Get Request to a client using a formatted string
/// </summary>
/// <param name="format">Path</param>
/// <param name="items">Parameters for Path String Formatting</param>
public void SendTextNoResponse(string format, params object[] items) public void SendTextNoResponse(string format, params object[] items)
{ {
HttpClientRequest request = new HttpClientRequest(); var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
string url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items)); var request = new HttpClientRequest()
request.Url = new UrlParser(url); {
Url = new UrlParser(url)
};
Client.Dispatch(request);
}
/// <summary>
/// Send an HTTP Request of a specific request type
/// </summary>
/// <param name="requestType">HTTP Request Type</param>
/// <param name="path">Path to request node</param>
public void SendText(RequestType requestType, string path)
{
var url = string.Format("http://{0}/{1}", Client.HostName, path);
var request = new HttpClientRequest()
{
Url = new UrlParser(url),
RequestType = requestType
};
var error = Client.DispatchAsyncEx(request, Response, request);
}
/// <summary>
/// Send an HTTP Request of a specific request type using a formatted string
/// </summary>
/// <param name="requestType">HTTP Request Type</param>
/// <param name="format">Path</param>
/// <param name="items">Parameters for Path String Formatting</param>
public void SendText(RequestType requestType, string format, params object[] items)
{
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
var request = new HttpClientRequest()
{
Url = new UrlParser(url),
RequestType = requestType
};
var error = Client.DispatchAsyncEx(request, Response, request);
}
/// <summary>
/// Send a unidirectional HTTP Request of a specific request type using a formatted string
/// </summary>
/// <param name="requestType">HTTP Request Type</param>
/// <param name="format">Path</param>
/// <param name="items">Parameters for Path String Formatting</param>
public void SendTextNoResponse(RequestType requestType, string format, params object[] items)
{
var url = string.Format("http://{0}/{1}", Client.HostName, string.Format(format, items));
var request = new HttpClientRequest()
{
Url = new UrlParser(url)
};
Client.Dispatch(request); Client.Dispatch(request);
} }
private void Response(HttpClientResponse response, HTTP_CALLBACK_ERROR error, object request) private void Response(HttpClientResponse response, HTTP_CALLBACK_ERROR error, object request)
{ {
if (error == HTTP_CALLBACK_ERROR.COMPLETED) if (error != HTTP_CALLBACK_ERROR.COMPLETED) return;
{
var responseReceived = response; var responseReceived = response;
if (responseReceived.ContentString.Length > 0) if (responseReceived.ContentString.Length <= 0) return;
{ if (ResponseRecived == null) return;
if (ResponseRecived != null) var httpClientRequest = request as HttpClientRequest;
ResponseRecived(this, new GenericHttpClientEventArgs(responseReceived.ContentString, (request as HttpClientRequest).Url.ToString(), error)); if (httpClientRequest != null)
} ResponseRecived(this, new GenericHttpClientEventArgs(responseReceived.ContentString, httpClientRequest.Url.ToString(), error));
}
} }
@@ -100,6 +177,8 @@ namespace PepperDash.Essentials.Core
#endregion #endregion
} }
public class GenericHttpClientEventArgs : EventArgs public class GenericHttpClientEventArgs : EventArgs
{ {
public string ResponseText { get; private set; } public string ResponseText { get; private set; }
@@ -112,4 +191,84 @@ namespace PepperDash.Essentials.Core
Error = error; Error = error;
} }
} }
/// <summary>
/// Objedct to set parameters for HTTP Requests
/// </summary>
public class GenericHttpClientConnectionOptions
{
/// <summary>
/// Gets or sets content types that are acceptable for the response. The default
/// value is "text/html, image/gif, image/jpeg, image/png, */*".
/// </summary>
[DefaultValue("text/html, image/gif, image/jpeg, image/png")]
public string Accept { get; set; }
/// <summary>
/// Controls whether to use HTTP Keep-Alive to keep the connection alive between
/// requests. If enabled (true) , once a request is made and a connection is
/// established, this connection is kept open and used for future requests. If
/// disabled, the connection is closed, and a new connection is created for future
/// requests.
/// </summary>
[DefaultValue(true)]
public bool KeepAlive { get; set; }
/// <summary>
/// This property controls whether the request operation will do an automatic
/// timeout checking. If timeout handling is turned on (i.e. this property is
/// set to true) and a request takes longer than Timeout, it will be terminated.
/// </summary>
[DefaultValue(true)]
public bool TimeoutEnabled { get; set; }
/// <summary>
/// Gets or sets the maximum amount of time (in seconds) that a client will wait
/// for a server response within a single request. The default value is 60 seconds
/// (1 minute). The timeout handling can be activated via the TimeoutEnabled
/// property.
/// </summary>
[DefaultValue(60)]
public int Timeout { get; set; }
/// <summary>
/// Gets or sets the version identifier of the UserAgent. Can be used to mimic
/// particular browsers like Internet Explorer 6.0
/// </summary>
[DefaultValue("1.1")]
public string Version { get; set; }
/// <summary>
/// Gets or sets the identifier of the software being used to retrieve data via
/// the URL. Some custom HTTP servers check this HTTP header to provide content
/// optimized for particular HTTP browsers.
/// </summary>
[DefaultValue("Crestron SimplSharp HTTP Client")]
public string UserAgent { get; set; }
/// <summary>
/// Name that will be inserted into the Authorization HTTP header in the request
/// to the server.
/// </summary>
public string UserName { get; set; }
/// <summary>
/// Password that will be inserted into the Authorization HTTP header in the
/// request to the server.
/// </summary>
public string Password { get; set; }
/// <summary>
/// The server Port that you intend the client to connect to. If you do not
/// assign a port number on this property, the port number in the parsed URL
/// will be used. If a port number is assigned in the parsed URL, it will take
/// precedence over this property.
/// </summary>
/// <remarks>
/// If you do not assign a port number on this property, the port number in the
/// parsed URL will be used.
/// </remarks>
///
public int Port { get; set; }
}
} }

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
@@ -8,6 +9,7 @@ namespace PepperDash_Essentials_Core.Devices
/// <summary> /// <summary>
/// Interface for any device that is able to control it'spower and has a configurable reboot time /// Interface for any device that is able to control it'spower and has a configurable reboot time
/// </summary> /// </summary>
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
{ {
/// <summary> /// <summary>
@@ -24,6 +26,7 @@ namespace PepperDash_Essentials_Core.Devices
/// <summary> /// <summary>
/// Interface for any device that contains a collection of IHasPowerReboot Devices /// Interface for any device that contains a collection of IHasPowerReboot Devices
/// </summary> /// </summary>
[Obsolete("PepperDash_Essentials_Core.Devices is Deprecated - use PepperDash.Essentials.Core")]
public interface IHasControlledPowerOutlets : IKeyName public interface IHasControlledPowerOutlets : IKeyName
{ {
/// <summary> /// <summary>

View File

@@ -0,0 +1,87 @@
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash.Essentials.Core
{
/// <summary>
/// Interface for any device that has a battery that can be monitored
/// </summary>
public interface IHasBatteryStats : IKeyName
{
int BatteryPercentage { get; }
int BatteryCautionThresholdPercentage { get; }
int BatteryWarningThresholdPercentage { get; }
BoolFeedback BatteryIsWarningFeedback { get; }
BoolFeedback BatteryIsCautionFeedback { get; }
BoolFeedback BatteryIsOkFeedback { get; }
IntFeedback BatteryPercentageFeedback { get; }
}
/// <summary>
/// Interface for any device that has a battery that can be monitored and the ability to charge and discharge
/// </summary>
public interface IHasBatteryCharging : IHasBatteryStats
{
BoolFeedback BatteryIsCharging { get; }
}
/// <summary>
/// Interface for any device that has multiple batteries that can be monitored
/// </summary>
public interface IHasBatteries : IKeyName
{
ReadOnlyDictionary<string, IHasBatteryStats> Batteries { get; }
}
public interface IHasBatteryStatsExtended : IHasBatteryStats
{
int InputVoltage { get; }
int OutputVoltage { get; }
int InptuCurrent { get; }
int OutputCurrent { get; }
IntFeedback InputVoltageFeedback { get; }
IntFeedback OutputVoltageFeedback { get; }
IntFeedback InputCurrentFeedback { get; }
IntFeedback OutputCurrentFeedback { get; }
}
/// <summary>
/// Interface for any device that is able to control its power, has a configurable reboot time, and has batteries that can be monitored
/// </summary>
public interface IHasPowerCycleWithBattery : IHasPowerCycle, IHasBatteryStats
{
}
/// <summary>
/// Interface for any device that is able to control it's power and has a configurable reboot time
/// </summary>
public interface IHasPowerCycle : IKeyName, IHasPowerControlWithFeedback
{
/// <summary>
/// Delay between power off and power on for reboot
/// </summary>
int PowerCycleTimeMs { get; }
/// <summary>
/// Reboot outlet
/// </summary>
void PowerCycle();
}
/// <summary>
/// Interface for any device that contains a collection of IHasPowerReboot Devices
/// </summary>
public interface IHasControlledPowerOutlets : IKeyName
{
/// <summary>
/// Collection of IPduOutlets
/// </summary>
ReadOnlyDictionary<int, IHasPowerCycle> PduOutlets { get; }
}
}

View File

@@ -23,9 +23,10 @@ namespace PepperDash.Essentials.Core
/// <returns></returns> /// <returns></returns>
public static FileInfo[] GetFiles(string fileName) public static FileInfo[] GetFiles(string fileName)
{ {
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName)); string fullFilePath = Global.FilePathPrefix + fileName;
var files = dirInfo.GetFiles(Path.GetFileName(fileName)); DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath));
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName); var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath));
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath);
if (files.Count() > 0) if (files.Count() > 0)
{ {
return files; return files;
@@ -38,9 +39,10 @@ namespace PepperDash.Essentials.Core
public static FileInfo GetFile(string fileName) public static FileInfo GetFile(string fileName)
{ {
DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fileName)); string fullFilePath = Global.FilePathPrefix + fileName;
var files = dirInfo.GetFiles(Path.GetFileName(fileName)); DirectoryInfo dirInfo = new DirectoryInfo(Path.GetDirectoryName(fullFilePath));
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fileName); var files = dirInfo.GetFiles(Path.GetFileName(fullFilePath));
Debug.Console(0, "FileIO found: {0}, {1}", files.Count(), fullFilePath);
if (files.Count() > 0) if (files.Count() > 0)
{ {
return files.FirstOrDefault(); return files.FirstOrDefault();
@@ -81,7 +83,7 @@ namespace PepperDash.Essentials.Core
{ {
if (fileLock.TryEnter()) if (fileLock.TryEnter())
{ {
DirectoryInfo dirInfo = new DirectoryInfo(file.Name); DirectoryInfo dirInfo = new DirectoryInfo(file.DirectoryName);
Debug.Console(2, "FileIO Getting Data {0}", file.FullName); Debug.Console(2, "FileIO Getting Data {0}", file.FullName);
if (File.Exists(file.FullName)) if (File.Exists(file.FullName))
@@ -202,7 +204,7 @@ namespace PepperDash.Essentials.Core
public static void WriteDataToFile(string data, string filePath) public static void WriteDataToFile(string data, string filePath)
{ {
Thread _WriteFileThread; Thread _WriteFileThread;
_WriteFileThread = new Thread((O) => _WriteFileMethod(data, filePath), null, Thread.eThreadStartOptions.CreateSuspended); _WriteFileThread = new Thread((O) => _WriteFileMethod(data, Global.FilePathPrefix + "/" + filePath), null, Thread.eThreadStartOptions.CreateSuspended);
_WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority; _WriteFileThread.Priority = Thread.eThreadPriority.LowestPriority;
_WriteFileThread.Start(); _WriteFileThread.Start();
Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread"); Debug.Console(0, Debug.ErrorLogLevel.Notice, "New WriteFile Thread");
@@ -217,6 +219,7 @@ namespace PepperDash.Essentials.Core
{ {
if (fileLock.TryEnter()) if (fileLock.TryEnter())
{ {
using (StreamWriter sw = new StreamWriter(filePath)) using (StreamWriter sw = new StreamWriter(filePath))
{ {
sw.Write(data); sw.Write(data);

View File

@@ -200,6 +200,7 @@
<Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" /> <Compile Include="Crestron IO\Relay\GenericRelayDevice.cs" />
<Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" /> <Compile Include="Crestron IO\Relay\ISwitchedOutput.cs" />
<Compile Include="Crestron IO\StatusSign\StatusSignController.cs" /> <Compile Include="Crestron IO\StatusSign\StatusSignController.cs" />
<Compile Include="Devices\PowerInterfaces.cs" />
<Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" /> <Compile Include="Web\RequestHandlers\AppDebugRequestHandler.cs" />
<Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" /> <Compile Include="Web\RequestHandlers\GetFeedbacksForDeviceRequestHandler.cs" />
<Compile Include="Web\EssentialsWebApiHelpers.cs" /> <Compile Include="Web\EssentialsWebApiHelpers.cs" />

View File

@@ -22,7 +22,7 @@ namespace PepperDash.Essentials.DM
/// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions /// Builds a controller for basic DM-RMCs with Com and IR ports and no control functions
/// ///
/// </summary> /// </summary>
public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback public class DmBladeChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback
{ {
private const string NonePortKey = "inputCard0--None"; private const string NonePortKey = "inputCard0--None";

View File

@@ -23,7 +23,7 @@ namespace PepperDash.Essentials.DM
/// ///
/// </summary> /// </summary>
[Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")] [Description("Wrapper class for all DM-MD chassis variants from 8x8 to 32x32")]
public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitch, IRoutingNumericWithFeedback public class DmChassisController : CrestronGenericBridgeableBaseDevice, IDmSwitchWithEndpointOnlineFeedback, IRoutingNumericWithFeedback
{ {
private const string NonePortKey = "inputCard0--None"; private const string NonePortKey = "inputCard0--None";
public DMChassisPropertiesConfig PropertiesConfig { get; set; } public DMChassisPropertiesConfig PropertiesConfig { get; set; }

View File

@@ -436,9 +436,9 @@ namespace PepperDash.Essentials.DM
} }
return rx; return rx;
} }
else if (parentDev is DmChassisController) else if (parentDev is IDmSwitchWithEndpointOnlineFeedback)
{ {
var controller = parentDev as DmChassisController; var controller = parentDev as IDmSwitchWithEndpointOnlineFeedback;
var chassis = controller.Chassis; var chassis = controller.Chassis;
var num = props.ParentOutputNumber; var num = props.ParentOutputNumber;
Debug.Console(1, "Creating DM Chassis device '{0}'. Output number '{1}'.", key, num); Debug.Console(1, "Creating DM Chassis device '{0}'. Output number '{1}'.", key, num);

View File

@@ -127,10 +127,10 @@ namespace PepperDash.Essentials.DM
BasicDmTxControllerBase tx; BasicDmTxControllerBase tx;
bool useChassisForOfflineFeedback = false; bool useChassisForOfflineFeedback = false;
if (parentDev is DmChassisController) if (parentDev is IDmSwitchWithEndpointOnlineFeedback)
{ {
// Get the Crestron chassis and link stuff up // Get the Crestron chassis and link stuff up
var switchDev = (parentDev as DmChassisController); var switchDev = (parentDev as IDmSwitchWithEndpointOnlineFeedback);
var chassis = switchDev.Chassis; var chassis = switchDev.Chassis;
//Check that the input is within range of this chassis' possible inputs //Check that the input is within range of this chassis' possible inputs
@@ -179,6 +179,7 @@ namespace PepperDash.Essentials.DM
return null; return null;
} }
} }
if (parentDev is DmpsRoutingController) if (parentDev is DmpsRoutingController)
{ {
// Get the DMPS chassis and link stuff up // Get the DMPS chassis and link stuff up

View File

@@ -16,10 +16,17 @@ using PepperDash.Essentials.Core;
using PepperDash.Essentials.DM.Config; using PepperDash.Essentials.DM.Config;
namespace PepperDash.Essentials.DM { namespace PepperDash.Essentials.DM {
public interface IDmSwitch { public interface IDmSwitch
{
Switch Chassis { get; } Switch Chassis { get; }
Dictionary<uint, string> TxDictionary { get; } Dictionary<uint, string> TxDictionary { get; }
Dictionary<uint, string> RxDictionary { get; } Dictionary<uint, string> RxDictionary { get; }
} }
public interface IDmSwitchWithEndpointOnlineFeedback : IDmSwitch
{
Dictionary<uint, BoolFeedback> InputEndpointOnlineFeedbacks { get; }
Dictionary<uint, BoolFeedback> OutputEndpointOnlineFeedbacks { get; }
}
} }