mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 05:05:00 +00:00
Merge pull request #1057 from PepperDash/hotfix/video-codec-base-updateDirectoryXsig
fix: updates to resolve directory issues DEV
This commit is contained in:
37
.github/workflows/add-issues-to-project.yml
vendored
Normal file
37
.github/workflows/add-issues-to-project.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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 }}
|
||||||
|
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.Bridges
|
||||||
|
{
|
||||||
|
public class IAnalogInputJoinMap : JoinMapBaseAdvanced
|
||||||
|
{
|
||||||
|
|
||||||
|
[JoinName("InputValue")]
|
||||||
|
public JoinDataComplete InputValue = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Input Value", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
[JoinName("MinimumChange")]
|
||||||
|
public JoinDataComplete MinimumChange = new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "Minimum voltage change required to reflect a change", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Analog });
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinStart">Join this join map will start at</param>
|
||||||
|
public IAnalogInputJoinMap(uint joinStart)
|
||||||
|
: this(joinStart, typeof(IAnalogInputJoinMap))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Constructor to use when extending this Join map
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="joinStart">Join this join map will start at</param>
|
||||||
|
/// <param name="type">Type of the child join map</param>
|
||||||
|
protected IAnalogInputJoinMap(uint joinStart, Type type)
|
||||||
|
: base(joinStart, type)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
|
|
||||||
[JoinName("InputState")]
|
[JoinName("InputState")]
|
||||||
public JoinDataComplete InputState = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
public JoinDataComplete InputState = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "Room Email Url", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
new JoinMetadata { Description = "Input State", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor to use when instantiating this Join Map without inheriting from it
|
/// Constructor to use when instantiating this Join Map without inheriting from it
|
||||||
|
|||||||
@@ -15,5 +15,7 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
public uint PortNumber { get; set; }
|
public uint PortNumber { get; set; }
|
||||||
[JsonProperty("disablePullUpResistor")]
|
[JsonProperty("disablePullUpResistor")]
|
||||||
public bool DisablePullUpResistor { get; set; }
|
public bool DisablePullUpResistor { get; set; }
|
||||||
|
[JsonProperty("minimumChange")]
|
||||||
|
public int MinimumChange { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
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;
|
||||||
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
|
|
||||||
|
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a generic digital input deviced tied to a versiport
|
||||||
|
/// </summary>
|
||||||
|
public class GenericVersiportAnalogInputDevice : EssentialsBridgeableDevice, IAnalogInput
|
||||||
|
{
|
||||||
|
public Versiport InputPort { get; private set; }
|
||||||
|
|
||||||
|
public IntFeedback InputValueFeedback { get; private set; }
|
||||||
|
public IntFeedback InputMinimumChangeFeedback { get; private set; }
|
||||||
|
|
||||||
|
Func<int> InputValueFeedbackFunc
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return () => InputPort.AnalogIn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Func<int> InputMinimumChangeFeedbackFunc
|
||||||
|
{
|
||||||
|
get { return () => InputPort.AnalogMinChange; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public GenericVersiportAnalogInputDevice(string key, string name, Func<IOPortConfig, Versiport> postActivationFunc, IOPortConfig config) :
|
||||||
|
base(key, name)
|
||||||
|
{
|
||||||
|
InputValueFeedback = new IntFeedback(InputValueFeedbackFunc);
|
||||||
|
InputMinimumChangeFeedback = new IntFeedback(InputMinimumChangeFeedbackFunc);
|
||||||
|
|
||||||
|
AddPostActivationAction(() =>
|
||||||
|
{
|
||||||
|
InputPort = postActivationFunc(config);
|
||||||
|
|
||||||
|
InputPort.Register();
|
||||||
|
|
||||||
|
InputPort.SetVersiportConfiguration(eVersiportConfiguration.AnalogInput);
|
||||||
|
InputPort.AnalogMinChange = (ushort)(config.MinimumChange > 0 ? config.MinimumChange : 655);
|
||||||
|
if (config.DisablePullUpResistor)
|
||||||
|
InputPort.DisablePullUpResistor = true;
|
||||||
|
|
||||||
|
InputPort.VersiportChange += InputPort_VersiportChange;
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Created GenericVersiportAnalogInputDevice on port '{0}'. DisablePullUpResistor: '{1}'", config.PortNumber, InputPort.DisablePullUpResistor);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Set minimum voltage change for device to update voltage changed method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="value">valid values range from 0 - 65535, representing the full 100% range of the processor voltage source. Check processor documentation for details</param>
|
||||||
|
public void SetMinimumChange(ushort value)
|
||||||
|
{
|
||||||
|
InputPort.AnalogMinChange = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void InputPort_VersiportChange(Versiport port, VersiportEventArgs args)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Versiport change: {0}", args.Event);
|
||||||
|
|
||||||
|
if(args.Event == eVersiportEvent.AnalogInChange)
|
||||||
|
InputValueFeedback.FireUpdate();
|
||||||
|
if (args.Event == eVersiportEvent.AnalogMinChangeChange)
|
||||||
|
InputMinimumChangeFeedback.FireUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region Bridge Linking
|
||||||
|
|
||||||
|
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
|
||||||
|
{
|
||||||
|
var joinMap = new IAnalogInputJoinMap(joinStart);
|
||||||
|
|
||||||
|
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(joinMapSerialized))
|
||||||
|
joinMap = JsonConvert.DeserializeObject<IAnalogInputJoinMap>(joinMapSerialized);
|
||||||
|
|
||||||
|
if (bridge != null)
|
||||||
|
{
|
||||||
|
bridge.AddJoinMap(Key, joinMap);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
// Link feedback for input state
|
||||||
|
InputValueFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputValue.JoinNumber]);
|
||||||
|
InputMinimumChangeFeedback.LinkInputSig(trilist.UShortInput[joinMap.MinimumChange.JoinNumber]);
|
||||||
|
trilist.SetUShortSigAction(joinMap.MinimumChange.JoinNumber, SetMinimumChange);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Unable to link device '{0}'. Input is null", Key);
|
||||||
|
Debug.Console(1, this, "Error: {0}", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
trilist.OnlineStatusChange += (d, args) =>
|
||||||
|
{
|
||||||
|
if (!args.DeviceOnLine) return;
|
||||||
|
InputValueFeedback.FireUpdate();
|
||||||
|
InputMinimumChangeFeedback.FireUpdate();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void trilist_OnlineStatusChange(GenericBase currentDevice, OnlineOfflineEventArgs args)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
public static Versiport GetVersiportDigitalInput(IOPortConfig dc)
|
||||||
|
{
|
||||||
|
|
||||||
|
IIOPorts ioPortDevice;
|
||||||
|
|
||||||
|
if (dc.PortDeviceKey.Equals("processor"))
|
||||||
|
{
|
||||||
|
if (!Global.ControlSystem.SupportsVersiport)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportAnalogInput: Processor does not support Versiports");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ioPortDevice = Global.ControlSystem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var ioPortDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IIOPorts;
|
||||||
|
if (ioPortDev == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportAnalogInput: Device {0} is not a valid device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ioPortDevice = ioPortDev;
|
||||||
|
}
|
||||||
|
if (ioPortDevice == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportAnalogInput: Device '0' is not a valid IIOPorts Device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dc.PortNumber > ioPortDevice.NumberOfVersiPorts)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportAnalogInput: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if(!ioPortDevice.VersiPorts[dc.PortNumber].SupportsAnalogInput)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportAnalogInput: Device {0} does not support AnalogInput on port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return ioPortDevice.VersiPorts[dc.PortNumber];
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class GenericVersiportAbalogInputDeviceFactory : EssentialsDeviceFactory<GenericVersiportAnalogInputDevice>
|
||||||
|
{
|
||||||
|
public GenericVersiportAbalogInputDeviceFactory()
|
||||||
|
{
|
||||||
|
TypeNames = new List<string>() { "versiportanaloginput" };
|
||||||
|
}
|
||||||
|
|
||||||
|
public override EssentialsDevice BuildDevice(DeviceConfig dc)
|
||||||
|
{
|
||||||
|
Debug.Console(1, "Factory Attempting to create new Generic Versiport Device");
|
||||||
|
|
||||||
|
var props = JsonConvert.DeserializeObject<IOPortConfig>(dc.Properties.ToString());
|
||||||
|
|
||||||
|
if (props == null) return null;
|
||||||
|
|
||||||
|
var portDevice = new GenericVersiportAnalogInputDevice(dc.Key, dc.Name, GenericVersiportAnalogInputDevice.GetVersiportDigitalInput, props);
|
||||||
|
|
||||||
|
return portDevice;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Core.CrestronIO
|
||||||
|
{
|
||||||
|
public interface IAnalogInput
|
||||||
|
{
|
||||||
|
IntFeedback InputValueFeedback { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -42,18 +42,19 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
OutputPort = postActivationFunc(config);
|
OutputPort = postActivationFunc(config);
|
||||||
|
|
||||||
OutputPort.Register();
|
OutputPort.Register();
|
||||||
|
|
||||||
|
|
||||||
if (!OutputPort.SupportsDigitalOutput)
|
if (!OutputPort.SupportsDigitalOutput)
|
||||||
{
|
{
|
||||||
Debug.Console(0, this, "Device does not support configuration as a Digital Output");
|
Debug.Console(0, this, "Device does not support configuration as a Digital Output");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OutputPort.SetVersiportConfiguration(eVersiportConfiguration.DigitalOutput);
|
||||||
|
|
||||||
|
|
||||||
OutputPort.VersiportChange += OutputPort_VersiportChange;
|
OutputPort.VersiportChange += OutputPort_VersiportChange;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Debug.Console(1, this, "Created GenericVersiportDigitalOutputDevice on port '{0}'.", config.PortNumber);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -72,7 +73,18 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
/// <param name="state">value to set the output to</param>
|
/// <param name="state">value to set the output to</param>
|
||||||
public void SetOutput(bool state)
|
public void SetOutput(bool state)
|
||||||
{
|
{
|
||||||
OutputPort.DigitalOut = state;
|
if (OutputPort.SupportsDigitalOutput)
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Passed the Check");
|
||||||
|
|
||||||
|
OutputPort.DigitalOut = state;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Console(0, this, "Versiport does not support Digital Output Mode");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Bridge Linking
|
#region Bridge Linking
|
||||||
@@ -116,39 +128,39 @@ namespace PepperDash.Essentials.Core.CrestronIO
|
|||||||
public static Versiport GetVersiportDigitalOutput(IOPortConfig dc)
|
public static Versiport GetVersiportDigitalOutput(IOPortConfig dc)
|
||||||
{
|
{
|
||||||
|
|
||||||
IIOPorts ioPortDevice;
|
IIOPorts ioPortDevice;
|
||||||
|
|
||||||
if (dc.PortDeviceKey.Equals("processor"))
|
if (dc.PortDeviceKey.Equals("processor"))
|
||||||
{
|
|
||||||
if (!Global.ControlSystem.SupportsVersiport)
|
|
||||||
{
|
{
|
||||||
Debug.Console(0, "GetVersiportDigitalOuptut: Processor does not support Versiports");
|
if (!Global.ControlSystem.SupportsVersiport)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportDigitalOuptut: Processor does not support Versiports");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ioPortDevice = Global.ControlSystem;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var ioPortDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IIOPorts;
|
||||||
|
if (ioPortDev == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportDigitalOuptut: Device {0} is not a valid device", dc.PortDeviceKey);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ioPortDevice = ioPortDev;
|
||||||
|
}
|
||||||
|
if (ioPortDevice == null)
|
||||||
|
{
|
||||||
|
Debug.Console(0, "GetVersiportDigitalOuptut: Device '0' is not a valid IOPorts Device", dc.PortDeviceKey);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
ioPortDevice = Global.ControlSystem;
|
|
||||||
}
|
if (dc.PortNumber > ioPortDevice.NumberOfVersiPorts)
|
||||||
else
|
|
||||||
{
|
|
||||||
var ioPortDev = DeviceManager.GetDeviceForKey(dc.PortDeviceKey) as IIOPorts;
|
|
||||||
if (ioPortDev == null)
|
|
||||||
{
|
{
|
||||||
Debug.Console(0, "GetVersiportDigitalOuptut: Device {0} is not a valid device", dc.PortDeviceKey);
|
Debug.Console(0, "GetVersiportDigitalOuptut: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
ioPortDevice = ioPortDev;
|
var port = ioPortDevice.VersiPorts[dc.PortNumber];
|
||||||
}
|
return port;
|
||||||
if (ioPortDevice == null)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "GetVersiportDigitalOuptut: Device '0' is not a valid IIOPorts Device", dc.PortDeviceKey);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dc.PortNumber > ioPortDevice.NumberOfVersiPorts)
|
|
||||||
{
|
|
||||||
Debug.Console(0, "GetVersiportDigitalOuptut: Device {0} does not contain a port {1}", dc.PortDeviceKey, dc.PortNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ioPortDevice.VersiPorts[dc.PortNumber];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,6 +123,7 @@
|
|||||||
<Compile Include="Bridges\IBridge.cs" />
|
<Compile Include="Bridges\IBridge.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\AirMediaControllerJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\AppleTvJoinMap.cs" />
|
||||||
|
<Compile Include="Bridges\JoinMaps\IAnalogInputJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\IDigitalOutputJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\IDigitalOutputJoinMap.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\PduJoinMapBase.cs" />
|
<Compile Include="Bridges\JoinMaps\PduJoinMapBase.cs" />
|
||||||
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
|
<Compile Include="Bridges\JoinMaps\C2nRthsControllerJoinMap.cs" />
|
||||||
@@ -182,8 +183,10 @@
|
|||||||
<Compile Include="Crestron IO\DinCenCn\IHasCresnetBranches.cs" />
|
<Compile Include="Crestron IO\DinCenCn\IHasCresnetBranches.cs" />
|
||||||
<Compile Include="Crestron IO\DinIo8\DinIo8Controller.cs" />
|
<Compile Include="Crestron IO\DinIo8\DinIo8Controller.cs" />
|
||||||
<Compile Include="Crestron IO\Inputs\CenIoDigIn104Controller.cs" />
|
<Compile Include="Crestron IO\Inputs\CenIoDigIn104Controller.cs" />
|
||||||
|
<Compile Include="Crestron IO\Inputs\GenericVersiportAnalogInputDevice.cs" />
|
||||||
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
|
<Compile Include="Crestron IO\Inputs\GenericDigitalInputDevice.cs" />
|
||||||
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
<Compile Include="Crestron IO\Inputs\GenericVersiportInputDevice.cs" />
|
||||||
|
<Compile Include="Crestron IO\Inputs\IAnalogInput.cs" />
|
||||||
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
<Compile Include="Crestron IO\Inputs\IDigitalInput.cs" />
|
||||||
<Compile Include="Crestron IO\IOPortConfig.cs" />
|
<Compile Include="Crestron IO\IOPortConfig.cs" />
|
||||||
<Compile Include="Crestron IO\Ir\CenIoIr104Controller.cs" />
|
<Compile Include="Crestron IO\Ir\CenIoIr104Controller.cs" />
|
||||||
|
|||||||
@@ -1004,7 +1004,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
if (codec.DirectoryRoot != null)
|
if (codec.DirectoryRoot != null)
|
||||||
{
|
{
|
||||||
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)codec.DirectoryRoot.CurrentDirectoryResults.Count);
|
var contactsCount = codec.DirectoryRoot.CurrentDirectoryResults.Where(c => c.ParentFolderId.Equals("root")).ToList().Count;
|
||||||
|
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)contactsCount);
|
||||||
|
Debug.Console(2, this, ">>> contactsCount: {0}", contactsCount);
|
||||||
|
|
||||||
var clearBytes = XSigHelpers.ClearOutputs();
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
|
|
||||||
@@ -1020,7 +1022,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
codec.DirectoryResultReturned += (sender, args) =>
|
codec.DirectoryResultReturned += (sender, args) =>
|
||||||
{
|
{
|
||||||
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)args.Directory.CurrentDirectoryResults.Count);
|
var isRoot = codec.CurrentDirectoryResultIsNotDirectoryRoot.BoolValue == false;
|
||||||
|
var argsCount = isRoot
|
||||||
|
? args.Directory.CurrentDirectoryResults.Where(a => a.ParentFolderId.Equals("root")).ToList().Count
|
||||||
|
: args.Directory.CurrentDirectoryResults.Count;
|
||||||
|
|
||||||
|
trilist.SetUshort(joinMap.DirectoryRowCount.JoinNumber, (ushort)argsCount);
|
||||||
|
Debug.Console(2, this, ">>> argsCount: {0}", argsCount);
|
||||||
|
|
||||||
var clearBytes = XSigHelpers.ClearOutputs();
|
var clearBytes = XSigHelpers.ClearOutputs();
|
||||||
|
|
||||||
@@ -1184,46 +1192,47 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
return GetXSigString(tokenArray);
|
return GetXSigString(tokenArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
|
private string UpdateDirectoryXSig(CodecDirectory directory, bool isRoot)
|
||||||
{
|
{
|
||||||
var xSigMaxIndex = 1023;
|
var xSigMaxIndex = 1023;
|
||||||
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
var tokenArray = new XSigToken[directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
? xSigMaxIndex
|
? xSigMaxIndex
|
||||||
: directory.CurrentDirectoryResults.Count];
|
: directory.CurrentDirectoryResults.Count];
|
||||||
|
|
||||||
Debug.Console(2, this, "IsRoot: {0}, Directory Count: {1}, TokenArray.Length: {2}", isRoot,
|
Debug.Console(2, this, "IsRoot: {0}, Directory Count: {1}, TokenArray.Length: {2}", isRoot, directory.CurrentDirectoryResults.Count, tokenArray.Length);
|
||||||
directory.CurrentDirectoryResults.Count, tokenArray.Length);
|
|
||||||
|
|
||||||
var contacts = directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
var contacts = directory.CurrentDirectoryResults.Count > xSigMaxIndex
|
||||||
? directory.CurrentDirectoryResults.Take(xSigMaxIndex)
|
? directory.CurrentDirectoryResults.Take(xSigMaxIndex)
|
||||||
: directory.CurrentDirectoryResults;
|
: directory.CurrentDirectoryResults;
|
||||||
|
|
||||||
var counterIndex = 1;
|
var contactsToDisplay = isRoot
|
||||||
foreach (var entry in contacts)
|
? contacts.Where(c => c.ParentFolderId == "root")
|
||||||
{
|
: contacts.Where(c => c.ParentFolderId != "root");
|
||||||
var arrayIndex = counterIndex - 1;
|
|
||||||
var entryIndex = counterIndex;
|
|
||||||
|
|
||||||
Debug.Console(2, this, "Entry{2:0000} Name: {0}, Folder ID: {1}", entry.Name, entry.FolderId, entryIndex);
|
var counterIndex = 1;
|
||||||
|
foreach (var entry in contactsToDisplay)
|
||||||
|
{
|
||||||
|
var arrayIndex = counterIndex - 1;
|
||||||
|
var entryIndex = counterIndex;
|
||||||
|
|
||||||
if (entry is DirectoryFolder && entry.ParentFolderId == "root")
|
Debug.Console(2, this, "Entry{2:0000} Name: {0}, Folder ID: {1}, Type: {3}, ParentFolderId: {4}",
|
||||||
{
|
entry.Name, entry.FolderId, entryIndex, entry.GetType().GetCType().FullName, entry.ParentFolderId);
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, String.Format("[+] {0}", entry.Name));
|
|
||||||
|
|
||||||
counterIndex++;
|
if (entry is DirectoryFolder)
|
||||||
counterIndex++;
|
{
|
||||||
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, String.Format("[+] {0}", entry.Name));
|
||||||
|
|
||||||
continue;
|
counterIndex++;
|
||||||
}
|
|
||||||
|
|
||||||
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, entry.Name);
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
counterIndex++;
|
tokenArray[arrayIndex] = new XSigSerialToken(entryIndex, entry.Name);
|
||||||
}
|
|
||||||
|
|
||||||
return GetXSigString(tokenArray);
|
|
||||||
|
|
||||||
|
counterIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetXSigString(tokenArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkVideoCodecCallControlsToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
private void LinkVideoCodecCallControlsToApi(BasicTriList trilist, VideoCodecControllerJoinMap joinMap)
|
||||||
|
|||||||
@@ -303,11 +303,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
{
|
{
|
||||||
var contact = new InvitableDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
|
var contact = new InvitableDirectoryContact { Name = c.ScreenName, ContactId = c.Jid };
|
||||||
|
|
||||||
contact.ContactMethods.Add(new ContactMethod() { Number = c.Jid, Device = eContactMethodDevice.Video, CallType = eContactMethodCallType.Video, ContactMethodId = c.Jid });
|
contact.ContactMethods.Add(new ContactMethod()
|
||||||
|
{
|
||||||
|
Number = c.Jid,
|
||||||
|
Device = eContactMethodDevice.Video,
|
||||||
|
CallType = eContactMethodCallType.Video,
|
||||||
|
ContactMethodId = c.Jid
|
||||||
|
});
|
||||||
|
|
||||||
if (folders.Count > 0)
|
if (folders.Count > 0)
|
||||||
{
|
{
|
||||||
contact.ParentFolderId = c.IsZoomRoom ? "rooms" : "contacts";
|
contact.ParentFolderId = c.IsZoomRoom
|
||||||
|
? roomFolder.FolderId // "rooms"
|
||||||
|
: contactFolder.FolderId; // "contacts"
|
||||||
}
|
}
|
||||||
|
|
||||||
contacts.Add(contact);
|
contacts.Add(contact);
|
||||||
|
|||||||
Reference in New Issue
Block a user