mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-17 05:35:03 +00:00
fix: add tieline type to output for console & CWS
This commit is contained in:
@@ -1,13 +1,6 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Crestron.SimplSharp;
|
||||
using Crestron.SimplSharpPro;
|
||||
using Crestron.SimplSharpPro.DM;
|
||||
|
||||
using PepperDash.Core;
|
||||
|
||||
namespace PepperDash.Essentials.Core
|
||||
{
|
||||
@@ -89,8 +82,8 @@ namespace PepperDash.Essentials.Core
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("Tie line: {0}:{1} --> {2}:{3}", SourcePort.ParentDevice.Key, SourcePort.Key,
|
||||
DestinationPort.ParentDevice.Key, DestinationPort.Key);
|
||||
return string.Format("Tie line: {0}:{1} --> {2}:{3} {4}", SourcePort.ParentDevice.Key, SourcePort.Key,
|
||||
DestinationPort.ParentDevice.Key, DestinationPort.Key, Type.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +102,6 @@ namespace PepperDash.Essentials.Core
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
static TieLineCollection _Default;
|
||||
private static TieLineCollection _Default;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
using Crestron.SimplSharp.WebScripting;
|
||||
using Newtonsoft.Json;
|
||||
using PepperDash.Core.Web.RequestHandlers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||
{
|
||||
@@ -15,11 +12,13 @@ namespace PepperDash.Essentials.Core.Web.RequestHandlers
|
||||
|
||||
protected override void HandleGet(HttpCwsContext context)
|
||||
{
|
||||
var tieLineString = JsonConvert.SerializeObject(TieLineCollection.Default.Select((tl) => new {
|
||||
var tieLineString = JsonConvert.SerializeObject(TieLineCollection.Default.Select((tl) => new
|
||||
{
|
||||
sourceKey = tl.SourcePort.ParentDevice.Key,
|
||||
sourcePort = tl.SourcePort.Key,
|
||||
destinationKey = tl.DestinationPort.ParentDevice.Key,
|
||||
destinationPort = tl.DestinationPort.Key
|
||||
destinationPort = tl.DestinationPort.Key,
|
||||
type = tl.Type.ToString(),
|
||||
}));
|
||||
|
||||
context.Response.StatusCode = 200;
|
||||
|
||||
Reference in New Issue
Block a user