mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-07-02 10:38:16 +00:00
Updates DisplayControllerBridge to support BasicIrDisplay types, adds Samsung IR driver file, updates SetupFileSystem in ControlSystem.cs to build plugin folder
This commit is contained in:
parent
c15adea02e
commit
af12a81c00
6 changed files with 48 additions and 30 deletions
BIN
IR Drivers/samsung_un_series.ir
Normal file
BIN
IR Drivers/samsung_un_series.ir
Normal file
Binary file not shown.
|
|
@ -18,10 +18,9 @@ namespace PepperDash.Essentials.Bridges
|
||||||
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.TwoWayDisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
public static void LinkToApi(this PepperDash.Essentials.Core.DisplayBase displayDevice, BasicTriList trilist, uint joinStart, string joinMapKey)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
JoinMap = JoinMapHelper.GetJoinMapForDevice(joinMapKey) as DisplayControllerJoinMap;
|
||||||
_TriList = trilist;
|
_TriList = trilist;
|
||||||
|
|
||||||
|
|
@ -31,17 +30,31 @@ namespace PepperDash.Essentials.Bridges
|
||||||
}
|
}
|
||||||
|
|
||||||
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 Bridge Type {0}", displayDevice.GetType().Name.ToString());
|
Debug.Console(0, "Linking to Bridge Type {0}", displayDevice.GetType().Name.ToString());
|
||||||
|
|
||||||
_TriList.StringInput[JoinMap.Name].StringValue = displayDevice.GetType().Name.ToString();
|
_TriList.StringInput[JoinMap.Name].StringValue = displayDevice.GetType().Name.ToString();
|
||||||
|
|
||||||
|
var commMonitor = displayDevice as ICommunicationMonitor;
|
||||||
|
if (commMonitor != null)
|
||||||
|
{
|
||||||
|
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Two way feedbacks
|
||||||
|
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 = new IntFeedback(() => { return InputNumber; });
|
InputNumberFeedback = new IntFeedback(() => { return InputNumber; });
|
||||||
InputNumberFeedback.LinkInputSig(_TriList.UShortInput[JoinMap.InputSelect]);
|
InputNumberFeedback.LinkInputSig(_TriList.UShortInput[JoinMap.InputSelect]);
|
||||||
var commMonitor = displayDevice as ICommunicationMonitor;
|
}
|
||||||
commMonitor.CommunicationMonitor.IsOnlineFeedback.LinkInputSig(trilist.BooleanInput[JoinMap.IsOnline]);
|
|
||||||
|
|
||||||
// Poewer Off
|
// Power Off
|
||||||
trilist.SetSigTrueAction(JoinMap.PowerOff, () =>
|
trilist.SetSigTrueAction(JoinMap.PowerOff, () =>
|
||||||
{
|
{
|
||||||
InputNumber = 102;
|
InputNumber = 102;
|
||||||
|
|
@ -73,7 +86,6 @@ namespace PepperDash.Essentials.Bridges
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
displayDevice.CurrentInputFeedback.OutputChange += new EventHandler<FeedbackEventArgs>(CurrentInputFeedback_OutputChange);
|
|
||||||
trilist.SetUShortSigAction(JoinMap.InputSelect, (a) =>
|
trilist.SetUShortSigAction(JoinMap.InputSelect, (a) =>
|
||||||
{
|
{
|
||||||
if (a == 0)
|
if (a == 0)
|
||||||
|
|
@ -91,6 +103,7 @@ namespace PepperDash.Essentials.Bridges
|
||||||
displayDevice.PowerToggle();
|
displayDevice.PowerToggle();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (displayDevice is PepperDash.Essentials.Core.TwoWayDisplayBase)
|
||||||
InputNumberFeedback.FireUpdate();
|
InputNumberFeedback.FireUpdate();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -134,10 +147,9 @@ namespace PepperDash.Essentials.Bridges
|
||||||
public uint PowerOff { get; set; }
|
public uint PowerOff { get; set; }
|
||||||
public uint InputSelect { get; set; }
|
public uint InputSelect { get; set; }
|
||||||
public uint PowerOn { get; set; }
|
public uint PowerOn { get; set; }
|
||||||
|
public uint IsTwoWayDisplay { get; set; }
|
||||||
public uint SelectScene { get; set; }
|
public uint SelectScene { get; set; }
|
||||||
public uint LightingSceneOffset { get; set; }
|
|
||||||
public uint ButtonVisibilityOffset { get; set; }
|
public uint ButtonVisibilityOffset { get; set; }
|
||||||
public uint IntegrationIdSet { get; set; }
|
|
||||||
|
|
||||||
public DisplayControllerJoinMap()
|
public DisplayControllerJoinMap()
|
||||||
{
|
{
|
||||||
|
|
@ -145,14 +157,16 @@ namespace PepperDash.Essentials.Bridges
|
||||||
IsOnline = 50;
|
IsOnline = 50;
|
||||||
PowerOff = 1;
|
PowerOff = 1;
|
||||||
PowerOn = 2;
|
PowerOn = 2;
|
||||||
InputSelect = 4;
|
IsTwoWayDisplay = 3;
|
||||||
IntegrationIdSet = 1;
|
|
||||||
LightingSceneOffset = 10;
|
|
||||||
ButtonVisibilityOffset = 40;
|
ButtonVisibilityOffset = 40;
|
||||||
|
InputSelectOffset = 4;
|
||||||
|
|
||||||
|
// Analog
|
||||||
|
InputSelect = 4;
|
||||||
|
|
||||||
|
// Serial
|
||||||
Name = 1;
|
Name = 1;
|
||||||
InputNamesOffset = 10;
|
InputNamesOffset = 10;
|
||||||
InputSelectOffset = 4;
|
|
||||||
// Analog
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OffsetJoinNumbers(uint joinStart)
|
public override void OffsetJoinNumbers(uint joinStart)
|
||||||
|
|
@ -162,8 +176,8 @@ namespace PepperDash.Essentials.Bridges
|
||||||
IsOnline = IsOnline + joinOffset;
|
IsOnline = IsOnline + joinOffset;
|
||||||
PowerOff = PowerOff + joinOffset;
|
PowerOff = PowerOff + joinOffset;
|
||||||
PowerOn = PowerOn + joinOffset;
|
PowerOn = PowerOn + joinOffset;
|
||||||
|
IsTwoWayDisplay = IsTwoWayDisplay + joinOffset;
|
||||||
SelectScene = SelectScene + joinOffset;
|
SelectScene = SelectScene + joinOffset;
|
||||||
LightingSceneOffset = LightingSceneOffset + joinOffset;
|
|
||||||
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
ButtonVisibilityOffset = ButtonVisibilityOffset + joinOffset;
|
||||||
Name = Name + joinOffset;
|
Name = Name + joinOffset;
|
||||||
InputNamesOffset = InputNamesOffset + joinOffset;
|
InputNamesOffset = InputNamesOffset + joinOffset;
|
||||||
|
|
|
||||||
|
|
@ -248,6 +248,10 @@ namespace PepperDash.Essentials
|
||||||
if (!Directory.Exists(sgdDir))
|
if (!Directory.Exists(sgdDir))
|
||||||
Directory.Create(sgdDir);
|
Directory.Create(sgdDir);
|
||||||
|
|
||||||
|
var pluginDir = Global.FilePathPrefix + "plugins";
|
||||||
|
if (!Directory.Exists(pluginDir))
|
||||||
|
Directory.Create(pluginDir);
|
||||||
|
|
||||||
return configExists;
|
return configExists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,13 @@ namespace PepperDash.Essentials
|
||||||
return new Device(key, name);
|
return new Device(key, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// MOVE into something else???
|
//// MOVE into something else???
|
||||||
else if (typeName == "basicirdisplay")
|
//else if (typeName == "basicirdisplay")
|
||||||
{
|
//{
|
||||||
var ir = IRPortHelper.GetIrPort(properties);
|
// var ir = IRPortHelper.GetIrPort(properties);
|
||||||
if (ir != null)
|
// if (ir != null)
|
||||||
return new BasicIrDisplay(key, name, ir.Port, ir.FileName);
|
// return new BasicIrDisplay(key, name, ir.Port, ir.FileName);
|
||||||
}
|
//}
|
||||||
|
|
||||||
else if (typeName == "commmock")
|
else if (typeName == "commmock")
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,5 +4,5 @@
|
||||||
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
[assembly: AssemblyCompany("PepperDash Technology Corp")]
|
||||||
[assembly: AssemblyProduct("PepperDashEssentials")]
|
[assembly: AssemblyProduct("PepperDashEssentials")]
|
||||||
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")]
|
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2018")]
|
||||||
[assembly: AssemblyVersion("1.4.9.*")]
|
[assembly: AssemblyVersion("1.4.10.*")]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 433f71da3e8381834ba3c9207622fae16f639ba9
|
Subproject commit 1675b98b87a37a915081fff64e79cdc062147588
|
||||||
Loading…
Add table
Add a link
Reference in a new issue