mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-04 07:14:58 +00:00
Compare commits
1 Commits
feature/bu
...
WhartonLFC
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1446ee1048 |
@@ -92,11 +92,11 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
// (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
// (device as CameraBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
// continue;
|
// continue;
|
||||||
//}
|
//}
|
||||||
else if (device is PepperDash.Essentials.Core.DisplayBase)
|
//else if (device is pepperdash.essentials.core.displaybase)
|
||||||
{
|
//{
|
||||||
(device as DisplayBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
// (device as displaybase).linktoapi(eisc, d.joinstart, d.joinmapkey);
|
||||||
continue;
|
// continue;
|
||||||
}
|
//}
|
||||||
else if (device is DmChassisController)
|
else if (device is DmChassisController)
|
||||||
{
|
{
|
||||||
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as DmChassisController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
@@ -147,11 +147,11 @@ namespace PepperDash.Essentials.Bridges
|
|||||||
(device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as HdMdxxxCEController).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//else if (device is LightingBase)
|
else if (device is LightingBase)
|
||||||
//{
|
{
|
||||||
// (device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
(device as LightingBase).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
// continue;
|
continue;
|
||||||
//}
|
}
|
||||||
//else if (device is DigitalLogger)
|
//else if (device is DigitalLogger)
|
||||||
//{
|
//{
|
||||||
// (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
// (device as DigitalLogger).LinkToApi(Eisc, d.JoinStart, d.JoinMapKey);
|
||||||
|
|||||||
@@ -1,222 +1,225 @@
|
|||||||
using System;
|
//using system;
|
||||||
using System.Collections.Generic;
|
//using system.collections.generic;
|
||||||
using System.Linq;
|
//using system.linq;
|
||||||
using System.Text;
|
//using system.text;
|
||||||
using Crestron.SimplSharp;
|
//using crestron.simplsharp;
|
||||||
using Crestron.SimplSharpPro.DeviceSupport;
|
//using crestron.simplsharppro.devicesupport;
|
||||||
using PepperDash.Core;
|
//using pepperdash.core;
|
||||||
using PepperDash.Essentials.Core;
|
//using pepperdash.essentials.core;
|
||||||
using PepperDash.Essentials.Devices.Common;
|
//using pepperdash.essentials.devices.common;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Bridges
|
//namespace pepperdash.essentials.bridges
|
||||||
{
|
//{
|
||||||
public static class DisplayControllerApiExtensions
|
// public static class displaycontrollerapiextensions
|
||||||
{
|
// {
|
||||||
|
|
||||||
public static int InputNumber;
|
// public static int inputnumber;
|
||||||
public static IntFeedback InputNumberFeedback;
|
// public static intfeedback inputnumberfeedback;
|
||||||
public static List<string> InputKeys = new List<string>();
|
// public static list<string> inputkeys = new list<string>();
|
||||||
public static void LinkToApi(this PepperDash.Essentials.Core.DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
// public static void linktoapi(this pepperdash.essentials.core.displaybase displaydevice, basictrilist trilist, uint joinstart, string joinmapkey)
|
||||||
{
|
// {
|
||||||
|
|
||||||
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
// var joinmap = joinmaphelper.getjoinmapfordevice(joinmapkey) as displaycontrollerjoinmap;
|
||||||
|
|
||||||
if (joinMap == null)
|
// if (joinmap == null)
|
||||||
{
|
// {
|
||||||
joinMap = new DisplayControllerJoinMap();
|
// joinmap = new displaycontrollerjoinmap();
|
||||||
}
|
// }
|
||||||
|
|
||||||
joinMap.OffsetJoinNumbers(joinStart);
|
// joinmap.offsetjoinnumbers(joinstart);
|
||||||
|
|
||||||
Debug.Console(1, "Linking to Trilist '{0}'",trilist.ID.ToString("X"));
|
// debug.console(1, "linking to trilist '{0}'",trilist.id.tostring("x"));
|
||||||
Debug.Console(0, "Linking to Display: {0}", displayDevice.Name);
|
// debug.console(0, "linking to display: {0}", displaydevice.name);
|
||||||
|
|
||||||
trilist.StringInput[joinMap.Name].StringValue = displayDevice.Name;
|
// trilist.stringinput[joinmap.name].stringvalue = displaydevice.name;
|
||||||
|
|
||||||
var commMonitor = displayDevice as ICommunicationMonitor;
|
// var commmonitor = displaydevice as icommunicationmonitor;
|
||||||
if (commMonitor != null)
|
// if (commmonitor != null)
|
||||||
{
|
// {
|
||||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
// commmonitor.communicationmonitor.isonlinefeedback.linkinputsig(trilist.booleaninput[joinmap.isonline]);
|
||||||
}
|
// }
|
||||||
|
|
||||||
InputNumberFeedback = new IntFeedback(() => { return InputNumber; });
|
// inputnumberfeedback.linkinputsig(trilist.ushortinput[joinmap.inputselect]);
|
||||||
|
// // two way feedbacks
|
||||||
|
// var twowaydisplay = displaydevice as pepperdash.essentials.core.twowaydisplaybase;
|
||||||
|
// if (twowaydisplay != null)
|
||||||
|
// {
|
||||||
|
// trilist.setbool(joinmap.istwowaydisplay, true);
|
||||||
|
|
||||||
// Two way feedbacks
|
// twowaydisplay.currentinputfeedback.outputchange += new eventhandler<feedbackeventargs>(currentinputfeedback_outputchange);
|
||||||
var twoWayDisplay = displayDevice as PepperDash.Essentials.Core.TwoWayDisplayBase;
|
|
||||||
if (twoWayDisplay != null)
|
|
||||||
{
|
|
||||||
trilist.SetBool(joinMap.IsTwoWayDisplay, true);
|
|
||||||
|
|
||||||
twoWayDisplay.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(CurrentInputFeedback_OutputChange);
|
|
||||||
|
|
||||||
|
|
||||||
InputNumberFeedback.LinkInputSig(trilist.UShortInput[joinMap.InputSelect]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Power Off
|
// }
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOff, () =>
|
|
||||||
{
|
|
||||||
InputNumber = 102;
|
|
||||||
InputNumberFeedback.FireUpdate();
|
|
||||||
displayDevice.PowerOff();
|
|
||||||
});
|
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(PowerIsOnFeedback_OutputChange);
|
// // power off
|
||||||
displayDevice.PowerIsOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PowerOff]);
|
// trilist.setsigtrueaction(joinmap.poweroff, () =>
|
||||||
|
// {
|
||||||
|
// inputnumber = 102;
|
||||||
|
// inputnumberfeedback.fireupdate();
|
||||||
|
// displaydevice.poweroff();
|
||||||
|
// });
|
||||||
|
|
||||||
// PowerOn
|
// displaydevice.powerisonfeedback.outputchange += new eventhandler<feedbackeventargs>(powerisonfeedback_outputchange);
|
||||||
trilist.SetSigTrueAction(joinMap.PowerOn, () =>
|
// displaydevice.powerisonfeedback.linkcomplementinputsig(trilist.booleaninput[joinmap.poweroff]);
|
||||||
{
|
|
||||||
InputNumber = 0;
|
// // poweron
|
||||||
InputNumberFeedback.FireUpdate();
|
// trilist.setsigtrueaction(joinmap.poweron, () =>
|
||||||
displayDevice.PowerOn();
|
// {
|
||||||
});
|
// inputnumber = 0;
|
||||||
|
// inputnumberfeedback.fireupdate();
|
||||||
|
// displaydevice.poweron();
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
displayDevice.PowerIsOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PowerOn]);
|
// displaydevice.powerisonfeedback.linkinputsig(trilist.booleaninput[joinmap.poweron]);
|
||||||
|
|
||||||
int count = 1;
|
// int count = 1;
|
||||||
foreach (var input in displayDevice.InputPorts)
|
// foreach (var input in displaydevice.inputports)
|
||||||
{
|
// {
|
||||||
InputKeys.Add(input.Key.ToString());
|
// inputkeys.add(input.key.tostring());
|
||||||
var tempKey = InputKeys.ElementAt(count - 1);
|
// var tempkey = inputkeys.elementat(count - 1);
|
||||||
trilist.SetSigTrueAction((ushort)(joinMap.InputSelectOffset + count), () => { displayDevice.ExecuteSwitch(displayDevice.InputPorts[tempKey].Selector); });
|
// trilist.setsigtrueaction((ushort)(joinmap.inputselectoffset + count), () => { displaydevice.executeswitch(displaydevice.inputports[tempkey].selector); });
|
||||||
Debug.Console(2, displayDevice, "Setting Input Select Action on Digital Join {0} to Input: {1}", joinMap.InputSelectOffset + count, displayDevice.InputPorts[tempKey].Key.ToString());
|
// debug.console(2, displaydevice, "setting input select action on digital join {0} to input: {1}", joinmap.inputselectoffset + count, displaydevice.inputports[tempkey].key.tostring());
|
||||||
trilist.StringInput[(ushort)(joinMap.InputNamesOffset + count)].StringValue = input.Key.ToString();
|
// trilist.stringinput[(ushort)(joinmap.inputnamesoffset + count)].stringvalue = input.key.tostring();
|
||||||
count++;
|
// count++;
|
||||||
}
|
// }
|
||||||
|
|
||||||
Debug.Console(2, displayDevice, "Setting Input Select Action on Analog Join {0}", joinMap.InputSelect);
|
// debug.console(2, displaydevice, "setting input select action on analog join {0}", joinmap.inputselect);
|
||||||
trilist.SetUShortSigAction(joinMap.InputSelect, (a) =>
|
// trilist.setushortsigaction(joinmap.inputselect, (a) =>
|
||||||
{
|
|
||||||
if (a == 0)
|
|
||||||
{
|
|
||||||
displayDevice.PowerOff();
|
|
||||||
InputNumber = 0;
|
|
||||||
}
|
|
||||||
else if (a > 0 && a < displayDevice.InputPorts.Count && a != InputNumber)
|
|
||||||
{
|
|
||||||
displayDevice.ExecuteSwitch(displayDevice.InputPorts.ElementAt(a - 1).Selector);
|
|
||||||
InputNumber = a;
|
|
||||||
}
|
|
||||||
else if (a == 102)
|
|
||||||
{
|
|
||||||
displayDevice.PowerToggle();
|
|
||||||
|
|
||||||
}
|
// {
|
||||||
if (twoWayDisplay != null)
|
// if (a == 0)
|
||||||
InputNumberFeedback.FireUpdate();
|
// {
|
||||||
});
|
// displaydevice.poweroff();
|
||||||
|
// inputnumber = 0;
|
||||||
|
// inputnumberfeedback.fireupdate();
|
||||||
|
// }
|
||||||
|
// else if (a > 0 && a < displaydevice.inputports.count )
|
||||||
|
// {
|
||||||
|
// displaydevice.executeswitch(displaydevice.inputports.elementat(a - 1).selector);
|
||||||
|
// inputnumber = a;
|
||||||
|
// inputnumberfeedback.fireupdate();
|
||||||
|
// }
|
||||||
|
// else if (a == 102)
|
||||||
|
// {
|
||||||
|
// displaydevice.powertoggle();
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
var volumeDisplay = displayDevice as IBasicVolumeControls;
|
|
||||||
if (volumeDisplay != null)
|
|
||||||
{
|
|
||||||
trilist.SetBoolSigAction(joinMap.VolumeUp, (b) => volumeDisplay.VolumeUp(b));
|
|
||||||
trilist.SetBoolSigAction(joinMap.VolumeDown, (b) => volumeDisplay.VolumeDown(b));
|
|
||||||
trilist.SetSigTrueAction(joinMap.VolumeMute, () => volumeDisplay.MuteToggle());
|
|
||||||
|
|
||||||
var volumeDisplayWithFeedback = volumeDisplay as IBasicVolumeWithFeedback;
|
// });
|
||||||
if(volumeDisplayWithFeedback != null)
|
|
||||||
{
|
|
||||||
volumeDisplayWithFeedback.VolumeLevelFeedback.LinkInputSig(trilist.UShortInput[joinMap.VolumeLevelFB]);
|
|
||||||
volumeDisplayWithFeedback.MuteFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VolumeMute]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void CurrentInputFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
Debug.Console(0, "CurrentInputFeedback_OutputChange {0}", e.StringValue);
|
// var volumedisplay = displaydevice as ibasicvolumecontrols;
|
||||||
|
// if (volumedisplay != null)
|
||||||
|
// {
|
||||||
|
// trilist.setboolsigaction(joinmap.volumeup, (b) => volumedisplay.volumeup(b));
|
||||||
|
// trilist.setboolsigaction(joinmap.volumedown, (b) => volumedisplay.volumedown(b));
|
||||||
|
// trilist.setsigtrueaction(joinmap.volumemute, () => volumedisplay.mutetoggle());
|
||||||
|
|
||||||
}
|
// var volumedisplaywithfeedback = volumedisplay as ibasicvolumewithfeedback;
|
||||||
|
// if(volumedisplaywithfeedback != null)
|
||||||
|
// {
|
||||||
|
// volumedisplaywithfeedback.volumelevelfeedback.linkinputsig(trilist.ushortinput[joinmap.volumelevelfb]);
|
||||||
|
// volumedisplaywithfeedback.mutefeedback.linkinputsig(trilist.booleaninput[joinmap.volumemute]);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
static void PowerIsOnFeedback_OutputChange(object sender, FeedbackEventArgs e)
|
// static void currentinputfeedback_outputchange(object sender, feedbackeventargs e)
|
||||||
{
|
// {
|
||||||
|
|
||||||
// Debug.Console(0, "PowerIsOnFeedback_OutputChange {0}", e.BoolValue);
|
// debug.console(0, "currentinputfeedback_outputchange {0}", e.stringvalue);
|
||||||
if (!e.BoolValue)
|
|
||||||
{
|
|
||||||
InputNumber = 102;
|
|
||||||
InputNumberFeedback.FireUpdate();
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
else
|
|
||||||
{
|
// static void powerisonfeedback_outputchange(object sender, feedbackeventargs e)
|
||||||
InputNumber = 0;
|
// {
|
||||||
InputNumberFeedback.FireUpdate();
|
|
||||||
}
|
// // debug.console(0, "powerisonfeedback_outputchange {0}", e.boolvalue);
|
||||||
}
|
// if (!e.boolvalue)
|
||||||
|
// {
|
||||||
|
// inputnumber = 102;
|
||||||
|
// inputnumberfeedback.fireupdate();
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// inputnumber = 0;
|
||||||
|
// inputnumberfeedback.fireupdate();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
public class DisplayControllerJoinMap : JoinMapBase
|
// public class displaycontrollerjoinmap : joinmapbase
|
||||||
{
|
// {
|
||||||
// Digital
|
// // digital
|
||||||
public uint PowerOff { get; set; }
|
// public uint poweroff { get; set; }
|
||||||
public uint PowerOn { get; set; }
|
// public uint poweron { get; set; }
|
||||||
public uint IsTwoWayDisplay { get; set; }
|
// public uint istwowaydisplay { get; set; }
|
||||||
public uint VolumeUp { get; set; }
|
// public uint volumeup { get; set; }
|
||||||
public uint VolumeDown { get; set; }
|
// public uint volumedown { get; set; }
|
||||||
public uint VolumeMute { get; set; }
|
// public uint volumemute { get; set; }
|
||||||
public uint InputSelectOffset { get; set; }
|
// public uint inputselectoffset { get; set; }
|
||||||
public uint ButtonVisibilityOffset { get; set; }
|
// public uint buttonvisibilityoffset { get; set; }
|
||||||
public uint IsOnline { get; set; }
|
// public uint isonline { get; set; }
|
||||||
|
|
||||||
// Analog
|
// // analog
|
||||||
public uint InputSelect { get; set; }
|
// public uint inputselect { get; set; }
|
||||||
public uint VolumeLevelFB { get; set; }
|
// public uint volumelevelfb { get; set; }
|
||||||
|
|
||||||
// Serial
|
// // serial
|
||||||
public uint Name { get; set; }
|
// public uint name { get; set; }
|
||||||
public uint InputNamesOffset { get; set; }
|
// public uint inputnamesoffset { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public DisplayControllerJoinMap()
|
// public displaycontrollerjoinmap()
|
||||||
{
|
// {
|
||||||
// Digital
|
// // digital
|
||||||
IsOnline = 50;
|
// isonline = 50;
|
||||||
PowerOff = 1;
|
// poweroff = 1;
|
||||||
PowerOn = 2;
|
// poweron = 2;
|
||||||
IsTwoWayDisplay = 3;
|
// istwowaydisplay = 3;
|
||||||
VolumeUp = 5;
|
// volumeup = 5;
|
||||||
VolumeDown = 6;
|
// volumedown = 6;
|
||||||
VolumeMute = 7;
|
// volumemute = 7;
|
||||||
|
|
||||||
ButtonVisibilityOffset = 40;
|
// buttonvisibilityoffset = 40;
|
||||||
InputSelectOffset = 10;
|
// inputselectoffset = 10;
|
||||||
|
|
||||||
// Analog
|
// // analog
|
||||||
InputSelect = 11;
|
// inputselect = 11;
|
||||||
VolumeLevelFB = 5;
|
// volumelevelfb = 5;
|
||||||
|
|
||||||
// Serial
|
// // serial
|
||||||
Name = 1;
|
// name = 1;
|
||||||
InputNamesOffset = 10;
|
// inputnamesoffset = 10;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public override void OffsetJoinNumbers(uint joinStart)
|
// public override void offsetjoinnumbers(uint joinstart)
|
||||||
{
|
// {
|
||||||
var joinOffset = joinStart - 1;
|
// var joinoffset = joinstart - 1;
|
||||||
|
|
||||||
IsOnline = IsOnline + joinOffset;
|
// isonline = isonline + joinoffset;
|
||||||
PowerOff = PowerOff + joinOffset;
|
// poweroff = poweroff + joinoffset;
|
||||||
PowerOn = PowerOn + joinOffset;
|
// poweron = poweron + joinoffset;
|
||||||
IsTwoWayDisplay = IsTwoWayDisplay + joinOffset;
|
// istwowaydisplay = istwowaydisplay + joinoffset;
|
||||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
// buttonvisibilityoffset = buttonvisibilityoffset + joinoffset;
|
||||||
Name = Name + joinOffset;
|
// name = name + joinoffset;
|
||||||
InputNamesOffset = InputNamesOffset + joinOffset;
|
// inputnamesoffset = inputnamesoffset + joinoffset;
|
||||||
InputSelectOffset = InputSelectOffset + joinOffset;
|
// inputselectoffset = inputselectoffset + joinoffset;
|
||||||
|
|
||||||
InputSelect = InputSelect + joinOffset;
|
// inputselect = inputselect + joinoffset;
|
||||||
|
|
||||||
VolumeUp = VolumeUp + joinOffset;
|
// volumeup = volumeup + joinoffset;
|
||||||
VolumeDown = VolumeDown + joinOffset;
|
// volumedown = volumedown + joinoffset;
|
||||||
VolumeMute = VolumeMute + joinOffset;
|
// volumemute = volumemute + joinoffset;
|
||||||
VolumeLevelFB = VolumeLevelFB + joinOffset;
|
// volumelevelfb = volumelevelfb + joinoffset;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
@@ -1,103 +1,103 @@
|
|||||||
//using System;
|
using System;
|
||||||
//using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
//using System.Linq;
|
using System.Linq;
|
||||||
//using System.Text;
|
using System.Text;
|
||||||
//using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
//using Crestron.SimplSharpPro.DeviceSupport;
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
//using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
//using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
//using PepperDash.Essentials.Devices.Common;
|
using PepperDash.Essentials.Devices.Common;
|
||||||
|
|
||||||
//namespace PepperDash.Essentials.Bridges
|
namespace PepperDash.Essentials.Bridges
|
||||||
//{
|
{
|
||||||
// public static class GenericLightingApiExtensions
|
public static class GenericLightingApiExtensions
|
||||||
// {
|
{
|
||||||
// public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this PepperDash.Essentials.Core.Lighting.LightingBase lightingDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
// {
|
{
|
||||||
// var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericLightingJoinMap;
|
var joinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as GenericLightingJoinMap;
|
||||||
|
|
||||||
// if (joinMap == null)
|
if (joinMap == null)
|
||||||
// joinMap = new GenericLightingJoinMap();
|
joinMap = new GenericLightingJoinMap();
|
||||||
|
|
||||||
// joinMap.OffsetJoinNumbers(joinStart);
|
joinMap.OffsetJoinNumbers(joinStart);
|
||||||
// Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Debug.Console(0, "Linking to lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
Debug.Console(0, "Linking to lighting Type {0}", lightingDevice.GetType().Name.ToString());
|
||||||
|
|
||||||
// // GenericLighitng Actions & FeedBack
|
// GenericLighitng Actions & FeedBack
|
||||||
// trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
trilist.SetUShortSigAction(joinMap.SelectScene, u => lightingDevice.SelectScene(lightingDevice.LightingScenes[u]));
|
||||||
|
|
||||||
// int sceneIndex = 1;
|
int sceneIndex = 1;
|
||||||
// foreach (var scene in lightingDevice.LightingScenes)
|
foreach (var scene in lightingDevice.LightingScenes)
|
||||||
// {
|
{
|
||||||
// var tempIndex = sceneIndex - 1;
|
var tempIndex = sceneIndex - 1;
|
||||||
// trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
trilist.SetSigTrueAction((uint)(joinMap.LightingSceneOffset + sceneIndex), () => lightingDevice.SelectScene(lightingDevice.LightingScenes[tempIndex]));
|
||||||
// scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
scene.IsActiveFeedback.LinkInputSig(trilist.BooleanInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)]);
|
||||||
// trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
trilist.StringInput[(uint)(joinMap.LightingSceneOffset + sceneIndex)].StringValue = scene.Name;
|
||||||
// trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
trilist.BooleanInput[(uint)(joinMap.ButtonVisibilityOffset + sceneIndex)].BoolValue = true;
|
||||||
// sceneIndex++;
|
sceneIndex++;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
if (lightingDevice.GetType().Name.ToString() == "LutronQuantumArea")
|
||||||
// {
|
{
|
||||||
// var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
var lutronDevice = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||||
// lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
lutronDevice.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
|
||||||
// trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
trilist.SetStringSigAction(joinMap.IntegrationIdSet, s => lutronDevice.IntegrationId = s);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
//ApiEisc.Eisc.SetStringSigAction(ApiMap.integrationID, (s) => { lutronLights.IntegrationId = s; });
|
||||||
|
|
||||||
|
|
||||||
// /*
|
/*
|
||||||
// var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
var lutronLights = lightingDevice as PepperDash.Essentials.Devices.Common.Environment.Lutron.LutronQuantumArea;
|
||||||
|
|
||||||
|
|
||||||
// for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
for (uint i = 1; i <= lightingBase.CircuitCount; i++)
|
||||||
// {
|
{
|
||||||
// var circuit = i;
|
var circuit = i;
|
||||||
// lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
lightingBase.CircuitNameFeedbacks[circuit - 1].LinkInputSig(trilist.StringInput[joinMap.CircuitNames + circuit]);
|
||||||
// lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
lightingBase.CircuitIsCritical[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitIsCritical + circuit]);
|
||||||
// lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
lightingBase.CircuitState[circuit - 1].LinkInputSig(trilist.BooleanInput[joinMap.CircuitState + circuit]);
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitCycle + circuit, () => lightingBase.CycleCircuit(circuit - 1));
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitOnCmd + circuit, () => lightingBase.TurnOnCircuit(circuit - 1));
|
||||||
// trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
trilist.SetSigTrueAction(joinMap.CircuitOffCmd + circuit, () => lightingBase.TurnOffCircuit(circuit - 1));
|
||||||
|
|
||||||
// }
|
}
|
||||||
// */
|
*/
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// public class GenericLightingJoinMap : JoinMapBase
|
public class GenericLightingJoinMap : JoinMapBase
|
||||||
// {
|
{
|
||||||
// public uint IsOnline { get; set; }
|
public uint IsOnline { get; set; }
|
||||||
// public uint SelectScene { get; set; }
|
public uint SelectScene { get; set; }
|
||||||
// public uint LightingSceneOffset { get; set; }
|
public uint LightingSceneOffset { get; set; }
|
||||||
// public uint ButtonVisibilityOffset { get; set; }
|
public uint ButtonVisibilityOffset { get; set; }
|
||||||
// public uint IntegrationIdSet { get; set; }
|
public uint IntegrationIdSet { get; set; }
|
||||||
|
|
||||||
// public GenericLightingJoinMap()
|
public GenericLightingJoinMap()
|
||||||
// {
|
{
|
||||||
// // Digital
|
// Digital
|
||||||
// IsOnline = 1;
|
IsOnline = 1;
|
||||||
// SelectScene = 1;
|
SelectScene = 1;
|
||||||
// IntegrationIdSet = 1;
|
IntegrationIdSet = 1;
|
||||||
// LightingSceneOffset = 10;
|
LightingSceneOffset = 10;
|
||||||
// ButtonVisibilityOffset = 40;
|
ButtonVisibilityOffset = 40;
|
||||||
// // Analog
|
// Analog
|
||||||
// }
|
}
|
||||||
|
|
||||||
// public override void OffsetJoinNumbers(uint joinStart)
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
// {
|
{
|
||||||
// var joinOffset = joinStart - 1;
|
var joinOffset = joinStart - 1;
|
||||||
|
|
||||||
// IsOnline = IsOnline + joinOffset;
|
IsOnline = IsOnline + joinOffset;
|
||||||
// SelectScene = SelectScene + joinOffset;
|
SelectScene = SelectScene + joinOffset;
|
||||||
// LightingSceneOffset = LightingSceneOffset + joinOffset;
|
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
||||||
// ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//}
|
}
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
|
||||||
|
|||||||
Reference in New Issue
Block a user